<< 31-10-2023 >>

00:02:46arkanoidjuancarlospaco: if I try to use @if in my config.nims, I get "Error: expression expected, but found 'keyword if'"
00:04:00arkanoidoh, wait, that is a nim.cfg file, not a config.nims
00:04:49arkanoidthis nimble vs nims vs cfg is a mess
00:05:59*deadmarshal_ joined #nim
00:07:10arkanoidwhat is the equivalent of "@if danger: .. @end" in .nims ?
00:32:11FromDiscord<Yardanico> when defined should work?
00:32:16FromDiscord<Yardanico> `when defined(danger)` etc
00:40:22arkanoidactually not
00:40:48arkanoidI mean, not if "switch(debug)" is defined in same file, above it
00:41:01arkanoidmaybe it works if "nim c -d:debug
01:04:38FromDiscord<takemichihanagaki3129> Hi guys, what should I do in this case?↵Is there a way to pass variables to `config.nims` from another nimScript file? I mean, I have `tasks.nims` that do a lot of things on my project, but all my compile flags are into `config.nims`.↵↵Let's say that `tasks` can accept `./task.nims build --release` and `./task.nims build --debug`, how can I tell to `config.nims` that I want the `debug` configuration, for instance?
01:38:20*lumo_e quit (Quit: Quit)
01:58:06*edr quit (Quit: Leaving)
02:08:16*krux02__ quit (Remote host closed the connection)
02:12:31NimEventerNew thread by Niminem: Why is JS backend not compiling, see https://forum.nim-lang.org/t/10582
02:35:03FromDiscord<Elegantbeef> config.nims is likely loaded first so it's probably best to just have a `release.flags` file you load @takemichihanagaki3129
02:37:07FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "config.nims is likely loaded": Sure! Ty for the explanation.
02:58:32*derpydoo quit (Quit: derpydoo)
05:10:15NimEventerNew Nimble package! arrayutils - map/mapIt for arrays, see https://github.com/choltreppe/arrayutils
05:19:42*rockcavera quit (Remote host closed the connection)
06:18:39*advesperacit joined #nim
06:53:52FromDiscord<griffith1deadly> i love nim macros :nim1:
06:53:53FromDiscord<OdoItal> How expected is it that I get about 27% faster code using `uint` instead of `int` everywhere for some performance-critical (but otherwise esoteric) code?
06:57:45FromDiscord<Elegantbeef> Expected
06:57:53FromDiscord<Elegantbeef> Nim has range checking on `int`
07:03:22FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#pragmas-compilation-option-pragmas will help you if you want to fix your hotpath
07:03:30FromDiscord<Elegantbeef> Whilst not making your entire code unsafe
07:08:53FromDiscord<OdoItal> Interesting; using `{.checks: off, optimization: speed.}` made the code 9% faster than using `int` on its own, but still slower than `uint`
07:09:18FromDiscord<Chronos [She/Her]> How about with `-d:danger`?
07:09:46FromDiscord<Chronos [She/Her]> Though it also disables bounds checking for arrays and such too
07:11:56FromDiscord<OdoItal> Negligible difference with `-d:danger`\: funny enough, including `{.checks: off, optimization: speed.}` while using `uint` actually slows it down by about 10%
07:12:05FromDiscord<OdoItal> I was going to push this code in a second anyway
07:15:01FromDiscord<demotomohiro> Nim discourage using uint: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#language-design-why-are-unsigned-types-discouragedqmark
07:16:19FromDiscord<Chronos [She/Her]> Hm
07:18:07FromDiscord<OdoItal> sent a code paste, see https://play.nim-lang.org/#ix=4KpV
07:18:45FromDiscord<OdoItal> It's a pretty tiny file, just ctrl-f replace `uint` with `int` and the uint literals with normal int literals
07:20:02FromDiscord<nnsee> In reply to @demotomohiro "Nim discourage using uint:": only because using it disables over/underflow checks
07:20:05FromDiscord<nnsee> which is kind of intended here
07:20:29FromDiscord<OdoItal> sent a code paste, see https://play.nim-lang.org/#ix=4KpX
07:20:48FromDiscord<Chronos [She/Her]> Is the repo private?
07:21:05FromDiscord<nnsee> they posted a link
07:21:14FromDiscord<nnsee> https://github.com/PaarthShah/happy_number_generator/blob/master/Nim/sum_of_squares.nim
07:21:16FromDiscord<Chronos [She/Her]> Yeah, opened it but not working
07:21:24FromDiscord<nnsee> it got mangled because of the newline
07:21:25FromDiscord<Chronos [She/Her]> 404
07:21:34FromDiscord<OdoItal> Oh oops, must've been private
07:21:35FromDiscord<Chronos [She/Her]> Yeah that link is still an issue
07:21:36FromDiscord<nnsee> oh wait
07:21:40FromDiscord<Chronos [She/Her]> Lol
07:21:40FromDiscord<nnsee> yeah it's still private lol
07:21:41FromDiscord<nnsee> my bad
07:21:46FromDiscord<Chronos [She/Her]> No worries haha
07:21:49FromDiscord<nnsee> i'm wayyyy too tired today
07:22:01FromDiscord<Chronos [She/Her]> Relatable but that's me everyday :P
07:22:05FromDiscord<OdoItal> Okay it's public now \:^)
07:29:28FromDiscord<OdoItal> (Btw when I say this is "performance critical"\: this is basically just me dogfooding my own interview problem rosetta-code style)
07:31:03FromDiscord<OdoItal> So if I can't explain why the `uint` is faster then it'll only be minorly embarrassing for me
07:32:38FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Kq2
07:34:35*PMunch joined #nim
07:37:30FromDiscord<demotomohiro> If you really want to know why uint is faster than int, reading generated C code or assembly code would help.↵You can use:↵https://godbolt.org/↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#nim-compiler-how-to-produce-assembler-codeqmark
07:50:06FromDiscord<OdoItal> Yeah, that'd be the next step for when I'm awake \:^)↵(@demotomohiro)
07:51:10FromDiscord<megabytesofrem> alright cursed question incoming
07:51:40FromDiscord<megabytesofrem> since Nim compiles to C, could I write some shitty FFI thing to interop with DevKitPro and target the 3DS so I dont have to use C for my homebrew
07:52:02Amun-Rasure
07:52:34FromDiscord<megabytesofrem> oh god
07:52:47FromDiscord<megabytesofrem> is it bad that im tempted to do it lol
07:52:52PMunchSomeone even wrote a Gameboy game in Nim :P
07:52:53FromDiscord<megabytesofrem> C is kind of a nightmare
07:53:07PMunchhttps://www.goodboygalaxy.com/
07:53:17FromDiscord<megabytesofrem> ok this is dope
07:53:24PMunchOh, that apparently runs on the 3DS as well :)
07:56:53PMunchI believe this is how they do it: https://github.com/exelotl/natu
07:57:54PMunchAnd here's a presentation of it for NimConf 2020 https://www.youtube.com/watch?v=sZUM7MhWr88
08:04:08PMunchThere's no way to build an enum in a block, right?
08:04:30FromDiscord<Elegantbeef> What does that mean?
08:05:46PMunchWell I had an idea for something like a tagged or labeled exception. Basically you have one try/except block, but you can label statements or sections in your try block. Then in the exception block you can change what you do based on the label
08:06:00PMunchCurrently I'm just using strings, but using enums would be even cooler
08:06:29PMunchBut that requires me to write out the enum first..
08:06:35FromDiscord<Elegantbeef> Nim actually might have what you want in a odd undocumented api
08:06:46PMunchOh really?
08:07:12FromDiscord<Elegantbeef> I've got to find it but araq mentioned it once somewhere on the forum
08:07:37FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/8963#58594
08:07:49FromDiscord<Elegantbeef> Though this is a state machine so never mind
08:09:04PMunchHuh, that's cool though
08:09:13PMunchBut yeah, not quite what I had in mind..
08:12:32PMunchHaha, welp, managed to instantly break that feature :P
08:13:07PMunchTo be fair I didn't expect this to work: https://play.nim-lang.org/#ix=4Kq9
08:14:00FromDiscord<Elegantbeef> Yea it's not even documented 😄
08:14:17FromDiscord<Elegantbeef> Assignment is after all destructured into a `goto label`
08:14:48PMunchYeah, I was just curious to see if it could somehow manage to jump out of a procedure without returning
08:15:17FromDiscord<Elegantbeef> Is that even possible in C
08:15:22FromDiscord<Elegantbeef> Arent labels scoped
08:15:33PMunchYes they are
08:15:39PMunchBut I think there's a way to do it
08:16:00FromDiscord<Elegantbeef> It's theoretically possible assuming you of course stack scan for a label put there
08:16:25PMunchWell sure :P
08:16:27FromDiscord<Elegantbeef> Storing the label location in an integer then just jumping there
08:16:43PMunchI thought there was some way to do it "correctly" but it appears I was wrong
08:16:56FromDiscord<Elegantbeef> Anywho you wanted like `except T as E and state == Bleh`?
08:17:13PMunchOh I didn't imagine it anything that fancy
08:19:57PMunchCurrently I'm playing with it like this: http://ix.io/4Kqb or like this: http://ix.io/4Kqc
08:21:20FromDiscord<Elegantbeef> I have a possibly better idea, give me a second to see if it explodes
08:22:04PMunchUnfortunately Nim just isn't flexible enough to allow me to create my own `try` which introduces a local label variable while reusing the same except blocks..
08:25:33FromDiscord<Elegantbeef> Oh shit it works!
08:25:40FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4Kqe
08:25:49PMunchI would've liked to be able to do something like this: http://ix.io/4Kqf
08:26:33FromDiscord<Elegantbeef> You can do that though
08:26:34PMunchOoh, that's pretty nifty
08:26:44PMunchCan do what?
08:27:00FromDiscord<Elegantbeef> Not being able to use except is a bug I guess
08:27:06FromDiscord<Elegantbeef> You should be able to use it there
08:27:24FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4Kqg does compile
08:27:26PMunchWhat do you mean, I could have excepts to by custom macro/template?
08:27:30FromDiscord<Elegantbeef> Paint the rest of the owl
08:27:37FromDiscord<Elegantbeef> Yes
08:27:45PMunchWait what?!
08:27:48FromDiscord<Phil> That looks like a different version of "try multiple excepts" to me, I don't quite see the difference
08:27:51FromDiscord<Elegantbeef> `finally` `else` `elif` `except` all can be consumed by macros
08:27:51PMunchSince when was this allowed?
08:28:03FromDiscord<Elegantbeef> 1.4... maybe 1.6
08:28:13FromDiscord<Elegantbeef> Some bugs with it on things like `finally` and the like
08:28:28PMunchPhil, well the idea here is to be able to distinguish where in my try block an error occurred without having to introduce a new scope
08:29:45PMunchNext thing you'll come and tell me that auto-building enums have been a feature all this time as well :P
08:29:55FromDiscord<Elegantbeef> But yea this is a very simple but nice feature that Nim suddenly got I use it here for some interesting shortening https://github.com/beef331/nimtrest/blob/master/staticcases.nim#L59-L99
08:30:02FromDiscord<Phil> Time for a new article PMunch 😛
08:30:10PMunchI'm actually considering it
08:30:30PMunchAll this started because I read about a "better" way of handling exceptions in Javascript by just boxing them in a Maybe type
08:30:35FromDiscord<Elegantbeef> "So I bitched in the realtime chat and some jackass just open my world"
08:30:58PMunchI think his boxed sample for what I'm trying to do was just as long as the initial code he had for it :P
08:31:27FromDiscord<Elegantbeef> All this talk of boxing makes me want to eat ear
08:31:35PMunchOooh, `staticCase`!
08:32:32FromDiscord<Elegantbeef> Yea it's surprisingly flexible
08:32:41FromDiscord<Elegantbeef> The sad part is though the branches cannot be typed for obvious reasons
08:34:09PMunchHmm, inconvenient but not a complete game-breaker
08:34:38FromDiscord<Elegantbeef> Oh yea, you can still implement an entire error handler inside of them
08:34:49FromDiscord<Elegantbeef> One could implement their own exception handling code if they wanted to
08:34:50PMunchHmm, so a mix between static strings and staticCase is almost like an automatic enum, right?
08:35:07FromDiscord<Elegantbeef> Sorta I guess
08:35:30FromDiscord<Elegantbeef> Do not get the assurance of having a value
08:35:38FromDiscord<Elegantbeef> So still have typos
08:35:41PMunchI have an idea
08:36:38FromDiscord<Elegantbeef> Given you're the one running the show you can always just check whenever someone uses `label` add that to a list, then emit an error if the except handles an error that's not in that array
08:37:04FromDiscord<Elegantbeef> Atleast I imagine you're doing something like `except ValueError("label") as e`
08:37:56PMunchOh right, I have control over the branches as well
08:38:05FromDiscord<Elegantbeef> Yep
08:38:18PMunchLike the `except Y as e` part
08:38:19PMunchHmm
08:38:28PMunchThen I could do this even easier than what I was thinking
08:38:43FromDiscord<Elegantbeef> Yep `except "label"` also works
08:39:02FromDiscord<Elegantbeef> You can make your own ergonomic error handler that looks nearly identical to the built in
08:39:07FromDiscord<Elegantbeef> This is not possible in many languages
08:39:08PMunchI had the idea of using a custom numeric literal whose macro added the string to a list
08:39:12FromDiscord<Elegantbeef> Gotta love it
08:40:09FromDiscord<Elegantbeef> Right when you use `label` you just set the active label to the integer in that list
08:40:40FromDiscord<Elegantbeef> Then inside the error handler you can just do `proc label(): lent string = names[selectedLabel]`
08:42:12FromDiscord<Elegantbeef> So much fun stuff to do
08:43:30PMunchAh damn it, custom numeric literals only works for, well, numerals
08:44:02PMunchWell, that means my more generic solution won't work
08:44:22FromDiscord<Elegantbeef> `proc label(s: static string) = addToCurrentList(s)`
08:44:27FromDiscord<Elegantbeef> `label"hello"`
08:44:49FromDiscord<Elegantbeef> `proc label(s: static string) {.compileTime.} = addToCurrentList(s)`
08:45:05FromDiscord<Chronos [She/Her]> Hm, I'm wondering if my library shouldn't support bytes-specific operations for the JS backend
08:51:18FromDiscord<Elegantbeef> Do those lowly webdevs need it?
08:55:06FromDiscord<Chronos [She/Her]> I wouldn't imagine so
08:55:31FromDiscord<Chronos [She/Her]> Unless they're on NodeJS backend stuff but at that point you're better off using a native ULID library since those exist
08:55:49FromDiscord<Chronos [She/Her]> I'm making my lib work for JS so I can use it if I really want to
08:55:56FromDiscord<Chronos [She/Her]> Also I'm extremely bored rn :p
09:04:11FromDiscord<Chronos [She/Her]> Ah, is it `&&` for bitwise operations (in general) that I use for masking?
09:05:37FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kql
09:05:51FromDiscord<Chronos [She/Her]> Yep it is, epic
09:06:00FromDiscord<Yardanico> In reply to @chronos.vitaqua "Ah, is it `&&`": you mean `&`
09:06:16FromDiscord<Yardanico> in Nim `and` just means both `&` and `&&` depending on the context (integers/floats vs bools)
09:06:29FromDiscord<Yardanico> oh right single & is not common in C
09:06:33FromDiscord<Yardanico> (edit) "not common" => "different"
09:06:55FromDiscord<Yardanico> wait no it is, although I guess it'll behave the same <https://learn.microsoft.com/en-us/cpp/cpp/bitwise-and-operator-amp?view=msvc-170>
09:07:41FromDiscord<System64 ~ Flandre Scarlet> Is there a cross-platform file picker for Nim?
09:07:57FromDiscord<Chronos [She/Her]> In reply to @yardanico "you mean `&`": Ah yeah, my bad aha
09:09:26FromDiscord<Yardanico> In reply to @sys64 "Is there a cross-platform": maybe you can just use a part of nigui for that?
09:10:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @yardanico "maybe you can just": Yeah↵Or I can use an ImGUI plugin but I need to make C++ and C bindings for that
09:10:18FromDiscord<Yardanico> but an imgui file picker won't be native
09:10:35FromDiscord<Yardanico> if you don't want native, then it's much easier to make, no? you can just connect the std/os procs to whatever GUI you have
09:11:17FromDiscord<System64 ~ Flandre Scarlet> I think it would be better if it's native
09:11:46FromDiscord<zkv> hi , Nim memory model link from nim-lang.org/documentation.html is broken
09:12:38FromDiscord<System64 ~ Flandre Scarlet> Wait, MacOS still not supported?
09:12:39FromDiscord<Yardanico> hmm, that's an unofficial blog post, I wonder if zevv just changed the url scheme
09:12:55FromDiscord<Yardanico> In reply to @sys64 "Wait, MacOS still not": well, nigui isn't that active in development so no one contributed native cocoa yet
09:13:58FromDiscord<Yardanico> In reply to @zkv "hi *, Nim memory": you can check it from the web archive, but I'll open an issue in website repo
09:14:03FromDiscord<Yardanico> or you can if you want to
09:14:53FromDiscord<zkv> @Yardanico thank you, i will open it
09:15:02FromDiscord<Yardanico> <https://github.com/nim-lang/website>
09:17:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @yardanico "well, nigui isn't that": Ah alright↵I can use ImGUI dialogs, but it would be quite painful to do I think
09:18:00FromDiscord<Yardanico> can't you just use something like https://github.com/samhocevar/portable-file-dialogs ?
09:18:06FromDiscord<Yardanico> i think there was even a binding to this or a similar lib
09:18:20FromDiscord<Yardanico> ah <https://github.com/nim-lang/dialogs> is win32 + gtk
09:18:36FromDiscord<Yardanico> also <https://github.com/Tormund/os_files> seems to support x11/osx/windows
09:19:15FromDiscord<Elegantbeef> Aswell
09:19:16FromDiscord<Elegantbeef> https://nimble.directory/pkg/tinydialogs
09:20:03FromDiscord<zkv> @Yardanico https://github.com/nim-lang/website/issues/382
09:20:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://nimble.directory/pkg/tinydialogs": Tinydialogs is Windows only I think ?
09:20:46FromDiscord<Elegantbeef> Nope
09:21:01FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1168842049202688020/image.png?ex=65533bfc&is=6540c6fc&hm=7b4cd7ec5502ab6c11f6ee0165ae93237a53cd01f3111bb2cb05d3ce69104650&
09:21:21FromDiscord<Yardanico> <https://sourceforge.net/projects/tinyfiledialogs/> the description is in a weird format but it sums up features well enough
09:22:29FromDiscord<System64 ~ Flandre Scarlet> I think it's what I use
09:23:58FromDiscord<System64 ~ Flandre Scarlet> I also tried to compile my NIMGL app to Emscripten, doesn't work
09:24:09FromDiscord<Yardanico> hm?
09:24:15FromDiscord<Yardanico> but it doesn't claim to support emscripten
09:25:11FromDiscord<System64 ~ Flandre Scarlet> Some people managed to run Dear ImGUI apps on Emscripten
09:25:26FromDiscord<Yardanico> yes I know that it's not hard, but weren't we talking about file pickers?
09:25:32FromDiscord<Yardanico> for emscripten you'd have to write it specifically for emscripten
09:25:42FromDiscord<Yardanico> e.g. from a quick google search <https://github.com/Armchair-Software/emscripten-browser-file>
09:25:58FromDiscord<Yardanico> because emscripten doesn't wrap those GUI apis like for file pickers, you have to interface with JS
09:26:43FromDiscord<System64 ~ Flandre Scarlet> Since Tiny Dialogs is cross platform, it solives my problem
09:26:56FromDiscord<Yardanico> yes but I don't think it'll work in emscripten :P
09:27:25FromDiscord<System64 ~ Flandre Scarlet> I was talking about Dear ImGUI for Emscripten
09:27:47FromDiscord<Chronos [She/Her]> What's the alternative to `os.sleep` in the JS backend?
09:28:10FromDiscord<Yardanico> In reply to @chronos.vitaqua "What's the alternative to": you'd have to use the JS alternative, e.g. <https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep>
09:28:15FromDiscord<Yardanico> and what do you want it for?
09:28:38FromDiscord<Yardanico> since JS is usually all asynchronous, code is written differently
09:29:34FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kqo
09:29:40FromDiscord<Chronos [She/Her]> In reply to @yardanico "since JS is usually": Fair
09:29:47FromDiscord<Yardanico> but what does that do?
09:30:16FromDiscord<Yardanico> oh, wait until that identifier, I mean, for JS you'd have to make a callback version
09:30:44FromDiscord<Yardanico> but generally the use-case seems niche enough to have in an ulid library
09:30:48FromDiscord<Chronos [She/Her]> Ah alright then
09:30:55FromDiscord<Chronos [She/Her]> Yeah fair
09:31:22FromDiscord<Chronos [She/Her]> I may just make it throw an error tbf, since that's more compliant with the spec
09:31:32FromDiscord<Yardanico> also apparently there's <https://github.com/adelq/ulid>, but it's okay if you want to make your own
09:32:01FromDiscord<Yardanico> although now nim has sysrand, so pkg/random here isn't needed
09:33:19FromDiscord<Chronos [She/Her]> My ULID library is already published, just want to make it work for the JS backend now out of boredom aha
09:33:34FromDiscord<Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID
09:34:02PMunchWohoo, it works: https://play.nim-lang.org/#ix=4Kqq
09:34:03FromDiscord<Yardanico> quite a big more lines :P
09:34:05FromDiscord<Yardanico> (edit) "big" => "bit"
09:34:05PMunchElegantbeef *
09:34:20FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kqr
09:34:28FromDiscord<Chronos [She/Her]> I also didn't realise that `sysrand` worked on the JS backend, which is what this code would fix too, but `nint128` doesn't support the JS backend so
09:34:54FromDiscord<Chronos [She/Her]> In reply to @yardanico "quite a bit more": Mine is ✨ spec compliant ✨
09:35:06FromDiscord<Chronos [She/Her]> Well, nearly
09:35:21PMunchCould introduce some sugar for the actual labeling, and some sugar for pattern matching the except branches on labels. But the core system works
09:35:31PMunchThey are even built as enums ;)
09:35:58FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4Kqs
09:36:05PMunchOh, and the logic in `label` should probably check if the label hasn't been encountered before :P
09:37:00FromDiscord<Yardanico> In reply to @chronos.vitaqua "Mine is ✨ spec": hm, it looks simple enough, i'm just curious where adelq isn't spec compatible?
09:37:05FromDiscord<Yardanico> seems like it has a benchmark too, interesting
09:38:04PMunchHuh cool, you can even get the raised label in the `finally` block
09:40:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @yardanico "just speculating, but it": wdym?
09:40:27FromDiscord<Yardanico> In reply to @sys64 "wdym?": tags
09:40:28FromDiscord<Yardanico> release tags
09:40:39FromDiscord<Yardanico> if a repo has release tags, nimble will prefer to use them instead of cloning the latest commit
09:41:12FromDiscord<Yardanico> ah nvm lol
09:41:22FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4Kqt
09:41:27FromDiscord<Yardanico> it's `install` not `intall`
09:41:42FromDiscord<Yardanico> the error is because nimble tries to find a .nimble file to try to find a task named `intall`
09:41:53FromDiscord<System64 ~ Flandre Scarlet> OOF
09:41:59FromDiscord<Chronos [She/Her]> https://github.com/ulid/spec this is the spec here aha↵↵It's compatible but doesn't handle stuff like incrementing the random value if a ULID is generated in the same millisecond, as well the fact it doesn't support the binary format
09:42:27FromDiscord<Chronos [She/Her]> It would've worked obviously but I wanted a project to do so
09:47:52PMunchI like the syntax to label a block, but I think some better inline syntax for labeling simple statements would be nice
10:23:15FromDiscord<jessatehcrow> sent a long message, see http://ix.io/4Kqy
10:29:23PMunchYou will probably be able to just use Futhark to wrap liblo automatically
10:29:51PMunchGets you the C-like interface though, so not as nice as a fully developed wrapper
10:31:34FromDiscord<jessatehcrow> i see..
11:11:08FromDiscord<kryp7on> I have problems when installing Nim.↵↵I installed it through `curl` command. I have macOS. In the end, I did `export` command and I tried typing `nim` in CLI and it worked. I closed terminal, opened VS Code, installed Nim extension but now I cant run `nim` command in VS Code nor in macOS's CLI.
11:11:21FromDiscord<kryp7on> it says "nim: command not found
11:11:48PMunchThat's because your PATH isn't set up correctly
11:13:01FromDiscord<kryp7on> It actually says: `zsh: command not found: nim`
11:13:05PMunchAnd which `export` command?
11:13:13FromDiscord<kryp7on> and command was `export PATH=etc.`
11:13:44PMunchYeah, that's not a command you're supposed to execute, that's something you should put in your shell config
11:14:00PMunch.zshrc if it's the same as on Linux
11:14:04FromDiscord<kryp7on> yea
11:14:05FromDiscord<kryp7on> it says
11:14:08FromDiscord<kryp7on> `export ZSH="$HOME/.oh-my-zsh`
11:14:22FromDiscord<kryp7on> now I am not sure how to put Nim into ZSH path 😅
11:14:22PMunchThat's something else
11:14:40PMunchYou shouldn't put it in your ZSH path, you should put it in the PATH variable
11:14:47PMunchThose are two different variables
11:15:37FromDiscord<kryp7on> I did it firstly, put it into PATH variable
11:15:45FromDiscord<kryp7on> but my CLI is iTerm which is using ZSH
11:16:39PMunchiTerm is your terminal emulator, ZSH is your shell
11:16:47FromDiscord<kryp7on> thats right
11:17:02PMunchBut when you ran the `export` command in your shell you only set the PATH variable for that shell
11:17:20FromDiscord<kryp7on> that means it should work
11:17:24FromDiscord<kryp7on> but it doesnt for some reason
11:17:26PMunchYou need to put that line in your .zshrc file so that the PATH get set every time you start ZSH
11:18:04FromDiscord<kryp7on> Ill try that. I just need to google what was that path for Nim, bcs I closed shell and lost line
11:18:05PMunchYou set it correctly in the shell where you installed it, but then you closed that shell. Try to run `echo $PATH` in a new shell and see
11:18:06FromDiscord<kryp7on> bruh
11:18:44FromDiscord<kryp7on> it disappeared from $PATH
11:18:50FromDiscord<kryp7on> I ran it when I installed it, it was there
11:19:11FromDiscord<kryp7on> do you remember whats the line for PATH setting for Nim?
11:19:13PMunchDo you want me to tell you a third time why that happened?
11:19:49PMunchProbably it's `export PATH=$PATH:<wherever Nim got installed>`
11:19:59FromDiscord<kryp7on> oh yea
11:20:05FromDiscord<kryp7on> it was temporary written in PATH
11:20:08PMunchYou probably also want to add `.nimble/bin`
11:20:09FromDiscord<nnsee> In reply to @kryp7on "it disappeared from $PATH": modifications to environment variables only last for the session where they were modified
11:20:15FromDiscord<kryp7on> when I closed CLI, it deleted
11:20:20PMunchYup
11:21:02PMunch`.nimble/bin` contains all the binaries you can install via Nimble, including helper tools for certain libraries
11:21:15FromDiscord<nnsee> if you want it to persist, you need to add the `export PATH="$PATH:[nimble bin directory]"` line to your `.zshrc` line so it gets executed every time you run zsh
11:25:40FromDiscord<kryp7on> In reply to @nnsee "if you want it": @pmunch Thanks guys, this worked! :))
11:30:50FromDiscord<ziyu4huang> Hi, is there any nim compile time benchmark compare to C++ or other popular lanaguage such as Rust ?
11:32:31PMunchLike how long stuff takes to compile?
11:40:56NimEventerNew thread by gilarc: Nim Slack Community, see https://forum.nim-lang.org/t/10583
11:41:13FromDiscord<ziyu4huang> yes, it's know that cpp take long time to compile due to language complexit and template, how Nim solve it ?
11:56:56FromDiscord<Chronos [She/Her]> Nim isn't much better with it's compile times for big projects tbh
12:43:10PMunchThe work on incremental compilation will hopefully help though
12:46:43FromDiscord<deech4592> In reply to @chronos.vitaqua "Nim isn't much better": Can you elaborate on the size of the project and the compile times? Unless there is some pathological metaprogramming involved I'm finding it difficult to understand why a language that doesn't have C++'s `include` problem isn't much better.
12:49:22FromDiscord<kryp7on> sent a long message, see http://ix.io/4Kr5
12:49:40*derpydoo joined #nim
12:50:58FromDiscord<nnsee> In reply to @deech4592 "Can you elaborate on": `#include` is pretty primitive compared to Nim's templates and macros. The biggest issue Nim currently has re: compile times, is as PMunch said, no support for incremental compilation
12:52:07PMunchkryp7on, if you want to make sure that you don't change an assignment by accident
12:52:24PMunchOr just to make it clear to the reader that this assignment won't change
12:53:03FromDiscord<nnsee> In reply to @nnsee "`#include` is pretty primitive": Sorry, I'm really tired, I thought you meant `#define` not `#include`
12:53:12FromDiscord<deech4592> In reply to @nnsee "`#include` is pretty primitive": Right, Nim doesn't have the issue C++ a single include can pull in to huge amounts of code. Even without IC it should still be a lot better, I would expect at least an order of magnitude.
12:53:18PMunchUnless you use crazy macros I've found Nim to compile quite fast compared to C++
12:53:45FromDiscord<nnsee> In reply to @deech4592 "Right, Nim doesn't have": in my (anecdotal) experience, you're right
12:54:07FromDiscord<deech4592> (edit) "In reply to @nnsee "`#include` is pretty primitive": Right, Nim doesn't have the ... issuewhere" added "C++" | "C++" => "where"
12:54:11PMunchBut I have heard that it is a concern for some of the larger codebases out there
12:54:34FromDiscord<nnsee> but I also don't really write C++ much at all, so I don't really have a point of reference here (but I spend a lot of time compiling _other people's code_ 😅)
12:55:39FromDiscord<Chronos [She/Her]> In reply to @deech4592 "Can you elaborate on": Look at the compiler for example, it's pretty big and slow to compile because there's no sort of IC, everything needs to be recompiled every time (though as PMunch said, this will hopefully be fixed)
12:56:14FromDiscord<Chronos [She/Her]> In reply to @kryp7on "I understand that `var`": Immutable data at runtime, for example if you have a user's ID as an integer, you don't want to accidentally change it
12:56:59FromDiscord<Chronos [She/Her]> In reply to @PMunch "Unless you use crazy": I can't speak about C++ because I've never used it, really
12:57:07FromDiscord<deech4592> The compiler builds from scratch in 3 mins on my 8-core i7, 16GB RAM machine.
12:57:28FromDiscord<Chronos [She/Her]> Yeah I wouldn't know how C++ compares to Nim
12:57:45FromDiscord<deech4592> `clang` takes 4 hours.
12:58:38FromDiscord<Chronos [She/Her]> That sounds horrible actually
12:59:02FromDiscord<Chronos [She/Her]> I don't know any massively big project, besides the compiler, it could be compared to
12:59:08FromDiscord<nnsee> to be fair, Nim's compile time could be counted as `[nim's own compile time] + [gcc/clang compile time]` :D
13:01:27FromDiscord<deech4592> I suspect the C bits account for about 1/2 that because the `csources` take ~1.5 minutes to compile and link. Sorry for hammering on this but build times are pretty important to me and one of the reasons I use Nim.
13:04:38FromDiscord<kryp7on> In reply to @chronos.vitaqua "Immutable data at runtime,": thank you guys @pmunch
13:05:58FromDiscord<nnsee> fwiw I alleviate a lot of my no-IC pains with ccache
13:06:04*PMunch quit (Quit: Leaving)
13:06:48FromDiscord<kryp7on> I am wondering: did somebody have experience with writing bigger project in Nim and had problems understanding other programmer's code? Becuase Nim's syntax is so flexible, so one maybe dont know every single syntax and instead sticks with only one way>
13:06:51FromDiscord<kryp7on> (edit) "way>" => "way?"
13:11:42*CO2 quit (Quit: WeeChat 4.1.1)
13:12:43FromDiscord<griffith1deadly> In reply to @kryp7on "I am wondering: did": large projects/companies have their own defined code syntax, and it's enforced
13:14:33FromDiscord<griffith1deadly> example https://status-im.github.io/nim-style-guide/
13:46:16*dragsbruh joined #nim
13:46:25dragsbruhhi?
13:50:29FromDiscord<nnsee> hello
13:51:28*PMunch joined #nim
13:53:06dragsbruhI kind of have a problem\
13:53:11dragsbruhwith os module
13:53:23FromDiscord<nnsee> what's your problem?
13:53:56dragsbruhthis is the code:
13:53:56dragsbruhimport os
13:53:57dragsbruhdiscard setCurrentDir(newDir: "/");
13:54:25*dragsbruh quit (Quit: Client closed)
13:54:34*dragsbruh joined #nim
13:54:52dragsbruhcan u help
13:56:07*dragsbruh quit (Client Quit)
13:56:11FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Krq
13:56:38FromDiscord<nnsee> In reply to @dragsbruh "discard setCurrentDir(newDir: "/");": that's not valid syntax
13:56:41FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Krs
13:57:17FromDiscord<nnsee> drop the semicolon at the end of the line, and use an equals sign instead of a colon (or, yeah just `"/"`)
13:58:40FromDiscord<griffith1deadly> also discard work only with functions that has return type (primitives e.x)
13:58:50FromDiscord<griffith1deadly> (edit) "e.x)" => "ex)"
13:58:56FromDiscord<Chronos [She/Her]> That seems like some sus code lol
14:05:53FromDiscord<kryp7on> In reply to @chronos.vitaqua "That seems like some": what is wrong with code? 😄
14:07:08FromDiscord<Chronos [She/Her]> Why would you need to go to the root dir :p
14:07:26FromDiscord<Chronos [She/Her]> Not my place to say anything tho, could be perfectly harmless or red teaming
14:07:44*xet7 quit (Remote host closed the connection)
14:16:18FromDiscord<kryp7on> oh, you mean its ransomware? 😄
14:16:53FromDiscord<kryp7on> whatsoever, I was making ransomware in Rust and was hanging on Rust discrod server and its not unusual for people to question what you are doing certain things haha
14:17:07FromDiscord<kryp7on> even if Im CS student, and in that time I was making PoC ransomware
14:17:26FromDiscord<kryp7on> (edit) "what" => "why"
14:24:29FromDiscord<Chronos [She/Her]> Ah fair
14:25:22FromDiscord<nnsee> In reply to @chronos.vitaqua "Why would you need": maybe they were just using it as an example
14:25:57FromDiscord<nnsee> speaking of which, am i blind, or is there no easy way to print the current working directory in the os module?
14:26:44FromDiscord<nnsee> i was writing an example for them demonstrating the changing of the directory but i couldn't find the cwd proc?
14:27:00FromDiscord<Chronos [She/Her]> Fair
14:27:31FromDiscord<odexine> In reply to @nnsee "i was writing an": https://nim-lang.org/docs/ospaths2.html#getCurrentDir
14:27:33FromDiscord<odexine> moved
14:27:48FromDiscord<Chronos [She/Her]> In reply to @nnsee "speaking of which, am": https://nim-lang.org/docs/ospaths2.html#getCurrentDir
14:27:50FromDiscord<Chronos [She/Her]> Ah before me
14:32:29FromDiscord<nnsee> ah, thanks
14:32:34FromDiscord<nnsee> not sure why google didn't show me that
14:39:17FromDiscord<Chronos [She/Her]> Probably because it moved
14:39:29FromDiscord<Chronos [She/Her]> Typically I find searching the index with phrases works
14:48:28*CO2 joined #nim
15:08:13FromDiscord<nnsee> i tried that, but apparently didn't use the magic phrases
15:08:18FromDiscord<nnsee> (edit) "phrases" => "phrase"
15:16:46PMunchJust in case anyone wants to play around with my weird little exception thing from earlier: https://github.com/PMunch/labeltry
15:22:40FromDiscord<gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KrQ
15:25:39FromDiscord<jviega> Interesting, PMunch. Did you hear back from FOSDEM?
15:28:13FromDiscord<pmunch> In reply to @jviega "Interesting, PMunch. Did": No, no news yet. Their supposed to release the accepted rooms today, but given their track record I wouldn't hold my breath.
15:28:58FromDiscord<jviega> Haha okay! Hopefully it's not an issue. I'm planning on it.
15:32:04FromDiscord<Chronos [She/Her]> In reply to @nnsee "i tried that, but": 'current' got it for me lol
16:01:11NimEventerNew Nimble package! astiife - AST IIFE for nim. Generate code with AST., see https://github.com/xjzh123/astiife
16:03:25FromDiscord<Chronos [She/Her]> Isn't that just macros with extra steps?
16:19:32FromDiscord<Chronos [She/Her]> I wonder if having it so there's a plugin API for clients with WASM executing it, would be an interesting/good idea
16:19:52FromDiscord<Chronos [She/Her]> Not even on the frontend yet, nowhere near, but thinking of applications of it
16:26:31FromDiscord<griffith1deadly> how i can get pointer to closure?
16:44:20*NimBot joined #nim
16:44:38*FromDiscord joined #nim
16:48:18FromDiscord<_gumbercules> In reply to @griffith1deadly "how i can get": can you elaborate here on what you're trying to do?
16:48:34FromDiscord<_gumbercules> because I'm not sure why you would want to do this
16:50:18FromDiscord<griffith1deadly> In reply to @_gumbercules "can you elaborate here": i want to store pointer to closure in some location, and then convert pointer back to closure and call it.↵but I realize this is probably a complicated task
16:52:48FromDiscord<_gumbercules> it's not that it's complicated, it's just that closures capture and access their enclosing scope - otherwise you'd just write a normal function
16:53:41FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4Ks8
16:54:20FromDiscord<_gumbercules> and you can call `foo` simply with `myFooPtr()`
16:55:42FromDiscord<_gumbercules> in Nim closures are called with the `{.closure.}` calling convention - I'm not sure where you're passing this closure around but that might have implications
16:57:28FromDiscord<griffith1deadly> i use pointer only to determine the signature of this closure through an auxiliary object. whether the type is returned from it, whether it accepts arguments. in essence, just convert to pointer and then call it back when needed.
16:58:34FromDiscord<_gumbercules> I mean you can try `cast` but I doubt it will work
17:00:41FromDiscord<griffith1deadly> ahaha, it doesn't work both ways. that's why I thought I'd ask about it. getting pointer to closure is possible via rawProc. but when I convert pointer to {.nimcall.}, it doesn't see the passed parameters. it can't convert directly to {.closure.}
17:03:25FromDiscord<_gumbercules> gotcha - yeah I figured something like that was going to be screwy
17:04:43FromDiscord<_gumbercules> I wasn't aware of / forgot about `rawProc`
17:11:25FromDiscord<System64 ~ Flandre Scarlet> I have some progress for running Dear ImGUI on Emscripten, however, does someone knows why I have this error please? https://media.discordapp.net/attachments/371759389889003532/1168960428508979241/image.png?ex=6553aa3c&is=6541353c&hm=3e777fe8d847fd952f270669843fa467290a133109049cc4542abfbe523752cb&
17:11:39FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Ksh
17:11:55FromDiscord<_gumbercules> In reply to @sys64 "I have some progress": your shader failed to compile...
17:11:58FromDiscord<griffith1deadly> destination - rawProc, environtment - rawEnv
17:12:22FromDiscord<_gumbercules> In reply to @griffith1deadly "destination - rawProc, environtment": yeah, this is sounding more familiar
17:12:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "your shader failed to": Yeah I noticed↵But why it does work with a regular app but not Emscripten?
17:13:22FromDiscord<griffith1deadly> In reply to @sys64 "Yeah I noticed But": because for Emscripten you need shaders for gles3/gles2
17:13:28FromDiscord<griffith1deadly> not default gl
17:14:00*rockcavera joined #nim
17:17:25FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "ahaha, it doesn't work": Why do you need a closure specifically?
17:18:23FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Why do you need": because i can generate it directly to be added to table, and the procedures will still be visible.
17:19:29FromDiscord<_gumbercules> In reply to @griffith1deadly "because i can generate": what are you making, if you don't mind sharing?
17:20:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "because for Emscripten you": Oh alright
17:21:38FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "because i can generate": Ah
17:31:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "because for Emscripten you": And do you know how to use ES3 / 2 with NimGL please?
17:32:23FromDiscord<System64 ~ Flandre Scarlet> or alternatively, do you know a replacement library for OpenGL?
17:37:23FromDiscord<griffith1deadly> sent a long message, see http://ix.io/4Kst
17:37:43FromDiscord<System64 ~ Flandre Scarlet> Oh, I found the version https://media.discordapp.net/attachments/371759389889003532/1168967049087819857/image.png?ex=6553b066&is=65413b66&hm=feedb3603ad208afb36d126eaa65453dcda87a049c5ca7b47df634adc5b2db86&
17:38:20FromDiscord<griffith1deadly> In reply to @sys64 "And do you know": sorry, i don't use any version of gl for myself
17:39:25FromDiscord<griffith1deadly> In reply to @sys64 "or alternatively, do you": sokol-nim
17:41:38FromDiscord<_gumbercules> In reply to @griffith1deadly "i want to make": very cool!
17:41:44FromDiscord<_gumbercules> I use sokol-nim
17:41:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "I use sokol-nim": From Sokam? By seeing the name
17:41:59FromDiscord<_gumbercules> No
17:42:17FromDiscord<_gumbercules> by https://github.com/floooh
17:42:25FromDiscord<_gumbercules> https://github.com/floooh/sokol
17:43:45FromDiscord<System64 ~ Flandre Scarlet> Oh nice
17:45:33FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1168969017277562952/chrome_L3lOJ4938h_online-video-cutter.com_1.mp4?ex=6553b23c&is=65413d3c&hm=fbe5654e98386e409dbee798fd3c6bddfbcfa5da45c41e346a16ec820bfa6662&
17:45:40FromDiscord<_gumbercules> is a video of my project using sokol-nim
17:46:01FromDiscord<_gumbercules> and I've used imgui wtih sokol in other Nim and Odin projects
17:47:32Amun-Rabtw. sokół [IPA ˈsɔkuw] is polish for falcon
17:48:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "": Quite interesting!
17:48:27FromDiscord<System64 ~ Flandre Scarlet> Btw did someone already worked with Emscripten? I have problems with infinite loops
17:52:12FromDiscord<_gumbercules> In reply to @sys64 "Btw did someone already": what kinds of problems?
17:52:21FromDiscord<_gumbercules> In reply to @Amun-Ra "btw. sokół [IPA ˈsɔkuw]": Russian as well I believe
17:53:07FromDiscord<_gumbercules> `сокол` in Russian
17:53:28FromDiscord<griffith1deadly> is sokol better than raylib?
17:53:34FromDiscord<_gumbercules> they're very different
17:53:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "what kinds of problems?": I do a GUI app, so it uses an infinite loop↵But when the browser reaches the loop, it's stuck, nothing happens
17:54:09FromDiscord<_gumbercules> Sokol is an abstraction over a bunch of the various graphics APIs - OpenGL, Metal, D3D11, WebGPU
17:54:15Amun-Ra_gumbercules: yes, the only difference is the pronouciation of 'o' vs 'ó'
17:54:42FromDiscord<_gumbercules> In reply to @sys64 "I do a GUI": yeah - you need to let Emscripten handle the loop as the browser can't block on the main thread
17:54:47FromDiscord<_gumbercules> let me dig up docs for you
17:54:55FromDiscord<_gumbercules> there are a couple of ways to do it
17:55:13FromDiscord<_gumbercules> https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop
17:55:32FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Ksy
17:55:35FromDiscord<System64 ~ Flandre Scarlet> Blank page
17:55:36FromDiscord<System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=4Ksy" => "https://play.nim-lang.org/#ix=4Ksz"
17:55:58FromDiscord<_gumbercules> yeah, that's because async doesn't work the same - you're better off bundling assets
17:56:07FromDiscord<_gumbercules> https://emscripten.org/docs/porting/files/packaging_files.html
17:56:10FromDiscord<System64 ~ Flandre Scarlet> https://github.com/treeform/nim_emscripten_tutorial/blob/master/step2.nim↵I followed this
17:56:31FromDiscord<_gumbercules> I have no idea about ^ - I haven't used treeform's tutorials re: emscripten
17:56:39FromDiscord<_gumbercules> if you want to see how I'm doing it
17:57:35FromDiscord<_gumbercules> `--embed-file etc/sokol/shaders --preload-file etc/assets` in my call to `emcc`
17:57:49FromDiscord<_gumbercules> so I pass them via `passC`
17:57:50FromDiscord<System64 ~ Flandre Scarlet> I don't use any assets here
17:58:18FromDiscord<_gumbercules> oh - I thought you meant you were loading something - if the page never loads I'd check out the JS console
17:58:29FromDiscord<System64 ~ Flandre Scarlet> Nothing in the JS console
17:58:32FromDiscord<_gumbercules> hrm
17:59:21FromDiscord<_gumbercules> do you have a simple example of what you're trying to do? there are quite a few gotchas with emscripten / wasm but it's difficult to debug
17:59:36FromDiscord<_gumbercules> if you simply can't get treeform's example to work, I can try cloning it and figuring out what's going wrong
18:05:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "do you have a": https://media.discordapp.net/attachments/371759389889003532/1168973992351252611/src.zip?ex=6553b6de&is=654141de&hm=b643d0af33d8c4b2486724f6ad2c3cd543d759c841a34e44e2337fecbea0e8e2&
18:07:27FromDiscord<System64 ~ Flandre Scarlet> This is a simple Dear ImGUI app
18:07:51FromDiscord<_gumbercules> get rid of the while loop and replace it with an if
18:08:01FromDiscord<_gumbercules> you're looping infinitely inside of an infinite loop
18:08:36FromDiscord<_gumbercules> here I mean:
18:08:37FromDiscord<System64 ~ Flandre Scarlet> Oh
18:08:43FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4KsD
18:08:48FromDiscord<_gumbercules> make that `if not window.windowShouldClose:`
18:09:14FromDiscord<_gumbercules> better even would be to do `if window.windowShouldClose: cleanup`
18:10:26FromDiscord<_gumbercules> `if not` and `while not` require extra brain juice
18:13:45FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KsG
18:13:59FromDiscord<_gumbercules> yeah something like that
18:14:20FromDiscord<_gumbercules> there might be a more graceful way to terminate the emscripten main loop but 🤷
18:14:24FromDiscord<System64 ~ Flandre Scarlet> Still have a blank page
18:14:34FromDiscord<_gumbercules> alright, let me continue digging
18:15:02FromDiscord<Chronos [She/Her]> @griffith1deadly why can't you assign procs directly to tables? This works for me: https://play.nim-lang.org/#ix=4KsH
18:15:14FromDiscord<Chronos [She/Her]> This is with the `nimcall` calling procedure
18:16:08FromDiscord<_gumbercules> In reply to @sys64 "Still have a blank": which file are you opening after building the project btw? I'm currently on my work machine but will grab my other laptop and attempt to build the project on it
18:16:11FromDiscord<_gumbercules> index.html?
18:16:19FromDiscord<System64 ~ Flandre Scarlet> yeah
18:16:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "index.html?": This one yeah
18:16:26FromDiscord<_gumbercules> thanks, let me grab my other laptop, be back in a few
18:16:35FromDiscord<System64 ~ Flandre Scarlet> alright! Thanks!
18:23:31FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "This is with the": what are the advantages between the two?
18:24:44FromDiscord<Chronos [She/Her]> All procs in Nim, unless `importc`ed or the compiler is told otherwise, are `nimcall`
18:26:42FromDiscord<_gumbercules> looks like there may be some file paths in the build settings specific to your system possibly
18:26:47FromDiscord<_gumbercules> I've also never used `confy`
18:26:58FromDiscord<_gumbercules> let me see if I can figure out how to get it building
18:29:19FromDiscord<nnsee> In reply to @_gumbercules "there might be a": i like it - it's like yanking the computer's power cable out of the wall or something. gives a man a certain feeling of power
18:29:22FromDiscord<_gumbercules> @System64 ~ Flandre Scarlet how do you normally build this? `nimble install`?
18:29:38FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "This is with the": i can just add nimcall pragma and it will be proc https://media.discordapp.net/attachments/371759389889003532/1168980111106785280/image.png?ex=6553bc91&is=65414791&hm=6f40e6a331aba0be481f9aab8f0dbf8a6fa95743310f2a2f1ebaddd713755b96&
18:29:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "<@380360389377916939> how do you": ``nimble build -b:cpp -d:emscripten
18:30:00FromDiscord<System64 ~ Flandre Scarlet> (edit) "-d:emscripten" => "-d:emscripten``"
18:30:54FromDiscord<_gumbercules> In reply to @sys64 "``nimble build -b:cpp -d:emscripten``": okay cool, got it to build on my other machine, looking into the issue now
18:31:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "okay cool, got it": Alright! Thanks!
18:31:41FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "i can just add": Ah fair
18:35:18FromDiscord<_gumbercules> In reply to @sys64 "Alright! Thanks!": https://media.discordapp.net/attachments/371759389889003532/1168981536960413777/image.png?ex=6553bde5&is=654148e5&hm=e6ac5069cd317b94ea9d0f5ac8c05751e0f90a724403fef41cd4a1d058503101&
18:35:30FromDiscord<_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4KsN
18:35:31FromDiscord<_gumbercules> and no problem
18:35:38FromDiscord<_gumbercules> happy to help
18:36:11FromDiscord<nnsee> In reply to @_gumbercules "": do you have font hinting/AA turned off?
18:36:31FromDiscord<nnsee> ah, are you running it over RDP?
18:36:42FromDiscord<Chronos [She/Her]> Why is the output of Argon hashes as bytes (from Libsodium) much smaller than Argon hashes when ascii encoded?
18:36:44FromDiscord<nnsee> reminds me of java
18:36:54FromDiscord<Chronos [She/Her]> Is the ascii encoded version containing more data?
18:37:16FromDiscord<_gumbercules> it's imgui running in the browser in chrome canary - I have no idea what kind of OpenGL / Dear IMGUI options were turned on / off in the code. no remote desktop
18:37:24FromDiscord<_gumbercules> not my code - just helping to get it compiled / running
18:37:36FromDiscord<nnsee> In reply to @chronos.vitaqua "Why is the output": ASCII is a more limited set, binary bytes gives you the full 255
18:37:50FromDiscord<nnsee> In reply to @_gumbercules "it's imgui running in": I meant the chrome tab and URL bar
18:37:57FromDiscord<Chronos [She/Her]> Isn't ascii 127 chars that can be used?
18:38:14FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KsT
18:38:18FromDiscord<Chronos [She/Her]> That aren't special chars
18:38:19arkanoidcould you please help me understand this error message? https://play.nim-lang.org/#ix=4KsS
18:38:25FromDiscord<_gumbercules> oh yeah - I have a bunch of windows GUI options disabled
18:38:46FromDiscord<nnsee> In reply to @chronos.vitaqua "Isn't ascii 127 chars": yep, and that's only half of the full range :p
18:38:56FromDiscord<_gumbercules> specifically around GUI aesthetics
18:39:10FromDiscord<Chronos [She/Her]> `$argon2id$v=19$m=262144,t=3,p=1$FIGXa9/igzhC4RMIPFo3uw$nP3O5LqHKHDN+7+SJlbNL3NE2yLgYDcyBe6+oQxVTsU` vs `@[96, 200, 45, 192, 135, 146, 31, 102, 188, 83, 253, 198, 177, 24, 188, 32]` is definitely a lot different, I knowthere's some info there but
18:39:11FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1168982515940331561/image.png?ex=6553bece&is=654149ce&hm=e4affeb8d4db02aedfb9c917833df6e3789c4e0a6aaee4988f6ba27db0b06223&
18:39:11FromDiscord<nnsee> I'm not sure it's 127, it's probably lower+upper+digits+some symbols
18:39:30FromDiscord<Chronos [She/Her]> I wonder why the output here is much different
18:39:48FromDiscord<nnsee> In reply to @chronos.vitaqua "`$argon2id$v=19$m=262144,t=3,p=1$FIGXa9/igzhC4RMIPF": hmm, that does seem a lot, will check tomorrow, on my phone atm
18:40:27FromDiscord<Chronos [She/Her]> Fair, thanks Ras aha
18:40:36FromDiscord<nnsee> In reply to @_gumbercules "": ooof, i couldn't stand that :p
18:40:39FromDiscord<Chronos [She/Her]> I'm assuming some other data is stored but it's not clear as to what
18:40:58arkanoidthe error says that I cant add an element to a seq, but the type maches
18:41:01arkanoid*matches
18:41:07FromDiscord<Chronos [She/Her]> Actually
18:41:43FromDiscord<_gumbercules> In reply to @nnsee "ooof, i couldn't stand": meh, I'm old and my eyes suck anyway so I barely notice
18:41:55FromDiscord<_gumbercules> once I turned them off and ran with it for about a week I stopped caring I guess
18:42:19FromDiscord<_gumbercules> I used this PC primarily for astrophotography for a while and preserving battery life mattered more than readable fonts
18:42:43FromDiscord<Chronos [She/Her]> Bytes format is key derivatin while the string is made for storage
18:42:48FromDiscord<_gumbercules> as I didn't have a way to charge my gear when I was out taking photos - now that I do I could probably turn it back on
18:43:03FromDiscord<Chronos [She/Her]> Apparently it's fine to store the bytes in a db but clearly is missing some stuff still
18:46:46FromDiscord<Chronos [She/Her]> Ah, can anyone suggest a good way for sorting my code and it's types? I have a project that's starting to get a bit hefty
18:47:08FromDiscord<Chronos [She/Her]> Ideally I could sort them all into folders, but rn I have all of the types used defined within one area
18:47:29FromDiscord<Chronos [She/Her]> Maybe if I make a file importing them all, and just calling that file 'dbhooks' or something would be good
18:50:48FromDiscord<Phil> Personally I'd try to sort by problem domain
18:52:50FromDiscord<Phil> If you can split your program into problems you're solving (not technical tasks, individual full problems) and try to keep imports across directories ( problem domains) minimal that would suit nicely I think
18:54:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "": To delete?
18:54:11FromDiscord<Phil> That's assuming you have a large application that solves many different things.↵Splitting on a technical level (e.g. frontend backend) often comes easier and for small to medium size projects that's often what I do
18:57:42FromDiscord<System64 ~ Flandre Scarlet> Finally it works! https://media.discordapp.net/attachments/371759389889003532/1168987177334620260/image.png?ex=6553c325&is=65414e25&hm=13ed59bcb81d6806357e16ab0b32f5258cc60242c5eb93f7c632ebc5d92389e5&
18:58:53FromDiscord<Phil> Might actually make sense to refactor Snorlogue with that in mind as it currently follows the technical split
18:59:23FromDiscord<Phil> Then again, Snorlogue isn't really a large application nor does it solve a ton of problems, so feels like overengineering =/
19:03:31FromDiscord<System64 ~ Flandre Scarlet> Does WASM supports threading?
19:04:12*neceve joined #nim
19:12:33FromDiscord<Chronos [She/Her]> In reply to @isofruit "If you can split": Hm, a bit hard though
19:13:05FromDiscord<Chronos [She/Her]> Everything here is needed for storing data in a DB, handling stuff like routes, and then now, the creation of users
19:13:55FromDiscord<_gumbercules> In reply to @sys64 "To delete?": no sorry - I was just sharing a screenshot of my windows GUI settings
19:13:59FromDiscord<_gumbercules> In reply to @sys64 "Does WASM supports threading?": yes but it's more trouble than it's worth
19:14:09FromDiscord<_gumbercules> my strong advice is don't go there unless you have a really good reason to
19:14:14FromDiscord<jviega> Anyone know if there is a switch on the nimble / nim command line to build a .a? I'm assuming so, but having a hard time finding it
19:14:30FromDiscord<_gumbercules> the browser doesn't behave like a native app
19:14:47FromDiscord<Phil> A what now?
19:15:04FromDiscord<Phil> Oh, directed at jtv, apparently I need to google what a `.a` file is
19:15:28FromDiscord<jviega> Like a .so but statically linkable
19:15:39FromDiscord<Chronos [She/Her]> In reply to @jviega "Anyone know if there": That's for static linking, right?
19:15:41FromDiscord<Phil> Ahhh check, yeah SO gave the same
19:15:43Amun-Ra.a is an equivalent of windows' .lib
19:15:55FromDiscord<Chronos [She/Her]> Idk what either means
19:16:03FromDiscord<Chronos [She/Her]> Not a Windows user lol
19:16:29FromDiscord<Phil> In reply to @chronos.vitaqua "Hm, a bit hard": That's what a "utils" folder is for. See it as a general "application-internal libraries"-directory where each subfolder of utils is its own "mini-lib"
19:16:48FromDiscord<Phil> Or module, depending on how large or small your "technical" problems are that you're solving
19:16:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "my strong advice is": My app uses multithreading for file export
19:17:30FromDiscord<System64 ~ Flandre Scarlet> it copies the synth context to the thread and the thread manages to create the file and save it
19:18:06FromDiscord<Chronos [She/Her]> In reply to @isofruit "That's what a "utils"": Fair
19:18:08FromDiscord<_gumbercules> yeah - I'm just saying in a wasm context I'd' find a way to do that with callbacks or something
19:18:13FromDiscord<_gumbercules> instead of using multiple threads
19:18:23FromDiscord<_gumbercules> emscripten + wasm even
19:18:46FromDiscord<_gumbercules> https://emscripten.org/docs/porting/pthreads.html and https://emscripten.org/docs/api_reference/wasm_workers.html are your options pretty much
19:19:03FromDiscord<Chronos [She/Her]> So global utils module everything uses? Or separated into something by dir?
19:19:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "https://emscripten.org/docs/porting/pthreads.html a": I think Nim uses pthreads
19:19:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kt5
19:19:44FromDiscord<_gumbercules> pthreads are simply OS threads on linux
19:20:00FromDiscord<_gumbercules> https://man7.org/linux/man-pages/man7/pthreads.7.html
19:20:01FromDiscord<Phil> That's one attempt at how you could split things.↵Not saying its the best, just one possibility and possibly worth trying out..
19:20:08FromDiscord<Phil> (edit) "out.." => "out."
19:20:19FromDiscord<_gumbercules> windows has it's own threading implementation, same with macOS
19:20:27FromDiscord<_gumbercules> actually macos might use pthreads
19:20:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "https://man7.org/linux/man-pages/man7/pthreads.7.ht": Oh alright!↵Btw there is another problem↵File import / saving
19:20:31FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kt7
19:20:37FromDiscord<Phil> A global utils folder for technical problems that you encounter in multiple problemdomains, a local utils folder for technical problems specific to the given problemdomain
19:20:48FromDiscord<leorize> pthreads is just the interface
19:20:58FromDiscord<System64 ~ Flandre Scarlet> I don't think you can write on the disk with WASM/Emscripten
19:20:59FromDiscord<Phil> I wouldn't bother moving stuff from problemdomain1/utils to the global utils folder unless it is used in at least 2 problemdomains
19:21:06FromDiscord<_gumbercules> In reply to @sys64 "I don't think you": you need to use the virtual file system
19:21:18FromDiscord<Chronos [She/Her]> Lol
19:21:18FromDiscord<_gumbercules> https://emscripten.org/docs/api_reference/Filesystem-API.html
19:21:20FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kt8
19:21:22FromDiscord<Phil> And even then you need to make sure that it's definitely the same problem that gets solved and not similar ones
19:21:35FromDiscord<Phil> Similar problems may warrant code duplication just so you can cover them freely
19:21:52FromDiscord<_gumbercules> In reply to @leorize "pthreads is just the": yeah, my bad
19:21:58FromDiscord<Phil> (edit) "cover" => "change" | "changethem freely ... " added "and independently from one another"
19:22:06FromDiscord<Chronos [She/Her]> So that I don't accidentally break code between them?
19:22:08FromDiscord<leorize> it doesn't look bad tbh↵(@Chronos [She/Her])
19:22:09FromDiscord<Chronos [She/Her]> Ah makes sense
19:22:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "https://emscripten.org/docs/api_reference/Filesyste": Quite interesting↵But not sure if I can open a file select dialog from WASM
19:22:35FromDiscord<Phil> Basically, the idea is to make sure that different domains do not share code that right now works but is used in slightly different manners
19:22:40FromDiscord<Chronos [She/Her]> In reply to @leorize "it doesn't look bad": The code is definitely messy tho aha, `types` is imported basically everywhere
19:22:47FromDiscord<Chronos [She/Her]> In reply to @isofruit "Basically, the idea is": Gucci o7
19:23:12FromDiscord<Phil> Which may make future refactorings hard as then a change for problemdomain 1 breaks code in problemdomain 4 and you're not aware of it
19:23:16FromDiscord<Phil> (if you don't have tests)
19:23:45FromDiscord<Chronos [She/Her]> I defo should add tests tbh
19:23:46FromDiscord<_gumbercules> sorry I meant to link here @flani : https://emscripten.org/docs/porting/files/index.html
19:23:53FromDiscord<Chronos [She/Her]> Procrastinating n them rn tho lol
19:23:59FromDiscord<_gumbercules> fuck - that's not the correct person, sorry flani
19:24:04FromDiscord<_gumbercules> @System64 ~ Flandre Scarlet https://emscripten.org/docs/porting/files/index.html
19:24:16FromDiscord<Phil> Note that it may make sense to write yourself a README.md that covers the structure so you don't forget it 3 weeks down the line and start breaking rules ^^
19:24:31FromDiscord<Chronos [She/Her]> Yeah, actually did that before you said so aha
19:24:33FromDiscord<Phil> That also helps lay out the task each module should solve
19:25:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "<@380360389377916939> https://emscripten.org/docs/p": So I'd need to make bindings for Nim?
19:25:53FromDiscord<Chronos [She/Her]> Naming files is the hardest part aha
19:26:07FromDiscord<_gumbercules> I'm sure they exist somewhere - if not it should be pretty trivial to do so
19:26:21FromDiscord<Phil> For reference, I did roughly that approach in my web application, I just didn't make a utils folder, I just dumped those modules into the root directory directly
19:26:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "I'm sure they exist": Usually I execute some JS code to pop up the loader
19:26:59FromDiscord<Chronos [She/Her]> Fair
19:27:11FromDiscord<Phil> Which looking back I kinda regret because having a utils folder and regarding each module there as a kind of application-specific mini-lib would've been kinda neat.↵With "technical"-code isolated into the utils folder and "problem-domain"-code with business logic isolated in the various problemdomain folders
19:28:20FromDiscord<Phil> But basically I had a "genericRepository", "genericService", "genericController" and then a bunch of folders for each "domain", those being "character", "creature", "diaryentry", "encounter", "spells", "rules" etc.
19:28:55FromDiscord<Phil> And the modules inside those folders then made use of genericRepository/Service/Controller depending on what was necessary in their own modules
19:29:33FromDiscord<Phil> I think I even wrote myself the Readme file I recommended you write for yourself
19:30:02FromDiscord<Chronos [She/Her]> Yeah that makes sense
19:30:12FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Ktg
19:30:13FromDiscord<Chronos [She/Her]> I'm doing this now :p
19:30:38FromDiscord<_gumbercules> In reply to @sys64 "Usually I execute some": yeah this sounds like what you probably need to do - it seems like emsmcripten will store blobs in memory and then you need to use some JS to get them to persist outside of the WASM env
19:30:44FromDiscord<_gumbercules> https://stackoverflow.com/questions/54384684/webassembly-emscripten-write-files-to-disk-from-within-browser
19:32:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "https://stackoverflow.com/questions/54384684/webass": https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#calling-javascript-from-c-c↵I found this to call JS code
19:33:06FromDiscord<Phil> ~~Honestly this is kinda my own stab at domain driven design based on the concepts that I understood it focussing on while completely finding the methods to achieve its goals bonkers~~
19:33:21FromDiscord<Phil> (edit) "~~Honestly this is kinda my own stab at domain driven design based on the concepts that I understood it focussing on while completely finding the methods ... to" added "taught"
19:33:39FromDiscord<_gumbercules> In reply to @sys64 "https://emscripten.org/docs/porting/connecting_cpp_": yeah - there's a libray named `jsBind` that provides some macros to simplify the interop b/w C/C++ and JS via emscripten
19:33:44FromDiscord<_gumbercules> but this is the way essentially
19:38:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "yeah - there's a": So I need to do a binding for Nim ?
19:38:31FromDiscord<_gumbercules> no, sorry - it's a Nim library
19:38:42FromDiscord<_gumbercules> https://github.com/yglukhov/jsbind/
19:38:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "no, sorry - it's": Oh ! It will help me à lot !
19:38:59FromDiscord<System64 ~ Flandre Scarlet> Thanks !
19:44:02FromDiscord<Chronos [She/Her]> In reply to @isofruit "~~Honestly this is kinda": I don't understand that lol
19:48:31FromDiscord<Phil> As in sentence is confusing or as in "I dunno about domain driven design" ?
19:49:14FromDiscord<Elegantbeef> Domain driven design is when you write variable names that are valid domain names
19:50:07FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Kto
19:50:30FromDiscord<leorize> make a proc and it'll work
19:50:49FromDiscord<Elegantbeef> Nim does have an implicit `string -> cstring` converter but it warns, though on JS it's perfectly safe
19:50:57FromDiscord<Phil> In reply to @Elegantbeef "Domain driven design is": domaindrivendesign is when your variable is somestuff.com
19:55:04FromDiscord<user2m> sent a code paste, see https://paste.rs/WNZBo
19:55:19FromDiscord<user2m> In reply to @leorize "make a proc and": what do you mean?
19:56:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ktp
19:57:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ktq
19:57:38FromDiscord<user2m> In reply to @Elegantbeef "The easiest way to": ah ok
20:12:30arkanoidI've a piece of code that returns wrong data when compiled with danger, but is correct with release. What could be the issue?
20:13:24FromDiscord<Elegantbeef> Relying on undefined behaviour that the release logic accidently protects you from
20:14:00arkanoidO_o
20:16:23FromDiscord<Elegantbeef> Valgrind and other friends will help you here
20:16:34Amun-Raespecially friends
20:16:44FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Ktv
20:16:48FromDiscord<Elegantbeef> Given what you last talked about I assume you're doing C interop?
20:16:56arkanoidmy debug code is already compiled with -fsanitize=address, and it already passes
20:17:03arkanoidand release works perfectly
20:17:09Amun-Raarkanoid: add undefined
20:17:34FromDiscord<Elegantbeef> `network{.importc: "_network".}: Network`
20:18:32arkanoidalso -fsanitize=address,undefined compiles without warning
20:18:51Amun-Raand how it runs?
20:19:23arkanoidAmun-Ra: slow but fine
20:19:47Amun-Rahmm
20:20:14Amun-Rado you add any other defs to danger? --opt?
20:20:16FromDiscord<leorize> does it still produce wrong result?
20:20:22Amun-Raperhaps something optimizes out
20:20:41arkanoidto recap: -fsanitize=address,undefined enabled for both compiler and linker, no warns. Program runs correctly with debug, release. With danger a "collect:" returns [0,0,0,0] instead of [X,Y,W,X]
20:20:44FromDiscord<Elegantbeef> Danger and release by default optimize the same
20:21:02FromDiscord<Elegantbeef> Danger only removes checks which allows the C compiler to optimise more aggresively
20:21:06arkanoidI've added "opt:speed"
20:21:09FromDiscord<leorize> there's also the potential that you're causing side-effects via asserts
20:21:32Amun-Raright, that's why I ansked whether any other defs where added manually
20:22:03Amun-Raarkanoid: can you paste the code somewhere?
20:22:04arkanoidwell, have to go now. I can probably narrow down the single function that returns A when release, B when danger, but can't do now
20:22:17arkanoidAmun-Ra: I'll paste it
20:22:46FromDiscord<Elegantbeef> That doesn't matter the default optimization is for speed
20:31:22FromDiscord<Chronos [She/Her]> In reply to @isofruit "As in sentence is": Both :p
20:41:24FromDiscord<Elegantbeef> Pmunch are you still on?
20:42:25FromDiscord<System64 ~ Flandre Scarlet> @_gumbercules ↵Well, with my bigger app, I have those weird errors https://media.discordapp.net/attachments/371759389889003532/1169013529249054770/message.txt?ex=6553dbb0&is=654166b0&hm=3ae0dd20cdd14f91afa9a581b77f226a80e6e559bb19c141dd3decfe8cb14d2a&
20:42:34FromDiscord<System64 ~ Flandre Scarlet> While compiling to Emscripten
20:53:13PMunch@Elegantbeef, yup
20:55:24FromDiscord<Chronos [She/Her]> Hey Phil, thanks for your suggestion of keeping code contained within it's own problem domains, definitely going to be better for the restructure aha
21:00:19PMunch@Elegantbeef, are you?
21:01:39FromDiscord<pmunch> Ah pings don't survive across all the bridges
21:01:49FromDiscord<pmunch> Elegantbeef\: yes I'm still online
21:01:56FromDiscord<pmunch> But probably not for long
21:03:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4KtD
21:03:41FromDiscord<jviega> Is there a way to see my link line when compiling?
21:04:35FromDiscord<jviega> Trying to figure out what I have to bundle to distribute a nim .a, as just producing it doesn't seem to bundle everything I need
21:05:22PMunchMaybe with `--listCmd`?
21:05:34FromDiscord<jviega> Will try, thank you
21:05:52FromDiscord<jviega> Perfect, thanks
21:06:07PMunch@Elegantbeef, well that has some interesting side effects
21:06:55PMunchNow `getLabel` in a `finally` block won't show `NoLabel` when nothing raised, and things probably can't be nested properly any longer
21:09:25FromDiscord<Elegantbeef> Alternatively you might also be interested in https://play.nim-lang.org/#ix=4KtF which allows nested labels
21:09:26FromDiscord<Elegantbeef> But you do not technically need the double raise
21:09:27FromDiscord<Elegantbeef> Put a `defer` that sets it back to `NoLabel`
21:09:29FromDiscord<Elegantbeef> Actually the defer doesn't work
21:10:24PMunchHow bad is a double raise, just out of curiosity
21:10:39PMunchI thought it would just restart the raising process without too much work
21:11:56FromDiscord<Elegantbeef> It's not the end of the world but on the bad path it unwinds the stack twice and has twice the error checks
21:12:56FromDiscord<jviega> Hmm, I'm missing something on these massive lines. what do I need to pick up _cmdCount and _cmdLine?
21:13:20PMunchOh it does the full unwind twice..
21:13:24PMunchYeah that's not great
21:13:38FromDiscord<Elegantbeef> It's just food for thought, I'm now outta here to freeze my ass off 😄
21:14:21PMunchMaybe try with `--genScript:on` to get compile script in your .nimcache folder. I used that when debugging Ratel stuff
21:14:31PMunch@Elegantbeef, freeze your ass off?
21:14:52FromDiscord<jviega> Thanks
21:14:56PMunchYeah it could definitely be better, not sure how much work I should put into this little experiment though :P
21:17:06FromDiscord<Elegantbeef> Yea going to walk my dogs
21:17:12FromDiscord<Elegantbeef> Not that it's really cold out 😄
21:17:49PMunchI'm going to get a snow, uhm, remover machine?
21:17:58PMunchWhat on earth do you call those?
21:18:27PMunchLike one of these: https://haugalandbatsenter.no/images/product/7d3fe5f0-6984-4c20-996c-60337d2189d8.jpg?7c27d3d3-ce09-d4bb-c82b-a9a38c47
21:19:43FromDiscord<fowl.mouth> Snow blower
21:19:50PMunchThat's it!
21:20:18FromDiscord<fowl.mouth> It’s snowing here, first snow of the season
21:21:04PMunchWe had some snow a couple weeks back, but it looks like it's more here to stay this time
21:21:26PMunchAnd of course the yearly total chaos down south :P
21:21:43PMunchAlways fun to read the news the first couple days they have snow
21:51:23*noxp joined #nim
21:51:35*attah quit (Read error: Connection reset by peer)
21:51:44FromDiscord<Chronos [She/Her]> Wondering if it's a good idea to make it so everything has to operate on an `Application` type
21:51:56FromDiscord<Chronos [She/Her]> (Better names accepted lol)
21:52:27FromDiscord<Chronos [She/Her]> Since, it'd make it easier to spin up stuff for multiprocessing, even if that's not what I'm doing yet
21:52:43FromDiscord<Elegantbeef> Opposed to what?
21:53:48FromDiscord<Chronos [She/Her]> Just defining everything as variables and grabbing them as necessary from whatever file it's defined in
21:54:22FromDiscord<Chronos [She/Her]> I personally think it'd be better to group all the components that make the app, into one type but not sure if there is a better way even if I can't see it
21:55:18*attah joined #nim
21:58:12FromDiscord<Elegantbeef> globals r bad
21:58:27PMunchYeah, don't do globals
21:59:16FromDiscord<Chronos [She/Her]> 👍
22:02:28*PMunch quit (Quit: leaving)
22:14:22FromDiscord<bostonboston> Anyone have any practical examples of using `mixin`
22:20:01FromDiscord<Elegantbeef> https://www.jasonbeetham.com/writeups/codereuse.html \:d
22:20:39FromDiscord<Elegantbeef> https://github.com/beef331/gooey/blob/master/src/gooey.nim↵https://github.com/beef331/truss3d/blob/master/src/truss3D/atlasser.nim
22:21:21FromDiscord<pmunch> So this is interesting: https://play.nim-lang.org/#ix=4KtM
22:21:56FromDiscord<pmunch> In an exception you can goto back into the state machine case.
22:22:38FromDiscord<pmunch> I wonder what happens with variables local to the try scope then you do that 🤔
22:23:33FromDiscord<pmunch> Could be useful to refresh an expired token and jump back where it failed.
22:42:34FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KtR
22:42:57FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1169043862275231784/message.txt?ex=6553f7f0&is=654182f0&hm=acbab67672ea9e1b69c37879d62b1932fe77f8fa34513cc63fa2de580613832e&
22:58:56FromDiscord<Chronos [She/Her]> Kinda wish Nim followed whatever Python does with package structures, with an 'entrypoint' file in a dir that can export stuff when importing the package
22:59:11FromDiscord<Chronos [She/Her]> Mostly because it means I can keep folders self-contained
23:08:26*neceve quit (Ping timeout: 255 seconds)
23:14:56*noxp quit (Quit: WeeChat 4.1.1)
23:21:21FromDiscord<_gumbercules> In reply to @sys64 "": it appears the `extern c` is getting applied / generated twice. Not sure why...
23:21:28FromDiscord<_gumbercules> that's the underlying problem though
23:23:34*advesperacit quit ()
23:31:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "it appears the `extern": I fixed the problem with ``--define:jsbindNoEmJs``
23:36:38FromDiscord<System64 ~ Flandre Scarlet> Wow some sketchy warns here https://media.discordapp.net/attachments/371759389889003532/1169057376066883656/image.png?ex=65540486&is=65418f86&hm=884f9041cf130bd295a3b2b19b29020c094bda5389edd9a7c61cf86949f46c75&
23:37:58FromDiscord<_gumbercules> ah yeah I think I had to do that as well in my project
23:38:07FromDiscord<_gumbercules> although I don't even know if I'm using jsbind anymore 🤷
23:40:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "although I don't even": At least it works↵However I quite worried about those warnings
23:40:09FromDiscord<System64 ~ Flandre Scarlet> (edit) "I" => "I'm"
23:41:03FromDiscord<_gumbercules> you need to set the size of the thread pool via configuration
23:41:18FromDiscord<_gumbercules> and yeah - you can't block on the main thread
23:41:40FromDiscord<_gumbercules> well you can but you shouldn't
23:41:42FromDiscord<_gumbercules> it's going to break your app
23:49:58*oprypin quit (Quit: Bye)
23:50:09*oprypin joined #nim