<< 22-10-2021 >>

00:02:03FromDiscord<Anonymous Poet> is there a way to get the nim compiler to print out the nim code in the final pass before converting it to c/c++? i know theres dumpAstGen, dumpTree, etc. but those arent the final asts. there might still be template rewriting, and macro expansion, etc.
00:04:45FromDiscord<Elegantbeef> there is `macros.expandMacros`
00:04:56FromDiscord<Elegantbeef> it takes in a typed AST so all expansions happen
00:05:54FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3CrP
00:06:31FromDiscord<Anonymous Poet> compiling with just `nim r file.nim`
00:07:30FromDiscord<Elegantbeef> Doesnt `r` hide compiler output?
00:07:59FromDiscord<Anonymous Poet> not sure, but `c` doesnt print anything either
00:08:11FromDiscord<Elegantbeef> I cannot compile that code so cannot help
00:08:15FromDiscord<Anonymous Poet> im concerned that `expandMacros` doesnt do anything if theres no macro in it
00:10:05FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3CrT
00:12:15FromDiscord<Anonymous Poet> i dont understand why but now it works for my code too ... could it have been cached somehow?
00:12:27FromDiscord<Elegantbeef> Are you sure it's compiling again?
00:12:30FromDiscord<Elegantbeef> `nim c -f`
00:13:04FromDiscord<Anonymous Poet> i copied your playground snippet into a file, compiled that, saw the output, and then tried the same thing on my file, and got output, where before i wasnt (with the same compile command)
00:14:07*rockcavera joined #nim
00:14:07*rockcavera quit (Changing host)
00:14:07*rockcavera joined #nim
00:16:03FromDiscord<Anonymous Poet> very strange that this works ... i mustve been doing something wrong before. thank you!
00:17:29FromDiscord<Anonymous Poet> one more thing: when i use `--expandArc:myfunc` it produces an even-more expanded ast, but im not sure its still valid nim, ex `:tmpD` as a statement on a line by itself. do you know if theres a way to get the lifecycle hooks in my macro too?
00:18:18FromDiscord<Elegantbeef> Nope since your macro can completely change the output which means arc hasnt ran yet
00:18:35FromDiscord<Elegantbeef> Arc needs code it knows will be safe to insert it's destructors
00:19:09FromDiscord<Anonymous Poet> i see, thanks. that makes sense
00:58:11FromDiscord<deech> It seems shipping a Nim library with `exportc`d functions also requires bundling `nimbase.h`. Is there any way around this?
00:58:51*Gustavo6046 quit (Ping timeout: 245 seconds)
00:58:54*Gustavo6046_ joined #nim
01:01:44*Gustavo6046_ is now known as Gustavo6046
01:04:20FromDiscord<Elegantbeef> I dont think treeform's genny does, could be wrong though
01:04:46FromDiscord<Elegantbeef> Though that's dynlib, i guess
01:05:12FromDiscord<Elegantbeef> Hurdur i'm a genius or something here
01:09:29FromDiscord<Elegantbeef> So I guess assuming you're using the generated C it's required
01:11:31*Gustavo6046 quit (Ping timeout: 252 seconds)
01:13:02*Gustavo6046 joined #nim
01:19:45*neurocyte0132889 quit (Ping timeout: 260 seconds)
01:36:25FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Cs9
01:38:46FromDiscord<geekrelief> if I swap `object | proc` for `typed` it compiles.
01:43:47*NimBot joined #nim
01:44:21FromDiscord<Elegantbeef> Can i see the object's declaration?
01:44:59FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Csb
01:45:25FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Csc
01:46:17FromDiscord<Elegantbeef> And macro usage?
01:46:23FromDiscord<geekrelief> sent a code paste, see https://paste.rs/G1y
01:46:25FromDiscord<Elegantbeef> There you go
01:46:45FromDiscord<geekrelief> I'm dumb.. what am I missing?
01:47:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Cse
01:47:29FromDiscord<Elegantbeef> The descriminator is bound to the first type so it gets `init_i` and expects `tmPluginInitI`
01:47:39FromDiscord<Elegantbeef> You want `varargs[typed]` in this case
01:47:46FromDiscord<Elegantbeef> Then you check in the macro they're objects afaik
01:47:51FromDiscord<geekrelief> oh duh.. tm_plugin_init_i and tm_plugin_shutdown_i aren't from the same root
01:48:22FromDiscord<geekrelief> ok I guess there's no way around using `typed`
01:48:49FromDiscord<geekrelief> can using parameter constraints help?
01:49:21FromDiscord<geekrelief> I guess not since there's nothing for `object`
01:51:43FromDiscord<geekrelief> this is what I get for trying to get fancy for the wrong reason, nim has so many features to play with!
02:05:28*arkurious quit (Quit: Leaving)
02:11:50FromDiscord<ruki> Do you know how I should solve this problem? https://github.com/nim-lang/Nim/issues/19033
02:14:16FromDiscord<geekrelief> this might be dumb, but did you try putting double quotes around the argument to `--passL:"-libpath:...."`?
02:15:20FromDiscord<geekrelief> for instance in my nimble file I use `--passC` like `"--passC:\"/wd4311 /wd4312 /wd4103 /wd4133 /wd4028\"" & `
02:15:24FromDiscord<geekrelief> (edit) "/wd4028\"" & `" => "/wd4028\""`"
02:28:30FromDiscord<ruki> In reply to @geekrelief "this might be dumb,": I try it, it does not work. = =
02:28:35*LyndsySimon quit (Ping timeout: 264 seconds)
02:28:46*LyndsySimon joined #nim
02:31:28FromDiscord<geekrelief> what if you switch the '-libpath' with a '/libpath'?
02:32:19FromDiscord<geekrelief> https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath?view=msvc-160
02:32:40FromDiscord<ruki> same problem
02:33:38FromDiscord<ruki> The problem is that vccexe passed the link flags to cl.exe, but cl.exe ignored them
02:34:32FromDiscord<ruki> sent a code paste, see https://play.nim-lang.org/#ix=3Csn
02:35:04FromDiscord<ruki> nim c --cc:vcc -d:release --nimcache:build\.gens\test\windows\x64\release\nimcache --passL:-libpath:build\windows\x64\release --passL:-lfoo -o:build\windows\x64\release\test.exe src\main.nim
02:40:07FromDiscord<geekrelief> seems like this error has been around a while https://forum.nim-lang.org/t/341
02:40:16FromDiscord<geekrelief> There's gotta be a fix by now
02:42:09FromDiscord<ruki> oh, seems to be the same problem.
02:42:40FromDiscord<geekrelief> https://github.com/nim-lang/Nim/issues/8098
02:45:35FromDiscord<ruki> This problem seems to exist for a long time, but it has not been fixed. 🙃
02:46:21FromDiscord<geekrelief> well looks like you just volunteered 🙂
02:46:24FromDiscord<geekrelief> j/k
02:46:40FromDiscord<ruki> I am very curious, now how nim links other static libraries on windows, this should be a basic feature.
02:46:48FromDiscord<geekrelief> I'm sure I'll run into this at some point too
02:47:26FromDiscord<geekrelief> In theory this should be a simple fix
02:49:26FromDiscord<Elegantbeef> I thought you just make an `.a` then link it with the compiler
02:51:20FromDiscord<ruki> .a? but it's windows library.
02:51:51FromDiscord<Elegantbeef> Thought`.a` is also used for windows static linking
02:52:29FromDiscord<geekrelief> just to double check did you try using `--clibdir`?
02:55:22FromDiscord<IsaacPaul> I'm trying to get some simple tests to run but keep running into an error: undeclared identifier: 'addTest' https://media.discordapp.net/attachments/371759389889003532/900940358995836968/Screen_Shot_2021-10-21_at_10.50.34_PM.png
02:55:54FromDiscord<Elegantbeef> have you exported `addTest`?
02:55:55FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Csq
02:55:58FromDiscord<Elegantbeef> You havent exported `addTest`
02:56:08FromDiscord<Elegantbeef> `addTest`
02:56:21FromDiscord<Elegantbeef> That'll export it, it's like a public accesor in other languages
02:57:25FromDiscord<IsaacPaul> ah that worked 🙃
02:57:54FromDiscord<ruki> In reply to @geekrelief "just to double check": When I use it, I will encounter another problem. It cannot completely pass the relative path to the compiler and linker. It seems that it will be converted to an absolute path, but the path location is wrong. So I can only use --passC/--passL to pass the real relative path
02:57:56FromDiscord<geekrelief> `--clibdir` returns the same issue
02:58:26*Gustavo6046 quit (Ping timeout: 245 seconds)
02:58:39*Gustavo6046 joined #nim
02:59:13*Pyautogui joined #nim
03:20:30*Pyautogui quit (Ping timeout: 260 seconds)
03:39:19*Pyautogui joined #nim
03:41:00PyautoguiNoob Question: Why does strmisc have a expandTabs func, when the same effect could be achieved with the strutils replace?
03:41:19*Gustavo6046_ joined #nim
03:42:13*Gustavo6046 quit (Ping timeout: 252 seconds)
03:43:32FromDiscord<Elegantbeef> I think it's to reduce module dependencies and cyclical logic
03:44:34*Gustavo6046_ is now known as Gustavo6046
03:48:01PyautoguiThe module dependencies reduction makes. I have never heard the term "cyclical logic" in connection with programming. Google just brings up circular reasoning. What does it mean in this context?
03:48:24PyautoguiEdit: "makes sense"
03:49:20FromDiscord<Elegantbeef> Cyclical dependancies mostly
03:49:45PyautoguiGot it, thanks.
03:56:22FromDiscord<geekrelief> In reply to @ruki "When I use it,": probably need to modify this https://github.com/nim-lang/Nim/blob/5e2b9341f343c3f80f92cfd160a0186f23521a42/tools/vccexe/vccexe.nim#L163-L169
03:59:13*Pyautogui quit (Quit: Connection closed)
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:10:46*tiorock joined #nim
04:10:46*tiorock quit (Changing host)
04:10:46*tiorock joined #nim
04:10:46*rockcavera is now known as Guest7704
04:10:46*Guest7704 quit (Killed (tungsten.libera.chat (Nickname regained by services)))
04:10:46*tiorock is now known as rockcavera
04:12:34*tiorock joined #nim
04:12:34*tiorock quit (Changing host)
04:12:34*tiorock joined #nim
04:12:34*rockcavera quit (Killed (sodium.libera.chat (Nickname regained by services)))
04:12:34*tiorock is now known as rockcavera
04:12:58FromDiscord<ruki> In reply to @geekrelief "probably need to modify": oh thanks
04:18:08*tiorock joined #nim
04:18:08*tiorock quit (Changing host)
04:18:08*tiorock joined #nim
04:18:08*rockcavera is now known as Guest5938
04:18:08*tiorock is now known as rockcavera
04:19:06*Guest5938 quit (Ping timeout: 260 seconds)
04:27:48FromDiscord<Tunnel> sent a code paste, see https://play.nim-lang.org/#ix=3CsB
04:28:39FromDiscord<Elegantbeef> `exportC`?
04:29:12*rockcavera quit (Remote host closed the connection)
04:31:33FromDiscord<Elegantbeef> You can also look at the `emit` pragma https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma
04:31:47FromDiscord<Tunnel> sent a code paste, see https://play.nim-lang.org/#ix=3CsC
04:32:20FromDiscord<Elegantbeef> what's `goto` defined as?
04:32:27FromDiscord<Tunnel> nothing?
04:32:41FromDiscord<Elegantbeef> Why not import the procedure than?
04:33:08FromDiscord<Tunnel> I think I follow now, but why would newPage work, and "otherSymbol" work, but goto gets mangled?
04:34:08FromDiscord<Elegantbeef> what's newPage defined as?
04:34:16FromDiscord<Tunnel> nothing as well
04:34:23FromDiscord<Elegantbeef> Uhh
04:34:31FromDiscord<Tunnel> sent a code paste, see https://play.nim-lang.org/#ix=3CsD
04:34:46FromDiscord<Tunnel> well I was adding my attempt at the goto proc, ignore that line...
04:37:28FromDiscord<Elegantbeef> Oh this is using js magic i see
04:37:35FromDiscord<Elegantbeef> does the `std/asyncjs` `await` not work here?
04:37:59FromDiscord<Tunnel> await expects a Future[T], and I havent figured out how to make jsobject into that.
04:41:26FromDiscord<Elegantbeef> Hmm the macros do cause some weird behaviour, i'll see if i can figure it out
04:52:43FromDiscord<Elegantbeef> Ah i found the issue `https://github.com/nim-lang/Nim/blob/version-1-6/lib/js/jsffi.nim#L50` goto is in a reservedWords list
04:53:05FromDiscord<Tunnel> I had just noticed that too. I'm not sure I understand why that is a thing though.
04:53:27FromDiscord<Elegantbeef> It's to avoid using keywords as procedures and the like i believe
04:53:59FromDiscord<Elegantbeef> `function for(){ console.log("hello");}` is invalid for instance
04:54:09FromDiscord<Tunnel> but that doesn't seem to be an issue to do on purpose though. Since Puppeteer seems to break that rule.
04:54:14FromDiscord<ruki> In reply to @geekrelief "probably need to modify": I have solved this problem, Thanks! 😀 https://github.com/nim-lang/Nim/issues/19033#issuecomment-949285922
04:54:32FromDiscord<Elegantbeef> Some words in that list might not be actually restricted
04:56:01FromDiscord<geekrelief> In reply to @ruki "I have solved this": nice 🙂
04:56:45FromDiscord<Tunnel> "removed from ecma 5/6 standard" https://www.w3schools.com/js/js_reserved.asp Seems like it is sometimes a restricted keyword...
04:57:23FromDiscord<geekrelief> In reply to @geekrelief "nice 🙂": I wonder if the link flags are guaranteed to always be at the end
04:57:58FromDiscord<geekrelief> In reply to @ruki "I have solved this": Do we know if the links flags are always at the end?
04:58:26FromDiscord<Elegantbeef> It's not ideal tunnel but https://play.nim-lang.org/#ix=3CsF
04:58:39FromDiscord<Elegantbeef> I'd suggest making a PR for removing it though
05:00:05*mahlon quit (Ping timeout: 258 seconds)
05:00:44FromDiscord<Tunnel> I thought about that, but does nim intentionally target pre 5/6? Directly removing it might break that compatibility.
05:02:37FromDiscord<Elegantbeef> Think it targets es3
05:02:58FromDiscord<Elegantbeef> So yea maybe just an optional overridemangle parameter
05:04:37FromDiscord<Rika> Nim targets es3
05:05:02*mahlon joined #nim
05:07:02FromDiscord<ruki> In reply to @geekrelief "Do we know if": I will sort them and put all --passL in tail
05:07:07FromDiscord<ruki> https://github.com/xmake-io/xmake/blob/62d3e0c681f25cb48560d07461a92738b55a0b6d/xmake/rules/nim/xmake.lua#L133-L150
05:07:07FromDiscord<Tunnel> Thanks for the help! The problem seems to be resolved for now at the very least.
05:07:54FromDiscord<geekrelief> In reply to @ruki "I will sort them": cool
05:10:05FromDiscord<OceanMongrel> proc func
05:13:26*Gustavo6046 quit (Ping timeout: 245 seconds)
05:14:17*Gustavo6046 joined #nim
05:17:46FromDiscord<geekrelief> In reply to @ruki "I will sort them": Seems like putting `--passL:/link` in front should do it, no need to sort. I tried changing the order of my arguments to `nim` and it compiled fine.
05:19:28FromDiscord<ruki> In reply to @geekrelief "Seems like putting `--passL:/link`": But there are some compile flags, not link flags. I need to submit the compiled flags in front of --passL:-link
05:19:36FromDiscord<ruki> e.g. --passC:xx
05:19:50FromDiscord<geekrelief> I'm using -passC too
05:19:57FromDiscord<geekrelief> I have a bunch of warnings I disable
05:20:23FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3CsK
05:20:39FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3CsL
05:20:42FromDiscord<geekrelief> so passL is in front of passC
05:21:12FromDiscord<geekrelief> anyway, just fyi
05:22:50FromDiscord<ruki> ok
05:33:44*Gustavo6046_ joined #nim
05:33:44*Gustavo6046 quit (Read error: Connection reset by peer)
05:36:32*Gustavo6046_ is now known as Gustavo6046
05:39:19NimEventerNew thread by Gblbaozi: How to send a command to cmd.exe, see https://forum.nim-lang.org/t/8530
06:11:37*pro joined #nim
06:22:04FromDiscord<soupayan> any good resource from where i can learn metaprogrammimg using nim?
06:23:51nrds<Prestige99> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 is good to learn macros
06:26:07FromDiscord<Elegantbeef> Dont say that might go to the authors head
06:32:14FromDiscord<Rika> Fuck you beef
06:32:18FromDiscord<Rika> Your shit is awful
06:32:24FromDiscord<Rika> Is that good enough to mitigate that issue
06:42:42FromDiscord<Elegantbeef> Rika with all the new users you need to say jk 😛
06:43:04FromDiscord<evoalg> nim 1.6 ... when I compile, I get Hints of unused variable twice each, why would that be?
06:43:29FromDiscord<Elegantbeef> Variables are unused
06:44:04FromDiscord<evoalg> I mean instead of once each, I get it twice each, exactly the same part of the code
06:44:37FromDiscord<Elegantbeef> Can you reproduce on playground?
06:45:06FromDiscord<evoalg> "test16.nim(15, 7) Hint: 'a' is declared but not used [XDeclaredButNotUsed]" and then other "test16.nim(15, 7) Hint: 'a' is declared but not used [XDeclaredButNotUsed]".↵How do I use playground? (sorry I'm quite new)
06:45:21FromDiscord<Elegantbeef> https://play.nim-lang.org/
06:47:10FromDiscord<Smarc> sent a long message, see http://ix.io/3CsW
06:48:15FromDiscord<evoalg> In reply to @Elegantbeef "https://play.nim-lang.org/": oh it's only when I use "import timeit" ....
06:49:21FromDiscord<evoalg> (edit) "...." => "....↵eg:↵echo timeGo do:↵ var a = 1"
06:50:09FromDiscord<geekrelief> In reply to @Smarc "Hey party people, here": I think this is what you're looking for https://nim-lang.github.io/Nim/manual.html#procedures-var-parameters
06:52:00FromDiscord<Elegantbeef> Does timeit take typed code?
06:53:04FromDiscord<Elegantbeef> rather `timeGo`
06:54:07FromDiscord<Rika> In reply to @Smarc "Hey party people, here": There’s no concept of modules after you compile afaik
06:57:01FromDiscord<evoalg> In reply to @Elegantbeef "rather `timeGo`": timeGo runs fine on my computer, but on playground it doesn't seem to work ... I'm not sure what you mean by typed code
06:58:10FromDiscord<geekrelief> In reply to @Smarc "Hey party people, here": Are you saying you want to modify the array C at compile time?
06:58:10FromDiscord<Elegantbeef> Macros can take `typed` and `untyped` code typed is semantically checked so has to be valid, and untyped is parsed but unchecked
06:59:06FromDiscord<geekrelief> (edit) "In reply to @Smarc "Hey party people, here": Are you saying you want to modify the array C at compile time? ... " added "Maybe a combination of `static` with `var` parameter to set array C?"
06:59:28FromDiscord<Elegantbeef> But it takes untyped, so i dont get what the macro is doing
06:59:41FromDiscord<geekrelief> (edit) "In reply to @Smarc "Hey party people, here": Are you saying you want to modify the array C at compile time? Maybe a combination of `static` with `var` parameter to set array C? ... " added "or just return the new array instead of using var parameter."
06:59:47FromDiscord<Elegantbeef> Smarc i'd suggest making an example and sharing it, it's unclear what you're after to me 😀
07:01:22FromDiscord<Smarc> In reply to @geekrelief "Are you saying you": `var` parameters did exactly what I wanted to do, thank you!
07:04:49FromDiscord<evoalg> In reply to @Elegantbeef "Macros can take `typed`": Thank you
07:08:13FromDiscord<that_dude> I was looking at the 1.6 changelog, and I was wondering, what's the difference between `import foo {.all.}` and `include foo`?
07:12:27FromDiscord<geekrelief> In reply to @that_dude "I was looking at": just a guess, but `include foo` is a basically inserted so any imports would be brought into your module, while `import foo {.all.}` probably wouldn't bring any imports in. I would have to test this to confirm it.
07:13:06FromDiscord<Elegantbeef> That's be my assumption aswell
07:13:26FromDiscord<that_dude> Ah so include also imports all of `foo`s dependencies as well. Got it
07:15:40FromDiscord<konsumlamm> include just copy pastes the module
07:17:14FromDiscord<geekrelief> Yeah I just tested it, and `{.all.}` doesn't bring in imports.
07:18:05prois it possible that one process appends to file, while another process is reading the first line of the same file and consuming it (deleting it) without changing the rest of the file
07:28:44*PMunch joined #nim
07:28:52*PMunch quit (Client Quit)
07:29:08*PMunch joined #nim
07:35:18FromDiscord<Smarc> Is it possible to create an object without explicitly naming the arguments? I mean writing Name(x, y) instead of Name(par1: x, par2: y)
07:37:05FromDiscord<Rika> Create a proc for it
07:37:12FromDiscord<Rika> That is the common convention
07:37:36FromDiscord<Rika> initType for objects, newType for reference objects
07:38:29FromDiscord<that_dude> I still want to complain that object initialization uses `:` to set its values despite nim using `=` everywhere else to set values and `:` to define type (afaik)
07:38:46FromDiscord<Rika> No comment
07:40:11FromDiscord<Rika> It’s not a change that can be done anymore without a version 2
07:40:38FromDiscord<that_dude> ik :(
07:40:48FromDiscord<that_dude> Here's to me hoping it will happen in v2
07:40:58FromDiscord<Rika> Just wait for the more unified initialisation RFCs to pass
07:41:02FromDiscord<Elegantbeef> I mean using procs works well so idk
07:42:43FromDiscord<that_dude> Yeah, but I find it just hides the issue. And often I don't want to make a proc whos purpose is nothing but to copy and paste the values with no changes. If I wanted to also add defaults, then sure, but often I don't need them
07:43:43FromDiscord<Elegantbeef> My view is constructors always suck
07:44:05FromDiscord<that_dude> Really?
07:44:19FromDiscord<that_dude> What about working with defaults?
07:44:57FromDiscord<Elegantbeef> doing `YourType(x: x, y: y)` is tedious so is `proc initYourType(x: XType, y: YType): YourType = YourType(x: x, y: y)`
07:45:06FromDiscord<Elegantbeef> I'm not talking about their existence just the syntax
07:45:43FromDiscord<Elegantbeef> Nowadays I think something like https://github.com/beef331/constructor#constructor-1 is idea, but who knows what i'll think later
07:46:00FromDiscord<Elegantbeef> ideal\
07:47:16FromDiscord<Rika> Not sure if I like how you use “let” instead of “result.” for defaults…
07:47:27FromDiscord<that_dude> Cheers to that, I do like that a lot more.
07:48:05FromDiscord<that_dude> In reply to @Rika "Not sure if I": It uses the implicit result in there instead
07:48:21FromDiscord<that_dude> from what I can see
07:48:32FromDiscord<Elegantbeef> Nah it emits a constructor at the end iirc
07:48:59FromDiscord<that_dude> I was wondering, I see the let in there, does that make the object immutable?
07:49:00FromDiscord<Rika> I mean the macro syntax
07:49:19FromDiscord<that_dude> that field I mean
07:49:43FromDiscord<Elegantbeef> Nope `let` is just demonstrating that you can get values at runtime
07:49:53FromDiscord<that_dude> Got it
07:50:03FromDiscord<Rika> I think it’s better if the body wasn’t a scuffed DSL and was just a “this part is inserted after the macro-created body”
07:50:27FromDiscord<Elegantbeef> Yea that could work
07:56:36FromDiscord<Elegantbeef> Anywho i'm still actively trying to think of better ways of making constructors cause i really dislike all present versions 😀
07:56:59FromDiscord<that_dude> What's wrong with them?
07:57:29FromDiscord<Elegantbeef> Generally tedious or just annoy me to write
07:57:59FromDiscord<that_dude> Even with your package
07:58:02FromDiscord<that_dude> ?
07:58:29FromDiscord<that_dude> Because tbh it seems pretty good, I'm struggling to find issues/disagreements
07:58:53FromDiscord<Elegantbeef> Well it makes it less annoying but i'm an idiot that's hesitant to bring in dependencies
07:59:53FromDiscord<Elegantbeef> Constructors are such a small portion of code that it seems comical to pull in a dependancy to just make a constructor 😀
07:59:58FromDiscord<that_dude> Ah. I'm a "As long as it doesn't crash and works as expected, I don't mind a minor size and performance hit" kinda guy
08:00:10FromDiscord<Elegantbeef> Well it doesnt effect either of those
08:00:22FromDiscord<that_dude> In which case why not just use it.
08:00:30FromDiscord<Elegantbeef> It's more just in most cases in the time i add the dependancy i could've made the constructor
08:01:03FromDiscord<Elegantbeef> I have to go get the version i have it pinned, put it in the nimble file, add the import, then make the constructor
08:01:22FromDiscord<that_dude> I made this thing because I needed better switches and counters for a program that has a gui https://github.com/XDEmer0r-L0rd-360-G0d-SlayerXD/NimCounter
08:01:51FromDiscord<that_dude> It's the most trivial thing ever, but I'm lazy and I did the work once already
08:01:54FromDiscord<Elegantbeef> `clear` should be `.setLen(0)`
08:02:24FromDiscord<that_dude> Is what I currently have bad?
08:02:27FromDiscord<Elegantbeef> `@[]` allocates a new sequence so you lose all that capacity you had
08:02:35FromDiscord<that_dude> ah
08:03:04FromDiscord<Elegantbeef> Isnt this an elaborate `CountTable[string]`?
08:03:22FromDiscord<that_dude> Hold up let me look that up lol
08:03:39FromDiscord<Elegantbeef> It's a table that goes string -\> int
08:03:49FromDiscord<that_dude> Damn lol yeah
08:04:14FromDiscord<that_dude> Well my initial purpose was for the single version so I can use it as switches. The multi was and after thought lol
08:04:17FromDiscord<Elegantbeef> `yourTable.inc("someString")` will add `"someString"` and make it `1`
08:05:21FromDiscord<that_dude> I was 90% what I did already existed so that's why I haven't messed with posting it in nimble
08:06:09FromDiscord<Elegantbeef> Well another note is you've mad an alias which isnt distinctly typed, so any `seq[string]` can use these procs
08:06:12FromDiscord<Elegantbeef> Which could be desired, but idk
08:07:14FromDiscord<Elegantbeef> Probably should ask if people want me to comment on their code instead of just doing it
08:07:22FromDiscord<that_dude> Who am I to take away possible niche functionality
08:07:35FromDiscord<that_dude> Nah I'm happy for it. I learned like 3 things already
08:09:55FromDiscord<Elegantbeef> Just to show you how you might do this if you want an object to be a type but not type match for it https://play.nim-lang.org/#ix=3Ctd
08:09:56NimEventerNew Nimble package! dslutils - A macro collection for creating DSL in nim, see https://github.com/codehz/dslutils
08:11:22FromDiscord<Elegantbeef> There are some bugs with distinct but i've got some PRs for some of those issues, though there are still others 😀
08:11:56FromDiscord<that_dude> Tbh I've known for a while that distinct exists, but I've like the ability to be lazy and just it work itself out
08:12:30FromDiscord<that_dude> That way I can still use normal procs I don't want to bother to impliment or somethnig
08:13:26FromDiscord<that_dude> Quite often I find that there is no need to remove features when it has little effect on the complexity
08:14:00FromDiscord<Elegantbeef> Yea i was just mentioning it cause some people act like distinct and type aliases are the same \:D
08:14:42FromDiscord<that_dude> That's why each type has exactly 4 procs with the same name that are intended to kinda mirror each other
08:16:37FromDiscord<that_dude> I guess I've never seen the need for distinct in the things I do because I don't really need a name that much that I want to overwrite the builtin
08:24:05*pro quit (Quit: WeeChat 3.3)
08:56:07*Vladar joined #nim
08:56:55FromDiscord<dilawar (Dilawar Singh)> Is there a way to pass the C compiler path to nim directly e.g. `nim c --some_cc_opt:/mingw64/bin/gcc.exe foo.nim`. Following works on bash like shell `CC=/mingw64/bin/gcc.exe nim c --cc:env foo.nim` but it is not very portable (inside cmake `add_custom_command` which may be executed with `cmd.exe` or `pwsh.exe`).
08:57:12FromDiscord<dilawar (Dilawar Singh)> The last resort would be to write a wrapper script 😟
08:57:48FromDiscord<dilawar (Dilawar Singh)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/901031353036976148): Is there a way to pass the C compiler path to nim directly e.g. `nim c --some_cc_opt:/mingw64/bin/gcc.exe foo.nim`?↵↵Following works on bash like shell `CC=/mingw64/bin/gcc.exe nim c --cc:env foo.nim` but it is not very portable (inside cmake `add_custom_command` which may be executed with `cmd.exe` or `pwsh.exe`).
09:00:45FromDiscord<Elegantbeef> I think the general way of doing it is making a shell script which invokes the compiler
09:05:20FromDiscord<dilawar (Dilawar Singh)> @elegantbeef\:matrix.org You may be right. Unfortunately add\_custom\_command does not copy parent process ENVs (https://stackoverflow.com/questions/35029277/how-to-modify-environment-variables-passed-to-custom-cmake-target/35032051)
09:07:06FromDiscord<Elegantbeef> Yea i dont know the best way here, so i can only say good luck
09:14:57FromDiscord<dilawar (Dilawar Singh)> Hmm. Not sure if it is worth asking it as a feature request on nim Github/forum. May be a useful feature in the universe of build environments!! Anyway, custom script it is.
09:35:26PMunchIIRC Nim does some extra choices when you choose the compiler, not only which binary to build with
09:47:53FromDiscord<dilawar (Dilawar Singh)> @\_discord\_709044657232936960\_=50=4dunch=5b=49=52=43=5d\:t2bot.io You are right. You can choose gcc, llvm etc but not the full path
09:48:12FromDiscord<dilawar (Dilawar Singh)> its finds the binary for you. Most of the time it does a pretty good job
09:49:28FromDiscord<dilawar (Dilawar Singh)> I got into one corner case where I am using msys+mingw and visual studio to build the whole system. Its a nightmare. And not to mention, on CI environment things are installed at non-standard places..
10:02:50FromDiscord<dilawar (Dilawar Singh)> In python, `sys.executable` in a script returns the path of the python interpreter. What is nim equivalent?
10:05:07FromDiscord<Rika> You cannot reliably do soafaik
10:05:11FromDiscord<Rika> (edit) "soafaik" => "so afaik"
10:11:31*madprops quit (Ping timeout: 268 seconds)
10:12:53*aaaaaaaaaa joined #nim
10:14:47FromDiscord<Rika> https://nim-lang.org/docs/os.html#getAppFilename
10:14:50FromDiscord<Rika> Maybe
10:19:34NimEventerNew question by Dilawar: What is nim&#39;s equivalent of Python&#39;s `sys.executable`?, see https://stackoverflow.com/questions/69675173/what-is-nims-equivalent-of-pythons-sys-executable
10:20:23*Vladar quit (Remote host closed the connection)
10:20:55FromDiscord<dilawar (Dilawar Singh)> Thanks. https://nim-lang.org/docs/os.html#getCurrentCompilerExe also looks promising.↵(@Rika)
10:21:05FromDiscord<Rika> That is the compiler
10:21:14FromDiscord<Rika> Do you want the running program or the compiler
10:21:21FromDiscord<Rika> And what for
10:22:50FromDiscord<dilawar (Dilawar Singh)> Both are same the same at compile time.
10:23:10FromDiscord<dilawar (Dilawar Singh)> At compile time, both are the same. Thanks for the help.
10:26:01FromDiscord<dilawar (Dilawar Singh)> I am working with `nimscript`. I should have been clearer.
10:27:34FromDiscord<Yardanico> In reply to @dilawar (Dilawar Singh) "I am working with": oh
10:30:23FromDiscord<Yardanico> btw, out of curiosity, any reason you're using nimscript? :P
10:30:40FromDiscord<Yardanico> no i mean it's fine, just curious why you're trying out nimscript first
10:31:21FromDiscord<dilawar (Dilawar Singh)> I don't want to learn PowerShell and python is part of development stack.. A good excuse to get into nim.
10:33:13FromDiscord<Yardanico> well, you can use Nim itself as kind of a scripting language easily
10:33:18FromDiscord<Yardanico> quite a lot of people do just that
10:33:42FromDiscord<Yardanico> and Nimscript is really just Nim, if you're worrying about the static typing - NimScript is also statically typedf
10:33:44FromDiscord<Yardanico> (edit) "typedf" => "typed"
10:41:15FromDiscord<dilawar (Dilawar Singh)> @\_discord\_177365113899057152\:t2bot.io Ah, I see. I got the impression that for scripting, `nimscript` is the way.
10:49:08*neurocyte0132889 joined #nim
10:49:08*neurocyte0132889 quit (Changing host)
10:49:08*neurocyte0132889 joined #nim
10:51:51PMunchNot really, Nim itself can be used for scripting just fine
10:52:10PMunchYou might want to check out nimcr for an easier way to run your scripts as well
10:52:31PMunchOh wait, you mentioned Powershell, so I guess your on Windows..
10:52:34PMunchMight not work then
10:54:07FromDiscord<Jan81> I would love using a language go write apps and also write basic scripts in 🙂 thats why im learning nim as well! I hate using powershell for this, bash for that, python for another
11:00:12*Gustavo6046 quit (Read error: Connection reset by peer)
11:03:21*Gustavo6046 joined #nim
11:10:39FromDiscord<dilawar (Dilawar Singh)> "I hate using powershell for this, bash for that, python for another so decided to use NIM" would make a good manga!
11:13:38FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3Cu3
11:13:55FromDiscord<Rika> No
11:14:21FromDiscord<Smarc> So then whats the Nim way to solve this? Please don't say don't use inheritance :P
11:14:46FromDiscord<Rika> If I cannot say that then my answer is “deal with it”
11:14:57FromDiscord<Rika> Or wait do you not know of the “of” operator
11:15:02FromDiscord<Yardanico> @Smarc i guess you can write a macro that will convert this to if/elif with `of`
11:15:04FromDiscord<Rika> “if animal of Cat”
11:15:15FromDiscord<Yardanico> if you want to use case statements
11:15:31FromDiscord<Rika> In reply to @Yardanico "<@!218712890780155915> i guess you": Ah case statement macros yeah those are new
11:15:38FromDiscord<Smarc> okay i figured that, so a usual if/elif statement with of operator is the way to go in this case?
11:16:00FromDiscord<Rika> If you don’t wanna make a macro yeah
11:16:20FromDiscord<Smarc> haven't dabbled into macros yet, but i'll look into it! Thank you guys once again
11:21:56*PMunch quit (Quit: Leaving)
11:30:38arkanoidI'm experimenting with nimpy, I want to try compiling a static executable that embeds python (limited to builtin modules to make things easier). It should be possible as my ubuntu box ships with "/usr/lib/x86_64-linux-gnu/libpython3.8.a"
11:31:40FromDiscord<Yardanico> well, the problem is that nimpy only supports dynamic loading of libpython so you'll have to modify it for static linking
11:32:14arkanoidproblem is that according to /proc/<pid>/maps the .so keeps being loaded even when using this config.nims: https://termbin.com/wp3i
11:32:38arkanoidoh, ok
11:32:38FromDiscord<Yardanico> yes, as I said
11:32:46FromDiscord<Yardanico> nimpy doesn't use dynlib, it loads the python libs by itself
11:32:50FromDiscord<Yardanico> so you'll have to modify it
11:32:54arkanoidnot even dynlibOverride can bypass nimpy logic?
11:33:03arkanoidok
11:33:11FromDiscord<Yardanico> no, dynlibOverride is only for when the library is using the `dynlib` pragma
11:33:17FromDiscord<Yardanico> for loading dynamic libraries
11:33:25arkanoidwhy nimpy went the non-nim way?
11:34:00FromDiscord<Yardanico> eh, it's not a "non-nim" way, and checking nimpy source code it seems to do that because python has a lot of versions, y'know :)
11:36:33arkanoidYeah I see it uses loadLib directly https://nim-lang.org/docs/dynlib.html#loadLib
11:37:30FromDiscord<Yardanico> if you check py_lib.nim you can see it has some checks for different versions that have different symbols or don't have some of them at all
11:37:57FromDiscord<Yardanico> i think it shouldn't too hard to modify nimpy for a static compilation, but you'll have to hardcode it to the python version you're using
11:38:10FromDiscord<Yardanico> also, why not just ship libpython with your app?
11:38:50arkanoidyou mean ship the dll/so with my nim executable?
11:38:54FromDiscord<Yardanico> yes
11:38:59FromDiscord<Yardanico> if you want a "single file binary" on linux, you can just use AppImage for example
11:39:17FromDiscord<Yardanico> and on windows you usually create installers, or in the worst case you can use tools like Enigma VirtualBox that pack whole folders into a single exe
11:39:31FromDiscord<Yardanico> and honestly python is almost universally available on linux distros
11:39:40FromDiscord<Yardanico> the version might differ though
11:39:43arkanoidwell for windows should be possible as exec folder is in dyn loader search path, but that's not true for linux
11:40:10FromDiscord<Yardanico> but you can just use https://github.com/yglukhov/nimpy/blob/master/nimpy/py_lib.nim#L471
11:41:16arkanoidcool!
11:42:20FromDiscord<Yardanico> `pyInitLibPath(getAppDir() / "libpython3.8.so")` or something like that
11:42:29FromDiscord<Yardanico> assuming you did `import std/os` for the `/`
11:42:51FromDiscord<evoalg> In reply to @Yardanico "<@!218712890780155915> i guess you": Quick noob question about that: in general for nim, what's the advantage of using case/of's instead of if/elif's?
11:43:21FromDiscord<Yardanico> all case statements must be exhaustive, meaning that you need to always handle all possible values (or _explicitly_ not handle them)
11:43:41FromDiscord<evoalg> that's a good thing?
11:43:44FromDiscord<Yardanico> yes?
11:43:53FromDiscord<Yardanico> you're not going to miss some value from your enum for example
11:44:01FromDiscord<Yardanico> see https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement for a more detailed explanation
11:44:12FromDiscord<evoalg> ah thank you
11:45:35FromDiscord<Yardanico> also it can be faster than if/elif in some cases, e.g. if you're doing some parser that consumes chars so you can use char sets
11:45:44FromDiscord<Yardanico> (second case example in that link)
11:47:30*Vladar joined #nim
11:51:47FromDiscord<evoalg> Thank you! ... that reminds me, in a proc when I do "if foo: return bar", then for the next line I don't bother with "else" because there's no need - is that bad? I've seen examples of people using "else".
11:53:19FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Cu9
11:53:32FromDiscord<Yardanico> it's not "bad" but depending on the code it can lead to unexpected behaviour
11:53:40FromDiscord<Yardanico> (not "undefined" but unexpected :P)
11:54:46FromDiscord<evoalg> can the next line be: return "goodbye" ... without else ... I know it can, but is it "ok"?
11:55:31FromDiscord<evoalg> I mean I know it works, but are there good reasons to use "else" where it's not needed here?
11:56:57FromDiscord<Rika> It’s okay
11:57:22FromDiscord<evoalg> Thank you!
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:09:50FromDiscord<Arend | ᛗᛟᚢᚱᛁᛖᛊ> I used `setSockOpt(OptReuseAddr, true)` in my code but every time I boot up the server it says address is in use since switching to 1.6.0 🤔
12:18:10*elph joined #nim
12:19:31*kayabaNerve quit (Remote host closed the connection)
12:19:56*kayabaNerve joined #nim
13:30:13*rockcavera joined #nim
13:30:13*rockcavera quit (Changing host)
13:30:13*rockcavera joined #nim
14:00:06*pch_ quit (Ping timeout: 260 seconds)
14:03:54*pch joined #nim
14:20:34FromDiscord<tandy> is there a way to cite the nim programming language?
14:21:20FromDiscord<Yardanico> i don't think there's a research paper about nim that you can cite, but i'm not an expert in this area
14:34:36FromDiscord<haxscramper> There should be a rules for citing online resources and other things
14:34:50FromDiscord<tandy> yeah im using that
14:34:50FromDiscord<haxscramper> Of course nim does not have research paper with DOI
14:34:56FromDiscord<tandy> just was wondering if there was a preferd way
14:35:23FromDiscord<haxscramper> I suppose you can look up general rules for citing an open-source projects
14:35:38FromDiscord<haxscramper> https://arxiv.org/abs/2003.03449
14:38:14*pro joined #nim
14:45:43*pro quit (Quit: WeeChat 3.3)
14:46:00*pro joined #nim
14:46:38*pro quit (Client Quit)
14:46:53*pro joined #nim
14:48:55*pro quit (Client Quit)
14:49:13*pro joined #nim
14:50:13*pro quit (Client Quit)
15:17:44arkanoidwhen should I use orc and not only arc?
15:19:04FromDiscord<Yardanico> In reply to @arkanoid "when should I use": well, basically, if you don't care much you can always use orc
15:19:08FromDiscord<Yardanico> orc is arc + cycle collector
15:19:19FromDiscord<Yardanico> so if you are sure that your program does not create cycles, you can just use arc
15:19:28FromDiscord<Yardanico> but if it does actually use cycles and you're using arc, the program will leak memory
15:19:37arkanoidis it when I make a ref object that references itself?
15:19:50FromDiscord<Yardanico> that too
15:20:06FromDiscord<dom96> In reply to @haxscramper "https://arxiv.org/abs/2003.03449": hah, that's my dissertation
15:20:08FromDiscord<Yardanico> or if you have a -> b -> c and c references a
15:21:05*al1ranger joined #nim
15:21:15arkanoidgot it, thanks. I wonder what's the overhead of orc over arc. I'd always use orc even if it would be 2x times slower
15:22:04FromDiscord<Yardanico> the overhead is not big, and it can be 0 if you mark potentially cyclic objects that are not actually cyclic as {.acyclic.}
15:22:18FromDiscord<Yardanico> https://nim-lang.org/blog/2020/12/08/introducing-orc.html
15:27:45arkanoidYardanico: is {.acyclic.} a pragma to help compiler compile faster, or it does actually speedup runtime?
15:27:57FromDiscord<Yardanico> check that article
15:28:15FromDiscord<Yardanico> ORC assumes all acyclic types can never contain cycles so it doesn't check them
15:28:18arkanoidit says "The Nim compiler analyses the involved types and only if it is potentially cyclic, code is produced that calls into the cycle collector"
15:28:28FromDiscord<Yardanico> cycle collector is orc's runtime part
15:28:36FromDiscord<Yardanico> so if you mark an actually cyclic type as acyclic it'll leak memory even with orc
15:34:17*Gustavo6046_ joined #nim
15:34:28*Gustavo6046 quit (Ping timeout: 252 seconds)
15:35:47arkanoidgot it, thanks
15:36:12arkanoidwell, hard realtime party!
15:36:59arkanoidthanks to nim 1.6.0 I've finally enabled arc/orc in my app. I was waiting for a bug to be fixed
15:37:09*Gustavo6046_ is now known as Gustavo6046
15:39:14*al1ranger quit (Quit: Leaving)
15:41:30FromDiscord<gerwy> hmm i know it might sound stupid, but i have module conflict and is there a way to like, seperate those two?↵i could always have one script that uses one module and the other one uses other one (they must be run one after another) but its pretty ugly solution↵I know its a problem because linking error pops up only when i import both of them
15:44:59FromDiscord<gerwy> and its stupid because i just wanted to use nimview with webview...
15:46:18FromDiscord<lbart> mmmhh I have an Enum which start with "1" and case kind of this enum and nim raises this: "Error: low(kind) must be 0 for discriminant"↵Why kind must start at 0?
15:46:48FromDiscord<Yardanico> can you show the enum definition?
15:47:44FromDiscord<Yardanico> and preferably code where you're trying to use the enums too
15:49:18FromDiscord<Yardanico> ah I see now, for an object variant
15:49:18FromDiscord<Yardanico> hmm
15:50:57FromDiscord<lbart> something like this: https://play.nim-lang.org/#ix=3CvO
15:51:18FromDiscord<Yardanico> yeah, I figured, doesn't look like you can fix that, any reason you want this enum to start at 1 ?
15:51:56FromDiscord<Yardanico> In reply to @lbart "something like this: https://play.nim-lang.org/#ix=": see the original issue https://github.com/nim-lang/Nim/issues/3096
15:52:46arkanoidcan {.push warningAsError[Effect]: on.} be applied at whole project and not as module pragma?
15:53:12FromDiscord<Yardanico> yes, just put it in your config
15:53:27FromDiscord<Yardanico> should be just `--warningAsError[Effect]:on`
15:53:36FromDiscord<Yardanico> i mean nim config, file.nim.cfg or file.nims
15:53:54FromDiscord<lbart> In reply to @Yardanico "yeah, I figured, doesn't": It's come from a standard. But I can live with an "unknown = 0"
15:54:36arkanoidconfig.nims(1, 2) Error: invalid command line option: '--warningAsError[Effect]'
15:54:39*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
15:55:01*Gustavo6046 joined #nim
15:55:10FromDiscord<Yardanico> ah, in nims it's a bit different I think
15:55:19FromDiscord<gerwy> okay nevermind, i didn't know about all nimview functions sowwy
15:55:29FromDiscord<Yardanico> In reply to @arkanoid "config.nims(1, 2) Error: invalid": try --warningAsError:"Effect:on"
15:56:11arkanoidok this works!
15:56:12FromDiscord<Yardanico> this is needed because in nimscript (which .nims is) `--` is just a template for `switch`
15:56:13arkanoidthanks
15:56:23FromDiscord<Yardanico> https://nim-lang.org/docs/nimscript.html#--.t%2Cuntyped%2Cuntyped
15:57:52arkanoidand how to make "UnusedImport" an error too?
15:58:20FromDiscord<Yardanico> same as you did Effect ?
15:58:20arkanoidfound
15:58:32arkanoidbut I get errors in system.nim :D
15:58:35arkanoidnot usable
15:59:03FromDiscord<Yardanico> well yeah, and I don't think it's such a big deal really
15:59:04arkanoid.choosenim/toolchains/nim-1.6.0/lib/system.nim(1902, 14) Error: imported and not used: 'coro_detection' [UnusedImport]
15:59:13arkanoidsure, not a problem
15:59:15FromDiscord<Yardanico> nim always has dead code elimination enabled anyway
15:59:37arkanoidyeah but it help keeping readable code clean
16:00:35FromDiscord<Yardanico> sure, but I find warnings given by the compiler enough for me to fix those issues :)
16:00:46FromDiscord<Yardanico> i don't need to make them into errors to be forced to fix them
16:25:31*Gustavo6046 quit (Ping timeout: 245 seconds)
16:25:33*Gustavo6046_ joined #nim
16:28:20*Gustavo6046_ is now known as Gustavo6046
16:32:32*arkurious joined #nim
17:07:17*natrys joined #nim
17:13:17FromDiscord<DMI-1407> is there a list of known bugs ? (most famous ones etc... ?)
17:16:59FromDiscord<Rika> the issues page on github?
17:17:19FromDiscord<DMI-1407> these are not bugs related to the language
17:17:25FromDiscord<DMI-1407> (mostly)
17:17:46FromDiscord<DMI-1407> i mean bugs related to the language only
17:18:59FromDiscord<DMI-1407> e.g. : https://media.discordapp.net/attachments/371759389889003532/901157696462532618/unknown.png
17:22:37FromDiscord<haxscramper> there are tags for the bugs on github
17:22:48FromDiscord<haxscramper> you can filter out things that you need
17:23:29FromDiscord<Rika> there are a lot of labels
17:23:44FromDiscord<haxscramper> And if you are wondering what it means exactly by "has a bug that affects symbols" then your best bet is to git blame someone who wrote this
17:23:48FromDiscord<haxscramper> read their mind
17:24:03FromDiscord<haxscramper> who the hell writes messages like that I wonder
17:24:06FromDiscord<haxscramper> super descriptive
17:24:25FromDiscord<haxscramper> "there might be some bug, but I won't even tell you what it can affect, or how or in what situations"
17:24:30FromDiscord<Rika> should have linked the issue
17:27:33FromDiscord<DMI-1407> ok 😅
17:28:05FromDiscord<haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/901159989324959744/image.png
17:28:05FromDiscord<haxscramper> holy shit
17:28:07FromDiscord<haxscramper> 11 years ago
17:28:09FromDiscord<haxscramper> fucking
17:28:35FromDiscord<haxscramper> unbelievable
17:28:37FromDiscord<DMI-1407> yeah hopefully that bug has been fixed already
17:28:45FromDiscord<dom96> there are older bugs in Firefox
17:28:55FromDiscord<haxscramper> The main question is "what bug"
17:29:19FromDiscord<haxscramper> sure, there are older bugs in multix↵(@dom96)
17:29:38FromDiscord<haxscramper> I bet there are bugs as old as half a century somewher
17:29:40FromDiscord<haxscramper> so what?
17:30:03FromDiscord<Rika> what does bugs in firefox have to do with this
17:30:07FromDiscord<Rika> thats a strange thing to say
17:30:08FromDiscord<DMI-1407> nim started in 2008
17:30:12FromDiscord<haxscramper> I've personally been bitten in the ass by bug report 23 years old, but that does not indicate anything
17:30:29FromDiscord<haxscramper> open-sourced in 2008
17:30:32FromDiscord<haxscramper> started in 2004 IIRC
17:30:36FromDiscord<DMI-1407> oh ok
17:30:51FromDiscord<haxscramper> well, that does not mean to imply anything, just a clarification
17:31:10FromDiscord<dom96> In reply to @Rika "what does bugs in": firefox is an open source project that actually has a lot of donations and they also have old bugs
17:31:19FromDiscord<dom96> how is it strange to draw parallels?
17:31:37FromDiscord<haxscramper> well, it is not strange to draw parallels if they mean anything
17:31:49FromDiscord<haxscramper> yeah, sure eveyone writes buggy code
17:32:04FromDiscord<haxscramper> main point is not an existence of the bug itself, but documentation that says
17:32:13FromDiscord<haxscramper> "it might be broken, idk how, idk why"
17:32:31FromDiscord<DMI-1407> its scary
17:32:51FromDiscord<dom96> In reply to @haxscramper "well, it is not": eh, the parallels I drew do mean something
17:33:14FromDiscord<dom96> it means "every open source project has 11+ year old bugs
17:33:19FromDiscord<dom96> (edit) "bugs" => "bugs""
17:33:21FromDiscord<haxscramper> I mean I don't know when bad things can happen, but you did inform that they are likely to happen somehow
17:34:17FromDiscord<haxscramper> This statement is just as hard to argue against as to find any value that it brings to the conversation. And that was not the point of the original discussion anyway↵(@dom96)
17:34:59FromDiscord<haxscramper> The point is, that for over a decate there has been a line in the docs, that said "things might go wrong" without actually telling anyone
17:35:01FromDiscord<haxscramper> and guess what
17:35:14FromDiscord<haxscramper> nobody has any means to actually find what this means now
17:35:24FromDiscord<DMI-1407> https://media.discordapp.net/attachments/371759389889003532/901161829047337031/unknown.png
17:35:42FromDiscord<haxscramper> unless they go over all bugs there are, find which ones are related to fieldPairs and try to play detective
17:35:52FromDiscord<haxscramper> but anyway, my assumption is that bug has been fixed
17:36:06FromDiscord<haxscramper> because `fieldPairs` worked in just about every situation that I managed to put it through
17:36:14FromDiscord<haxscramper> and I write some very whacky shit
17:36:22FromDiscord<dom96> In reply to @haxscramper "nobody has any means": Clearly you can just ask Araq about it 🙂
17:40:22FromDiscord<haxscramper> Let's see if this yields anything
17:40:33FromDiscord<haxscramper> Btw, 11989 stars on the GH
17:43:07FromDiscord<dom96> socialblade needs a github stars category
17:54:48*xet7 quit (Remote host closed the connection)
17:55:43*xet7 joined #nim
17:56:26*xet7 quit (Remote host closed the connection)
18:12:36FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3CwF
18:12:53FromDiscord<Hamid Bluri> (edit) "https://play.nim-lang.org/#ix=3CwF" => "https://play.nim-lang.org/#ix=3CwG"
18:13:25FromDiscord<Illusive> Hey guys, not sure where to post, but i am thinking of which language to learn. I am coming from Rust lang, and thinking which next one to learn. I picked golang and nim.
18:15:01FromDiscord<tandy> nim \@Illusive)
18:17:31FromDiscord<Illusive> In reply to @tandy "nim \> go (<@790153860130799616>)": nim syntax seems comfy
18:17:47FromDiscord<tandy> it is
18:20:10FromDiscord<reilly> I recently had to write some Go for a project, and while Go's tooling leaves Nim in the dust, writing actual Go code made it very obvious to me just how much more Nim can do than Go.
18:21:15FromDiscord<haxscramper> Curly bracket itself is called pragma annotations↵(@Hamid Bluri)
18:21:56FromDiscord<haxscramper> well, it is not exactly after template, the formatting is not really readable here
18:22:15FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3CwL
18:22:15FromDiscord<haxscramper> it is a pragma block
18:22:29FromDiscord<reilly> @haxscramper I believe they're talking about the `{echo(x)}`
18:23:04FromDiscord<Illusive> In reply to @reilly "I recently had to": hm i guess i will use nim for my needs then
18:23:13FromDiscord<Illusive> any recommendations where to start?
18:23:38FromDiscord<Hamid Bluri> In reply to @reilly "<@!608382355454951435> I believe they're": yes but what's pragma block : D - i can't find it in the manual
18:23:50FromDiscord<Hamid Bluri> now i have 2 questions
18:24:08FromDiscord<haxscramper> `{echo(x)}`?
18:24:09FromDiscord<tandy> the manual↵(@Illusive)
18:24:09FromDiscord<haxscramper> https://nim-lang.org/documentation.html there are quite a few places you can start with
18:24:21FromDiscord<Hamid Bluri> In reply to @haxscramper "`{echo(x)}`?": yes
18:24:27FromDiscord<reilly> In reply to @haxscramper "`{echo(x)}`?": Look closer at what comes right after `template`
18:24:48FromDiscord<haxscramper> Pragma block is a pragma in form of a block ... basically. It is not different from regular pragma, and serves to provide some extra information to the compiler↵(@Hamid Bluri)
18:25:04FromDiscord<haxscramper> Most pragmas are added to procs, types and fields
18:25:08FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3CwM
18:25:11FromDiscord<haxscramper> TWM pattern
18:25:14FromDiscord<haxscramper> TRM
18:25:15FromDiscord<Rika> term rewriting
18:25:37FromDiscord<haxscramper> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros
18:25:38FromDiscord<Rika> basically nim looks for `echo x` and replaces it with `pwnecho(x)`
18:25:40FromDiscord<Rika> pretty much
18:25:46FromDiscord<reilly> In reply to @Illusive "any recommendations where to": I think https://learnxinyminutes.com/docs/nim/ is a good way of quickly familiarizing yourself with basic Nim syntax. Also a good reference in case you forget anything.
18:26:09FromDiscord<Rika> In reply to @reilly "I recently had to": tooling is quicker to remediate than language features
18:28:18FromDiscord<reilly> In reply to @haxscramper "https://nim-lang.org/documentation.html there are q": @Illusive the other links on this page are also definitely good to look at. I'd say start with Learn Nim in 5 Minutes so that you can know what you're looking at, then move on to the official tutorials. Also look at "Nim for..." if you have previous experience with C, Python, or TS/JS.
18:29:11FromDiscord<reilly> Also, the Nim for Beginners video series is relatively new and is still updated. Good if you prefer to listen and watch rather than just read. https://www.youtube.com/playlist?list=PLvwc2YT9MFOlPPexrsY-t7BNTdg2Vsx06
18:29:35FromDiscord<Hamid Bluri> thanks to Hax & Rika
18:29:53FromDiscord<haxscramper> Hamid Bluri\: if you are wondering whether you need to learn TRM patterns, I would say they answer is no
18:30:00FromDiscord<haxscramper> they are hardly ever used
18:30:03FromDiscord<Rika> same here
18:30:11FromDiscord<Hamid Bluri> ok : D
18:30:12FromDiscord<Rika> you need a really really good reason to use them
18:30:25FromDiscord<haxscramper> Like, they look like a nuclear option to solve some problems
18:30:37FromDiscord<haxscramper> Sometimes
18:30:48FromDiscord<haxscramper> But more often that not they are too powerful of a tool
18:30:58FromDiscord<haxscramper> And also have some bugs
18:31:38FromDiscord<Hamid Bluri> +1
18:32:32FromDiscord<Illusive> In reply to @reilly "Also, the Nim for": thanks i will take a look
18:46:07*xet7 joined #nim
18:50:57*yann-kaelig joined #nim
18:52:23FromDiscord<DMI-1407> is there a ide (except vs) that support nim (not just highlighting) ?
18:53:56yann-kaeligHello. I'm new to nim language, I'm not a dev but I'm really interested to start with nim and learn this language. My first question is, is there an nim dedicated IDE, I don't want to start to hack or lost my time in some configuration, I want to start to learn nim with a sane environment. What can you propose ?
18:54:21FromDiscord<IsaacPaul> looks like fieldPairs might have been fixed? https://github.com/nim-lang/Nim/issues/15221
18:55:43FromDiscord<IsaacPaul> In reply to @yann-kaelig "Hello. I'm new to": I'm currently using nim with vscode. Has all the features I need so far (linting, error highlighting, autocomplete), but a little bit confusing to set up.
18:56:58FromDiscord<IsaacPaul> In reply to @DMI-1407 "is there a ide": theres a sublime text plugin. Though I haven't tried it: https://github.com/nim-lang/NimLime
18:58:03FromDiscord<Hamid Bluri> In reply to @yann-kaelig "Hello. I'm new to": vscode + nim extention
18:58:04yann-kaeligHello IsaacPaul. I'm really not a fan of vscode, but if there is a clear tutorial to configure nim without headache, well if there is nothing else, it's ok for me
18:59:14FromDiscord<Hamid Bluri> nim extention for vscode doesn't need configuration
18:59:47yann-kaeligO, so I'm installing vscode, nim extension and I'm ready to go, that right ?
19:00:18FromDiscord<Hamid Bluri> if you've installed nim lang already, yes
19:00:25FromDiscord<Rika> what are you a fan of regards editors?
19:00:27FromDiscord<Rika> if not vscode
19:00:36FromDiscord<Rika> there is for [n]vim, emacs, etc
19:00:40FromDiscord<tandy> lite-xl↵(@Rika)
19:00:49FromDiscord<Hamid Bluri> just make sure download `nim-saem` extenstion
19:05:32yann-kaeligWell, not a fan it's only my point of view, I'm just not interested to lose a month in learning and configuring nvim, emacs or any any other IDE before I can start to work on nim. I'm interested to lean nim, and maybe after that I will see what I need to adjust in my IDE to optimize my work
19:06:06FromDiscord<Rika> i mean
19:06:11FromDiscord<Rika> what ide/editor do you use
19:06:14FromDiscord<haxscramper> open notepad, save `test.nim`
19:06:15FromDiscord<Rika> right now
19:06:24FromDiscord<haxscramper> run `nim c test.nim`
19:06:33FromDiscord<haxscramper> I mean there is 0 config needed to play with the langauge
19:06:56FromDiscord<haxscramper> you can use absolutely any editor to get started, and then if you are interested invest some more time
19:07:16yann-kaeligI know but at least some help is welcome, error highlighting, autocomplete and more
19:07:41FromDiscord<IsaacPaul> In reply to @yann-kaelig "O, so I'm installing": No you need a build task, update some configurations, and if you want to use the debugger then that needs to be setup too. ↵https://gist.github.com/izackp/485a850e485893ce5b808124826f69fc - Example of my current setup
19:07:52FromDiscord<haxscramper> autocomplete is not really good in any IDEs as of now
19:08:08FromDiscord<Yardanico> In reply to @IsaacPaul "No you need a": You don't need a build task though
19:08:20FromDiscord<IsaacPaul> need is a strong word.. lol
19:08:23FromDiscord<Rika> man im just asking what you're using right now to edit code so i can see if there is a nim plugin for it
19:08:31FromDiscord<haxscramper> well, doom emacs with nim layer worked for me out of the box, but in the end it all comes down to the nimsuggest being kind of bad
19:08:34FromDiscord<Yardanico> Nim extension has F6 for quick compile and run for the current Nim file
19:08:45FromDiscord<IsaacPaul> Oh I didn't know that lol
19:14:07FromDiscord<jmgomez> Hey guys Im trying to import a cpp dyn library as a test but the nim compiler is complaining. It does not seem to find it I think. Where is it looking for? Is there any special folder or something?
19:15:44FromDiscord<Yardanico> where is that library located?
19:16:04FromDiscord<Yardanico> And also, does it export a C ABI or a C++ ABI?
19:16:15FromDiscord<haxscramper> "nim compiler is complaining" what is the error message
19:16:58FromDiscord<haxscramper> If you are on linux the easiest way might be to run it via strace to find out where it scans for the files
19:17:00FromDiscord<jmgomez> The error message is https://media.discordapp.net/attachments/371759389889003532/901187399181275186/unknown.png
19:17:05FromDiscord<jmgomez> It's a Cpp
19:17:38FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=
19:17:57FromDiscord<jmgomez> That's how Im making the binding and the lib is located alongside the binary
19:18:19FromDiscord<haxscramper> First, this is not a dynamic library erro message, your program has failed static linking via `ld`
19:18:22FromDiscord<haxscramper> How do you wrap the function?
19:18:41FromDiscord<jmgomez> https://media.discordapp.net/attachments/371759389889003532/901187823288324156/unknown.png
19:19:08FromDiscord<haxscramper> It is not possible to importcpp symbols from the cxx dynamic library this way
19:19:09FromDiscord<haxscramper> if it is exports cxx symbols
19:19:09FromDiscord<haxscramper> cpp\
19:19:10yann-kaeligSo, as I understand there is no nim IDE for nim programming, an All-In-One ready to go that make the learning of nim language fun, pleasant. The opposite of having to configure n softwares for this purpose.
19:19:26FromDiscord<Rika> yes
19:19:30FromDiscord<Rika> we are not big enough for that
19:19:43FromDiscord<haxscramper> we have plugins for the editors
19:19:47FromDiscord<Rika> IIRC neither does rust
19:19:52FromDiscord<haxscramper> we don't have dedicated IDE for that one
19:20:02FromDiscord<jmgomez> Im not following man. How they should be exported them?
19:20:09FromDiscord<jmgomez> Is there any doc or something that I can refer to?
19:20:25FromDiscord<IsaacPaul> https://nim-lang.org/nimedit/ 🤷‍♂️ No idea if it's useful but its on the official website lol
19:20:29FromDiscord<Rika> its old
19:20:36FromDiscord<Rika> prolly abandoned even
19:20:43FromDiscord<IsaacPaul> makes sense
19:20:53nrds<Prestige99> vscode is probably your best bet
19:21:18FromDiscord<IsaacPaul> Honestly if you're new set it up isn't going to take you months.. worst case a day or two.
19:21:33FromDiscord<IsaacPaul> (edit) "set it up" => "setup"
19:22:07FromDiscord<IsaacPaul> It's also needed experience for becoming a capable developer
19:22:10nrds<Prestige99> I think there's a single vscode plugin that does everything you need, saemnim or nimsaem I think
19:22:40FromDiscord<IsaacPaul> average case an hour lol
19:22:53FromDiscord<IsaacPaul> like it should just work, but sometimes these plugins just don't work lol
19:23:07yann-kaeligok, thank you very much, so vscode until I acquire enough competence to write one :)
19:23:09FromDiscord<haxscramper> This code is C or C++? How do you compile it? When C++ code is involved your shared library will usually not contain symbol names like `helloDLl`, instead it would be a mangled representation↵(@jmgomez)
19:23:10FromDiscord<IsaacPaul> maybe nims not in the path or a dependencies crashes
19:23:17FromDiscord<haxscramper> Can you send the code text so I can try this out
19:23:30FromDiscord<IsaacPaul> (edit) "nims" => "nim is"
19:23:47FromDiscord<haxscramper> Or you can run `readelf -sW` for this purpose
19:23:48FromDiscord<IsaacPaul> (edit) "dependencies" => "dependency"
19:24:23FromDiscord<haxscramper> Also, I'm not sure if `importcpp` is even supported for dynamic library imports, since in this case you are dealing only with library symbols
19:24:48FromDiscord<haxscramper> https://forum.nim-lang.org/t/8352#53847 this is a more convoluted example
19:24:59FromDiscord<jmgomez> There is no much code. A basic library with a function in cpp and that binding
19:25:05FromDiscord<haxscramper> `_ZN6Optick4Core16BeginUpdateFrameENS_9FrameType4TypeElm` is how functions in namespaces look in cxx shoo
19:25:15FromDiscord<haxscramper> can you send the code so I can try this out?↵(@jmgomez)
19:25:35FromDiscord<haxscramper> something I can copy-paste to reproduce the issue you are having and maybe try to figure out how to solve it
19:26:41FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3CwZ
19:28:05yann-kaeligMy first project is to port a software written in Bash to nim, it's a software that takes care of configuring, compiling, installing software in a Linux distribution.
19:28:28FromDiscord<jmgomez> My goal is to do a test of a binding for Unreal. They use dynamic libraries all the way down
19:31:16FromDiscord<jmgomez> looking around it seems like you can also include the headers directly and compile the cpps?
19:31:27FromDiscord<haxscramper> yes
19:32:01FromDiscord<geekrelief> In reply to @jmgomez "My goal is to": There's this https://github.com/pragmagic/nimue4 but they dropped it and went with godot.
19:32:02FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Cx1
19:32:34yann-kaeligI would like to offer a graphical interface for this software, I have done a lot of research on this subject, still seams that in most case GUI project written in nim are at the test stage
19:32:47FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Cx2
19:32:50FromDiscord<haxscramper> And then you can wrap it in nim using `importc: "helloDll", dynlib: "ActualDll.so"`
19:33:24FromDiscord<haxscramper> There is no C++ when dynamic libraries are invoved, it all has to be squashed to the regular C-mangled names
19:33:29FromDiscord<jmgomez> In reply to @geekrelief "There's this https://github.com/pragmagic/nimue4 bu": I know. I would like to narrow the scope first and just get nim code executed
19:33:46FromDiscord<haxscramper> Then `extern "C"` on the cxx definition
19:34:12FromDiscord<haxscramper> Other alternative is to just `importcpp: , "header"` this
19:35:00FromDiscord<haxscramper> I don't remember how you are supposed to do `cxx -> dl -> cxx` interface sandwich
19:35:31FromDiscord<jmgomez> I see. So TIL I learn that I wont be going that route. Will give at shot to compile the cpp sources them. Maybe I can make that work more easily
19:35:34FromDiscord<haxscramper> but `importcpp/header` would allow you to do this, since it just generates C code
19:35:34FromDiscord<jmgomez> Thanks for your support
19:35:52FromDiscord<haxscramper> compiling C++ sources is certainly easier
19:36:31FromDiscord<haxscramper> Though UE might require build to be done via Visual Studio or something along those lines, and in this case you might be not so lucky
19:37:20FromDiscord<geekrelief> In reply to @jmgomez "I know. I would": Have you seen deech's Nim Nuggets talk?
19:38:59FromDiscord<jmgomez> In reply to @haxscramper "Though UE might require": I know better their build system than the Cpp traditional one. That's why I wanted to go with dlls.↵@geekrelief nope
19:40:24FromDiscord<geekrelief> In reply to @jmgomez "I know better their": might be helpful for you https://youtu.be/d2VRuZo2pdA?t=1964
19:40:32FromDiscord<Smarc> Whats the common naming convention for procs? camelCase or snake_case?
19:41:12FromDiscord<Rika> camel but it doesnt matter
19:41:14FromDiscord<Rika> you can use either
19:42:02FromDiscord<Smarc> Ye, but I want to go full blown nim style :) great, I like camelCase a lot more actually
19:46:53FromDiscord<zetashift> Handy doc for future Nimisms\: https://nim-lang.org/docs/nep1.html↵(@Smarc)
19:50:46FromDiscord<Illusive> So I would like to have a TOML file where I have some stuff to be set, and then in my main program I would like to parse configuration from this toml file.
19:51:25FromDiscord<Illusive> currently it is hardcoded inside of the code
19:51:30FromDiscord<Illusive> like this
19:51:33FromDiscord<Illusive> sent a code paste, see https://play.nim-lang.org/#ix=3Cx4
19:54:57FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Cx5
19:55:15FromDiscord<Illusive> cool thanks
19:55:18FromDiscord<haxscramper> might not actually compile since I just wrote it without checking
19:57:12FromDiscord<Illusive> In reply to @haxscramper "*might not actually compile": and it will build with these values that are in toml file, and it will not require the toml file it self right?
19:57:27*yann-kaelig left #nim (#nim)
19:57:41FromDiscord<Illusive> when i will have the executable it self
19:58:56FromDiscord<haxscramper> No, it will require the toml file, because that's the purpose of the configuration file.
19:59:02FromDiscord<Illusive> damn
19:59:03FromDiscord<Illusive> sad
19:59:18FromDiscord<haxscramper> well, you can do `const tomlData = staticRead"config.toml"`
19:59:28FromDiscord<haxscramper> Then `let conf = parseToml(tomlData)`
19:59:47FromDiscord<haxscramper> this way you won't need toml file and all values will be stored in the exe
20:00:14FromDiscord<haxscramper> `const tomlData = staticRead...` reads file at compile-time and stores its content in the `tomlData` that can be later read at runtime
20:00:24FromDiscord<Illusive> In reply to @haxscramper "this way you won't": this is what i need
20:00:25FromDiscord<Illusive> lel
20:00:35FromDiscord<Illusive> thanks
20:00:58FromDiscord<Illusive> but what about webhook?
20:00:59FromDiscord<haxscramper> Though I would personally just move common configuration into separate `.nim` file in this case, and just `import` it when needed
20:01:22FromDiscord<haxscramper> `comf["webhook"].getStr()`
20:01:31FromDiscord<Illusive> In reply to @haxscramper "`comf["webhook"].getStr()`": thanks again
20:02:15FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Cx8
20:02:21FromDiscord<haxscramper> I mean it is even simpler than toml and achieves the same results
20:04:20FromDiscord<Illusive> In reply to @haxscramper "I mean it is": maybe but tbh i like toml variant more
20:18:30FromDiscord<Illusive> sooo
20:18:38FromDiscord<Illusive> compiler screams at me with lots of erros
20:18:40FromDiscord<Illusive> (edit) "erros" => "errors"
20:19:10FromDiscord<rainbowasteroids> `slurp` \> `staticRead`
20:19:42FromDiscord<haxscramper> Yes, now imagine someone reading the code
20:20:39FromDiscord<haxscramper> And `cost tomlData = readFile` actually works just as well. I actually use it more often than staticRead
20:21:24FromDiscord<rainbowasteroids> slurp funnie nam
20:28:29FromDiscord<Illusive> soo
20:28:49FromDiscord<Illusive> sent a code paste, see https://play.nim-lang.org/#ix=3Cxe
20:28:55FromDiscord<Illusive> this is how this whole thing looks like
20:29:13FromDiscord<Illusive> (edit) "https://play.nim-lang.org/#ix=3Cxe" => "https://play.nim-lang.org/#ix=3Cxf"
20:29:27FromDiscord<rainbowasteroids> what compiler errors are you getting?
20:29:53FromDiscord<Rika> no, parse the string from tomlData
20:30:47FromDiscord<Illusive> yay
20:30:50FromDiscord<Illusive> got it working
20:30:52FromDiscord<Illusive> i think
20:30:57FromDiscord<Illusive> thanks
20:42:32*aaaaaaaaaa is now known as madprops
20:42:32*madprops quit (Changing host)
20:42:32*madprops joined #nim
20:49:24FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Cxj
20:49:52FromDiscord<Yardanico> Because otherwise you'll be reading the toml config at compile time but parsing it at runtime
21:04:30*Gustavo6046 quit (Read error: Connection reset by peer)
21:07:47*Gustavo6046 joined #nim
21:11:54*Vladar quit (Quit: Leaving)
21:31:26*FromDiscord quit (*.net *.split)
21:31:26*redj quit (*.net *.split)
21:31:26*nisstyre quit (*.net *.split)
21:31:26*systemdsucks quit (*.net *.split)
21:31:56*FromDiscord joined #nim
21:31:57*nisstyre joined #nim
21:32:34*nisstyre quit (Signing in (nisstyre))
21:32:34*nisstyre joined #nim
21:33:37*redj joined #nim
21:36:34*systemdsucks joined #nim
21:49:35*natrys quit (Ping timeout: 264 seconds)
22:03:16FromDiscord<tandy> [leorize](https://matrix.to/#/@leorize:envs.net)\: why does `currentType` return `or[int, string]` shouldnt it just return a single type?
22:04:27FromDiscord<leorize> currentType gets you the type discriminator, which is an enum
22:04:45FromDiscord<leorize> I suppose that name might be confusing \:p
22:04:46FromDiscord<tandy> oh
22:05:05FromDiscord<tandy> yeah lol
22:05:22FromDiscord<tandy> is there a way to infer the current type of a union type field?
22:05:35FromDiscord<tandy> `var v2: type(currentType(v))`
22:05:39FromDiscord<tandy> i was tryna do this
22:06:27FromDiscord<Elegantbeef> It's not statically known so nope
22:06:36FromDiscord<tandy> hmmm
22:06:37FromDiscord<leorize> the variants iterator will get you the variants of the union type
22:06:53FromDiscord<Elegantbeef> Based off runtime information it could be `int` or `string` presently, it'd need to be a union 😀
22:07:10FromDiscord<leorize> which you can use to generate `if x of typeA: x as typeA`, and things like that
22:07:34FromDiscord<tandy> hmmm
22:07:44FromDiscord<tandy> well it would need to work genericaly
22:07:50FromDiscord<tandy> cos jsony
22:08:19FromDiscord<Elegantbeef> Generics are statically known 😀
22:08:54FromDiscord<leorize> you can coerce the types
22:09:21FromDiscord<tandy> how?
22:09:31FromDiscord<tandy> / wdym
22:10:07FromDiscord<leorize> so you will want to generate a dispatch for jsony to dispatch based on what is the current type of the union
22:10:43FromDiscord<leorize> to do this, use the `variants` iterator to get all types contained within union
22:11:37FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=3Cxu
22:12:15FromDiscord<leorize> I gtg now, but I can explain it in more details later
22:12:40FromDiscord<tandy> thanks, il pm you if thats okay
22:12:49FromDiscord<leorize> sure
22:13:12FromDiscord<Yardanico> https://programming-language-benchmarks.vercel.app/ has nim apparently
22:13:17FromDiscord<Yardanico> https://github.com/hanabi1224/Programming-Language-Benchmarks
22:13:41FromDiscord<Yardanico> although I think that doing benchmarks on the CI is kind of unreliable
23:31:21FromDiscord<Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3CxC
23:31:59FromDiscord<Elegantbeef> I'd say use saem's extension
23:33:14FromDiscord<Gumber> thanks - will give that a go
23:34:21FromDiscord<Gumber> yay! thanks! formatting works 😄
23:34:45FromDiscord<Elegantbeef> I did nothing! 😛
23:35:10*Gustavo6046 quit (Ping timeout: 252 seconds)
23:36:24*Gustavo6046 joined #nim
23:39:38FromDiscord<Elegantbeef> A lot of stuff will probably work better i believe