<< 15-11-2022 >>

00:00:15FromDiscord<emanresu3> Nevermind, I was using Nim 1.4.8, I updated to Nim 1.6.6 and it's working!
00:06:52FromDiscord<pietroppeter> In reply to @Elegantbeef "Oh cool, that code": ok updated issue, thanks! ❤️
00:22:46FromDiscord<Elegantbeef> Though i should be very clear it's pretty much a toy ECS, so no clue if it's worthwhile
00:29:26FromDiscord<pietroppeter> well, my goal was toying around with ecs, so I'd say it fits the bill 🙂
00:48:36FromDiscord<scarf> how do i pass multiple arguments when `createThread`?
00:49:16FromDiscord<scarf> (edit) "how do i" => "what is an idiomatic way to"
00:49:21FromDiscord<scarf> (edit) "when" => "with"
00:49:39FromDiscord<Elegantbeef> A tuple
00:52:40FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fVy
00:53:36FromDiscord<Rika> No no, you have normal arguments in the function (not a tuple) then you pass a tuple of arguments as if it was the function call
00:53:46FromDiscord<Rika> Wait
00:53:47FromDiscord<Rika> No
00:53:52FromDiscord<Rika> That’s a different language
00:53:52FromDiscord<Rika> Lol
00:53:58FromDiscord<Rika> Me forgetful
00:54:03FromDiscord<Rika> What’s the problem exactly then?
00:54:32FromDiscord<scarf> i want to use `threadFunc` with multiple arguments inside `createThread` in a meaningful way
00:54:45FromDiscord<Rika> I think the thread type in the array up top is wrong
00:55:26FromDiscord<Elegantbeef> It is
00:55:31FromDiscord<Rika> Put the argument type before the variables and do Thread[Args] no?
00:55:49FromDiscord<scarf> pardon?
00:56:14FromDiscord<scarf> what i just want to do is to follow examples in <https://nim-lang.org/docs/threads.html#examples> but also print thread id in `threadFunc`
00:56:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fVA
00:56:42FromDiscord<Rika> The type you pass into the thread type is the same type of the parameter of the function
00:56:47FromDiscord<Rika> (edit) "parameter" => "argument"
00:57:06FromDiscord<Rika> Is -> should be
00:58:37FromDiscord<scarf> thanks, it works now
01:00:01FromDiscord<Rika> 👌
01:00:32FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fVE
01:01:20FromDiscord<ChocolettePalette> What is it then? O.O
01:01:43FromDiscord<Elegantbeef> Destructors have to be defined in the same file as the object declaration
01:02:43FromDiscord<ChocolettePalette> Since when does nim have destructors? 0\_0
01:03:47FromDiscord<Elegantbeef> Since like 1.2
01:03:50FromDiscord<Elegantbeef> Arc/Orc use them
01:05:13FromDiscord<scarf> In reply to @Elegantbeef "Destructors have to be": putting it inside `lib/core/locks.nim` also fails :(
01:06:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fVF
01:07:17FromDiscord<scarf> wonder why it doesn't work for just `Lock` tho?
01:08:15*yarrie quit (Quit: Leaving)
01:08:25FromDiscord<Elegantbeef> Are you sure you got the same error?
01:08:39FromDiscord<Elegantbeef> If you declared it in the file after declaration and before usage it should work
01:17:44FromDiscord<Elegantbeef> Eitherway eventually Nim's threading primitives will be fine
01:18:09FromDiscord<ChocolettePalette> Eventually...
01:19:39FromDiscord<ringabout> In reply to @scarf "hecc, I thought Lock": Did you use `Lock = object`?
01:20:09FromDiscord<Elegantbeef> Eh 2.0 is soon
01:20:54FromDiscord<ringabout> std/threads will get rid of generics and use pointers instead.
01:24:36FromDiscord<ringabout> Lock is a alias to sysLock, so you cannot define destructors for it.
01:24:42FromDiscord<ringabout> (edit) "a" => "an"
01:25:58FromDiscord<ringabout> You need to wrap SysLock in the new Lock object.
01:28:31FromDiscord<scarf> In reply to @Elegantbeef "If you declared it": alright, will try again after going back home
01:28:31FromDiscord<scarf> In reply to @ringabout "Did you use `Lock": i used `Lock` in `std/locks`
01:28:33FromDiscord<scarf> In reply to @ringabout "Lock is an alias": thanks, that was the reason. would it be feasible to define destructor for syslocks?
01:28:33FromDiscord<scarf> alright, that'd require some tweaking, i guess
01:29:52FromDiscord<ringabout> See also https://github.com/nim-lang/Nim/pull/18640/files
01:30:03FromDiscord<ringabout> It is not necessarily correct though.
01:32:57*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
01:50:31FromDiscord<banan|crab> how do i get the root directory in nim
02:21:50FromDiscord<ChocolettePalette> Idk if you can do it in Nim but in C++ yoh can do e.g. `std::string root = "/";`↵(@banan|crab)
02:22:05*arkurious quit (Quit: Leaving)
02:22:09FromDiscord<Elegantbeef> You can of course do the same but that's not platform agnostic
02:22:32FromDiscord<ChocolettePalette> Well it works on android too
02:23:22FromDiscord<Elegantbeef> It works on \nix
02:24:53FromDiscord<ChocolettePalette> Linux ends with nux so it actually works on \n?x
02:26:01FromDiscord<Elegantbeef> Sorry i cannot spell that's the same as nix to me
02:26:03FromDiscord<scarf> In reply to @ringabout "See also https://github.com/nim-lang/Nim/pull/18640": oh, it was already proposed, nice.
03:00:40FromDiscord<banan|crab> In reply to @ChocolettePalette "Idk if you can": will it work on windows
03:00:58FromDiscord<Rika> No lol
03:04:17FromDiscord<banan|crab> rip
03:04:55FromDiscord<ChocolettePalette> sent a code paste, see https://play.nim-lang.org/#ix=4fVP
03:05:28FromDiscord<banan|crab> but in nim tho
03:05:50FromDiscord<ChocolettePalette> ACTUALLY↵(@banan|crab)
03:06:00FromDiscord<ChocolettePalette> I will give you an answer
03:06:13FromDiscord<banan|crab> thanks
03:08:16FromDiscord<ChocolettePalette> Idk if you have a "root" on windows, afaik you have several disks thereE.g. your program can reside on a disk D\:/ or smthSo if you want to get the root directory of your disk, you can simply move to the parent "../" directory until there's no more parent directory
03:10:15FromDiscord<ChocolettePalette> Here are the docs\:https://nim-lang.org/docs/os.html#setCurrentDir,stringAnd since this module is cross platform it will work on windows
03:31:19FromDiscord<rem ig> what parsing frameworks are there
03:31:54FromDiscord<rem ig> i'll just go back to this language because attempting to rewrite it in haskell made my brain hurt
03:32:26FromDiscord<rem ig> but i don't want to do recursive descent
03:32:51FromDiscord<rem ig> (edit) removed "but"
03:33:01FromDiscord<rem ig> (edit) "what parsing frameworks are there ... " added "(not combinators)"
03:34:25FromDiscord<rem ig> something like antlr or lark
05:31:55FromDiscord<Tuatarian> Why does `r[0]` for accessing the first thing in a `Slice[Natural]` not work?
05:31:57FromDiscord<Tuatarian> how should I do it instead?
05:32:28FromDiscord<albassort> ???
05:32:53FromDiscord<Elegantbeef> `r.a`
05:33:13FromDiscord<albassort> but shouldn't slices work on 0?
05:33:21FromDiscord<Elegantbeef> What?
05:35:38FromDiscord<albassort> "abc"[0 .. 1] == "ab"
05:36:12FromDiscord<Tuatarian> In reply to @Elegantbeef "`r.a`": thanks
05:39:56FromDiscord<rem ig> is npeg fast enough to use
05:40:05FromDiscord<rem ig> i thought PEG were slow
05:41:39FromDiscord<Rika> In reply to @albassort ""abc"[0 .. 1] ==": That’s not what they’re asking
05:43:10FromDiscord<albassort> yea im confused as to what they're saying?
05:43:49FromDiscord<Rika> “Why can’t I index a slice? `0..1[0]` doesn’t work”
05:44:40FromDiscord<albassort> ah
05:45:17FromDiscord<albassort> theres no "count leading 1s" in bitops
05:45:28FromDiscord<Rika> Not relevant
05:45:48FromDiscord<albassort> its relevant for me
05:45:55FromDiscord<Rika> Oh do you mean another topic
05:46:07FromDiscord<Rika> Invert the integer and CLZ then
05:46:15FromDiscord<Rika> Bitwise not
05:46:48FromDiscord<albassort> yea but thats like 12 extra cycles I could be doing something else >:O
05:47:00FromDiscord<Rika> Yeah okay
05:47:20FromDiscord<Rika> Go design the processor with the CLO operation then lol
05:47:54FromDiscord<Elegantbeef> It expands to native code↵(@rem ig)
05:48:49FromDiscord<albassort> In reply to @Rika "Go design the processor": oh these are direct bindings
05:48:51FromDiscord<albassort> justified then
05:49:08FromDiscord<albassort> no reason to really have that low level
05:49:16FromDiscord<albassort> or high level
05:49:39FromDiscord<Rika> Think they’re as close as possible to what can be done quickly to the respective architecture you’re compiling on
05:49:44FromDiscord<Rika> Rather, for
05:50:26FromDiscord<Rika> You can always try to look for a count leading ones algorithm that’s faster than an invert bits then count leading zeroes
06:10:06Zevv@reg im: it's likely not as fast as custom written parsers, but it is pretty performant: your grammer gets compiled to Nim code at compile time, which will get compiled with your C compiler in the end. The parser inner loop is dispatched by a computedGoto when using gcc, which is pretty darn fast
06:10:55FromDiscord<Elegantbeef> @rem ig i'll ping them for you zevv 😄
06:11:30Zevv#Nim is really done with irc, eh
06:11:32Zevvshame
06:12:09FromDiscord<Elegantbeef> Blame the freenode takeover
06:12:52Zevvone of my hobbies is avoiding propriatary services that require accounts, especially commercial services.
06:13:21FromDiscord<Elegantbeef> I'm partially with you
06:13:25FromDiscord<Elegantbeef> That's why i try to use matrix over discord
06:13:34FromDiscord<Elegantbeef> It needs an account but atleast it's not proprietary
06:15:25ZevvLife is pretty hard without google play on my phone. I had some government stuff I needed to do the other day. I told them I could not comply because I did not agree with the terms and servies of google and apple and was thus not able to run their App
06:15:48Zevvit was a fun ride to get them to send me the .apk
06:17:07FromDiscord<Elegantbeef> Atleast the EU shows some sign of want to use non proprietary software, but doesnt mean much i guess
06:17:50Zevvdutch government was planning to abandon SMS 2fa in favor of apps, but that got rolled back
06:18:06Zevvnot sure if that is a good thing perse, but it shows they do care
06:18:33FromDiscord<Elegantbeef> Some german medical chat is powered by matrix, well they have a contract with element
06:19:11Zevvanyway, thanks for being my pingproxy Elegantbeef :)
06:19:20FromDiscord<Elegantbeef> The future is now
06:20:20Zevvhow i learned to stop worrying and love big tech?
06:20:31FromDiscord<Elegantbeef> lol
06:21:23FromDiscord<Elegantbeef> You just need to fire the engineers so the software stops working
06:21:28FromDiscord<Elegantbeef> Follow the Musk
06:22:40Zevvwe'll see. in the end everone is feel to used and do as they please; i choose not to depend on any such services, but that comes at a price. I'm a total social outcast and can't even ping discord users.
06:23:00Zevvi'll no go back to reading my paper newspaper
06:23:24FromDiscord<Elegantbeef> Just setup your own matrix home server so you then can ping a discord user instead of just using your IRC 😛
06:23:46ZevvThe fact that I *can* do that does not imply that I *want* to do that
06:24:26ZevvFor me nothing changed; I just added a one line config to my IRC to drop the "FromDiscord> " prefix from every nick and everything works like before
06:24:36Zevvtadaa
06:26:11Zevvwhile here, I might as well go back on topic.
06:26:39ZevvWhat's the state of moving refs between threads these days? Can this be done sanely?
06:27:00ZevvAra4s writeup says "Memory can be shared effectively between threads without copying in Nim version 2", but that was always possible.
06:27:21ZevvI don't want to share memory, I want to share nim-managed refs; not just share, but allocate on thread A and move the ref effectively to thread B
06:27:24FromDiscord<Elegantbeef> isolated exists, but no clue if it works yet
06:27:47FromDiscord<Elegantbeef> Channels for nim2.0 should use `isolated` so you can sink across threads, or atleast in theory
06:28:31ZevvThe problem with isolate is that you can not isolate something reliably if it was not instantiated as an isolate from the start
06:29:13FromDiscord<ringabout> I don't think that's possible for now, but you should ask in the internals channel.
06:29:41FromDiscord<ringabout> Nothing changes since the last time when the question is raises in the cps matrix.
06:29:54FromDiscord<ringabout> (edit) "is raises" => "was raised"
06:31:33FromDiscord<Elegantbeef> Moving part of a graph from a thread sounds like a fun challenge 😄
06:32:22Zevvyeah, that was my point
06:32:39ZevvI tried a number of different approaches, but they all reply on run time isolation
06:32:59Zevvand/or violate the C memory model by touching stuff outside locks
06:33:28ZevvI tend to trust mratsim on these topics, and his code still relies on raw pointers
06:38:19FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4fWe
06:38:24FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4fWe" => "https://play.nim-lang.org/#ix=4fWf"
06:38:49FromDiscord<Elegantbeef> was `@` too much
06:39:12FromDiscord<albassort> ?
06:39:38FromDiscord<Elegantbeef> `@x1.toOpenArrayByte(0, x1.high)`
06:39:52FromDiscord<albassort> does that cast it to a sequence?
06:40:14FromDiscord<Elegantbeef> `@` converts an open array to a sequence
06:40:15FromDiscord<Elegantbeef> It doesnt cast it
06:40:21FromDiscord<Elegantbeef> You cannot cast a slice to a sequence
06:41:42FromDiscord<albassort> In reply to @Elegantbeef "`@x1.toOpenArrayByte(0, x1.high)`": ``@(x1.toOpenArrayByte(0, x1.high))``
06:41:53FromDiscord<Elegantbeef> Uhhh
06:42:05FromDiscord<albassort> it didn't compile with just the @
06:42:10FromDiscord<albassort> which makes sense it did look a bit odd
06:44:25*kenran joined #nim
06:51:22Zevv@rem ig: I just checked, a straightforward NPeg json parser is about 3 times slower than the Nim-native `parseJson` parser which is used by the stdlib
06:56:25*droidrage quit (Ping timeout: 260 seconds)
07:00:45*ltriant quit (Ping timeout: 256 seconds)
07:00:46NimEventerNew thread by miran: Nim 1.6.10 RC2, see https://forum.nim-lang.org/t/9614
07:06:43FromDiscord<rem ig> In reply to @Zevv "@rem ig: I just": wow that's slow(?)
07:31:29*PMunch joined #nim
08:36:02ZevvIf it's too slow, just write a parser by hand, that will aways outperform any generic generated parser. Also, it's not the parsing itself, that's running in 1/5th of the time of parsejson, but it's the string copies that take up time
08:36:46FromDiscord<Elegantbeef> Yea parseJson isnt the best metric given that it's not even the best json parser 😄
08:36:48Zevvif nim only had true slices
08:36:59FromDiscord<Elegantbeef> Viewtypes soon TM
08:37:13Zevvsoon
08:50:38PMunchA view will keep the entire original string in memory right?
08:51:03PMunchSo if I load a massive JSON string and parse it, and it contains a single string, then the entire object will have to be kept in memory for that single string..
08:51:04FromDiscord<Elegantbeef> It's a checked pointer and length
08:51:24PMunchAh, so Nims allocator will release the surrounding data?
08:51:33FromDiscord<Elegantbeef> To be fair that's how jsony works
08:51:40FromDiscord<Elegantbeef> Jsony only works on a string it doesnt stream
08:51:53FromDiscord<Elegantbeef> But yes that's a trade off when borrowing memory
08:52:12FromDiscord<Elegantbeef> You have to ensure your borrows(parsing in this case) doesnt outlive the source
08:52:42ZevvPMunch: indeed. and the problem is that when parsing jos, one needs to make substring copies of most of the parsed elements
08:53:18Zevva view is a checked pointer and length, and a reference to the original string, likely
08:54:37Zevvso this will make arc/orc lifes harder
08:54:43Zevvlives
08:55:25PMunchRight..
08:55:39FromDiscord<Elegantbeef> The reference to the original string isnt needed with a borrow checker
08:56:02*ltriant joined #nim
08:56:10Zevvwhich we don't have :)
08:57:29Zevvfor what its worth, just *parsing* 300Mb of json takes npeg 0.45 seconds. Parsing and capturing the terminals (strings, numbers, bools) bumps that up to 6 seconds.
08:57:55FromDiscord<rem ig> damn
08:58:03Zevvit's not only the string copies, its also the extra work done for capturing of course
08:58:11FromDiscord<rem ig> why does nim use 2 spaces btw?
08:58:21Zevvit doesn't
08:58:29FromDiscord<rem ig> i have to run nimpretty on my code or its unreadable sometimes
08:58:35Zevvyou can use whatever number of spaces you like
08:58:41Zevvas long as you're consistent
09:00:10Zevvanyway, npeg might or might not be too slow for you use case, this is all I can squeeze out of it at this time. For 99% of the jobs I use it for it is fast enough, because I seldom need to parse hundreds of megabytes of stuff for which there does not already exist a proper parser.
09:05:11FromDiscord<rem ig> for now im just doing a recursive descent
09:05:24Zevvthat's probably best
09:05:47Zevvbut just out of curiosity, what is it you are parsing, do you have a reference or example?
09:13:17FromDiscord<rem ig> lua like language
09:13:36FromDiscord<rem ig> sent a code paste, see https://play.nim-lang.org/#ix=4fWO
09:16:19Zevvnice
09:18:03Zevvno left recursion in there, that should pretty much translate literally to a peg
09:21:58*dnh joined #nim
09:27:00FromDiscord<rem ig> it was a pain in the ass to design this grammar btw
09:39:48Zevvwhy is that?
09:40:31Zevvalso, npeg can do one trick to make your life easier: it has built in pratt parser / precedence climbing
09:40:50Zevvso your term/factor/relational_expr get somewhat simpler
09:50:00FromDiscord<albassort> is there a form of table which goes between both
09:50:16FromDiscord<albassort> <-> not ->
09:53:14FromDiscord<albassort> I'll make my own i have an idea
09:53:25FromDiscord<albassort> for now I'll just invert it
09:54:48Zevvthere is not, you'd typically build that with two Table[]s
09:57:14FromDiscord<albassort> indeed
09:59:54FromDiscord<albassort> how can I get a unchecked block of memory
10:00:52FromDiscord<albassort> i guess i can just use create
10:00:54Zevvhow do you mean 'unchecked'?
10:01:14Zevvdo you want a raw unmanaged pointer?
10:01:15FromDiscord<albassort> it just exists and nobody touches it
10:01:16Zevvlike c malloc?
10:01:26FromDiscord<albassort> pretty much
10:01:54Zevvhttps://nim-lang.org/docs/segfaults.html#c_malloc%2Ccsize_t
10:02:07Zevvno that's wrong
10:02:28Zevvwell, there is c_malloc somewhere
10:02:47FromDiscord<Yardanico> just use `create`
10:02:55FromDiscord<Yardanico> or a`alloc`, but `create` is nicer
10:03:11Zevvwhat he says ^
10:03:12FromDiscord<Yardanico> it'll still use Nim's allocator, but it's a raw pointer and you need to free it yourself by calling `dealloc`
10:03:25FromDiscord<Yardanico> zevv i thought you forgot about nim altogether :P
10:03:30ZevvI mostly did
10:03:41FromDiscord<albassort> i dont think i need alloc
10:03:43Zevvit shows, I don't even know how to allocate a block of raw memory
10:03:52Zevvalthough it was me who reworked the nim allocater stuff a few years back
10:03:58FromDiscord<Yardanico> In reply to @albassort "i dont think i": what do you need then?
10:04:10FromDiscord<Yardanico> if you want a pointer to a block of memory, you need alloc or something abstracting it
10:04:21Zevvor just a seq[byte] and get a ptr to element #0
10:04:34FromDiscord<Yardanico> that too
10:06:08*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
10:07:33*wallabra joined #nim
11:01:54FromDiscord<oxnan> anyone know if I can run cpp code in nim?
11:09:33Amun-Rayou can {.compile.} it or {.emit.} it
11:14:20*Guest8738 joined #nim
11:14:27*Guest8738 quit (Client Quit)
11:20:10*jmdaemon quit (Ping timeout: 240 seconds)
11:22:00PMunch@oxnan, short answer is yes
11:23:42PMunchHmm, again I'm stuck on multithreading again..
11:33:34PMunchI have a bunch of IDs and a massive set of data that maps these IDs to a pair of coordinates. Now I want to run through all my data, and for each ID in my list store the coordinates. So after I'm done I should have a list of ID -> coordinate mappings. Because I have so much data I've set the parsing of it up to use threads, but now I'm struggling with how to read this list of IDs and store the results
12:04:35FromDiscord<oxnan> Amun-ra you have an example of this?
12:17:47NimEventerNew thread by Hobbyman: How can I concatenate strings of type sqlQuery (db_sqlite)?, see https://forum.nim-lang.org/t/9615
12:20:42*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:32:03ZevvPMunch: tell me once you know how to properly do these things
12:45:15PMunchZevv, I will.. I've been meaning to investigate this stuff for quite a while now
12:45:29FromDiscord<Phil> In reply to @oxnan "anyone know if I": I'm not 100% sure but from what I've seen the nimqml package would count as running C++ code.↵nimqml is nim bindings to qml, which is a language of QT and QT is written in C++ I think.↵Though I'm not 100% on that since I haven't invested time yet to understand how it is calling and running QT
12:46:23FromDiscord<Phil> (edit) "In reply to @oxnan "anyone know if I": I'm not 100% sure but from what I've seen the nimqml package would count as running C++ code.↵nimqml is nim bindings to ... qml,only" added "run" | "QT" => "only runs through QT's code, which"
12:49:20*dnh joined #nim
12:53:52FromDiscord<oxnan> ah nice, thanks 🙂
12:55:54FromDiscord<ringabout> Naming is hard => https://github.com/nim-lang/Nim/pull/20850
12:56:40PMunchZevv, for this I ended up using a SharedTable
12:56:57FromDiscord<Phil> In reply to @ringabout "Naming is hard =>": You're telling me, I struggle with naming so damn often
12:57:34FromDiscord<Phil> I'd go with how they differ in behaviour or what the difference in their idea is, what differentiates old from new threads?
12:57:50FromDiscord<Phil> What new idea encompass the new threads?
12:58:00FromDiscord<ringabout> Look like we are on the same page.
12:58:43FromDiscord<ringabout> There are no new threads so the threads name is preserved for future use
12:59:28FromDiscord<ringabout> But the old threads module is discouraged to use since it should have been low-level primitives, not generics.
13:00:01FromDiscord<Phil> So there will be a new thread module but there is none yet?
13:00:05FromDiscord<Phil> Or will there be none at all?
13:00:19FromDiscord<ringabout> (edit) "preserved" => "reserved"
13:00:48FromDiscord<ringabout> Not for 2.0.
13:01:02PMunchWait what?
13:01:05FromDiscord<ringabout> Perhaps 2.x with a RFC prepared
13:01:15PMunchSo how are we going to use threads then?
13:01:20FromDiscord<ringabout> You can continue to use old threads
13:01:26PMunchSeems like a weird thing to cut out without any real replacement..
13:01:39FromDiscord<ringabout> Just its name is a bit unnatural.
13:02:07FromDiscord<Phil> Can't the entire module not just have a massive deprecated pragma or sth?
13:02:28FromDiscord<Phil> Because if there's nothing to differentiate against it's a bit difficult to go with names
13:02:40FromDiscord<ringabout> There is no alternative so there is no deprecation for now.
13:02:42FromDiscord<Phil> I guess "generic-threads" would be valid since as you stated they are apparently based on generics
13:02:57FromDiscord<ringabout> The implementation of old threads module is good enough.
13:05:57FromDiscord<dlesnoff> oldthread name is already a warning, no need to add a pragma.
13:06:46FromDiscord<Phil> oldthread implicates newthread, leading to confusion when that's nowhere to be found
13:07:06FromDiscord<Phil> thus "generic-threads" remains my suggestion
13:07:47*derpydoo joined #nim
13:18:59FromDiscord<albassort> can a closure iterator take repeated input
13:19:16FromDiscord<albassort> apart from the input it is initalized upon
13:19:18FromDiscord<albassort> (edit) "initalized" => "initialized"
13:19:29FromDiscord<albassort> or will i need to do some spaghetti
13:20:09FromDiscord<dlesnoff> In reply to @Isofruit "thus "generic-threads" remains my": Ok but it should come with a flag telling that it will be deprecated/removed at some point, unless it won't
13:21:07FromDiscord<dlesnoff> oh it wasn't mentioned in the conversation, sorry so it won't. Yes generic-threads will be better then
13:26:28FromDiscord<albassort> In reply to @albassort "apart from the input": they dont, so im going to make an extra function which feeds it new data
13:26:35FromDiscord<albassort> we getting pasta-tastic
13:27:04FromDiscord<albassort> i could break it into smaller bits though and have it be less disgusting
13:34:11FromDiscord<Phil> In reply to @Jiezron "Ok but it should": Oh I entirely agree with that one
13:34:49FromDiscord<Phil> At least it should be planned on the backburner to deprecate that module the NANOSECOND an RFC is accepted for a different thread module
13:38:08*notchris joined #nim
13:52:06NimEventerNew thread by choltreppe: Problems with gcc.exe and gcc.linkexe, see https://forum.nim-lang.org/t/9616
13:52:30FromDiscord<HJarausch (HJarausch)> Nimble on Android \: tries to access nimble install https://github.com/nim-lang/bigints which isn't permitted. How to fix this? Thanks Helmut
13:52:49FromDiscord<ringabout> In reply to @HJarausch (HJarausch) "Nimble on Android \:": errors?
13:53:59FromDiscord<HJarausch (HJarausch)> Nimble on Android \: tries to access /data/local/tmp/nimble\_31638/ which isn't permitted
13:55:47FromDiscord<ringabout> https://stackoverflow.com/questions/23424602/android-permission-denied-for-data-local-tmp
14:21:51FromDiscord<HJarausch (HJarausch)> @ringabout Unfortunately this doesn't help. Even on my rooted Android tablet I cannot make /data/local accessible for a non-root user. (SE Linux). My only chance is to "convince" nimble to use a different temp folder
14:29:06*arkurious joined #nim
14:30:02FromDiscord<albassort> i dont know if this is the worst code i've ever written or the best
14:46:31arkanoiddom96: is there a reason why withTimout {.async.} returns a boolean, instead of rising an exception? Is it just a performance thing?
14:50:01*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:50:51*dnh joined #nim
14:55:26*sagax quit (Ping timeout: 246 seconds)
15:05:06FromDiscord<scarf> In reply to @ringabout "See also https://github.com/nim-lang/Nim/pull/18640": were there any problems that caused the PR to close?
15:06:00*PMunch quit (Remote host closed the connection)
15:07:06FromDiscord<ringabout> I didn't remember, perhaps caused by lacking of reviewing.
15:07:22FromDiscord<ringabout> (edit) "didn't" => "don't"
15:10:28*Phytolizer joined #nim
16:08:16*kenran quit (Remote host closed the connection)
16:22:04*derpydoo quit (Ping timeout: 252 seconds)
16:36:00PhytolizerWould someone be interested in a bit of code review? I just yesterday finished testing an implementation of the standardized JSON patch format using the Jansson library and would like some pointers on where to go next with this package. The main implementation is around 200 LOC. https://github.com/Phytolizer/nim-jsonpatch
16:36:36NimEventerNew thread by zevv: Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2", see https://forum.nim-lang.org/t/9617
17:15:29FromDiscord<vestel> Do we have smth like `shared_ptr` in Nim?
17:16:08*Phytolizer quit (Quit: Client closed)
17:16:21*Phytolizer joined #nim
17:18:43NimEventerNew thread by xigoi: Nvim-summon: Neovim plugin for adding standerd library imports, see https://forum.nim-lang.org/t/9618
17:32:09FromDiscord<Tanguy> `ref` is approximately a `shared_ptr`
17:36:07*Phytolizer quit (Quit: Client closed)
17:36:09FromDiscord<sOkam!> sent a long message, see http://ix.io/4fYg
17:38:44FromDiscord<sOkam!> etymology is seen as this esoteric theoretical-only tool... but its actually the root of all meaning. and naming is just giving meaning to ideas, so they are literally the same knowledge field, in essence
17:39:19*Phytolizer joined #nim
17:39:23*jmdaemon joined #nim
17:40:05*Phytolizer quit (Client Quit)
17:43:13*sts-q joined #nim
17:44:01FromDiscord<ShalokShalom> In reply to @sOkam! "etymology and synonym finders": We could probably write some software for this↵↵Maybe some IDE integration?
17:44:13FromDiscord<ShalokShalom> There is probably something already
17:44:48*sts-q left #nim (Reform running sic irc client says bye for now.)
17:46:46NimEventerNew thread by japplegame: How to add a file to a project without importing, see https://forum.nim-lang.org/t/9619
17:48:28*PMunch joined #nim
17:49:13FromDiscord<ShalokShalom> In reply to @Elegantbeef "I've looked at wasmtime,": Just heard about https://wasmcloud.com/
17:49:19FromDiscord<ShalokShalom> You could be interested 🤷🏻‍♂️
17:50:50FromDiscord<ShalokShalom> Hnn, crazy. That's written in Elixir.
17:50:53FromDiscord<ShalokShalom> https://github.com/wasmCloud/wasmcloud-otp
17:53:18PMunchZevv, you around?
17:53:58Zevvsure, zup
17:54:13Zevvwas my forum post stupid?
17:54:17PMunchI'm looking at your threading question
17:54:19PMunchNot at all
17:54:29PMunchI've been wondering the exact same thing!
17:54:38Zevvthis issue has been hunting me for about two years
17:54:41PMunchAraq keeps saying it's super easy, but never tells us how :P
17:54:44Zevvand is one of the reasons I kidn of lost strust
17:55:18Zevvso I decided to just throw the question in the open. I have tons of details and specifics, but I chose to leave them all out
17:55:22Zevvmake it an open discussion
17:55:37Zevvbut imho, as long as RCs are not atomic, this can not be done
18:00:14PMunchI'm all for the open discusion
18:00:24PMunchI mean, it has to be possible to somehow move data between threads
18:01:16Zevvthere's a problem with memory semantics. Say we have a magic function move() that does the job. It will need to have a sink argument
18:01:17PMunchThere is the sink parameter, which makes sure that the reference isn't used after that procedure is called
18:01:32ZevvIf you pass it something with RC==1, we are technically good to go
18:01:39PMunchYup
18:01:40Zevvquestion is, what do you do when RC > 1
18:01:43Zevvbut ignore that for now
18:01:56PMunchI think the current implementation throws an error
18:02:00Zevvso I make code in move() that passes the ref to B somehow
18:02:20Zevvthe problem is that at the end of the code of my move() fucntion nim will recrease the refs RC
18:02:25Zevvbut at that time, I have already moved it to B
18:02:30Zevvso A is no longer allowed to touch that memory
18:02:59ZevvA will do this without having a proper lock on the object
18:03:03Zevvso the decrease is UB
18:03:10ZevvB might or might not see the decrease
18:06:06PMunchI think that's what isolated is for: https://github.com/nim-lang/Nim/blob/devel/lib/std/isolation.nim
18:06:19Zevvnot even. isolated just makes sure RC will never be > 1
18:06:28PMunchAh
18:06:29Zevvbut it's not a workable solution because you will need to inistantiate your object as an isolate
18:06:34Zevvand keep it around like that all the time
18:06:43Zevvthe RC semantics are not different in the end
18:07:28PMunchWhat about this stuff? https://github.com/nim-lang/threading
18:07:51Zevvsure, you tell me
18:09:40FromDiscord<sOkam!> In reply to @ShalokShalom "We could probably write": that would be hella epic↵I guess it would be just word search integration with the IDE?↵I don't know how the word databases work, but I figure it would be just adding some sort of database navigation system, I imagine 🤔
18:10:29FromDiscord<ShalokShalom> In reply to @PMunch "Araq keeps saying it's": This sounds like a sentence that we could frame and put on the wall 😄
18:10:44FromDiscord<ShalokShalom> Or as stickers, for our cars 😄
18:11:16FromDiscord<ShalokShalom> In reply to @sOkam! "that would be hella": First step would be, if any of them offer a public API
18:11:45ZevvPMunch: https://github.com/nim-lang/threading/blob/49562fa0d393e765823b2ea96ca14fbb9889a566/threading/smartptrs.nim#L78-L80
18:11:48Zevvthere you go.
18:12:09Zevvit's a re-implementation of refs, excplicitly, with atomic on the RC
18:13:07*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
18:13:24PMunchAah, right
18:14:28FromDiscord<sOkam!> In reply to @ShalokShalom "First step would be,": etymonline is the best database I know. and they have a chrome extension, so I figure they must have some sort of system for that 🤔
18:14:36*wallabra joined #nim
18:15:24FromDiscord<ShalokShalom> Wonderful 😄
18:16:50PMunchZevv, maybe we should use Cunningham's Law and post an article about how threading works in Nim :P
18:16:59PMunchBased solely on assumptions
18:21:16*pro joined #nim
18:26:02*om3ga quit (Ping timeout: 255 seconds)
18:33:13FromDiscord<planetis> would you mind writing a simple example, it shouldn't be difficult.
18:33:31Zevvwho?
18:33:52FromDiscord<planetis> Zevv, about your threading question
18:34:12Zevvwell, I can write examples that don't work
18:34:24FromDiscord<planetis> sure do that
18:34:53ZevvAraq'
18:35:02Zevvs answer does not compile and is wrong in more ways
18:35:35FromDiscord<planetis> Please explain
18:37:18Zevvmy question was about moving a newly allocated ref between threads. g is a global that already existed before the threas was spawned
18:37:48FromDiscord<hmmm> dumb question sirs : if I have "for i in myseq" how can I stop looping before the last element?
18:38:09Zevvalso the lack of locking makes this UB, both threads might or might not agree abotu what is in `g`
18:38:19Zevvbut thats' nitpicking
18:40:43FromDiscord<hmmm> I think I can use some kind of if condition + discard but seems clunky
18:40:59FromDiscord<hmmm> or pass maybe
18:41:20PMunchZevv, how do you plan on knowing where to move something in your final code?
18:41:42PMunchI'm just curious
18:41:55Zevvlet's assume a semaphore or wait cond
18:42:27PMunchYeah but how do you know where in memory to put it?
18:43:08ZevvI can pass the address of the ref
18:43:42Zevvbut that is part of the problem itself, how am I suppsed to do this so that I do not violate the memory model
18:43:44PMunchInto the thread proc as an argument?
18:43:53Zevvcan this be done without 'raw' pointers in the first place?
18:44:27PMunchWell I guess channels is the "obvious" answer. But they still require copying AFAIK
18:44:42ZevvI'm fine with copying the ref itself
18:45:06Zevvbut not the data, because the whole point of this excersize is to move the data, not to copy it
18:45:25PMunchSend an Isolated over a channel maybe?
18:45:48Zevvok, let's assume that for now, these are the tools we are given
18:46:14FromDiscord<hmmm> ye if work'd but I bet there is some cute sequtils sugar I'm missing 😑
18:46:53PMunch@hmmm, you mean break?
18:47:17FromDiscord<hmmm> nu I mean looping in a for loop x times except last one without using if
18:47:42Zevv`for` can't tell if it's the last one in all cases
18:47:56FromDiscord<hmmm> hmm I see
18:48:00Zevvfor iterating seqs it might be possible, but for closure iterators there is no way to tell
18:48:02PMunchfor i in myseq[0..^1]
18:48:25PMunchOh yeah, for closure iterators all bets are off
18:48:43Zevvmyseq[0..^1] will copy your seq, minus one element
18:49:02FromDiscord<hmmm> yea I think it was that one munchie 😃
18:49:26PMunchfor i in myseq.toOpenArray(0, myseq.len - 1)
18:50:00PMunchOr maybe myseq.high..
18:51:29PMunchZevv, so this "works" but it's ugly as sin and I'm not sure if it works: http://ix.io/4fYp
18:53:08Zevvrun it on valgrind
18:53:22Zevvor asan
19:00:34Zevvnim r --passC:-fsanitize=thread --passL:-fsanitize=thread --debugger:native -d:usemalloc r.nim
19:00:45*derpydoo joined #nim
19:02:15PMunchWell that returns a slew of data race warnings
19:02:19Zevvright
19:03:31PMunchIt does that if I don't touch g in the thread as well though..
19:03:58PMunchThis also shows errors, although not as many: http://ix.io/4fYt
19:04:17Zevvthere are no mutexes, so it is just not going to be clean
19:04:43Zevvyou can't just poke at someone elses memory and get away with it
19:07:57PMunchTrying doing it manually with a thread and not threadpool
19:08:00PMunchhttp://ix.io/4fYv
19:08:24PMunchNow I get fewer errors, and just as many errors whenever I access the global memory or not (2)
19:08:44PMunchIt seems to actually complain that I'm accessing the thread variable..
19:09:38PMunchI mean this should be memory safe though shouldn't it? Since I sync/join the threads before the global thread accesses g there is never actually any race going on
19:10:38Zevvseems ok
19:17:09FromDiscord<planetis> here I am sending objects from one thread to another with a spsc channel https://github.com/planetis-m/sync/blob/master/tests/tspsc1.nim
19:17:19Zevvobjects or ref objects
19:17:33PMunchWhat's a spsc channel?
19:17:44PMunchSingle-Producer, Single-Consumer?
19:17:51FromDiscord<planetis> ref. it's tested with thread sanitizer but latest allocator changes broke it
19:18:12Zevvhow do you manage the arc RC?
19:18:13FromDiscord<planetis> they broke allignment, I will fill a bug report soon
19:19:34FromDiscord<planetis> just this https://github.com/planetis-m/sync/blob/master/sync/spsc_queue.nim#L49
19:20:15FromDiscord<planetis> but note that's a special case because of trypush semantics (it's documented in the rfc)
19:20:45Zevvit's not sinking, is ti?
19:21:14FromDiscord<planetis> that one https://github.com/nim-lang/RFCs/issues/347
19:21:28FromDiscord<planetis> ye push should sink but not trypush
19:22:14FromDiscord<planetis> here is a rc string type with isolate support https://github.com/planetis-m/cowstrings/blob/main/cowstrings.nim#L159 it makes a copy if the rc > 0
19:23:00FromDiscord<planetis> it's tested here https://github.com/planetis-m/cowstrings/blob/main/tests/bcowstrings2.nim
19:23:10FromDiscord<planetis> but again currently broken on devel
19:23:47Zevvthis is my minimal example
19:23:56Zevvignoring the fact that there is no lock on the data in my object
19:24:14Zevvthis will get complaints from the sanatizer consistenly in eqdestroy___t_64
19:25:35PMunchThis?
19:26:05Zevvhm wait the 't.addr is now' echo must go of course, that's after the move
19:26:33Zevvargh it's confusing that just using threads throws me a few data races by default
19:26:51*kenran joined #nim
19:28:09FromDiscord<planetis> I don't see any code btw
19:28:24Zevvhttp://ix.io/4fYz
19:28:26Zevvsorry
19:33:26FromDiscord<planetis> I don't really know if the channels_builtin works with orc we should ask araq or xflywind
19:34:22FromDiscord<planetis> I think it's deprecated for this raeson
19:34:42Zevvthat's kind of the point of my question. How are we supposed to do this :)
19:35:46FromDiscord<planetis> PMunch: did you have any success with mratsim's channels?
19:35:55PMunchThe ones in threading?
19:35:56PMunchNot really
19:36:06FromDiscord<planetis> no the one in weave
19:36:23FromDiscord<planetis> the one in threading is broken for sure
19:36:38PMunchI tried to apply them to Zevvs example right now, but it just gives me a vague error that "Expression cannot be isolated: t"
19:36:45PMunchWithout really saying why
19:36:46PMunchOh
19:38:44FromDiscord<planetis> that one is totally untested and shouldn't compile by design https://github.com/nim-lang/threading/blob/master/threading/channels.nim#L359
19:39:14FromDiscord<planetis> you need to pass a var location
19:45:48FromDiscord<planetis> (for example there are other problems as well)
20:15:00FromDiscord<Bung> does the macros.`newProc` accept generic param ?
20:29:02FromDiscord<Elegantbeef> Bung no it does not
20:29:43FromDiscord<Bung> then how you do that, I know you have done before
20:29:46FromDiscord<Elegantbeef> I mean it would support typeclass'd parameters
20:30:10FromDiscord<Elegantbeef> You can call that procedure then add to the `[2]` index
20:30:29FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/definitions/routines.nim#L131
20:31:23FromDiscord<Elegantbeef> I dont have docs for Micros but it makes macros so much easier, though I assume you're doing something compiler related so it might not help you
20:32:38FromDiscord<Bung> ah, I see you modify the returned procType node by subscrition
20:33:20FromDiscord<Elegantbeef> Oh that assert is a bug waiting to happen 😄
20:39:29PMunch@Elegantbeef, got a good title for my static-loosing issue?
20:40:13FromDiscord<Elegantbeef> "Static field access does not constant fold with arc/orc"
20:40:30FromDiscord<Bung> hmm , am debugging into this https://github.com/nim-lang/Nim/issues/16758, dunno what expected when user write a wrong macro
20:40:42FromDiscord<Bung> it lack one generic param
20:41:38FromDiscord<Elegantbeef> Well raise either an internal or local error for when it is nil
20:43:38FromDiscord<Bung> let me see how it render a invalid node
20:44:25*kenran quit (Remote host closed the connection)
20:50:34FromDiscord<Yardanico> @beef you're a professional
20:50:59FromDiscord<Yardanico> is this a bug in generic resolution or something?
20:51:05FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4fYY
20:51:25FromDiscord<Elegantbeef> Since when?!
20:51:29FromDiscord<Yardanico> this hits recursion limit because floorDiv uses mod and for some reason the compiler picks the user-defined mod instead of the math mod
20:51:51FromDiscord<Elegantbeef> It's a generic this is correct
20:52:05FromDiscord<Elegantbeef> `floorDiv` needs `bind mod`
20:52:21FromDiscord<Yardanico> yeah
20:52:32FromDiscord<Elegantbeef> Nim forces open symbols that are overloaded in generic scope
20:52:40FromDiscord<Elegantbeef> So this is actually a rare case of "working as intended"
20:55:19FromDiscord<Elegantbeef> @ringabout\: did your change adding user defined defaults change the first node in a `nkObjConstr` to `nkType`?
20:55:51FromDiscord<Elegantbeef> I've gotta git bisect but likely somewhere around that is the issue
20:56:05FromDiscord<Bung> Error\: 'blk.p(a)' has nil child at index hmm cant get better error message for macro
21:04:28arkanoidwhat's the correct way to check if a float can be converted to int without losing information?
21:06:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fZ2
21:07:10FromDiscord<.tochka> oh nice
21:07:14FromDiscord<.tochka> needed that :D
21:07:42FromDiscord<Elegantbeef> `import std/[fenv, math]` of course
21:08:41FromDiscord<Elegantbeef> The int part is dumb now that i think about it
21:08:50FromDiscord<.tochka> do low and high work for floats btw?
21:09:20FromDiscord<Elegantbeef> It should be `f in typeof(f)(int.low)..typeof(f)(int.high)` 😄
21:09:26FromDiscord<Elegantbeef> they return -inf and +inf
21:09:34FromDiscord<Elegantbeef> So yes/no
21:09:54FromDiscord<.tochka> hmm, not that useful
21:11:53arkanoid:-|
21:12:57FromDiscord<Elegantbeef> fenv has `maximumPositiveValue` and it's min counterpart
21:14:20FromDiscord<Elegantbeef> Yea looked into @ringabout and the defaults breaks https://play.nim-lang.org/#ix=4fZ3 seems the VM now needs to manually get the symbol for the `nkType`
21:15:57*pro quit (Quit: pro)
21:17:52FromDiscord<.tochka> is there a way to have string repr of something in buffer instead of new string allocation via std?
21:18:16FromDiscord<Elegantbeef> https://nim-lang.org/docs/digitsutils.html
21:19:32FromDiscord<Elegantbeef> You could also make your own stream like api
21:19:37FromDiscord<.tochka> so, only for ints?
21:19:37FromDiscord<Elegantbeef> frosty makes it super easy
21:19:45FromDiscord<.tochka> ik you could diy it, just asking about std
21:20:50FromDiscord<Elegantbeef> Then the answer is sadly there is no `$(var openarray[char], t: MyType)` api
21:21:11FromDiscord<Elegantbeef> I guess it'd also require a var int
21:21:23PMunch@Elegantbeef, it came out a bit wordy: https://github.com/nim-lang/Nim/issues/20854
21:21:25FromDiscord<.tochka> for position, ye
21:21:28PMunchFeel free to add anything
21:21:49FromDiscord<Elegantbeef> You didnt even say field access once
21:22:36PMunchWas I supposed to?
21:22:45FromDiscord<Elegantbeef> Hey you asked for a title!
21:22:51FromDiscord<Arouzing> sent a code paste, see https://play.nim-lang.org/#ix=4fZ6
21:23:50FromDiscord<Elegantbeef> remove `json.items`
21:23:55FromDiscord<Elegantbeef> It's just `items`
21:24:20PMunchAnd `node: volumes` won't work
21:24:29FromDiscord<.tochka> having while is kinda weird
21:24:40PMunch`volumes` is an assignment, not a type
21:25:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fZ9
21:26:02FromDiscord<Elegantbeef> That's a simple single depth iterator
21:26:20FromDiscord<Elegantbeef> If you want to do multi-depth you'll need to learn how to do a depth search and do that 😄
21:29:02FromDiscord<oxnan> sent a code paste, see https://play.nim-lang.org/#ix=4fZa
21:29:21FromDiscord<Elegantbeef> `Handle(nil)`
21:29:26FromDiscord<oxnan> oh thanks
21:29:31FromDiscord<Elegantbeef> Or it might be `Handle(0)`
21:29:41FromDiscord<oxnan> thanks, will try
21:29:51FromDiscord<Elegantbeef> Handle is either a distinct pointer or a distinct integer one of those should work
21:33:51FromDiscord<Elegantbeef> @.tochka\: thinking about it there is a relatively large problem with stringifying to a preallocated buffer in that you need to either precalculate size or just add to the buffer then error when you need to overflow, so it'd be nice in some cases it almost likely will implode on you
21:35:12*PMunch quit (Quit: leaving)
21:36:01FromDiscord<.tochka> yes, but zig solves it by providing your a method to get required space for given format and arguments
21:36:32FromDiscord<.tochka> not a nim way i guess
21:36:48*om3ga joined #nim
21:37:23FromDiscord<Arouzing> sent a code paste, see https://play.nim-lang.org/#ix=4fZd
21:37:25FromDiscord<Elegantbeef> Well like i said it wouldnt be too hard to DIY using frosty 😛
21:37:59FromDiscord<Elegantbeef> you then do `for x in myJson.filter({JInt}): echo x.intVal`
21:38:05FromDiscord<Elegantbeef> filtered\
21:38:23FromDiscord<Arouzing> this make so much sense now!!!
21:38:56FromDiscord<.tochka> In reply to @Elegantbeef "Well like i said": i can look into it
21:42:46FromDiscord<Bung> HANDLE is int
21:42:51FromDiscord<Elegantbeef> bung use your inside voice
21:44:16FromDiscord<Bung> hmm too late
21:46:56FromDiscord<Bung> my bad it's pointer
21:47:33FromDiscord<.tochka> its whatever
21:50:55FromDiscord<oxnan> is there a way to look up an NTSTATUS code in winim easily?
21:51:03FromDiscord<oxnan> as in print the definition
21:58:45FromDiscord<.tochka> via FormatMessage and RtlNtStatusToDosError
21:59:11FromDiscord<.tochka> (edit) "via FormatMessage and RtlNtStatusToDosError ... " added "afaik"
21:59:55FromDiscord<oxnan> thanks!
22:01:50arkanoidwhy I get B called instead of A? https://play.nim-lang.org/#ix=4fZh
22:04:12FromDiscord<Elegantbeef> Concept matching is higher than range match
22:04:32FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4fZj
22:04:46FromDiscord<Elegantbeef> `FloatLike` doesnt require a conversion whereas `Natural` does
22:06:00arkanoidThanks! But why Natural requires a conversion here?
22:06:14FromDiscord<Elegantbeef> Cause int is not a natural
22:06:24arkanoidoh! range type, right
22:06:35arkanoidwell, make sense
22:06:56FromDiscord<Elegantbeef> Nim chooses the most specific and an exact match is \> implicit conversion
22:08:31arkanoidI thought range types were kinda implicit, not sure why
22:09:15FromDiscord<Elegantbeef> They are implicit
22:23:21FromDiscord<oxnan> sent a code paste, see https://play.nim-lang.org/#ix=4fZn
22:24:03FromDiscord<Elegantbeef> Is it a compiler error or runtime?
22:26:35FromDiscord<oxnan> sent a code paste, see https://play.nim-lang.org/#ix=4fZp
22:31:10FromDiscord<Tuatarian> are string mixins a thing?
22:31:21FromDiscord<Tuatarian> alternatively, is there a good way to read nim code as nim code instead of as text?
22:31:32FromDiscord<Tuatarian> (edit) "alternatively, is there a good way to read nim code as nim code instead of as text? ... " added "(from a nim program)"
22:31:58FromDiscord<Tuatarian> my specific use case here is that I'd like to have a table of function definitions while minimizing the unreadability of the table itself
22:32:00FromDiscord<Tuatarian> so I
22:33:03FromDiscord<Tuatarian> I was intending to shove all the functions into some file somewhere, have a text file which lists the members of the table in a more readable manner, and read that into the actual table from the actual program
22:34:26FromDiscord<Elegantbeef> Can this be done statically?
22:35:47FromDiscord<Elegantbeef> I assume so, which means you can just make a macro generate the table then do something like `let myEventTable = genEventTable()`
22:36:41FromDiscord<.tochka> In reply to @oxnan "nothing breaks, but the": probably have to look at windows specific forums
22:36:50FromDiscord<oxnan> yeah probably
23:31:05FromDiscord<Tuatarian> In reply to @Elegantbeef "I assume so, which": ok, so I can do all the file reading and the like in a macro?
23:31:37FromDiscord<Tuatarian> I'd still need to interpret a string as nim code though
23:31:57FromDiscord<Tuatarian> this should happen statically, not just can happen statically
23:32:42FromDiscord<Elegantbeef> Why do you even need to interpret a string as nim code
23:32:47FromDiscord<Elegantbeef> Why can you not just use Nim code as nim code
23:46:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4fZA
23:46:23FromDiscord<Elegantbeef> For instance
23:47:33FromDiscord<Elegantbeef> @Tuatarian