<< 19-06-2019 >>

00:16:43shashlick@rayman22201 how will hcr help
00:17:21rayman22201instead of dlls, your plugins become HCR modules
00:18:44rayman22201but I guess you need some way to detect entirely new modules, not just module changes.... so actually, nvm
00:19:52rayman22201actually. as long as the "main" module doesn't change, you can add new imports and do this.
00:21:51rayman22201can a macro define an import?
00:23:02rayman22201nvm. It would be very hacky
00:25:27shashlickIt's not about the plugins
00:25:36shashlickThat works fine without hcr
00:25:45shashlickPredates it by a couple months
00:26:21shashlickIn my main module itself, I need to share strings and seqs across threads
00:28:07rayman22201oh I see
00:28:37rayman22201I thought it was your plugins that caused the problem. I misunderstood.
00:28:39*abm quit (Quit: Leaving)
00:29:09rayman22201then, newruntime is really your best bet
00:29:30shashlickwell problem is that newruntime isn't targeted at 1.0
00:29:42shashlickso we need some sharing support until then
00:30:46rayman22201maintaining a fork with your own version of seq and string doesn't seem great either.
00:31:10shashlicknot doing that, doesn't seem sensible to mess with compiler when a real solution is in the works
00:31:23shashlickam thinking of creating a sharedString type
00:31:41rayman22201Yeah. making your own userspace datastructure is probably your best bet.
00:31:52rayman22201as annoying as that is
00:32:21*rayman22201 overuses the phrase "best bet"
00:32:41shashlicki was thinking of wrapping libck
00:32:46shashlickbut that starts at arrays
00:35:28rayman22201you are kind of stuck with manual memory management either way.
00:36:28shashlickyep
00:36:38rayman22201:sadpanda"
00:37:57shashlickhow do you override =destroy
00:38:27shashlickError: signature for '=destroy' must be proc[T: object](x: var T)
00:39:20rayman22201can you share your destroy proc definition?
00:41:37shashlickproc `=destroy`*(ss: var sharedString) =
00:42:56shashlicknever mind
00:43:58rayman22201ok
00:48:14shashlickhow do you say string|cstring and default initialize for a proc param
00:49:57shashlicknever mind, nim implicitly converts anyway
01:00:56shashlickwell its coming along
01:03:43FromGitter<zetashift> @SychoRyn did you get it to install? You might also be easier off with choosenim: https://github.com/dom96/choosenim
01:07:49FromDiscord_<SychoRyn> I'll check out choosenim
01:08:19*rayman22201 was waiting for the pastebin
01:08:31shashlickwell, actually you can use =destroy only on an object and a sharedString has to be allocShared itself so it has to be a pointer
01:13:07rayman22201You can wrap the shared pointer in a type that is regular alloc'ed. Then the type does DIY ref counting in the destructor
01:14:30shashlickright but then that type is on the threadlocal heap
01:14:33shashlickand cannot be shared
01:15:38rayman22201to "share" it, you copy the type to the new thread, and increase the ref count (which is also shared).
01:16:31shashlickso the bucket is copied but the contents are shared?
01:16:35rayman22201yup
01:16:57rayman22201That's one solution I can think of anyway
01:20:22shashlickwell, the contents can change so i want the bucket to be shared too
01:20:30shashlicki guess i cannot avoid the explicit destroy
01:21:02shashlickwhich will be ugly since you use strings often and each one will need to be explicitly destroyed
01:21:31shashlickunfortunately destroy is restricted to objects
01:22:38rayman22201well, that is a type safety thing. dangerous to destroy a pointer that you can't prove size info about.
01:24:12rayman22201you can get around the changing buckets limitation by defering deletes, and having your shared pointers be linked lists.
01:25:13rayman22201perf is probably going to start to suffer here though. it starts to become a lot of overhead.
01:26:48shashlicklooks like the opposite - the contents can change, but the bucket stays the same so both threads have a pointer to the same bucket
01:30:37*mal`` quit (Quit: Leaving)
01:31:52rayman22201yeah. the only real change you care about is a resize. Instead of keeping a `ref: sharedString`inside each threads bucket, you keep `ref: sharedStringLinkedListNode`.
01:31:52rayman22201The linked list node has an "invalid" flag, which tells you to go to the next node. (This is all shared memory, so the nextNode field is available to all threads)
01:31:52rayman22201On a resize, you make a new `sharedStringLinkedListNode`, marks the old one as invalid (but doesn't free the memory).
01:31:52rayman22201When the local thread goes the read the string, it first checks the ptr to see if it's still valid, if it isn't it updates it's internal pointer to the latest node.
01:34:45rayman22201And you can't delete a linked list node until you know that no thread has a reference to it
01:35:22rayman22201(so each node has it's own ref count I suppose)
01:41:09*mal`` joined #nim
01:44:35rayman22201Every read, write, and destroy has to wrapped for this to work. Override all the operators lol
02:05:03*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:09:46rayman22201This would replace the shared bucket. Instead of a shared bucket, each thread gets it's own bucket, that is backed by the shared linked list. The coordination and automatic memory management is then taken care of by overriding the necessary operators (including `destroy`, which allows you to hook into the thread local gc).
02:09:52rayman22201it's very C++ like actually
02:11:25rayman22201It's complicated as hell to implement and get right, but it will give you automatic memory management. (no explicit destroys).
02:14:59rayman22201I also have no idea what the perf cost would be. It is probably going to be slower than the stdlib string, and it's definitely slower than just doing the explicit memory management yourself. IDK how much slower though. It might be ok, depending on your use case.
02:15:07*rayman22201 is now just rambling
02:18:45rayman22201It will be very safe (in the Rust sense of the word). Safer than libck
02:27:33shashlickSorry dinner, brb
02:28:41rayman22201no worries
02:33:00FromDiscord_<SychoRyn> Nim is cool so far
02:37:14rayman22201I guess that means you got it to install successfully ๐Ÿ™‚
02:37:27rayman22201yay
02:57:42*deech_ joined #nim
02:58:20*dddddd quit (Remote host closed the connection)
03:03:27shashlick@rayman22201 - in my case, I just want to sync two threads, so that might be overkill
03:03:58shashlicki could just use channels and make up some bogus language but that annoys me
03:04:18shashlicknim already has sharedlist so could leverage that for your idea
03:06:15*leorize quit (Ping timeout: 256 seconds)
03:07:43*NimBot joined #nim
03:11:18*leorize joined #nim
03:12:10*deech_ quit (Remote host closed the connection)
03:16:46rayman22201Pick your poison lol
03:29:12*theelous3 quit (Ping timeout: 245 seconds)
03:54:06*fjellfras joined #nim
04:07:27FromDiscord_<SychoRyn> guys
04:07:29FromDiscord_<SychoRyn> I made a great program
04:07:57FromDiscord_<SychoRyn> https://pastebin.com/TyGck40c
04:29:13*envoyt quit (Ping timeout: 245 seconds)
04:29:55*envoyt joined #nim
04:32:08*nsf joined #nim
04:35:24*arecaceae quit (Remote host closed the connection)
04:35:43*arecaceae joined #nim
05:23:34*narimiran joined #nim
05:27:42*leorize quit (Quit: WeeChat 2.3)
05:28:42*sentreen quit (Ping timeout: 268 seconds)
05:31:32*envoyt quit (Ping timeout: 272 seconds)
05:31:53*envoyt joined #nim
05:55:00*sentreen joined #nim
05:57:26*leorize joined #nim
06:21:40*leorize quit (Quit: WeeChat 2.3)
06:26:13*rokups joined #nim
06:29:14*leorize joined #nim
06:30:16rokupsare -d:useMalloc and -d:nogc documented anywhere? i cant find it
06:30:36leorizenogc is --gc:none
06:31:03leorize-d:useMalloc is currently undocumented, but when used with --newruntime it'll use the OS's malloc instead of Nim's allocator
06:31:09*PMunch joined #nim
06:32:41rokupshow is memory freed with --gc:none?
06:32:55leorizememory is not freed with --gc:none
06:33:02leorizeit's discouraged to use --gc:none
06:33:11leorize--newruntime is aiming to be a better --gc:none
06:34:21leorizean another alternative to --gc:none is --gc:regions
06:34:44leorizememory is allocated within a region and the entire region is freed at one time
06:34:57leorizeunfortunately there aren't any docs for this gc mode
06:35:21rokupsare garbage collectors documented anywhere? i again cant see any descriptions of all these values that can be passed to --gc
06:36:11*drewr quit (Ping timeout: 248 seconds)
06:36:12rokups`--gc:refc` sounds very much like objects being refcounted, but i suspect there is a catch
06:36:49leorizeit's slow :p
06:36:51leorizeand it's the default
06:37:13leorizerefc is a deterred refcounting gc iirc
06:37:53leorizehttps://nim-lang.org/docs/nimc.html
06:38:02PMunchleorize, it's not that slow
06:38:08leorize^ this should cover some switches
06:38:29leorizeyea, still faster than --newruntime the last time I checked :p
06:38:38rokupsanyway im looking for a combination of flags to use with function hooking. i guess it must be `--gc:none --newruntime` as per message in forum. you said memory is not freed with that gc which cant be right .did you mean memory is meant to be freed manually?
06:39:04leorize--newruntime implies --gc:destructor
06:39:13leorizethis is a brand new operation mode
06:39:32leorizebut what are you trying to do?
06:39:36rokupsso how is it supposed to be used?
06:40:14leorizejust add --newruntime :p
06:40:29leorizehttps://nim-lang.org/araq/ownedrefs.html
06:40:37leorize^ that's the original proposal for newruntime
06:40:58*drewr joined #nim
06:41:02PMunchrokups, with gc:none you get a warning every time you use a garbage collected structure (like string, or seq). And you can do you own memory management. Mostly useful for things like microcontrollers and super performance critical stuff that will actually get tested for leaks
06:41:21rokupsyeah i misspoke. it was `--newruntime -d:useMalloc`
06:41:46rokupsso using these no manual memory management is needed and objects are destroyed when they go out of scope?
06:41:55rokupseven ref objects?
06:42:14leorizeyea, see that blog I linked above
06:42:22rokupsalright, thanks
06:42:37leorizeit's worth noting that --newruntime is... new
06:42:57leorizeand there are many bugs, like not working well with closures
06:43:00Araqrokups, try hcr.rst?
06:43:36AraqI documented how it works, it works with the old runtime (but will also work with the new runtime)
06:43:36rokupswhere is that? certainly not in Nim repo
06:44:12Araqhttps://raw.githubusercontent.com/nim-lang/Nim/devel/doc/hcr.rst
06:44:16Araqit's new
06:44:22rokupsleorize: yeah i realize that. just testing waters. in the past Nim was absolutely nogo for this specific usecase im after, now it is becoming viable
06:44:33leorizehttps://nim-lang.github.io/Nim/hcr
06:44:39leorize^ doc's up
06:45:03PMunchrokups, what is your specific usecase?
06:45:25rokupsfunction hooking in foreign processes
06:47:23PMunchFor any specific scenario? And why does that mean you can't use the GC (don't know much about how that works under the hood, sorry if that's a really obvious question)
06:48:07rokupscode implemented in nim would be called by some random thread that GC is not aware of
06:48:33Araqthere is setupForeignThreadGc() or whatever it's called
06:49:10PMunchnim-lang.org/docs/system.html#setupForeignThreadGc.t
06:49:21rokupsi cant say i trust GC very much to run in such conditions. who knows what could go wrong
06:49:21PMunchDocumentation on that is a bit... sparse
06:49:34AraqEdit button!
06:49:43*Vladar joined #nim
06:49:57PMunchWell I sorta knows what it does, but certainly not enough to write documentation for it..
06:50:07Araqfair enough
06:50:33leorizethere's already documentation for it...
06:50:39leorizejust that it's not exposed to nimdoc
06:51:07leorizea simple change should be enough
06:52:00Araqhmmm Source links are wrong, probably because 'master' is dead
06:52:06Araqnarimiran, ?
06:52:07PMunchAh, it's the classic documentation was created without the required switches issue: https://github.com/nim-lang/Nim/blob/master/lib/system/gc_common.nim#L200-L234
06:52:19Araqyup
06:52:56PMunchHmm, it would be cool if Nim could create sections for that in the output
06:54:04PMunchNot entirely sure what the output would be though
06:54:21leorizefor now `or defined(nimdoc)` works well enough :p
06:54:38PMunchMaybe when branches could get a `docswitch` pragma that takes some explanation
06:55:51PMunchleorize, oh yeah, for this that works fine. But take eg. some cross platform code that does slightly different things between Windows and Linux.
06:56:02PMunchSo you can't easily just choose one of the branches
06:56:15leorizea nimdoc branch with detailed doc ftw
06:57:10Araqjust fix the issue, don't introduce more machinery that we can get wrong
06:57:18Araq'when defined(nimdoc)' is fine
06:57:46Araqand doc comments can already outline platform specific behaviour
06:57:50PMunchCome to think of it you can do most of it with just defined(nimdoc), but maybe Nim should at least throw a warning when you generate documentation that are missing pieces?
06:58:17narimiranAraq: yeah, source links are wrong, we need to patch docgen.nim:683, but i'm not sure how to make it both simple and effective
06:58:19PMunchI think a lot of people (myself included) just forget that this will happen
06:58:21leorizean optional [ExportedButNoDoc] hint?
06:58:35Araqfor the stdlib, yeah, for other projects it can be fine to not have doc comments
06:58:48Araqideally everything there is to say is in the proc type declaration already
06:59:01Araqand no informal description is required :P
06:59:22*Araq remembers Eclipse writing doc comments for him
06:59:40PMunchleorize, ExportedButNoDoc would help, but I was more thinking of DocumentedButSwitchedAway
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:01*PMunch shudders at Araqs mention of Eclipse doc comments
07:00:02leorizelooks like when --threads:on, setupForeignThreadGc is a proc instead of a template :p
07:00:21PMunchYes, and that might be a bit confusing :P
07:00:26Araqit's beautiful :P
07:00:31PMunchI mean it makes perfect sense
07:00:46PMunch(The template vs. proc, not the doc comments in Eclipse)
07:02:07PMunchI was talking to someone the other day about doc comments by the way, and one thing Nim doesn't have is a formalized way to outline what a parameter is, and what the return value is. Although with its expressive type system I hardly ever find the need to explain them anyways
07:02:44PMunchrokups, sorry for derailing the chat :P
07:03:41PMunchHmm, are you supposed to have setupForeignThreadGc at the start of a callback and tearDownForeignThreadGc at the end?
07:03:50Araqno
07:03:54PMunchOr is tearDownForeignThreadGc used for something else?
07:03:58PMunchAh
07:03:59Araqdon't call tearDownForeignThreadGc
07:04:05PMunchEver?
07:04:43*gmpreussner joined #nim
07:05:24FromGitter<gogolxdong> I've made hcr.rst compile with latest sdl2, does this need a PR?
07:06:18rokupsim not sure its a good idea to have a gc in such situations anyhow. there is no knowing when code will be called again (if ever). and gc touching random memory might become a problem when these hooks must remain as invisible as possible
07:07:12leorizethe docs said "the GC for this thread will only be initialized once per thread, no matter how often it is called."
07:08:33rokupssounds like gc uses thread-local variables for some state too. another reason to avoid it ^_^
07:08:52*krux02 joined #nim
07:08:59leorizeAraq: done https://github.com/nim-lang/Nim/pull/11536
07:10:42PMunchrokups, it should work fine. setupForeignThreadGC is literally meant to do exactly what you need. The GC won't touch memory that it isn't in charge of, and if you need to pass memory to or from some other code you can use GC_ref and GC_unref.
07:11:18*laaron- quit (Remote host closed the connection)
07:11:33rokupsgc would still scan stack when hook is called. or not scan anything and free anything if hook is not called
07:12:57PMunchWell yes, that is how GCs work. If the hook is called often enough that it actually acrues some amount of memory it will also be freed. But if is called very seldom and it doesn't allocate a lot of memory it will just be left there
07:12:59rokupsfurther more if one thread calls multiple hooks then gc will start scanning stack that belongs to parent native application too which may or may not be a problem. this is a touchy subject ^_^
07:13:17PMunchThe same way you don't empty your trash can every day, but only once it gets full
07:13:31leorizeit won't be a problem :p
07:13:44*laaron joined #nim
07:14:06PMunchThe GC will only scan memory that it has allocated I think
07:14:21PMunchSo it won't go ham and just scan through all you memory willy nilly
07:14:26rokupsGC scans stack for pointer it has allocated
07:14:39rokupsand it scans from the stack top to the current position
07:14:51PMunchAh yes, it will scan the stack
07:15:24rokupscall me memory nazi but i prefer to have explicit control in this kind of setting
07:15:44PMunchNot actually sure how that works with setupForeignThreadGC, will it still scan the entire stack, even from before that call?
07:16:04leorizethe code is really simple, actually
07:16:10PMunchWell then gc:none and manually managing it is probably your best bet :)
07:16:18leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/system/gc_common.nim#L160
07:16:34PMunchBut I don't think it's necessary
07:16:51leorizeone thing for sure, the GC won't corrupt memory :p
07:16:53rokupsit wont, but if say we are in situation such as: [hook_a call][some parent app code calls[hook_b call] then when hook_b is called gc could scan entire stack from hook_a to hook_b, including stack with data from parent app
07:17:10PMunchAh yes, so it will only scan from wherever setupForeignThreadGC was called
07:17:51leorizeaside from possible performance issue, I don't think there's any other problem
07:19:09*Trustable joined #nim
07:19:16PMunchYeah, the GC is meant to scan your entire programs stack anyways, so scanning a frame or two from another program really shouldn't do much
07:19:46leorizemy advice would be: try it first and see if there's any real problem
07:20:25PMunchWorst case scenario it points to some memory you have allocated, which isn't very likely, and you will have some memory that lingers about for a bit longer that it should
07:22:30PMunchHmm, what does "thread local storage emulation" mean? (from `tlsEmulation`)
07:22:47leorizesome OS doesn't have native tls support
07:23:10leorizeso it's emulated with primitives like pthread_setspecific
07:23:17PMunchAah
07:30:13*solitudesf joined #nim
07:33:01*lf-araujo joined #nim
07:39:10*leorize quit (Remote host closed the connection)
07:46:23*leorize joined #nim
08:01:20leorizelooks like travis' OSX homebrew is totally broken
08:01:32*couven92 joined #nim
08:02:01narimiranleorize: yep
08:02:30leorizemaybe open an issue at https://github.com/travis-ci/travis-ci/ ?
08:04:24leorizenarimiran: I've spent some time to debug tfloatrange
08:04:42leorizethe result is... idk, it just fails when it feels like it
08:08:19TangerHey folks, I'm trying to define a constructor for an object, but I get an error fro redefining the symbol. Pastebin here: https://pastebin.com/3WTpvNUF
08:08:46leorizeyea, that's not how you define a constructor...
08:08:58TangerSorry, a casting function I guess
08:09:26leorizeuse `proc initMQTTByte` or toMqttByte instead
08:10:07leorize"constructor" in Nim doesn't really exist :p
08:10:24leorizealso the object constructor is only available to object types
08:10:59leorizebtw, with the playground working really well now, you can share code snippet there :)
08:11:02TangerHow is a Port object in nativesockets able to be cast from an int then leorize? ie 1337.Port. Wouldn't that be something like `proc Port(x:SomeUnsignedInteger)`?
08:11:12TangerOh yeah, I keep forgetting about the playground, thanks
08:11:31leorizeno, it's just a normal conversion :p
08:11:44TangerAh, because it's a distinct uint?
08:12:09leorizehttps://nim-lang.org/docs/manual.html#statements-and-expressions-type-conversions
08:12:37leorizeand https://nim-lang.org/docs/manual.html#type-relations-convertible-relation
08:13:18leorizeand thanks to Nim's method call syntax
08:13:30leorize!eval uint8(8) == 8.uint8
08:13:32NimBotCompile failed: /usercode/in.nim(1, 10) Error: expression 'true' is of type 'bool' and has to be discarded
08:13:40leorize!eval doAssert uint8(8) == 8.uint8
08:13:43NimBot<no output>
08:14:22TangerThanks leorize, it's all clicking now
08:19:35FromGitter<kayabaNerve> leorize: Why echo over doAssert?
08:19:59leorize?
08:23:19*floppydh joined #nim
08:27:09FromGitter<kayabaNerve> !eval echo uint8(8) == 8.uint8
08:27:12NimBottrue
08:27:19FromGitter<kayabaNerve> :thinking:
08:30:57*leorize quit (Ping timeout: 256 seconds)
08:33:59*leorize joined #nim
08:49:46*neceve joined #nim
08:51:33*dddddd joined #nim
08:59:00*leorize quit (Remote host closed the connection)
09:08:05*leorize joined #nim
09:28:46leorize[m]narimiran: looks like cirrus Windows VMs have at least 4 cores
09:29:19leorize[m]but they don't have live console, so... we have to wait for a step to finish before it's output can be seen
09:29:39*leorize_ joined #nim
09:31:01*leorize quit (Ping timeout: 256 seconds)
09:35:10*lf-araujo quit (Ping timeout: 252 seconds)
09:36:53*stefanos82 joined #nim
09:39:28*Acid147 joined #nim
10:06:38lqdev[m]seems like Nim playground is dead, the XHR sent to play.nim-lang.org/compile returns a 502 (bad gateway) status code
10:06:51leorize[m]!eval echo "alive!"
10:06:53NimBotCompile failed: <no output>
10:07:05leorize[m]PMunch: ^
10:07:06lqdev[m]huh, interesting
10:09:51*leorize_ quit (Quit: WeeChat 2.3)
10:15:43rokupsis there a way to turn `nnkIdent` into actual type? for example i have `nnkIdent "TableRef"` which and i want to test if it is a ref type
10:18:04FromGitter<mratsim> getType
10:18:14FromGitter<mratsim> getType(yourIdent) might work
10:18:56rokupsi tried that already: `Error: node has no type`
10:18:59FromGitter<mratsim> ah no, getType(int) will create the NimNode representation of the int type
10:19:25FromGitter<mratsim> but nnkIdents have no types, you need an nnkSym for that so your input must be typed (and not untyped)
10:20:29FromGitter<mratsim> the easiest would be to quote do your ident and test
10:21:51rokupsyes changing to `typed` looks like should do. it broke my macro but it should be fixable
10:21:53FromGitter<mratsim> also let myType = bindSym($myIdent) could work
10:22:04FromGitter<mratsim> but it's a bit convoluted
10:23:01FromGitter<mratsim> This is how I test if something is a int using bindSym for example: https://github.com/mratsim/Arraymancer/blob/master/src/private/ast_utils.nim#L20-L26
10:24:28*fjellfras quit (Quit: Leaving)
10:29:43PMunchleorize[m], yeah I'm updating the server
10:32:30PMunchI left for lunch and it had popped up a prompt, but by the time I came back the ssh connection had timed out..
10:33:22lqdev[m]seems like I'm not the only one always caught up by the [y/N] prompts when I go afk
10:35:02*abm joined #nim
10:38:23livcd!eval echo "alive!"
10:39:23NimBotCompile failed: <no output>
10:40:14PMunchWorking on it..
10:40:22PMunchI think something messed up..
10:47:12PMunchSeems to be an issue with docker
10:56:43rokupsany idea how could i create `Sym "_:type"` under `nnkGenericParams`? that thingy is created when i have a first parameter `_: typedesc[Table[A, B]]`. not sure how to synthesize that symbol manually
10:58:36rokupsi ofc tried `genSym(nskType|nskLet, "_"|"_:type")` but at this point i have no idea what im doing
11:01:32PMunchnewIdent("_") should work
11:02:36rokupsthat produces `Ident "_"` while i need `Sym "_:type"`
11:05:49PMunchAre you sure?
11:06:21PMunchThat you need a Sym
11:06:32PMunchMost of the time an ident works just fine
11:06:46PMunchNim will consider it a sym when it needs to
11:07:49rokupsi am not sure of anything heh. i tried and it didnt work though. the way i make macro is i write code that i would like macro to produce, dump it's ast and then massage my macro until it produces same thing
11:08:18rokupsand i have basically same thing except that one sym
11:08:52rokups`Error: illformed AST: [A; B; _:type300260]` is not very helpful error
11:09:36*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
11:09:46*laaron- joined #nim
11:09:58PMunch!eval echo "And we're back! leorize[m] and lqdev[m]"
11:10:01NimBotAnd we're back! leorize[m] and lqdev[m]
11:10:14lqdev[m]yay!
11:10:48PMunchrokups, have you seen dumpAstGen?
11:11:01PMunchNot to mention `quote`
11:11:16rokupsdumpAstGen produces code that does not compile :D
11:11:29PMunchHmm, yeah it's not perfect..
11:13:11PMunchplay.nim-lang.org/index.html?ix=1MbM
11:13:24PMunchHmm, I need to fix indent in the playground output
11:14:19*Mister_Magister quit (Quit: bye)
11:16:27*Mister_Magister joined #nim
11:20:57lqdev[m]there's a bug with the playground, if you get a compile error, `nim`'s stderr (and only stderr) will be displayed no matter if compilation succeeds or not
11:21:43PMunchReally?
11:21:55PMunchEven if you switch from debug output to normal output?
11:22:02lqdev[m]aah, that's a thing
11:22:06lqdev[m]I didn't know about that
11:22:09PMunchYes :P
11:22:17PMunchThe button beside "Run"
11:22:32lqdev[m]I see it now
11:22:46PMunchIf there is debug output it auto-switches to that
11:23:49ZevvPMunch: that bit me as well, could we make that more obvious somehow?
11:24:13PMunchI'm open to ideas
11:24:38PMunchMaybe the button could change colour?
11:24:48PMunchAt least a bit easier to notice that it has switched
11:25:22Zevvsomething like that. Personally I'd prefer to just have it all in one window, but I guess thats not nice for everyone
11:26:01Zevvor if the window is large enough, show both windows in panes?
11:26:03PMunchWell, I wanted to have it separated so new users wouldn't wonder what all that output was
11:26:18lqdev[m]btw, I discovered that you can just browse the container's filesystem but probably isn't a vuln since the playground's running in a Docker container
11:26:23Zevvbut then again, you dont want to develop a complete IDE there
11:26:34Zevvlqdev[m]: right
11:26:56PMunchlqdev[m], yeah you have complete freedom within the container
11:26:58ZevvI spent some time looking for vulnerabilities, and from my limited perspective it looks pretty solid
11:27:08ZevvI cant get it to blow up anymore either
11:27:09PMunchBut it's nuked as soon as compilation is done, or time runs out
11:27:13PMunch:D
11:28:09lqdev[m]it runs in a container after all, so no vulnerabilities should be present. since everyone gets their very own Linux instance
11:28:39PMunchWell, short of meltdown/spectre/whatever-the-rest-are-called
11:28:59PMunchI think there was a new Docker vuln as well that allowed it to gain access to the actual file system
11:29:17lqdev[m]ah yes, but the easy ones are simply not a thing
11:30:08Zevvthat was fun: inits /proc/self/exe was a physical link to the docker binary
11:30:15Zevvand would be writable
11:30:26*AndChat|624225 joined #nim
11:30:37ZevvI believe the workaround is that they now make a one time copy of that binary
11:30:47Zevvand dispose of it right after the exec()
11:31:44PMunchhttp://ix.io/1MbT
11:31:54PMunchHmm, anyone got any ideas why 0.20.0 fails to build?
11:32:07*envoyt quit (Ping timeout: 245 seconds)
11:32:53Zevvdo you even have a gcc :)
11:33:23PMunchYup: http://ix.io/1MbV
11:33:49PMunchIt's a bit old though..
11:33:57PMunchBut that's Ubuntu for you..
11:40:50vegai_seems to be building fine on my Ubuntu though
11:41:00vegai_not complete yet, admittedly
11:41:50*laaron- quit (Remote host closed the connection)
11:42:23PMunchYeah it went for a while before crashing
11:43:37PMunchHmm, I cloned the repo and checked out the tag to build it manually. It failed in a different place this time: Error: execution of an external program failed: 'gcc -c -w -O3 -fno-strict-aliasing -I/home/pmunch/Nim/lib -I/home/pmunch/Nim/compiler -o /home/pmunch/Nim/nimcache/r_linux_amd64/stdlib_assertions.nim.c.o /home/pmunch/Nim/nimcache/r_linux_amd64/stdlib_assertions.nim.c'
11:43:49PMunchStrange thing is, running that command works fine..
11:44:54*laaron joined #nim
11:46:26PMunchHmm, I wonder if the machine is just running out of memory or something
11:48:13*lritter joined #nim
11:48:58vegai_Hint: operation successful (99192 lines compiled; 25.280 sec total; 139.199MiB peakmem; Release Build) [SuccessX]
11:49:15vegai_same version of ubuntu as you have, I believe
11:49:21vegai_I have 2GB on this
11:49:28PMunchThis machine has 1GB
11:49:41vegai_hmm, well, I guess that could be it
11:49:58PMunchShame though if you need more than a Gig of RAM to build Nim..
11:56:39vegai_is that comment about peakmem accurate?
11:57:08vegai_I guess it's just about some part of the whole build, since it certainly took longer than 25.280 seconds
11:57:44vegai_Hetzner Cloud gives you 2GB virtual machines for 2.49euros though :)
11:57:53vegai_dunno if that's more than what you're currently using but I'm guessing not
11:59:02PMunchI've got no idea
11:59:14PMunchIt's dom96 who's set this up
11:59:33rokupsanyhow im trying to get this work. anyone bored enough to take a look? http://ix.io/1Mc9/nim
12:02:04PMunchYeah.. That genSym is definitely wrong
12:03:21rokupsthat genSym is me being desperate ^_^
12:06:34PMunchWhat is it that you're actually trying to do?
12:07:01PMunchI guess adding the _:typedesc[TableRef[A, B]] as the first argument?
12:07:08rokupstrying to make a macro that inserts `_: typedesc[TableRef[A, B]]` as a first parameter yes
12:13:36PMunchSomething like this: https://play.nim-lang.org/index.html?ix=1MbM
12:14:08PMunchBy the way, Nim uses 2 spaces for indentation, not 4
12:14:42*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
12:15:16*laaron joined #nim
12:16:25PMunchrokups ^
12:17:01rokupsand that is a mistake (2 spaces) :p
12:17:26PMunchHaha, you get used to it :)
12:17:42narimiranyep, now 4 spaces feel like way too much waste
12:17:45rokupsthankfully we dont have to :p
12:17:49PMunchI thought it looked weird at first as well, but now I think Python and C looks so wasteful
12:18:05narimiran`is_main_module` also now looks quite strange
12:18:38rokupsits funny you guys bring these up, considering that nim tries to enable people using their own style without forcing it on to others ^_^
12:18:56PMunchOh no, by all means, do what you like :)
12:19:04narimiranwe bring it up, after reading "and that is a mistake" ;)
12:19:22rokups:D
12:19:34rokups2 spaces are too much mental strain for me, harder to see indentations
12:20:00PMunchIt's just that a lot of people who haven't used Nim don't realise that Nim uses 2 spaces or that we have style insensitivity so they stick to what they know and end up with some odd looking Nim code
12:20:51PMunchIf you want to use 4 spaces and snake_case then be my guest, I just wanted to let you know it wasn't canonical in case you weren't aware
12:21:25PMunchI still think Nim should've gone with tabs though..
12:21:43lqdev[m]please no
12:21:49PMunchSo much nicer, everyone can choose how big or small they want their tabs to appear
12:22:05lqdev[m]80 columns
12:22:10narimiran...and on github you have this "nice" 8 space tabs. how about no :P
12:22:25PMunchWhat?! Are tabs on GitHub 8 spaces?
12:22:31lqdev[m]ah yes, it's been like that for a while and they haven't fixed it yet
12:22:42FromGitter<kaushalmodi> > I still think Nim should've gone with tabs though.. โŽ โŽ Please no from me too :)
12:23:18PMunchWell it's the only way to make the old kind of C code where you use 4 spaces for indentation but combine every two indent level into a single 8 wide tab
12:23:34PMunchThat stuff looks absolutely horrid if you use anything but 8 wide tabs :P
12:23:56PMunchBut apart from GitHub showing tabs as 8 spaces, what else is wrong with them?
12:24:13PMunchI like the idea that 1 tab = 1 level of indentation
12:24:17rokupsPMunch: go has very strong opinions about code style. that is why i am in nim room and not in go room :D
12:24:20lqdev[m]it's easy to mix them up with spaces, so forbidding tabs is a good thing
12:24:25rokupsdeveloper freedom is important
12:24:26PMunchNo ambiguity, no way to create weird half-indents
12:25:19rokupsas for tabs vs spaces... spaces are better because you cant configure your editor to show spaces wrong, where with tabs you can
12:25:30rokupsother than that it matters little
12:25:44*Snircle joined #nim
12:26:29PMunch"you cant configure your editor to show spaces wrong" well you probably could.. :P
12:27:07rokupsbe nice if nimsuggest could infer style used by current file and suggest names in pascalCase, CamelCase or snake_case
12:27:18PMunchlqdev[m], yes for Python that allows you to use either it's a valid argument, but if only tabs were allowed then it wouldn't really be an issue
12:27:39PMunchI mean how often do you hit the space key to indent?
12:27:39*Trustable quit (Remote host closed the connection)
12:28:03rokupssometimes..?
12:28:18rokupsto fix indentation of single line
12:29:14PMunchYes, because using spaces as indentation is inherently flawed..
12:29:27PMunchWith tabs that wouldn't be an issue
12:29:36lqdev[m]spaces are more versatile in terms of indentation, you can wrap your proc arguments to line up without any problem
12:29:40PMunchBecause there would be no half-indents
12:30:10PMunchlqdev[m], that's a fair point
12:31:41rokupsand this is exactly where tabs break when editor is misconfigured
12:32:23rokupsand then we end up with files that contain configuration for tab width for vim for example. a configuration in every file and just for one editor kind. spaces - they work everywhere without any configuration
12:33:07PMunchBut you are stuck with looking at code that might be indented in a way you don't like
12:33:24rokupsindent it in a way you like then
12:34:00PMunchThe thing with tabs is that as long as you don't mix them with spaces for indentation you can configure them any way you like without any actual issues
12:34:15PMunchBut what if you are e.g. browsing GitHub
12:34:27PMunchOr just a code-paste
12:34:37PMunchI'm not going to download it just to indent it the way I prefer
12:35:11PMunchAnyways, did you try the solution I sent?
12:36:41narimiranok, if tabs vs spaces is over, our travis now says "Error: Your Homebrew is outdated. Please run `brew update`." :rolleyes:
12:37:41rokupsPMunch: what happens if i write code with editor where tab width is = 4 spaces and you edit my code in editor with tab width = 8 spaces?
12:37:46PMunchIt's not over until the blood of the infidels water our tab-crops!
12:37:55rokupswhat happens if you are a weird one and set your tab width to 6 spaces?
12:38:01PMunchrokups, absolutely nothing
12:38:09PMunchWell, apart from code being written
12:38:15narimiranleorize[m]: should we re-introduce a part of this: https://github.com/nim-lang/Nim/commit/6a94599d66484396b4e080e5bb8c1aa8e8f129af#diff-354f30a63fb0907d4ad57269548329e3 ?
12:38:24lqdev[m]you don't get 80 columns and it pisses me off
12:38:35rokupsoh yeah? what about comments that are aligned to your chosen column limit (like 80)?
12:38:37PMunchThe code will have literal tab characters in it, so whatever you set them to display as it would work the same
12:38:48rokupsthere will be many cases where tabs break under different width
12:38:59PMunchrokups, ah well that's actually a good point
12:39:13narimiran...but aside from that? :P :D
12:39:59rokupswhen proc parameters go to new line you may choose to align them with ( on previous line. good luck doing that, but if you manage that will also break with different tab width
12:40:11rokupsidk if this is a thing in nim, but it is a thing in c family
12:40:23PMunchI think it's actually discouraged in NEP-1
12:40:33PMunchBut I do it anyways (shh, don't tell anyone)
12:40:35*narimiran People's Front of Judea vs the Judean People's Front
12:40:41PMunchAt least to a certain degree
12:40:47rokupsdiscouraged or not its not exactly relevant ^_^
12:40:56PMunchnarimiran, haha :P
12:41:07rokupspeople will do it. people are doing it. and spaces dont break in all these situations
12:41:13lqdev[m]actually it's encouraged not discouraged
12:41:36lqdev[m]gosh, we're fighting over tabs vs spaces for indentation, are there really no better, less subjective topics to talk about?
12:41:57rokupsbut the most important argument for spaces is that everybody else is using them. at this point its just easier to use spaces and not fight against the current. i used to be tab user myself you know
12:42:13narimiranPMunch: "what advatages do spaces have?", "well, you can wrap better", "ok, but besides wrapping?", "nicer github", "ok, but besides wrapping, github, ....., what did spaces ever bring?"
12:42:21PMunchlqdev[m], wait is that a new thing? I'm pretty sure it used to say not to do that..
12:42:28rokupsthis is also same reason why i use cmake as my primary build system. its just easier to use the popular tool/configuration
12:42:59PMunchnarimiran, wrapping and 80 char limit are the only good arguments I've heard
12:43:15PMunchGitHub supports ?ts=4 if you want to have a different tab size
12:43:23lqdev[m]https://nim-lang.org/docs/nep1.html#introduction-conventions-for-multiminusline-statements-and-expressions
12:43:37lqdev[m]it's been like that in 0.19.4
12:43:44PMunchlqdev[m], yeah I found that
12:43:58PMunchAah, yeah so fairly recent
12:44:00lqdev[m]don't know what it was back in the day since I was not a user of Nim, unfortunately
12:44:58rokups`?ts=4` is just another hoop to jump over. another reason why tabs suck
12:46:04PMunchlqdev[m], eh it seems like it was always that way..
12:46:59PMunchrokups, no it's why tabs are great. I can decide how I want to see my tabs, and it doesn't affect the code at all
12:47:55rokupsok you use tabs then :D
12:49:13PMunchDon't get me wrong, I don't mind using spaces. But if I could change the world with the snap of my fingers I'd make people use tabs
12:49:44PMunchAs in from the beginning
12:50:43rokupsim glad you cant, you would break it :D
12:51:33PMunchBut yeah, back to more useful topics. Did you try the solution?
12:51:55narimiranno please, talk about tabs/spaces a bit more
12:52:25*laaron quit (Remote host closed the connection)
12:52:32*AndChat|624225 quit (Read error: Connection reset by peer)
12:52:34narimiranit has been only half an hour :P
12:52:53*envoyt joined #nim
12:53:44rokupsPMunch what solution? that hello-world thingy you posted seems totally unrelated
12:54:12rokupsmaybe if it had tabs... :D
12:55:02PMunchOh woops, that was the wrong paste: http://ix.io/1Mcp/Nim
12:56:14rokupsok person who made that paste site deserves a special place in the hell
12:56:24PMunchWhat, ix?
12:56:28PMunchIt's amazing
12:56:35narimiranrokups: you'll get banned for saying that! :P
12:56:43*deech quit (Ping timeout: 246 seconds)
12:56:54narimiranhating 2 spaces? ok. but hating ix.io? nope.
12:57:03rokupsPMunch: nothing amazing about gutter being selected when trying to copy code :[
12:57:08PMunchrokups, if you want to turn line numbers and highlighting off just remove /Nim from the URL
12:57:30rokupssee this is like tabs vs spaces all over again ;D
12:57:38PMunchThat's the beauty of it you decide how you want to view the code :)
12:58:00rokupsnono, beauty is when thing works without knowing and having to do arcane url modifications
12:58:00PMunchBut yeah, for easy copy just go to http://ix.io/1Mcp
12:58:06PMunchAnd you will get the paste in raw form
12:58:19*laaron joined #nim
13:00:12rokupsPMunch: that solution - about same i had before. but we established we need `typed` to check if type is a ref type and then it all collapsed
13:02:07PMunchAaah
13:06:51PMunchSo you want to check if type is a ref in order to verify that the name is init?
13:06:57PMunchOtherwise it should be new?
13:08:10rokupsi would like to be able to call `Table[int, int].new()` and have it return `TableRef`. so my plan is to check if return type of `new` is ref type and remove that ref in the macro and then add a first parameter to the proc
13:12:13PMunchWait, can you give me a usage example?
13:12:49*laaron quit (Remote host closed the connection)
13:12:51rokups`Table[int, int].new()` ought to construct a new object of `TableRef[int, int]` type
13:14:22*laaron joined #nim
13:14:37PMunchAnd TableRef[int, int].new()?
13:15:34rokupsthat would be a `ref TableRef[int, int]` then. no idea if its a thing
13:15:43PMunchAh okay
13:23:28narimiran"So you want to check if type is a ref in order to verify that the name is init" -- i didn't follow the discussion nor read the code, but: what's wrong with how system.nim does it? `when (t is ref):`?
13:23:55PMunchYeah, that wasn't what he wanted
13:24:01rokupsproblem is not checking if type is ref
13:24:10rokupsproblem is inserting a new argument to a proc in a typed macro
13:24:18narimiranaha
13:24:33PMunchHow do you check the type by the way? I have a way, but it feels a bit dirty
13:25:06rokupsim not there yet as you can see ^_^
13:25:23rokupsbut i expect to be able to look for nnkRef or something
13:40:55*brett-soric joined #nim
13:45:05PMunchWell, it's not pretty: http://ix.io/1McO/nim
13:45:07PMunchBut it works..
13:45:31PMunchSo new is apparently already defined for Table, which was doing strange things
13:46:28PMunchwell, you can rename it to `new` now, but since your example didn't pass an openarray it appeared to work but never really called the generated procedure
13:50:44PMunchhttp://ix.io/1McP/Nim
13:50:46PMunchFixed a little bug
13:50:50PMunchrokups ^
13:51:35PMunchOne caveat though, since you take in a typed argument you can't have two procs with only the same return type
13:51:57PMunchEven though the resulting procedure would be valid, the type system will stop you before it gets that far..
13:52:29PMunchAlthough that does seem a bit weird..
13:53:16rokupsoh wow this is some kung-fu. i didnt realize we can mix typed and untyped that way. thanks!
13:53:56PMunchYeah it's a little trick I learned long ago
13:54:19PMunchBasically just make the typed part do as little as possible, and output something that an untyped macro can read and do the actual work with
13:54:53PMunchIt's a bit annoying though that you have to "detype" the arguments, and the way I'm doing it there isn't very nice..
13:55:05PMunchBut I don't know of another way of doing it..
13:58:12*nsf quit (Quit: WeeChat 2.4)
14:21:51FromGitter<alehander42> i think araq wanted
14:21:54FromGitter<alehander42> a semityped stuff
14:22:03FromGitter<alehander42> but i dont knwo how it works
14:22:17FromGitter<alehander42> btw do you guys use some tools to visualize data structures
14:22:27FromGitter<alehander42> e.g. for education or just debugging or anything
14:24:27FromGitter<alehander42> not really sure if applicable
14:25:24FromGitter<mratsim> @alehander42 I use pen and paper :p
14:29:24*laaron quit (Remote host closed the connection)
14:30:32*brett-soric left #nim (#nim)
14:31:32FromGitter<alehander42> do you have photos :P
14:33:30*laaron joined #nim
14:36:05*laaron quit (Remote host closed the connection)
14:38:07*laaron joined #nim
14:47:05PMunchrokups, I did some tinkering and I think maybe ctorAlt is a better approach: http://ix.io/1Mde/Nim
14:48:05PMunchIt means you only specify the return/type declaration once, doesn't rely on "kung-fu" as you put it, and means you can have multiple procedures with the same input types and different return types
14:48:44PMunchIt might not look as cool, but it definitely works better..
14:49:04rokupsthis is interesting. although it puts a return type to not intuitive spot
14:49:10PMunchYeah..
14:49:16PMunchThat's the only minus
14:49:59FromGitter<alehander42> honestly i wouldn't use `new` for int/floats
14:50:01FromGitter<alehander42> seems confusing
14:50:04PMunchYou could create a macro though that took a block of procedures and rewrote them, since the problem with ctor is that it creates multiple instances
14:50:09FromGitter<alehander42> e.g. i thought new(5)
14:50:13PMunchalehander42, yeah that was just for testing :P
14:50:14FromGitter<alehander42> creates a string with length
14:50:18PMunchI needed some types
14:50:24FromGitter<alehander42> oh yeah, just saying
14:51:11PMunchBut I should be heading home, ttyl
14:51:12*PMunch quit (Remote host closed the connection)
14:58:57*narimiran quit (Ping timeout: 258 seconds)
15:01:18rokupsthough i wonder whats that 3rd generic argument inserted in ast
15:11:15*floppydh quit (Quit: WeeChat 2.5)
15:16:16*envoyt quit (Ping timeout: 248 seconds)
15:17:32*leorize joined #nim
15:34:38*dGtlc3 quit (Ping timeout: 245 seconds)
15:35:31*dGtlc3 joined #nim
15:44:06FromDiscord_<CrowbarKZ> hi folks, what is the idiomatic way of removing items from a sequence while iterating it?
15:44:07FromDiscord_<CrowbarKZ> e.g. below doesn't work because length of sequence changes during iteration
15:44:07FromDiscord_<CrowbarKZ> ```
15:44:07FromDiscord_<CrowbarKZ> for e in entities.items:
15:44:07FromDiscord_<CrowbarKZ> if e.energy <= 0:
15:44:07FromDiscord_<CrowbarKZ> entities.delete(p.entities.find(e))
15:44:08FromDiscord_<CrowbarKZ> ```
15:45:00leorizevar i = 0; while i < len(entities): <body> inc i
15:45:20leorizealso, please avoid pasting code on discord, long code block will spam IRC
15:45:23lqdev[m]is there a `fract` function or do I have to use `x mod 1`?
15:47:36FromDiscord_<CrowbarKZ> Thanks leorize! Sorry, didn't know about discord code blocks, noted.
15:59:58FromDiscord_<CrowbarKZ> hm having tested the above - it produces incorrect result if you delete already processed index (some index after will be skipped)
16:01:37*laaron- joined #nim
16:01:57*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
16:07:20leorizeyea, that's why the default iterator doesn't support that
16:07:29leorizeso you should add some logic to shift your index around
16:09:35Araqwhile i < entities.len:
16:10:03Araq if entities[i].energy <= 0: entities.del(i)
16:10:07Araq else: inc(i)
16:11:24disruptekelide indentation whenever possible; `if entities[i].energy <= 0: entities.del(i); continue`
16:16:16*envoyt joined #nim
16:23:00FromDiscord_<CrowbarKZ> yep i think now it works as expected, thanks for the help guys ๐Ÿ˜ƒ
16:38:24*d10n-work joined #nim
16:54:38*envoyt quit (Ping timeout: 245 seconds)
16:54:59*envoyt joined #nim
17:35:06*elrood joined #nim
17:35:10*dwdv joined #nim
17:56:18*neceve quit (Remote host closed the connection)
18:11:31Araqyay, I found it
18:11:44Araqnew runtime closures are close!
18:21:54*theelous3 joined #nim
18:22:47*rayman22201 is very excited about this :-)
18:26:51*nsf joined #nim
18:29:27shashlick@rayman22201 - here's what i have so far for shared string - https://pastebin.com/jbT2fw3f
18:29:55shashlicknothing exotic anymore, but since the bucket is also shared, any shared string will be a pointer within the bucket
18:30:11shashlickstring cannot change, have to point to a new string after freeing the old one
18:31:23shashlickam going to build a sharedStringSeq using this sharedString as the backing
18:32:20shashlickaccess the seq using .split(":") and create a new seq with ":".join(seq) and save as a sharedString
18:32:34shashlickreally poor man's sharing but will work until we have a real solution with newruntime
18:33:38shashlickactually, the underlying string can change since the pointer to sharedString can be kept the same, only sharedStringObj.sptr will change if anything
18:33:53shashlicklet's see anyway, how it evolves
18:39:51rayman22201I would put a lock around your free procedure or you can get race conditions
18:40:33shashlickwell, so i have a lock on the bucket, but your suggestion would make this safer in geenral
18:41:19rayman22201Other than, good enough. ๐Ÿ˜
18:46:09*dwdv quit (Quit: quit)
18:47:33*nolanv quit (Ping timeout: 245 seconds)
18:52:03shashlickhow come you can overload `&=` for `ptr object` type but not `=`
18:56:07leorize`=` is a special symbol I believe
18:56:13leorizeit can only be overloaded for objects
18:56:38shashlickwell, i would be diligent when i override, like i am with `&=`
18:57:53*PMunch joined #nim
18:59:40*rokups quit (Quit: Connection closed for inactivity)
19:05:20FromGitter<xmonader> returning TableRef from an object returns mutable version? is there away to return a readonly version of that? or do I need to do .deepCopy on it ?
19:07:00lqdev[m]I think you can only make it immutable if you return a regular Table
19:10:33FromGitter<xmonader> @lqdev works thanks! thought i needed to use ref types when i'm using ref objects all the way
19:22:56PMunchA TableRef is the same as a ref Table. So it's essentially just a pointer to a Table object on the heap. With this pointer you are of course able to go to that memory location and change whatever is there
19:23:21PMunchThat's why it's mutable
19:28:08FromGitter<xmonader> @pmunch so that's the efficient definition? https://github.com/xmonader/nim-cachedtable/blob/master/src/cachedtable.nim#L10 to use mutable one or the ref one?
19:28:44PMunchHuh?
19:28:45FromGitter<xmonader> basically i'm manipulating the table from a higherlevel, but want people to `peek` into that table state without being able to modify it themselves
19:29:15PMunchThe best thing to do then would be to not expose that field in your type and write a "peek" proc
19:30:01FromGitter<xmonader> yes, i did so, but the return of that function in that specific case should be the immutable version.
19:32:40*rockcavera quit (Remote host closed the connection)
19:34:19*Tyresc joined #nim
19:44:58*rockcavera joined #nim
19:51:27*narimiran joined #nim
19:54:42*nsf quit (Quit: WeeChat 2.4)
19:57:39*vlad1777d_ joined #nim
19:57:47*Cthalupa quit (Ping timeout: 248 seconds)
19:59:34*Cthalupa joined #nim
20:00:53*vlad1777d quit (Ping timeout: 245 seconds)
20:13:19*nolanv joined #nim
20:20:18*abm quit (Quit: Leaving)
20:32:03*solitudesf- joined #nim
20:35:12*solitudesf quit (Ping timeout: 268 seconds)
20:42:05*solitudesf- quit (Quit: Leaving)
20:42:41*solitudesf joined #nim
20:57:54*Vladar quit (Remote host closed the connection)
21:09:25*drewr quit (Quit: ERC (IRC client for Emacs 26.2))
21:20:01*solitudesf quit (Ping timeout: 244 seconds)
21:26:35*PMunch quit (Remote host closed the connection)
21:39:35Araqclosures work! --> PR incoming
21:42:25*narimiran quit (Ping timeout: 268 seconds)
21:46:49*jfoutaise joined #nim
22:02:15*dGtlc3 quit (Remote host closed the connection)
22:02:37*dGtlc3 joined #nim
22:02:40*lritter quit (Quit: Leaving)
22:04:54rayman22201๐ŸŽ‰
22:23:23*krux02 quit (Remote host closed the connection)
22:30:57AlexMaxw #zig
22:31:28AlexMaxmistype (and sorry, I'm in a lot of upcoming language channels ;))
22:34:53rayman22201lol
22:46:15dom96huh, guards/locks sections are experimental?
22:47:15*drewr joined #nim
22:51:20Araqit's not battle-tested afaik. Nim doesn't use shared memory so locks are rarely used
23:07:31*d10n-work quit (Quit: Connection closed for inactivity)
23:11:13FromDiscord_<SychoRyn> People are telling me I should learn Julia
23:11:23FromDiscord_<SychoRyn> Whatโ€™s so great about Julia?
23:12:23dom96Why don't you ask in a Julia channel?
23:12:52FromDiscord_<SychoRyn> Idk this is the only programming Discord Iโ€™m in
23:22:34FromGitter<zetashift> @SychoRyn Julia is a nice language if you're heavy into data science and Python/R just doesn't cut it for you, but Nim is stronger as a general purpose language and hopefully one day also data science
23:24:29FromDiscord_<SychoRyn> Ah cool
23:24:44FromDiscord_<SychoRyn> I like nim so far so Iโ€™m gonna stick with it
23:24:57FromGitter<zetashift> Wise decision!(I'm biased though)
23:26:00FromDiscord_<SychoRyn> Iโ€™m surprised of how small nimโ€™s community is.
23:26:53*abm joined #nim
23:29:33FromGitter<zetashift> Well even though it's small(for certain reasons) it still pumps out a lot of great contributions
23:30:53rayman22201@Dom96, or anybody else who wants to chime in, I have been reading into async a bit more. What are your thoughts on this idea: make an async api for Channels, then use that to make an implementation of FlowVar?
23:36:07*Jesin quit (Quit: Leaving)
23:38:33*Jesin joined #nim
23:38:40*Acid147 quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
23:42:52*elrood quit (Remote host closed the connection)
23:51:55*envoyt quit (Ping timeout: 268 seconds)