<< 29-09-2020 >>

00:02:01*arecacea1 quit (Remote host closed the connection)
00:02:29*arecacea1 joined #nim
00:58:11*lritter quit (Ping timeout: 240 seconds)
00:59:10*lritter joined #nim
01:09:27*sagax joined #nim
01:11:40disruptekSo it turns out if you wear gloves and carry a hammer, a backpack, and a toolbox AND you wear dayglow suspenders... nobody fucks with you.
01:12:00disrupteklike, at all.
01:13:07disruptekor maybe it was the half a hooker face i had slung over my shoulder.
01:13:23disrupteki dunno, but something.
01:15:56disruptekThis is the kind of hotel where you don't put your feet on the carpet without shoes on.
01:23:30*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
01:27:41*Lord_Nightmare joined #nim
01:28:18*Tanger joined #nim
01:45:08*abm quit (Read error: Connection reset by peer)
01:49:20*apahl quit (Ping timeout: 244 seconds)
01:51:32*apahl joined #nim
01:59:03*Tanger quit (Remote host closed the connection)
01:59:25*Tanger joined #nim
02:02:42*Helios joined #nim
02:04:23*iwq quit (Ping timeout: 260 seconds)
02:12:24*iwq joined #nim
02:13:02*krux02 quit (Remote host closed the connection)
02:41:22*oprypin quit (Remote host closed the connection)
02:43:05*antranigv_ joined #nim
02:43:23*antranigv quit (Ping timeout: 240 seconds)
02:43:52*valitlo31 joined #nim
02:44:00*FromGitter quit (Ping timeout: 260 seconds)
02:46:08*oprypin joined #nim
02:46:12*valitlo31 quit (Read error: No route to host)
02:46:50*FromGitter joined #nim
02:59:12*muffindrake quit (Ping timeout: 260 seconds)
03:01:17*muffindrake joined #nim
03:04:03*thomasross joined #nim
03:40:48FromDiscord<Avatarfighter> disruptek youre not supposed to code with such a fit you'll be too productive
03:47:15*a_chou joined #nim
04:01:27disruptekdon't worry; i can't code on my phone.
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:43*supakeen joined #nim
04:07:32*waleee-cl quit (Quit: Connection closed for inactivity)
04:13:05nisstyreIs there a way to declare a proc and not provide an implementation (as far as the compiler knows) ?
04:14:03Prestigewhat's the use case?
04:14:08nisstyreI have `proc foo() : cint {.cdecl.}` and I want to copy some machine code into it
04:14:28nisstyreand execute it
04:14:45nisstyrefollowing this series, but in Nim obviously https://bernsteinbear.com/blog/compiling-a-lisp-1/
04:15:20FromDiscord<Elegant Beef> There is the `noDecl` and `header` which tell nim not to generate any code for the proc
04:15:31nisstyrethat works
04:15:55FromDiscord<Elegant Beef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-nodecl-pragma can read about them in actual detail here 😄
04:18:42nisstyrehmm I suppose it would be easier to just write the declaration in a C header and use that
04:20:47FromDiscord<Elegant Beef> You could also use this since you're using machine code https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
04:22:25*thomasross quit (Ping timeout: 264 seconds)
04:24:35nisstyrethat will come in handy later, thanks
04:30:17*apahl quit (Ping timeout: 272 seconds)
04:31:45*apahl joined #nim
04:59:20*mmohammadi9812 joined #nim
05:17:37*a_chou quit (Remote host closed the connection)
05:26:43*narimiran joined #nim
05:39:27nisstyrewell I almost got it working, but calling the functio segfaults
05:40:13nisstyrehttps://gist.github.com/weskerfoot/3e8751d25925ef88183f4e54f3f43b06 I suspect the issue is something to do with memory management, but not sure
05:42:17nisstyrevalgrind says it's something in excpt.nim accessing invalid memory
05:42:40nisstyrepushCurrentException
05:42:49nisstyrebut I don't know if that is the real problem
05:57:00*solitudesf joined #nim
06:38:20FromDiscord<Elegant Beef> Nisstyre worth noting your gist doesnt have the same machine code
06:39:08FromDiscord<Elegant Beef> Well this confirms if the data is copied properly, which it is
06:39:09FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2z7G
06:48:04FromDiscord<Broken insanity> How to get index of element in doublyLinkedList ?
06:55:12FromGitter<ynfle> `[]`?
06:55:49FromDiscord<Elegant Beef> The `find` proc returns the ref object which you can use anywhere
06:56:05FromDiscord<Elegant Beef> they dont have an index access implementation afaik
06:58:30*neceve joined #nim
07:01:39*Trustable joined #nim
07:16:00*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
07:17:14*PMunch joined #nim
07:21:12*lritter quit (Ping timeout: 260 seconds)
07:25:09PMunchHmm, it's quite annoying that you can't use command syntax in an `or` statement
07:26:41*JustASlacker quit (Remote host closed the connection)
07:27:35*Vladar joined #nim
07:29:17FromDiscord<Elegant Beef> time to have something that resembles lisp 😛
07:33:44*arecacea1 quit (Remote host closed the connection)
07:34:19*arecacea1 joined #nim
07:40:56*neceve quit (Remote host closed the connection)
07:47:33FromDiscord<alehander42> hm, why
07:47:37FromDiscord<alehander42> morning!
07:48:17FromDiscord<Elegant Beef> Why to me or pmunch? 😄
07:49:43PMunchGood morning alehander92
08:04:17*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:05:00FromDiscord<alehander42> morningg
08:05:14FromDiscord<alehander42> Elegant: well to you
08:05:20FromDiscord<alehander42> but i dont know the context maybe
08:06:11FromDiscord<Elegant Beef> well with the command syntax you have to wrap each call with `()`, so you get `(a b) or (a, c)`. But i was joking so it doesnt matter
08:11:50*Trustable quit (Remote host closed the connection)
08:12:05Araqwhat is an 'or' statement? never seen one
08:13:23FromDiscord<mratsim> Or maybe you saw one?
08:21:56*newUser joined #nim
08:23:08newUserhi, for example I have a main.nim and want another program name as main, how to solve this?
08:23:27*kinkinkijkin quit (Ping timeout: 240 seconds)
08:24:22FromDiscord<mratsim> nim c -o:myprogramname.exe main.nim
08:25:17*natrys joined #nim
08:26:35newUserthx, works. But I have put it first after main, this works not.
08:28:56*mmohammadi9812 joined #nim
08:29:44*newUser quit (Remote host closed the connection)
08:33:25Araqmaybe you need to put options before the filename as it's documented everywhere
08:34:45*gangstacat quit (Ping timeout: 272 seconds)
08:35:13bungdo I need open socket on their own thread? current I opened on main thread and register fd on child thread
08:39:31Araqthat's a good idea or else the socket buffering cannot work
08:46:00*abm joined #nim
08:46:13*Tanger quit (Quit: Leaving)
08:46:13bungok, thanks!
08:48:58FromDiscord<alehander42> ok, i think i hit my first new bug in `tcasestmt.nim`
08:51:23FromDiscord<alehander42> https://github.com/nim-lang/Nim/pull/15287/checks
08:51:24disbotNil type check implementation
08:51:38FromDiscord<alehander42> btw some of my checks ^
08:51:45FromDiscord<alehander42> are still yellow
08:51:58FromDiscord<alehander42> but it seems they finished
08:52:12FromDiscord<alehander42> but on github they show started >= ~11h
08:52:29FromDiscord<alehander42> (but on azure they are finished): is this a known issue
08:58:49Araqno, CIs are green for other PRs :P
09:04:57FromDiscord<alehander42> yellow is a nice color
09:30:54*mal`` quit (Quit: Leaving)
09:31:28*njoseph quit (Quit: No Ping reply in 180 seconds.)
09:32:33*njoseph joined #nim
09:32:57*NimBot joined #nim
09:33:31*infoyk joined #nim
09:37:45*mal`` joined #nim
09:52:05FromDiscord<alehander42> sent a code paste, see https://play.nim-lang.org/#ix=2z8B
09:52:19FromDiscord<Rika> funky
09:52:23FromDiscord<alehander42> i .. dont think i knew
09:52:25FromDiscord<alehander42> this is possible
09:52:29FromDiscord<Rika> it is????
09:52:37Araqsure
09:52:43FromDiscord<alehander42> it's a test in `tcasestmt`
09:52:47FromDiscord<Rika> is this intended?
09:52:55FromDiscord<alehander42> it's even tested!
09:53:01FromDiscord<Rika> thats super funky
09:53:12AraqI don't see why
09:53:17FromDiscord<alehander42> it makes some sense for strings
09:53:31FromDiscord<Rika> i mean its okay but it just *looks* wrong, im not saying it is
09:53:42FromDiscord<alehander42> i really didnt know
09:53:47FromDiscord<alehander42> what i am getting into with this ast stuff
09:53:48FromDiscord<alehander42> 😄
09:53:48AraqI wouldn't write it this way but it must work
09:54:07FromDiscord<alehander42> we should add it to the wiki
09:56:26FromDiscord<lqdev> to the manual
09:56:30FromDiscord<lqdev> iirc it's undocumented
09:56:34FromDiscord<lqdev> at least on stable
09:56:53AraqI remember seeing it in the manual
10:06:56disrupteki've used it a couple times, but yeah. it's a little creepy.
10:08:53FromDiscord<alehander42> ok this should be like 6 am
10:09:01*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
10:09:21FromDiscord<alehander42> yeah, i assumed the shape of `case`
10:09:27FromDiscord<alehander42> wrong assumptions stay behind
10:09:30FromDiscord<alehander42> many bugs
10:09:54Araqyou need to think less and read more.
10:10:28Araqread how other sections of the compiler traverse a nkCaseStmt, for example
10:12:12*ehmry joined #nim
10:14:24*dddddd quit (Ping timeout: 256 seconds)
10:19:35FromDiscord<alehander42> hm, `tastspec.nim` test is pretty useful
10:19:47FromDiscord<alehander42> yes, maybe that's true
10:26:37*sz0 joined #nim
10:26:57PMunchHmm, I've implemented a buffering working version of a socket stream
10:27:02PMunchBut it's currently only reading
10:27:18*Trustable joined #nim
10:27:38PMunchMixing reading and writing obviously doesn't work, should I create two different types for the two different kinds of streams?
10:29:45*dddddd joined #nim
10:39:34*gangstacat joined #nim
10:40:40Araqsounds like a good idea
10:41:25PMunchI was also thinking of making the write stream allow you to use getposition/setposition and write until you do a flush
10:41:35PMunchAnd flush is what actually sends the data
10:42:12PMunchAnd prevents you from writing into earlier parts
10:53:55*infoyk quit (Quit: WeeChat 2.9)
10:54:33*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
10:59:35Araqyay, found a compiler bug
10:59:50Araqproc inc(x: var AbstractTime) {.borrow.}
11:00:09Araq^ you can borrow from it but the C codegen crashes
11:01:05*krux02 joined #nim
11:04:12FromDiscord<juan_carlos> `try except` produces very tiny code with ARC/ORC :)
11:10:19Araqyeah :-)
11:14:00*Trustable quit (Remote host closed the connection)
11:20:27FromDiscord<juan_carlos> `{.noalias.}` is only meant to be used for `ptr` ?, is not taking literal `int` says `error: invalid use of restrict`
11:24:34FromDiscord<juan_carlos> `var x {.noalias.} = 9;echo x` --> `error: invalid use of restrict`
11:27:45FromDiscord<mratsim> I'd like it to be available for any object, for example BigInt even if passed as raw object compile down to ptr
11:28:10FromDiscord<mratsim> for parameter passing
11:28:23FromDiscord<mratsim> unless the noalias that was merged was just about variables?
11:29:18FromDiscord<juan_carlos> `.noalias annotation is for variables and parameters` quoted doc
11:37:43*narimiran quit (Ping timeout: 246 seconds)
11:52:06Araqit's for pointers
11:52:35Araqshould clarify the docs and maybe add some checks :P
11:57:13FromDiscord<juan_carlos> Oh, ok, then it works Ok :)
11:57:54FromDiscord<mratsim> What about my bigints :/
12:03:15Araqmratsim: what is that you need?
12:03:20Araq*is it
12:03:45Araqyou can use .noalias for pointers inside object fields
12:04:00Araq(haven't tested that one though...)
12:04:42FromDiscord<juan_carlos> .noalias ptr uint64 works ok.
12:04:52FromDiscord<mratsim> proc sub(a: var BigInt {.noalias.}, b: BigInt {.noalias.})
12:05:11Araqa {.noalias.}: var BigInt works
12:05:20Araqnot sure about b
12:05:25FromDiscord<mratsim> I have 10% time spent in function prologue/epilogue currently
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:37*supakeen joined #nim
12:07:36Araqfeel free to report bugs for .noalias
12:08:07FromDiscord<mratsim> I was thinking of going one way further than ASM and and taking over asmNoStackTrace
12:08:35FromDiscord<mratsim> taking over full codegen with asmnostacktrace
12:08:42FromDiscord<mratsim> tired of bad compiler codegen
12:10:58Araq__declspec(naked) ?
12:11:04Araqfun
12:12:15*dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat)
12:13:03Araqsometimes I regret not having invented a portable assembler, a real one that doesn't abstract over the stack, register allocation etc
12:15:07FromDiscord<juan_carlos> *HLA intensifies*
12:15:11FromDiscord<mratsim> I'll still rely on GCC/Clang to do register alloc
12:15:35FromDiscord<mratsim> but this way no prologue/epilogue and I can push/pop from the stack
12:15:52FromDiscord<mratsim> you can't use rsp, rbp in inline asm unless you'renaked
12:17:25FromDiscord<mratsim> basically adding temporary variable allocation from the stack is the main thing to add to this: https://github.com/mratsim/constantine/blob/master/constantine/primitives/macro_assembler_x86.nim
12:20:42*waleee-cl joined #nim
12:45:11*sz0 quit (Quit: Connection closed for inactivity)
12:46:08PMunchIs there a way to get a UDP socket in Nim that has the address and port field set so I can just to do `send` and not `sendTo`?
12:51:00PMunchAh, I can just use `connect` like I would with TCP
12:51:09PMunchThe documentation for the `nets` module should really be improved..
12:55:37bungwhat's wrong with child thread runs async code? https://play.nim-lang.org/#ix=2z9u
12:56:19bungit randomly pass travis CI now , after I change sync version code to async
13:02:01PMunchWhat is Context in this example?
13:02:13PMunchAnd that probably uses the global pool
13:02:27PMunchWhich won't work across thread
13:02:34FromDiscord<mratsim> Each thread will have its async loop and make sure they communicate via non-blocking async channels (which don't exist?)
13:04:04bungoh , I found the main change is after I open connection on child thread side
13:05:18bunghttps://github.com/bung87/amysql/blob/b0c1cf74ff5d566220c0e61d572359a8a503469a/src/amysql/db_pool.nim#L106
13:06:14bungContext has DBConn that wraps Connection which has async socket property
13:06:57bungchannels apis all sync, right ?
13:07:56bungthe old version I open connection on main thread then register its fd on child thread.
13:08:40FromGitter<gogolxdong> https://m.zhipin.com/mpa/html/weijd/weijd-job/d48512b8fe25a03d1nR439m0FlpR?date8=20200929
13:09:19FromGitter<gogolxdong> I published a recruiment of Nim devs.
13:10:05FromGitter<gogolxdong> Does this count for the first Nim devs position globally?
13:10:30PMunchStatus has been recruiting globally haven't they?
13:10:55FromGitter<gogolxdong> ok, in China. :)
13:11:04PMunchWell, I guess they had(have?) a policy that you need an hour overlap with the main office, which might be hard to do from China..
13:13:32*pbb quit (Ping timeout: 246 seconds)
13:14:11*pbb joined #nim
13:15:09FromGitter<gogolxdong> indeed.
13:15:57FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2z9V
13:16:00FromDiscord<shad0w> is there a difference ?
13:17:44FromGitter<gogolxdong> Status works on Ethereum 2.0 right? We work on IPFS.
13:18:54*FromDiscord quit (Remote host closed the connection)
13:19:08*FromDiscord joined #nim
13:24:05*Trustable joined #nim
13:25:02FromDiscord<Yardanico> @shad0w no, it's just different syntax
13:25:08bungdoes thread has own global dispatcher ?
13:25:20FromDiscord<Yardanico> Object construction syntax for refs automatically allocates a new instance, yes
13:25:51FromDiscord<mratsim> @Bung, no, well if you use threadpool
13:26:03FromDiscord<mratsim> but async isn't thread aware, you need to do your own
13:27:04FromDiscord<mratsim> @gogolxdong, yes we have a team on Eth2.0, a team on a decentralized messenger, a team on private and censorship resistant message protocol design
13:27:36FromDiscord<Yardanico> hehe
13:28:13FromDiscord<Yardanico> @gogolxdong is your work targeted at Chinese and is it open source? Just curious
13:30:25bung@mratsim so the code like this ? https://play.nim-lang.org/#ix=2za5
13:31:09FromDiscord<mratsim> I think the GlobalDispatcher means thread level, though I could be wrong, I didn't inspect async enough yet
13:31:31nisstyreElegant beef: any idea why it's segfaulting? I tried yours and still got that.
13:32:12bung@mratsim ok, I'll just try
13:35:24FromGitter<gogolxdong> It will be open source at last, target at Chinese at the momement I think, payment standard varies.
13:36:19FromGitter<gogolxdong> at last = when it's online.
13:36:32Araqgah, who came up with 'view' types
13:36:41Araqsuch a pita to implement
13:39:52Araqresult.add toOpenArray(s, ...) # this is a borrow operation. 'result' borrows from 's'. how do we know? simple, it's a call taking a 'var ViewType' but a 'var T' is always a view, so beware and strip off the first level of var-ness...
13:45:01FromDiscord<mratsim> Someone who just came to sightse
13:45:05FromDiscord<mratsim> sightsee
14:01:40nisstyreAraq: any idea why this doesn't work? https://play.nim-lang.org/#ix=2z7G
14:10:00FromDiscord<mratsim> compile with --debugger:native and run in gdb
14:11:14PMunchnisstyre, two bugs: first you protect it before trying to read it out for echoing, second you don't have to do the cat to ptr JitFunction and then deref, the pointer is already a function: https://play.nim-lang.org/#ix=2zao
14:11:26PMunchs/cat/cast
14:11:42nisstyreah, so that was it
14:11:48FromDiscord<mratsim> Also check out: https://github.com/mratsim/photon-jit/blob/cadc8ad472ebf86d6738ae276dc50b1678668522/photon_jit/photon_types.nim#L53-L89
14:12:23nisstyrethat's what I get for doing this at 2am
14:12:46nisstyrethank you
14:13:01PMunchNo problem, I was just looking at it and guessing at solutions :P
14:13:59PMunchSo what should I do with this socket stream implementation? http://ix.io/2zap
14:14:07FromDiscord<mratsim> I don't know how advanced you are on JIT and x86-64 (assuming that's what you're using) but I put a lot of practical comment in my code: https://github.com/mratsim/photon-jit/blob/cadc8ad472ebf86d6738ae276dc50b1678668522/photon_jit/photon_types.nim#L165-L298
14:15:01nisstyremratsim: I'm doing https://bernsteinbear.com/blog/compiling-a-lisp-1/ in Nim
14:15:23nisstyreI'll definitely check that out
14:16:44FromDiscord<mratsim> interesting, I was looking for self contained examples to expand photon-jit
14:16:51FromDiscord<mratsim> I started with Brainfuck
14:16:55FromDiscord<XxDiCaprioxX> Is there a class for image in Nim? Or do I have to do it all with sdl2?
14:17:07FromDiscord<XxDiCaprioxX> type not class
14:17:34FromDiscord<mratsim> type Image[N: static int] = array[N, tuple[r, g, b: uint8]]
14:17:47FromDiscord<XxDiCaprioxX> Wut
14:18:04FromDiscord<mratsim> also images can be RGB, BGR, YUV422 YUV444, ...
14:18:29FromDiscord<XxDiCaprioxX> Of what type would a variable holding a png be?
14:18:30FromDiscord<Yardanico> @XxDiCaprioxX your question is very broad
14:18:44FromDiscord<XxDiCaprioxX> Yeah probably
14:18:45FromDiscord<Yardanico> png is not a very simple format
14:18:51FromDiscord<mratsim> likely a RGBA tuple of uint8
14:18:53nisstyrepng is argb
14:19:03FromDiscord<Yardanico> See e.g https://github.com/jangko/nimPNG
14:19:05FromDiscord<Rika> png is also very complicated
14:19:07FromDiscord<mratsim> i.e. define your own colors: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/primitives/canvas.nim#L19-L28
14:19:08FromDiscord<XxDiCaprioxX> Okay let me formulate differently
14:19:11PMunchnisstyre, not always
14:19:16nisstyrewhen would it not be?
14:19:22PMunchIt can be indexed
14:19:29FromDiscord<Rika> png can also be 1 bit deep, 2 bits deep, 4 bits deep...
14:19:38nisstyremeaning you have a custom color space?
14:19:43nisstyrethat's interesting
14:19:47PMunchYup
14:19:55FromDiscord<XxDiCaprioxX> Is there a type in nim similar to something like buffered image?
14:20:00PMunchI used it once to create a colour cycling background based on the temperature of my system
14:20:02FromDiscord<mratsim> and when you want a generic algorithm, use concepts: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/io/color_conversions.nim#L77-L82
14:20:03nisstyrealso it's premultiplied alpha apparently
14:20:07FromDiscord<Rika> yes pngs can be indexed too, cool way to save space (or transmission time) if you really need
14:20:12nisstyrewhich makes it a bit trickier to set up, but easier to do alpha blending
14:20:42FromDiscord<mratsim> my RGB concept is agnostic to the RGB, BGR BRG GBR GRB or what not order for example
14:24:35FromDiscord<XxDiCaprioxX> How do I create procs only instances of a type can use?
14:25:05FromDiscord<mratsim> proc foo(x: MyType) =
14:25:21FromDiscord<XxDiCaprioxX> okay
14:28:57*luis_ joined #nim
14:29:29*luis_ quit (Client Quit)
14:29:56*luis_ joined #nim
14:34:27*ee7[m] joined #nim
14:38:52*PMunch quit (Quit: leaving)
14:39:30*luis_ quit (Quit: luis_)
14:39:54*luis_ joined #nim
14:40:20bungI fixed that my Context can't be copy
14:40:37*luis_ quit (Read error: Connection reset by peer)
14:40:56*luis_ joined #nim
14:42:27FromDiscord<alehander42> can we compile
14:42:34FromDiscord<alehander42> optimize* static calls?
14:42:43FromDiscord<alehander42> e.g. if you call `a(known)` on runtime
14:42:47FromDiscord<alehander42> and it's a pure func
14:43:07FromDiscord<alehander42> can the compiler just run it (if it uses non-platform stuff)
14:43:15FromDiscord<alehander42> and replace it with the result directly
14:44:41FromDiscord<alehander42> (i wonder how is this called: probably not a common optimization tho)
14:45:47*apahl quit (Ping timeout: 240 seconds)
14:46:58*apahl joined #nim
14:47:49FromDiscord<mratsim> Do static(a(foo)) to enforce compile time evaluation
14:48:04FromDiscord<mratsim> this is called constant propagation/constant folding
14:48:56FromDiscord<mratsim> I also expect that tagging __attribute(pure)) Nim func in the C backend will encourage the compiler to fold runtime calls to the same functions with the same arguments
14:56:08FromDiscord<alehander42> hm, yeah
14:56:18FromDiscord<alehander42> but i wonder if compilers do that automatically 🙂
14:56:21FromDiscord<alehander42> i know i can do it myself
14:57:17FromDiscord<alehander42> what exactly do you mean with "fold runtime calls .." ?
14:59:32FromDiscord<mratsim> let a = foo(1)↵let b = foo(1)
15:00:01FromDiscord<mratsim> if foo is declared pure, even if it's defined in another compilation unit, the compiler can just do b = a instead of calling foo again
15:00:14FromDiscord<mratsim> because no side-effect
15:00:25FromDiscord<mratsim> otherwise you only get this when using LTO
15:00:34FromDiscord<mratsim> or if foo is defined in the same file
15:01:02FromDiscord<alehander42> hmmm
15:01:02FromDiscord<mratsim> (I'm talking about GCC/Clang/MSVC)
15:01:16FromDiscord<alehander42> ahh ok
15:01:23FromDiscord<alehander42> i am imagining some kind of global memoization
15:02:53FromDiscord<Recruit_main707> `Error: unhandled exception: invalid object assignment [ObjectAssignmentDefect]` what does this error mean?
15:03:16FromDiscord<Recruit_main707> it happens under pretty specific cirmcumstances
15:06:27*bung quit (Ping timeout: 260 seconds)
15:07:42*bung joined #nim
15:13:51FromDiscord<exelotl> nimpng makes some unusual choices
15:14:13FromDiscord<exelotl> the PNGResult object is really limited, you can't do much with it
15:15:34FromDiscord<exelotl> meanwhile the `PNG` object is generic over the type of buffer that you want to store the pixel data in, and the only way to load one is using the streams API. But this is not well documented at all, took me *ages* to figure it out
15:15:43FromDiscord<exelotl> https://github.com/exelotl/trick/blob/master/src/trick/gfxconvert.nim#L291
15:15:47*bung quit (Ping timeout: 260 seconds)
15:16:07*bung joined #nim
15:22:33FromDiscord<shad0w> hi, is there a way to initialize objects with default values other than thier filed type defaults ?
15:22:56FromDiscord<shad0w> (edit) 'filed' => 'field'
15:23:58FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2zaM
15:24:21FromDiscord<shad0w> ^ something like this. if no number_of_courses given, it's 5 by default.
15:24:26*a_chou joined #nim
15:24:26FromDiscord<Rika> use an initializer proc
15:24:45FromDiscord<shad0w> a wut
15:25:09FromDiscord<Rika> make a proc with the name `initStudent` and use that to make `Student`s instead of constructor syntax
15:25:26FromDiscord<shad0w> i see
15:25:33FromDiscord<Rika> RFCs are in place to change this
15:25:40FromDiscord<shad0w> no other way to set defaults then i guess ?
15:25:54FromDiscord<Rika> i admit its a weird omission from nim, to have sugary initializers
15:25:56FromDiscord<Recruit_main707> not *yet*
15:26:14FromDiscord<Clyybber> @shad0w I have a PR that implements this, but its not finished
15:26:22FromDiscord<Clyybber> I'll probably work on it after the 1.4 release
15:26:39FromDiscord<shad0w> @Clyybber right on.
15:27:02FromDiscord<Rika> wish it was possible to override `default` or have a proc `=init` that would be used when constructor syntax was used or smth
15:27:06FromDiscord<Rika> would be interesting
15:27:39FromDiscord<Clyybber> yeah
15:28:19FromDiscord<shad0w> so for now, wrappers it is i guess. Thanks guts
15:28:23FromDiscord<shad0w> (edit) 'guts' => 'guys'
15:30:59FromDiscord<haxscramper> How do I configure stlib path when for standalone sempass example? It seems like both errors with `inlcude "system/fatal"` and `std/miscdollars` should be fixed by this, but I didn't have any progress since yesterday.
15:31:03FromDiscord<haxscramper> The code again - https://gist.github.com/haxscramper/8821819221b1d73866e4aed306147f0c
15:35:05FromDiscord<alehander42> wasn't there a @krux02 pr/rfc as well
15:44:28*luis_ quit (Ping timeout: 246 seconds)
15:52:28FromDiscord<exelotl> How up to date is https://nim-lang.org/docs/destructors.html ? Can I show it to a friend? :P
15:55:48FromDiscord<exelotl> in particular they asked if Nim does RAII and I don't really know what the answer is lol
15:56:22FromDiscord<Clyybber> Nim essentially does yeah
15:56:51FromDiscord<Clyybber> I would link https://nim-lang.github.io/Nim/destructors though
15:58:17FromDiscord<alehander42> oh, documents and procrastination
15:58:20FromDiscord<alehander42> just got back on
15:58:27FromDiscord<haxscramper> Is there a simple way to do `compileProject` from string, or I just have to copy-paste the implementation, only replacing file reading with `parseString`?
15:58:46*hnOsmium0001 joined #nim
16:01:24*Vladar quit (Quit: Leaving)
16:03:12*narimiran joined #nim
16:03:30FromDiscord<Vindaar> isn't it more correct to say that ARC _allows_ the user to write RAII code (thanks to automatic destructor calls when going out of scope, which allow the user to free all resources again), instead of saying "Nim does RAII". If I open some resource when I initialize my object, but don't put the freeing into the destructor it doesn't magically do it for me
16:03:36FromDiscord<alehander42> ok, now we're gettting to ~ exccomp.nim:509 in building the compiler
16:03:43FromDiscord<alehander42> extcomp*
16:04:07FromDiscord<alehander42> hm, it seems `canRaise` is possible to fail
16:04:12FromDiscord<alehander42> is this a bug?
16:04:29FromDiscord<haxscramper> But otherwise the example is working (not blowing up at runtime & compiles)
16:05:07FromDiscord<alehander42> it seems it assumes the `typ.n` can have sons in the last case
16:09:49FromDiscord<alehander42> what is the `n` for types
16:09:51FromDiscord<Clyybber> @Vindaar Yep, although I think smart pointers do the same in Cpp
16:10:19FromDiscord<alehander42> its nkRecord for recros
16:10:21FromDiscord<Clyybber> And its still considered RAII, maybe?
16:10:21FromDiscord<alehander42> (edit) 'recros' => 'records'
16:10:32FromDiscord<Clyybber> RAII is a bit of a misnomer anyways :P
16:10:33FromDiscord<alehander42> but it seems this is a tuple? ah, i'll debug later
16:11:05FromDiscord<Clyybber> @alehander42 The N for types is the fields for tuples and objects
16:11:09FromDiscord<Vindaar> @Clyybber that's my passing of smart pointers in C++ too, yes
16:11:19FromDiscord<alehander42> ok
16:11:19FromDiscord<Vindaar> *passing understanding
16:11:28FromDiscord<Clyybber> in case of case objects it can also contain nkRecCase
16:11:56FromDiscord<Clyybber> you can think of it as the type section of the respective type
16:14:27*thomasross joined #nim
16:17:58*a_chou quit (Ping timeout: 265 seconds)
16:27:10*ForumUpdaterBot quit (Remote host closed the connection)
16:27:17*ForumUpdaterBot joined #nim
16:29:12ForumUpdaterBotNew thread by Nocturn9x: Looking for collaborators!, see https://forum.nim-lang.org/t/6871
16:32:57*Vladar joined #nim
16:40:46FromDiscord<haxscramper> How can I just get typed AST after semPass? `ModuleGraph` has, `modules*: seq[PSym]` from which I can find the main module and do something else with it, but I'm not sure if this is a right way (and I'm not sure what can I do this one too). I expect to see something close to regular `typed` NimNode.
16:44:47*Q-Master quit (Read error: Connection reset by peer)
16:44:57*Q-Master joined #nim
16:45:31FromDiscord<Recruit_main707> about the error i asked about before: `[ObjectAssignmentDefect]`↵Is it me or it usually means you are not using ref objects when you should
16:45:41*a_chou joined #nim
16:53:14ForumUpdaterBotNew thread by Mantielero: Nimx - image, see https://forum.nim-lang.org/t/6873
17:26:51*a_chou quit (Remote host closed the connection)
17:27:11*a_chou joined #nim
17:28:39*apahl quit (Ping timeout: 272 seconds)
17:29:16*apahl joined #nim
17:31:46*m4r35n357 quit (Quit: Ex-Chat)
17:37:07*nikita` quit (Ping timeout: 240 seconds)
17:37:11*euantorano quit (Ping timeout: 256 seconds)
17:37:25*surma quit (Ping timeout: 244 seconds)
17:37:27*matlock quit (Ping timeout: 260 seconds)
17:37:42*hoek quit (Ping timeout: 260 seconds)
17:37:42*r4vi quit (Ping timeout: 260 seconds)
17:37:47*fowl quit (Ping timeout: 246 seconds)
17:38:02*jholland__ quit (Ping timeout: 260 seconds)
17:38:08*waleee-cl quit (Ping timeout: 246 seconds)
17:38:09*stever quit (Ping timeout: 272 seconds)
17:38:11*Adeon quit (Ping timeout: 258 seconds)
17:38:17*d10n-work quit (Ping timeout: 260 seconds)
17:38:17*npgm_ quit (Ping timeout: 260 seconds)
17:38:29*sirn quit (Ping timeout: 246 seconds)
17:38:34*hnOsmium0001 quit (Ping timeout: 246 seconds)
17:38:54*ormiret quit (Ping timeout: 272 seconds)
17:39:03*kwilczynski quit (Ping timeout: 260 seconds)
17:42:51*Jesin quit (Quit: Leaving)
17:44:54*haxscramper joined #nim
17:47:13*Trustable quit (Remote host closed the connection)
17:47:16*Jesin joined #nim
17:47:52*surma joined #nim
17:48:04*euantorano joined #nim
17:48:07*ormiret joined #nim
17:49:04*matlock joined #nim
17:49:13*hnOsmium0001 joined #nim
17:49:24*r4vi joined #nim
17:49:29*waleee-cl joined #nim
17:49:34*nikita` joined #nim
17:49:53*d10n-work joined #nim
17:50:21*Adeon joined #nim
17:50:30*kwilczynski joined #nim
17:50:33*npgm_ joined #nim
17:50:49*sirn joined #nim
17:51:15*hoek joined #nim
17:53:43*jholland__ joined #nim
17:55:36FromDiscord<krisppurg> Does anyone have any byte allocators or any simple byte library/guide in Nim or a `struct.pack_into` version in Nim either in a different way in Nim?↵I'm not sure what is the right question to ask. I've tried struct.nim can't find any other usages for `pack_into`, or any code that produces the same result in python. `struct.pack_into(">H", byte_array, 2, 53903863)`
17:55:52Oddmongerhow to make an alias on an object ? Affecting it only copy value. ref ? It doesn't seem dedicated to this (just ref counting , not reference like & in C)
17:56:08Oddmongerhttps://play.nim-lang.org/#ix=2zbw
17:57:44haxscramperOkay, now I'm even more confused than before. `PSym` has `ast*: PNode`. It has comment like "... it's a placeholder for compiler generated code that will be appended to the module after the sem pass (see appendToModule)". If I undestand correctly that is where all generic instantiations, macro expansions will be added after sempass.
17:57:44haxscramper
17:57:44haxscramperSempass implementaiton (`sem.myProcess`, right?) contains `storeNode` (this is for incremental compilation & AST replay, correct?). I suppose this is not what I need.
17:57:44haxscramper
17:57:47haxscramper`passes.processTopLevelStmt` seems like a function where all the magic happens, but result of each pass is just checked for `m.isNil()` not appended to `.ast` field.
17:57:51haxscramper
17:57:53haxscramperI assume that in `passes.processModule` only calls to either `parseTopLevelStmt` or `processTopLevelStmt` are relevant in my case, and `parse*` does only parsing so it is not applicable here.
17:57:56haxscramper
17:57:59haxscramperSorry for ping, but I would really much appreciate if either Araq or someone else just pointed out either where I should be looking or simply how to get typed AST (or tell me I'm an idiot and there is nothing that looks like `typed` NimNode). My current code is - https://gist.github.com/haxscramper/8821819221b1d73866e4aed306147f0c
17:58:08Oddmongerah i've found it
17:58:12Oddmongerjust adding «addr»
17:58:23Oddmongeraddr is the ref of nim
18:01:46FromDiscord<Yardanico> wat
18:02:07FromDiscord<Yardanico> If you already have a ref variable named a, then let b = a - b is the same reference
18:02:20FromDiscord<Yardanico> if it's not a ref, you use addr to take its address, but it can be unsafe
18:03:07FromDiscord<Yardanico> @krisppurg why not streams?
18:03:30FromDiscord<Yardanico> pack_into seems to just write the bytes into the buffer
18:04:53*stever joined #nim
18:05:20*fowl joined #nim
18:05:53FromDiscord<Yardanico> you can just write your own pack_into
18:06:01FromDiscord<Yardanico> Basically you use pack and then add the result to buffer
18:06:06FromDiscord<Yardanico> That's what pack_into is
18:06:34FromDiscord<Yardanico> Also why not just use Nim streams as I said? They are okay for dealing with binary data
18:08:43FromDiscord<krisppurg> I thought it had just peek(X?) read(X?) and some other stuff.
18:09:01*dv-^_^6 joined #nim
18:10:34FromDiscord<Yardanico> No, it has all the write procs as well
18:14:09*Jesin quit (Quit: Leaving)
18:14:17FromDiscord<Avatarfighter> @krisppurg nim streams are great but sometimes you may need to change the endian of the data you're writing because the write procs don't allow you to specify an endiann
18:14:39FromDiscord<Avatarfighter> (edit) 'endiann' => 'endian'
18:16:52*Jesin joined #nim
18:17:06FromDiscord<krisppurg> Do I cast the endian then?
18:17:08FromDiscord<krisppurg> @Avatarfighter
18:18:03FromDiscord<Avatarfighter> I wrote little helper procs when I was messing with streams: https://play.nim-lang.org/#ix=2zbI
18:19:00FromDiscord<Avatarfighter> So something like that should be good tbh
18:19:28FromDiscord<krisppurg> Alright.
18:22:05FromDiscord<Yardanico> you can use the endians module in stdlib
18:22:16FromDiscord<Yardanico> Or endians2 from status' stee
18:22:20FromDiscord<Yardanico> (edit) 'stee' => 'stew'
18:23:02FromDiscord<Yardanico> You can just copy and retain the copyright, it doesn't import anything
18:23:03FromDiscord<Yardanico> https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim
18:26:00FromDiscord<Yardanico> @Avatarfighter not sure why did you write a lot of procs like that
18:26:10FromDiscord<Yardanico> You could've used generics and a few templates, but okay :)
18:26:31FromDiscord<Avatarfighter> @Yardanico I actually am with my newer revision lmao
18:26:52FromDiscord<Avatarfighter> I have a template that unpacks stuff based on their fields
18:27:05FromDiscord<Avatarfighter> I just am too lazy to boot my other laptop so I just sent this lol
18:28:59FromDiscord<Avatarfighter> You would hate my projects Yadanico lmao I dont think I've used generics in months
18:29:12FromDiscord<Avatarfighter> (edit) 'You would hate my projects Yadanico lmao I dont think I've used generics in months ... ' => 'You would hate my projects Yadanico lmao I dont think I've used generics in monthswhen I could have'
18:29:58FromDiscord<Vindaar> just because you can make something generic, doesn't mean you should
18:30:18FromDiscord<Vindaar> might as well write python or something at that point 😛
18:31:05FromDiscord<Avatarfighter> Psh I would never do python
18:31:18FromDiscord<Avatarfighter> totally haven't for 6ish years 🤫
18:33:19FromDiscord<Vindaar> haha
18:34:55FromDiscord<Yardanico> @Vindaar but generics are better than duplicating mostly same code 10-15 times a’la Go
18:35:34FromDiscord<Vindaar> @Yardanico I was about to comment that in this instance it's definitely a good choice. My comment was only reading out of context, haha
18:36:16FromDiscord<alehander42> back home
18:36:18FromDiscord<Avatarfighter> wb
18:36:20FromDiscord<alehander42> a bit more work
18:36:27FromDiscord<alehander42> next bug
18:36:45FromDiscord<alehander42> my check crashes on sigmatchn.nim
18:36:46FromDiscord<Avatarfighter> is disruptek still alive? I haven't seen him speak in the IRC in a while
18:36:47FromDiscord<alehander42> sigmatch*
18:36:49FromDiscord<alehander42> yes
18:36:51FromDiscord<alehander42> i hope
18:37:02FromDiscord<alehander42> i think i saw him write today
18:37:03FromDiscord<alehander42> early
18:37:08FromDiscord<Avatarfighter> ok good
18:37:15FromDiscord<Avatarfighter> I was worried the man disappeared
18:37:21FromDiscord<Avatarfighter> left us for V lang 😢
18:37:29FromDiscord<haxscramper> @alehander42 do you know how to get typed AST from module after sempass?
18:37:29FromDiscord<Vindaar> yeah, that seems very like him
18:37:34FromDiscord<Avatarfighter> lmao
18:38:14FromDiscord<alehander42> hmm
18:38:17FromDiscord<alehander42> i think
18:38:23FromDiscord<alehander42> you get from all modules or something
18:38:30FromDiscord<alehander42> not really sure if you're using it as a library
18:38:32FromDiscord<alehander42> you can immitate
18:39:08FromDiscord<alehander42> what the compiler does in nim.nim
18:39:16FromDiscord<alehander42> and try to not invoke cgn
18:39:18FromDiscord<alehander42> (edit) 'cgn' => 'cgen'
18:39:20FromDiscord<alehander42> cgen*
18:40:14FromDiscord<alehander42> Araq i got an nkIdent in sempass2
18:40:16FromDiscord<alehander42> is this normal
18:43:01FromDiscord<alehander42> `let argConverter = if arg.kind == nkHiddenDeref: arg[0] else: arg`
18:43:08FromDiscord<alehander42> here one `arg` is ident (?)
18:45:46*gmaggior joined #nim
18:48:07FromDiscord<Clyybber> @alehander42 Rebase, args were always idents
18:48:21FromDiscord<haxscramper> > what the compiler does in nim.nim↵@alehander42 Maybe I missed something, but there is a `verbosePass` followed by `semPass` + backend-specific pass and then it just goes to `compileProject`
18:48:21FromDiscord<Clyybber> Only recently they became syms
18:49:09FromDiscord<haxscramper> And writes to file; basically the same as what I'm doing right now. I also tried looking at how `mStmt` magic is implemented but that yielded nothing
18:49:35FromDiscord<alehander42> but it's `var arg: PNode`
18:49:38FromDiscord<alehander42> as far i understand
18:49:56FromDiscord<alehander42> but this is in a template, so maybe its being replaced by a template
18:51:35FromDiscord<alehander42> but cgenPass
18:51:44FromDiscord<alehander42> seems registered in commandCompileToC
18:51:46FromDiscord<alehander42> @haxscramper
18:52:04FromDiscord<alehander42> so if you're not registering it
18:52:12FromDiscord<alehander42> i am not sure why its being invoked
18:52:32FromDiscord<krisppurg> How do I convert from string to char?
18:53:04FromDiscord<haxscramper> > so if you're not registering it↵@alehander42 yes, I tried to look what it /does/ and jump in somewhere between "we have module graph" and "generate C code" stages
18:53:36FromDiscord<alehander42> what are you trying to do: make a custom sem pass?
18:54:19FromDiscord<alehander42> maybe just adapting `nim.nim` to your custom `linter.nim` might be easiest for beginning
18:54:36FromDiscord<haxscramper> Get typed AST *after* existing sem pass. But now I realized that I might try and make my own pass that would act like cgenPass
18:54:44FromDiscord<haxscramper> So yes, like `nim.nim`
18:54:55FromDiscord<alehander42> yea
18:57:09FromDiscord<Yardanico> @krisppurg wdym? You can't
18:57:20FromDiscord<Yardanico> But if your string is 1 char you can do s[0]
18:57:29FromDiscord<krisppurg> O
18:57:38FromDiscord<Yardanico> char is an ASCII character
18:57:57FromDiscord<Yardanico> so if you mean 1 unicode char like ĝ - it won't fit in char
18:59:10FromDiscord<Yardanico> string in Nim is simply zero or more chars
18:59:20FromDiscord<Yardanico> like seq[char]
18:59:59*noonien joined #nim
19:04:35*mmohammadi9812 joined #nim
19:04:58OddmongerYardanico, i think i've finally get it (for the ref and ptr)
19:05:05Oddmongera ref is a counted ptr
19:06:48FromDiscord<Yardanico> yes, ref is a managed pointer
19:06:54FromDiscord<Yardanico> ptr is a raw pointer
19:11:01FromDiscord<haxscramper> And there is no internal documentation for compiler aside from comments in the source code and https://nim-lang.org/docs/intern.html , right?
19:12:23leorizethere are internal documentations, actually
19:12:37FromDiscord<Yardanico> they're a part of source code
19:13:05leorize[m]1https://nim-lang.github.io/Nim/compiler/theindex.html
19:13:06leorize[m]1enjoy
19:13:20leorize[m]1~compilerapi is https://nim-lang.github.io/Nim/compiler/theindex.html
19:13:20disbotcompilerapi: 11https://nim-lang.github.io/Nim/compiler/theindex.html
19:14:03FromDiscord<alehander42> also passing by ref and by ptr is a bit different
19:14:06FromDiscord<Yardanico> But they're all a part of the source code as I said
19:14:16FromDiscord<alehander42> (maybe not super correct to say "by ref" "by ptr")
19:14:56FromDiscord<haxscramper> Yes, that's what I mostly meant in "comments". Any general recommendations for starting with complier development? Aside from reading source code of course. Maybe some modules that I should look at first? Right now I just want to implement linter/callgraph generation, but I have some other ideas
19:15:05FromDiscord<haxscramper> Like for better error reporting
19:15:12FromDiscord<haxscramper> Better error messages*
19:15:14FromDiscord<alehander42> just go and improve
19:15:17FromDiscord<alehander42> it's a normal codebase
19:15:29FromDiscord<alehander42> overally you can read the compiler docs
19:15:40FromDiscord<alehander42> https://nim-lang.org/docs/intern.html
19:15:58FromDiscord<alehander42> especially the comp architecture section 😄
19:16:31FromDiscord<haxscramper> And I will probably finish hcprase + sourcetrail wrapper (or just nuke my PC after dealing with C++ build system)
19:16:41FromDiscord<alehander42> ah
19:17:19FromDiscord<haxscramper> But latter one is more likely TBH
19:22:35leorize~matrix is Nim channels on Matrix can be found at +nim:asra.gr (https://matrix.to/#/+nim:asra.gr)
19:22:36disbotmatrix: 11Nim channels on Matrix can be found at +nim:asra.gr (https://matrix.to/#/+nim:asra.gr)
19:23:44leorizeif anyone see people joining #nim via matrixbot on gitter just point them to this :P
19:23:48*solitudesf1 joined #nim
19:27:56*a_chou quit (Quit: a_chou)
19:29:26FromDiscord<haxscramper> And also have some kind of tool for measuring "rewrite complexity" (how much original code is transformed by various macro invocations) by diffing parsed tree and "after sempass"
19:29:57FromDiscord<haxscramper> Or semantic code diff between commits
19:33:53*sealmove joined #nim
19:53:18FromGitter<iffy> How can I save the time my program was compiled in a const (string)? Google is failing me and const t = $now() fails for using import c
19:58:07FromGitter<iffy> I guess I'll go with `const t = staticExec("date")` for now
19:59:22FromDiscord<Vindaar> @iffy: look no further: https://nim-lang.github.io/Nim/system.html#CompileDate
19:59:23FromDiscord<Vindaar> bbl
19:59:57FromGitter<iffy> ah, thank you
20:16:42FromDiscord<XxDiCaprioxX> When using the random module is it enough to just call `randomize()` at the beginning of the code?
20:17:54FromDiscord<Rika> yes
20:18:23FromDiscord<XxDiCaprioxX> Also: Is there a special way of creating a constructor?
20:18:45FromDiscord<Avatarfighter> Im curious about this too ^
20:19:44FromDiscord<Rika> what do you mean
20:19:54FromDiscord<alehander42> no
20:19:59FromDiscord<XxDiCaprioxX> Alright
20:20:00FromDiscord<Rika> right now, there are no special initializer syntaxes, there are multiple RFCs to add them
20:20:21FromDiscord<Avatarfighter> Should I be making a proc to initialize my objects and stuff? Or can I just do `let thing = Object(x: y)`?
20:20:28FromDiscord<Rika> make a proc
20:20:44FromDiscord<Avatarfighter> kk
20:21:03FromDiscord<Avatarfighter> going to make a dozen or so edits then lmao
20:31:15*disruptek yawns.
20:31:59FromDiscord<Recruit_main707> i wouldnt judge, cant talk for everyone in here though
20:33:07FromDiscord<XxDiCaprioxX> Can I initialize an empty array by just declaring it?
20:34:39FromDiscord<Recruit_main707> if i understood correctly, yes
20:35:08FromDiscord<Recruit_main707> !eval var a: array[3, int]; echo(a[0])
20:35:10NimBot0
20:35:32FromDiscord<Recruit_main707> !eval var a: array[3, int]; echo(a)
20:35:34NimBot[0, 0, 0]
20:35:57*Vladar quit (Quit: Leaving)
20:36:40FromDiscord<XxDiCaprioxX> alright thanks
20:38:45*natrys quit (Quit: natrys)
20:41:44disrupteki'll judge.
20:43:18FromDiscord<Avatarfighter> DISRUPTEK!
20:43:22FromDiscord<Avatarfighter> How have you been!
20:45:29disruptekdude.
20:45:44disrupteki've been on an adventure. what are you up to?
20:46:34FromDiscord<Avatarfighter> Not much tbh planning on seeing if I can run my scraper on even worse specs
20:46:38FromDiscord<Avatarfighter> what adventure have you been on/
20:46:42FromDiscord<Avatarfighter> ?*
20:47:51disrupteki was moving a car and it didn't want to go.
20:48:11disruptekstranded me twice until i took the gloves off.
20:48:47disruptekwhat does your scraper run on right now? still 1g of mem?
20:48:57FromDiscord<Avatarfighter> Nah I chopped it down a bit
20:49:19FromDiscord<Avatarfighter> we're at about 758 i believe
20:49:42disruptekcan you create a swapfile?
20:49:45FromDiscord<Avatarfighter> What type of car were you moving disruptek?
20:49:50FromDiscord<Avatarfighter> I probably can
20:50:06FromDiscord<Avatarfighter> Its just I have like 10gb atm but I'm planning on reducing the storage to 3gb lmao
20:50:13FromDiscord<Avatarfighter> https://www.youtube.com/watch?v=H99uqve6a9E was the car breaking down like this?
20:50:20disruptekwhy store anything locally?
20:50:42disruptekyou mean, a 2cv?
20:50:49disrupteknah.
20:50:49FromDiscord<Avatarfighter> mostly because I dont want to set up a remote ddb
20:51:04FromDiscord<Avatarfighter> Nah I meant the way that the 2cv broke down 😛
20:51:11disruptekdynamodb.
20:51:34FromDiscord<Avatarfighter> mmm thats good
20:51:40FromDiscord<Avatarfighter> I have so many AWS credits I'll do that
20:52:03disruptekit should be basically free.
20:52:13FromDiscord<Avatarfighter> welp
20:52:35FromDiscord<Avatarfighter> I'll have enough credits for that db to run till the earth dies then
20:53:05disruptekyou have to be smart about how you design it. nosql is a different kind of animal.
20:53:17disruptekbut, it's worth it.
20:53:19FromDiscord<Avatarfighter> ofc I only design things in the smartest of ways
20:53:26disrupteksweet.
20:53:41*narimiran quit (Ping timeout: 258 seconds)
20:53:44FromDiscord<Avatarfighter> plus I actually have quite a bit of experience with nosql so this should be fun 😛
20:53:52Prestigewhere can I look to find info on warning messages? I'm seeing method has lock level 0, but another method has <unknown> [LockLevel]
20:54:09disruptekwhat kinda info?
20:54:23PrestigeWell I have no idea what the warning means
20:55:02disruptekyou can specify the locklevel as a pragma to clear the warning. i forget what it's for.
20:55:29*mmohammadi9812 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
21:00:38*arecacea1 quit (Remote host closed the connection)
21:01:03*arecacea1 joined #nim
21:28:56FromDiscord<alehander42> oh man
21:28:59FromDiscord<alehander42> so i build now
21:29:45FromDiscord<alehander42> the compiler with strictNotNil
21:30:46FromDiscord<iWonderAboutTuatara> Are you generally supposed to uS `0..<1` or `0..^1`?
21:30:50FromDiscord<alehander42> its so slow disruptek
21:31:03disruptekis it?
21:31:17disruptekwhy?
21:31:41FromDiscord<alehander42> 😮
21:31:49FromDiscord<alehander42> not optimized
21:31:55FromDiscord<alehander42> https://media.discordapp.net/attachments/371759389889003532/760614859242078248/Screenshot_from_2020-09-30_00-29-08.png
21:32:34FromDiscord<alehander42> especially in vm.nim: all the `of` branches and probably expressions weight it down a bit
21:32:42FromDiscord<alehander42> i should just reuse the checkIf stuff
21:33:05FromDiscord<alehander42> sent a code paste, see https://play.nim-lang.org/#ix=2zcQ
21:33:08disruptekwe should find someone who wants to impl ic.
21:33:10FromDiscord<alehander42> something like that
21:33:19FromDiscord<alehander42> it's 6 times slower
21:33:22FromDiscord<alehander42> but i think
21:33:29FromDiscord<alehander42> if i just start not allocating the seq-s
21:33:41FromDiscord<alehander42> but using the stack for those
21:33:48FromDiscord<alehander42> or just return to the table approach
21:33:52FromDiscord<alehander42> it would be much faster
21:34:06FromDiscord<alehander42> using the stack as was the original zah idea*
21:34:10FromDiscord<alehander42> disruptek i find you
21:34:15disruptekwhat's the stack do?
21:34:28FromDiscord<lqdev> @iWonderAboutTuatara they have different meanings
21:34:34*^Q-Master^ joined #nim
21:34:53FromDiscord<haxscramper> Just found out we actually have five pattern matching in total - gara/macroutils/nimtrs/patty/matsuri and ast-pattern-matching
21:34:56FromDiscord<lqdev> a..<b == a..b.pred
21:35:07FromDiscord<alehander42> the stack info just stays there
21:35:14FromDiscord<lqdev> a..^b == a..BackwardsIndex(b)
21:35:16FromDiscord<alehander42> hm at least i have a benchmark
21:35:54disruptekyour algo is recursive now?
21:37:23*Q-Master quit (Ping timeout: 240 seconds)
21:38:02FromDiscord<alehander42> yeah
21:38:08FromDiscord<alehander42> wait what
21:38:56disrupteki can't tell if you're talking about nim's stack or your stack.
21:39:13disruptekwhen i talk about my stack, everyone knows what i'm talkin' about.
21:40:36*haxscramper quit (Remote host closed the connection)
21:41:15FromDiscord<alehander42> i am
21:41:19FromDiscord<alehander42> having those maps
21:41:33FromDiscord<alehander42> which are just `n` element values
21:41:43FromDiscord<alehander42> but they are all ref objects etc
21:42:02FromDiscord<alehander42> and constantly copying and allocating new ones
21:42:04*Q-Master joined #nim
21:42:39FromDiscord<alehander42> instead of the original idea which was to just have them all on a limited part of the stack
21:42:59FromDiscord<iWonderAboutTuatara> @lqdev right
21:43:41FromDiscord<iWonderAboutTuatara> Thanks!
21:44:08*gmaggior quit (Quit: Leaving)
21:44:54bunghave you guys faced `Error: Version #devel does not exist.` ? the travis CI cant download ?
21:45:27*^Q-Master^ quit (Ping timeout: 260 seconds)
21:45:59bungit occurs many times these days
21:47:09disruptekalehander92: use a pool to prevent allocs, or just never throw anything away.
21:47:54leorizethere's a pool implementation written by 4raq bundled in fusion
21:50:32FromDiscord<alehander42> i just need to simplify
21:50:35FromDiscord<alehander42> all the data handling
21:52:07*noonien quit (Ping timeout: 240 seconds)
21:52:47*hnOsmium0001 quit (Ping timeout: 240 seconds)
21:53:12*hoek quit (Ping timeout: 260 seconds)
21:53:12*nikita` quit (Ping timeout: 260 seconds)
21:53:12*d10n-work quit (Ping timeout: 260 seconds)
21:53:17*alehander92 quit (Ping timeout: 246 seconds)
21:53:23*sirn quit (Ping timeout: 272 seconds)
21:53:27*euantorano quit (Ping timeout: 240 seconds)
21:53:47*matlock quit (Ping timeout: 260 seconds)
21:54:01*npgm_ quit (Ping timeout: 272 seconds)
21:54:01*Adeon quit (Ping timeout: 272 seconds)
21:54:07*ormiret quit (Ping timeout: 240 seconds)
21:54:22*zielmicha__ quit (Ping timeout: 260 seconds)
21:55:42*noonien joined #nim
21:55:51*d10n-work joined #nim
21:56:18*sirn joined #nim
21:56:33*ormiret joined #nim
21:56:43*zielmicha__ joined #nim
21:56:44*Adeon joined #nim
21:56:51*matlock joined #nim
21:56:52*nikita` joined #nim
21:57:00*euantorano joined #nim
21:57:01*npgm_ joined #nim
21:57:20*hnOsmium0001 joined #nim
21:57:30*alehander92 joined #nim
21:57:30*hoek joined #nim
22:05:17disrupteksmart folks don't use fusion.
22:10:39*solitudesf quit (Ping timeout: 260 seconds)
22:12:21*solitudesf joined #nim
22:21:21*Sembei joined #nim
22:22:01*abm quit (Read error: Connection reset by peer)
22:26:27*solitudesf quit (Ping timeout: 258 seconds)
22:31:45*sagax quit (Remote host closed the connection)
22:34:23disruptekZevv: it was openapi that failed ci on npeg-0.23.0 due to an apparent npeg issue. i bumped openapi with a lower npeg req already.
22:37:06*abm joined #nim
22:41:18*Jesin quit (Quit: Leaving)
22:49:41*Jesin joined #nim
23:12:39disruptekZevv: also, yes, it was nim-1.0.6.
23:13:36*leorize quit (Quit: WeeChat 2.9)
23:16:54FromDiscord<JSGRANT> @alehander42 That terminal screenshot; IT'S LIKE STARING DIRECTLY INTO A NUCLEAR EXPLOSION lol
23:19:25FromDiscord<Yardanico> Too white
23:20:01FromDiscord<JSGRANT> @haxscramper One of the best-things about having powerful macros is that you can often implement language-features yourself -- one of the worst-things about having powerful macros is that you often implement language-features yourself. Lol It's one of the reason I really support iniatives like Fusion ... it's such a crazy problem in the Common-Lisp community. Like 10 versions of everything.
23:20:48disruptekit's a bad implementation of a poorly-thought-out concept, imo.
23:20:57disruptekyour point is a good one.
23:27:41FromDiscord<JSGRANT> I'm all for it; At least in-regards of it being an "authority" which promotes a semi-sanctioned 'good enough' solution to x,y,z domain -- like these projects pop-up regardless and I think it's better to be driven by the actual benevolent-dictator of a given community than some 3rd-party actor.
23:28:06disruptekbdfl has enough on his plate.
23:29:33FromDiscord<JSGRANT> I think this is the exact issue in-regards to CL; There's the standard -- which will "never" (in all likelyhood) be updated so it's entirely driven by the community so you end up with 10 competing standards that all implement basically the same stuff and makes the ecosystem superfically bloated for no real gain ... before i jumped ship from LISP (and really ... I fought myself for like a whole year over this) I was even considering forkin
23:29:56*krux02 quit (Remote host closed the connection)
23:30:21FromDiscord<JSGRANT> If there was no real issue with fragmentation; I'd say it wasn't a concern -- but I think it's actually a pretty big deal
23:30:33disruptekthe idea of composing distributions isn't bad, but this is not the way to do it. and i'm especially disappointed with how stuff is added to fusion.
23:31:45disruptekfragmentation will exist as long as there is something to be gained by /not/ using what already exists, right?
23:32:11FromDiscord<JSGRANT> re: Your issues with Fusion -- but isn't that mostly errata and/or an issue in the proccess (that could be fixed); And not fundemental to Fusion itself though, I assume?
23:32:43disruptekno, i think my complaints are fundamental.
23:33:04FromDiscord<JSGRANT> Have you laid them out formally somewhere?
23:33:04disrupteki see new stuff go into fusion that isn't well-tested, if it's tested at all.
23:33:21FromDiscord<JSGRANT> _has about 20 minutes till he needs to head out and run some errands_
23:33:23disruptekthe original idea centered around co-opting the best work from the community.
23:33:50disrupteki've whined about this. araq wants to try it his way. i'm fine with watching and criticizing.
23:34:40FromDiscord<JSGRANT> @disruptek But also yeah fragmentation always exists, but when you give people powerful enough tools -- they want to use them. There is alread a bunch of NIH-sentiment without giving someone "good macros" lol
23:34:57disruptekof course. we are all guilty of it.
23:35:21disruptekdespite championing nim's amazing ffi all the time, we like to have native shit.
23:37:27*apahl quit (Ping timeout: 240 seconds)
23:38:03FromDiscord<JSGRANT> I'm really split over Nim's FFI; Because it IS GREAT -- but I also still just kinda want a first-class LLVM backend because of p u r i t y and there's really no technical reason besides maybe-slightly-faster ultimately and even that's arguable
23:38:27disruptek1st-class llvm backend is on the way.
23:38:32disruptekjust give it time.
23:38:38*apahl joined #nim
23:38:43FromDiscord<JSGRANT> nlvm ?
23:38:49disruptekno.
23:38:54FromDiscord<JSGRANT> Like official
23:38:55FromDiscord<JSGRANT> ?
23:38:58disruptekyes.
23:39:20disruptekmaybe 2021. have to see...
23:40:10FromDiscord<JSGRANT> I mean, I'd certainly be excited for it. But at this point -- it feels like a "to have it" ; I think the purity aspect of having a lower-level IR is real / nice but really not exactly sure why I want it so bad tbh lol
23:40:31disruptekwell, it's a little more elegant.
23:40:48disruptekit could let us do some stuff faster/better/cheaper.
23:41:37disruptekit can remove undefined behavior that the compiler produces.
23:41:42FromDiscord<JSGRANT> Again, in support of it; lol -- but like we're talking marginal gains right? Like I can't imagine a 2x + speed up
23:41:58disruptekit can help us do related stuff like repl, ic, etc.
23:43:26disruptekit could be a little slower, actually. and it would use significantly more memory, which is the most troubling part.
23:43:45disruptekbut the output should be smaller and faster.
23:44:13FromDiscord<JSGRANT> Honestly having a first-class repl and ic are really high up there for me for "most exciting features" on the horizon. Well besides maybe a more robus hcr system. I basically just want Nim to FEEL dynamic lol
23:44:14FromDiscord<JSGRANT> _needs to check out inim again_
23:44:37FromDiscord<JSGRANT> robust*
23:45:00FromDiscord<JSGRANT> wow robus is SO CLOSE to rombus
23:45:02FromDiscord<JSGRANT> lol
23:45:03disrupteki get it, but i think most people really don't understand repl the way lisp people do.
23:45:26disruptekit's just hard to sell them on it when they have never really used it.
23:45:55disruptekinim is a repl in the same way that python is a repl.
23:46:25FromDiscord<JSGRANT> That tight-feedback loop (via Emacs) is probably THE REASON I stuck to programming in my mid-to-late-teens. Said before and I'll say it again, I really credit Emacs from "saving me" from Art School. lol
23:46:41disrupteki believe it.
23:46:56disruptekif i were a younger lad, i'd have used emacs.
23:48:45FromDiscord<Avatarfighter> Curious to know but how would one do a bitfield?
23:49:16disrupteksame as in c, if you're a masochist.
23:49:23disruptekelse, use a set of enums.
23:49:38FromDiscord<Avatarfighter> Wait a set of enums?
23:49:43FromDiscord<Avatarfighter> You can do enum -> bitfield?
23:49:47disruptek~manual
23:49:47disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
23:49:52FromDiscord<Avatarfighter> wowww
23:49:56disruptekyou can do set->bitfield
23:50:28FromDiscord<JSGRANT> sent a long message, see http://ix.io/2zdx
23:51:12disruptek"emacs is bloated" is literally what kept me from using it, though.
23:51:24disruptekit was not technically feasible.
23:51:31FromDiscord<JSGRANT> * I think having an "all-around / all-involved" ecosystem really helps lure people in. And really I think why the idea of having a AwesomeWM-like clone and configurable editor "enviroment" in Nim is such a promising idea to me.
23:51:34FromDiscord<Avatarfighter> disruptek you have peaked my interest with sets
23:51:46disruptekthat word is `piqued`.
23:51:56FromDiscord<Avatarfighter> no
23:51:59disrupteksets and enums are hugely powerful in nim.
23:52:16disruptekmostly because they compose so nicely.
23:52:42FromDiscord<Avatarfighter> Yeah I'm curious as to how the sets look in memory
23:53:22disruptekthey don't; sets don't have eyes. just values.
23:54:05FromDiscord<Avatarfighter> that was the most dad joke thing I've read today
23:54:16FromDiscord<XeroOl> I assume they're just bitsets
23:54:27disruptekyes.
23:54:36FromDiscord<JSGRANT> Different strokes for different folks I guess; But remember I wasn't especially tech (or at least programming-) orriented at the time -- I was drawn into Emacs because of all the crazy / goofy stuff in it. Not to say I didn't have programming-experiences whatsoever ... I did a lil C++ & Python because "I want to make games" -- wow things really have changed too much lol But yeah, I didn't get into Emacs as 'this is a powerful editor' but
23:54:37disruptekwell, in the case of enums.
23:55:31FromDiscord<JSGRANT> I personally think a project like Pharo (the Smalltalk System) would be more successful with absolute-beginners if they threw in a lot of toys / nonsense in the base image as-well
23:56:15disruptekpharo is pretty cool but, yeah, you need to give me some reason to boot the environment.
23:56:21FromDiscord<Avatarfighter> ok noice this does exactly what I want, thanks disruptek
23:56:26disruptekyep.
23:56:50FromDiscord<Avatarfighter> I am making the most ghetto bittorrent client atm
23:57:38disrupteki started with vi in like 1990, when i was sneaking into college campuses to use their computer labs or dialing up the 'net over 9600 baud.
23:58:11FromDiscord<XeroOl> help I'm still stuck with vscode
23:58:16disruptekemacs just wasn't tenable in those environments. or even on my first linux box, which had a 100mb drive.
23:58:36FromDiscord<JSGRANT> _is still passively looking at Spry every-once-and-awhile and hoping to see a pharo-like ui magically appear lol_