00:02:46 | arkanoid | juancarlospaco: if I try to use @if in my config.nims, I get "Error: expression expected, but found 'keyword if'" |
00:04:00 | arkanoid | oh, wait, that is a nim.cfg file, not a config.nims |
00:04:49 | arkanoid | this nimble vs nims vs cfg is a mess |
00:05:59 | * | deadmarshal_ joined #nim |
00:07:10 | arkanoid | what is the equivalent of "@if danger: .. @end" in .nims ? |
00:32:11 | FromDiscord | <Yardanico> when defined should work? |
00:32:16 | FromDiscord | <Yardanico> `when defined(danger)` etc |
00:40:22 | arkanoid | actually not |
00:40:48 | arkanoid | I mean, not if "switch(debug)" is defined in same file, above it |
00:41:01 | arkanoid | maybe it works if "nim c -d:debug |
01:04:38 | FromDiscord | <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:31 | NimEventer | New thread by Niminem: Why is JS backend not compiling, see https://forum.nim-lang.org/t/10582 |
02:35:03 | FromDiscord | <Elegantbeef> config.nims is likely loaded first so it's probably best to just have a `release.flags` file you load @takemichihanagaki3129 |
02:37:07 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "config.nims is likely loaded": Sure! Ty for the explanation. |
02:58:32 | * | derpydoo quit (Quit: derpydoo) |
05:10:15 | NimEventer | New 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:52 | FromDiscord | <griffith1deadly> i love nim macros :nim1: |
06:53:53 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> Expected |
06:57:53 | FromDiscord | <Elegantbeef> Nim has range checking on `int` |
07:03:22 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#pragmas-compilation-option-pragmas will help you if you want to fix your hotpath |
07:03:30 | FromDiscord | <Elegantbeef> Whilst not making your entire code unsafe |
07:08:53 | FromDiscord | <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:18 | FromDiscord | <Chronos [She/Her]> How about with `-d:danger`? |
07:09:46 | FromDiscord | <Chronos [She/Her]> Though it also disables bounds checking for arrays and such too |
07:11:56 | FromDiscord | <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:05 | FromDiscord | <OdoItal> I was going to push this code in a second anyway |
07:15:01 | FromDiscord | <demotomohiro> Nim discourage using uint: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#language-design-why-are-unsigned-types-discouragedqmark |
07:16:19 | FromDiscord | <Chronos [She/Her]> Hm |
07:18:07 | FromDiscord | <OdoItal> sent a code paste, see https://play.nim-lang.org/#ix=4KpV |
07:18:45 | FromDiscord | <OdoItal> It's a pretty tiny file, just ctrl-f replace `uint` with `int` and the uint literals with normal int literals |
07:20:02 | FromDiscord | <nnsee> In reply to @demotomohiro "Nim discourage using uint:": only because using it disables over/underflow checks |
07:20:05 | FromDiscord | <nnsee> which is kind of intended here |
07:20:29 | FromDiscord | <OdoItal> sent a code paste, see https://play.nim-lang.org/#ix=4KpX |
07:20:48 | FromDiscord | <Chronos [She/Her]> Is the repo private? |
07:21:05 | FromDiscord | <nnsee> they posted a link |
07:21:14 | FromDiscord | <nnsee> https://github.com/PaarthShah/happy_number_generator/blob/master/Nim/sum_of_squares.nim |
07:21:16 | FromDiscord | <Chronos [She/Her]> Yeah, opened it but not working |
07:21:24 | FromDiscord | <nnsee> it got mangled because of the newline |
07:21:25 | FromDiscord | <Chronos [She/Her]> 404 |
07:21:34 | FromDiscord | <OdoItal> Oh oops, must've been private |
07:21:35 | FromDiscord | <Chronos [She/Her]> Yeah that link is still an issue |
07:21:36 | FromDiscord | <nnsee> oh wait |
07:21:40 | FromDiscord | <Chronos [She/Her]> Lol |
07:21:40 | FromDiscord | <nnsee> yeah it's still private lol |
07:21:41 | FromDiscord | <nnsee> my bad |
07:21:46 | FromDiscord | <Chronos [She/Her]> No worries haha |
07:21:49 | FromDiscord | <nnsee> i'm wayyyy too tired today |
07:22:01 | FromDiscord | <Chronos [She/Her]> Relatable but that's me everyday :P |
07:22:05 | FromDiscord | <OdoItal> Okay it's public now \:^) |
07:29:28 | FromDiscord | <OdoItal> (Btw when I say this is "performance critical"\: this is basically just me dogfooding my own interview problem rosetta-code style) |
07:31:03 | FromDiscord | <OdoItal> So if I can't explain why the `uint` is faster then it'll only be minorly embarrassing for me |
07:32:38 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Kq2 |
07:34:35 | * | PMunch joined #nim |
07:37:30 | FromDiscord | <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:06 | FromDiscord | <OdoItal> Yeah, that'd be the next step for when I'm awake \:^)↵(@demotomohiro) |
07:51:10 | FromDiscord | <megabytesofrem> alright cursed question incoming |
07:51:40 | FromDiscord | <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:02 | Amun-Ra | sure |
07:52:34 | FromDiscord | <megabytesofrem> oh god |
07:52:47 | FromDiscord | <megabytesofrem> is it bad that im tempted to do it lol |
07:52:52 | PMunch | Someone even wrote a Gameboy game in Nim :P |
07:52:53 | FromDiscord | <megabytesofrem> C is kind of a nightmare |
07:53:07 | PMunch | https://www.goodboygalaxy.com/ |
07:53:17 | FromDiscord | <megabytesofrem> ok this is dope |
07:53:24 | PMunch | Oh, that apparently runs on the 3DS as well :) |
07:56:53 | PMunch | I believe this is how they do it: https://github.com/exelotl/natu |
07:57:54 | PMunch | And here's a presentation of it for NimConf 2020 https://www.youtube.com/watch?v=sZUM7MhWr88 |
08:04:08 | PMunch | There's no way to build an enum in a block, right? |
08:04:30 | FromDiscord | <Elegantbeef> What does that mean? |
08:05:46 | PMunch | Well 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:00 | PMunch | Currently I'm just using strings, but using enums would be even cooler |
08:06:29 | PMunch | But that requires me to write out the enum first.. |
08:06:35 | FromDiscord | <Elegantbeef> Nim actually might have what you want in a odd undocumented api |
08:06:46 | PMunch | Oh really? |
08:07:12 | FromDiscord | <Elegantbeef> I've got to find it but araq mentioned it once somewhere on the forum |
08:07:37 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/8963#58594 |
08:07:49 | FromDiscord | <Elegantbeef> Though this is a state machine so never mind |
08:09:04 | PMunch | Huh, that's cool though |
08:09:13 | PMunch | But yeah, not quite what I had in mind.. |
08:12:32 | PMunch | Haha, welp, managed to instantly break that feature :P |
08:13:07 | PMunch | To be fair I didn't expect this to work: https://play.nim-lang.org/#ix=4Kq9 |
08:14:00 | FromDiscord | <Elegantbeef> Yea it's not even documented 😄 |
08:14:17 | FromDiscord | <Elegantbeef> Assignment is after all destructured into a `goto label` |
08:14:48 | PMunch | Yeah, I was just curious to see if it could somehow manage to jump out of a procedure without returning |
08:15:17 | FromDiscord | <Elegantbeef> Is that even possible in C |
08:15:22 | FromDiscord | <Elegantbeef> Arent labels scoped |
08:15:33 | PMunch | Yes they are |
08:15:39 | PMunch | But I think there's a way to do it |
08:16:00 | FromDiscord | <Elegantbeef> It's theoretically possible assuming you of course stack scan for a label put there |
08:16:25 | PMunch | Well sure :P |
08:16:27 | FromDiscord | <Elegantbeef> Storing the label location in an integer then just jumping there |
08:16:43 | PMunch | I thought there was some way to do it "correctly" but it appears I was wrong |
08:16:56 | FromDiscord | <Elegantbeef> Anywho you wanted like `except T as E and state == Bleh`? |
08:17:13 | PMunch | Oh I didn't imagine it anything that fancy |
08:19:57 | PMunch | Currently I'm playing with it like this: http://ix.io/4Kqb or like this: http://ix.io/4Kqc |
08:21:20 | FromDiscord | <Elegantbeef> I have a possibly better idea, give me a second to see if it explodes |
08:22:04 | PMunch | Unfortunately 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:33 | FromDiscord | <Elegantbeef> Oh shit it works! |
08:25:40 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4Kqe |
08:25:49 | PMunch | I would've liked to be able to do something like this: http://ix.io/4Kqf |
08:26:33 | FromDiscord | <Elegantbeef> You can do that though |
08:26:34 | PMunch | Ooh, that's pretty nifty |
08:26:44 | PMunch | Can do what? |
08:27:00 | FromDiscord | <Elegantbeef> Not being able to use except is a bug I guess |
08:27:06 | FromDiscord | <Elegantbeef> You should be able to use it there |
08:27:24 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4Kqg does compile |
08:27:26 | PMunch | What do you mean, I could have excepts to by custom macro/template? |
08:27:30 | FromDiscord | <Elegantbeef> Paint the rest of the owl |
08:27:37 | FromDiscord | <Elegantbeef> Yes |
08:27:45 | PMunch | Wait what?! |
08:27:48 | FromDiscord | <Phil> That looks like a different version of "try multiple excepts" to me, I don't quite see the difference |
08:27:51 | FromDiscord | <Elegantbeef> `finally` `else` `elif` `except` all can be consumed by macros |
08:27:51 | PMunch | Since when was this allowed? |
08:28:03 | FromDiscord | <Elegantbeef> 1.4... maybe 1.6 |
08:28:13 | FromDiscord | <Elegantbeef> Some bugs with it on things like `finally` and the like |
08:28:28 | PMunch | Phil, 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:45 | PMunch | Next thing you'll come and tell me that auto-building enums have been a feature all this time as well :P |
08:29:55 | FromDiscord | <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:02 | FromDiscord | <Phil> Time for a new article PMunch 😛 |
08:30:10 | PMunch | I'm actually considering it |
08:30:30 | PMunch | All this started because I read about a "better" way of handling exceptions in Javascript by just boxing them in a Maybe type |
08:30:35 | FromDiscord | <Elegantbeef> "So I bitched in the realtime chat and some jackass just open my world" |
08:30:58 | PMunch | I 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:27 | FromDiscord | <Elegantbeef> All this talk of boxing makes me want to eat ear |
08:31:35 | PMunch | Oooh, `staticCase`! |
08:32:32 | FromDiscord | <Elegantbeef> Yea it's surprisingly flexible |
08:32:41 | FromDiscord | <Elegantbeef> The sad part is though the branches cannot be typed for obvious reasons |
08:34:09 | PMunch | Hmm, inconvenient but not a complete game-breaker |
08:34:38 | FromDiscord | <Elegantbeef> Oh yea, you can still implement an entire error handler inside of them |
08:34:49 | FromDiscord | <Elegantbeef> One could implement their own exception handling code if they wanted to |
08:34:50 | PMunch | Hmm, so a mix between static strings and staticCase is almost like an automatic enum, right? |
08:35:07 | FromDiscord | <Elegantbeef> Sorta I guess |
08:35:30 | FromDiscord | <Elegantbeef> Do not get the assurance of having a value |
08:35:38 | FromDiscord | <Elegantbeef> So still have typos |
08:35:41 | PMunch | I have an idea |
08:36:38 | FromDiscord | <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:04 | FromDiscord | <Elegantbeef> Atleast I imagine you're doing something like `except ValueError("label") as e` |
08:37:56 | PMunch | Oh right, I have control over the branches as well |
08:38:05 | FromDiscord | <Elegantbeef> Yep |
08:38:18 | PMunch | Like the `except Y as e` part |
08:38:19 | PMunch | Hmm |
08:38:28 | PMunch | Then I could do this even easier than what I was thinking |
08:38:43 | FromDiscord | <Elegantbeef> Yep `except "label"` also works |
08:39:02 | FromDiscord | <Elegantbeef> You can make your own ergonomic error handler that looks nearly identical to the built in |
08:39:07 | FromDiscord | <Elegantbeef> This is not possible in many languages |
08:39:08 | PMunch | I had the idea of using a custom numeric literal whose macro added the string to a list |
08:39:12 | FromDiscord | <Elegantbeef> Gotta love it |
08:40:09 | FromDiscord | <Elegantbeef> Right when you use `label` you just set the active label to the integer in that list |
08:40:40 | FromDiscord | <Elegantbeef> Then inside the error handler you can just do `proc label(): lent string = names[selectedLabel]` |
08:42:12 | FromDiscord | <Elegantbeef> So much fun stuff to do |
08:43:30 | PMunch | Ah damn it, custom numeric literals only works for, well, numerals |
08:44:02 | PMunch | Well, that means my more generic solution won't work |
08:44:22 | FromDiscord | <Elegantbeef> `proc label(s: static string) = addToCurrentList(s)` |
08:44:27 | FromDiscord | <Elegantbeef> `label"hello"` |
08:44:49 | FromDiscord | <Elegantbeef> `proc label(s: static string) {.compileTime.} = addToCurrentList(s)` |
08:45:05 | FromDiscord | <Chronos [She/Her]> Hm, I'm wondering if my library shouldn't support bytes-specific operations for the JS backend |
08:51:18 | FromDiscord | <Elegantbeef> Do those lowly webdevs need it? |
08:55:06 | FromDiscord | <Chronos [She/Her]> I wouldn't imagine so |
08:55:31 | FromDiscord | <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:49 | FromDiscord | <Chronos [She/Her]> I'm making my lib work for JS so I can use it if I really want to |
08:55:56 | FromDiscord | <Chronos [She/Her]> Also I'm extremely bored rn :p |
09:04:11 | FromDiscord | <Chronos [She/Her]> Ah, is it `&&` for bitwise operations (in general) that I use for masking? |
09:05:37 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kql |
09:05:51 | FromDiscord | <Chronos [She/Her]> Yep it is, epic |
09:06:00 | FromDiscord | <Yardanico> In reply to @chronos.vitaqua "Ah, is it `&&`": you mean `&` |
09:06:16 | FromDiscord | <Yardanico> in Nim `and` just means both `&` and `&&` depending on the context (integers/floats vs bools) |
09:06:29 | FromDiscord | <Yardanico> oh right single & is not common in C |
09:06:33 | FromDiscord | <Yardanico> (edit) "not common" => "different" |
09:06:55 | FromDiscord | <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:41 | FromDiscord | <System64 ~ Flandre Scarlet> Is there a cross-platform file picker for Nim? |
09:07:57 | FromDiscord | <Chronos [She/Her]> In reply to @yardanico "you mean `&`": Ah yeah, my bad aha |
09:09:26 | FromDiscord | <Yardanico> In reply to @sys64 "Is there a cross-platform": maybe you can just use a part of nigui for that? |
09:10:07 | FromDiscord | <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:18 | FromDiscord | <Yardanico> but an imgui file picker won't be native |
09:10:35 | FromDiscord | <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:17 | FromDiscord | <System64 ~ Flandre Scarlet> I think it would be better if it's native |
09:11:46 | FromDiscord | <zkv> hi , Nim memory model link from nim-lang.org/documentation.html is broken |
09:12:38 | FromDiscord | <System64 ~ Flandre Scarlet> Wait, MacOS still not supported? |
09:12:39 | FromDiscord | <Yardanico> hmm, that's an unofficial blog post, I wonder if zevv just changed the url scheme |
09:12:55 | FromDiscord | <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:58 | FromDiscord | <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:03 | FromDiscord | <Yardanico> or you can if you want to |
09:14:53 | FromDiscord | <zkv> @Yardanico thank you, i will open it |
09:15:02 | FromDiscord | <Yardanico> <https://github.com/nim-lang/website> |
09:17:36 | FromDiscord | <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:00 | FromDiscord | <Yardanico> can't you just use something like https://github.com/samhocevar/portable-file-dialogs ? |
09:18:06 | FromDiscord | <Yardanico> i think there was even a binding to this or a similar lib |
09:18:20 | FromDiscord | <Yardanico> ah <https://github.com/nim-lang/dialogs> is win32 + gtk |
09:18:36 | FromDiscord | <Yardanico> also <https://github.com/Tormund/os_files> seems to support x11/osx/windows |
09:19:15 | FromDiscord | <Elegantbeef> Aswell |
09:19:16 | FromDiscord | <Elegantbeef> https://nimble.directory/pkg/tinydialogs |
09:20:03 | FromDiscord | <zkv> @Yardanico https://github.com/nim-lang/website/issues/382 |
09:20:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://nimble.directory/pkg/tinydialogs": Tinydialogs is Windows only I think ? |
09:20:46 | FromDiscord | <Elegantbeef> Nope |
09:21:01 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1168842049202688020/image.png?ex=65533bfc&is=6540c6fc&hm=7b4cd7ec5502ab6c11f6ee0165ae93237a53cd01f3111bb2cb05d3ce69104650& |
09:21:21 | FromDiscord | <Yardanico> <https://sourceforge.net/projects/tinyfiledialogs/> the description is in a weird format but it sums up features well enough |
09:22:29 | FromDiscord | <System64 ~ Flandre Scarlet> I think it's what I use |
09:23:58 | FromDiscord | <System64 ~ Flandre Scarlet> I also tried to compile my NIMGL app to Emscripten, doesn't work |
09:24:09 | FromDiscord | <Yardanico> hm? |
09:24:15 | FromDiscord | <Yardanico> but it doesn't claim to support emscripten |
09:25:11 | FromDiscord | <System64 ~ Flandre Scarlet> Some people managed to run Dear ImGUI apps on Emscripten |
09:25:26 | FromDiscord | <Yardanico> yes I know that it's not hard, but weren't we talking about file pickers? |
09:25:32 | FromDiscord | <Yardanico> for emscripten you'd have to write it specifically for emscripten |
09:25:42 | FromDiscord | <Yardanico> e.g. from a quick google search <https://github.com/Armchair-Software/emscripten-browser-file> |
09:25:58 | FromDiscord | <Yardanico> because emscripten doesn't wrap those GUI apis like for file pickers, you have to interface with JS |
09:26:43 | FromDiscord | <System64 ~ Flandre Scarlet> Since Tiny Dialogs is cross platform, it solives my problem |
09:26:56 | FromDiscord | <Yardanico> yes but I don't think it'll work in emscripten :P |
09:27:25 | FromDiscord | <System64 ~ Flandre Scarlet> I was talking about Dear ImGUI for Emscripten |
09:27:47 | FromDiscord | <Chronos [She/Her]> What's the alternative to `os.sleep` in the JS backend? |
09:28:10 | FromDiscord | <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:15 | FromDiscord | <Yardanico> and what do you want it for? |
09:28:38 | FromDiscord | <Yardanico> since JS is usually all asynchronous, code is written differently |
09:29:34 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kqo |
09:29:40 | FromDiscord | <Chronos [She/Her]> In reply to @yardanico "since JS is usually": Fair |
09:29:47 | FromDiscord | <Yardanico> but what does that do? |
09:30:16 | FromDiscord | <Yardanico> oh, wait until that identifier, I mean, for JS you'd have to make a callback version |
09:30:44 | FromDiscord | <Yardanico> but generally the use-case seems niche enough to have in an ulid library |
09:30:48 | FromDiscord | <Chronos [She/Her]> Ah alright then |
09:30:55 | FromDiscord | <Chronos [She/Her]> Yeah fair |
09:31:22 | FromDiscord | <Chronos [She/Her]> I may just make it throw an error tbf, since that's more compliant with the spec |
09:31:32 | FromDiscord | <Yardanico> also apparently there's <https://github.com/adelq/ulid>, but it's okay if you want to make your own |
09:32:01 | FromDiscord | <Yardanico> although now nim has sysrand, so pkg/random here isn't needed |
09:33:19 | FromDiscord | <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:34 | FromDiscord | <Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID |
09:34:02 | PMunch | Wohoo, it works: https://play.nim-lang.org/#ix=4Kqq |
09:34:03 | FromDiscord | <Yardanico> quite a big more lines :P |
09:34:05 | FromDiscord | <Yardanico> (edit) "big" => "bit" |
09:34:05 | PMunch | Elegantbeef * |
09:34:20 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kqr |
09:34:28 | FromDiscord | <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:54 | FromDiscord | <Chronos [She/Her]> In reply to @yardanico "quite a bit more": Mine is ✨ spec compliant ✨ |
09:35:06 | FromDiscord | <Chronos [She/Her]> Well, nearly |
09:35:21 | PMunch | Could 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:31 | PMunch | They are even built as enums ;) |
09:35:58 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4Kqs |
09:36:05 | PMunch | Oh, and the logic in `label` should probably check if the label hasn't been encountered before :P |
09:37:00 | FromDiscord | <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:05 | FromDiscord | <Yardanico> seems like it has a benchmark too, interesting |
09:38:04 | PMunch | Huh cool, you can even get the raised label in the `finally` block |
09:40:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @yardanico "just speculating, but it": wdym? |
09:40:27 | FromDiscord | <Yardanico> In reply to @sys64 "wdym?": tags |
09:40:28 | FromDiscord | <Yardanico> release tags |
09:40:39 | FromDiscord | <Yardanico> if a repo has release tags, nimble will prefer to use them instead of cloning the latest commit |
09:41:12 | FromDiscord | <Yardanico> ah nvm lol |
09:41:22 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4Kqt |
09:41:27 | FromDiscord | <Yardanico> it's `install` not `intall` |
09:41:42 | FromDiscord | <Yardanico> the error is because nimble tries to find a .nimble file to try to find a task named `intall` |
09:41:53 | FromDiscord | <System64 ~ Flandre Scarlet> OOF |
09:41:59 | FromDiscord | <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:27 | FromDiscord | <Chronos [She/Her]> It would've worked obviously but I wanted a project to do so |
09:47:52 | PMunch | I like the syntax to label a block, but I think some better inline syntax for labeling simple statements would be nice |
10:23:15 | FromDiscord | <jessatehcrow> sent a long message, see http://ix.io/4Kqy |
10:29:23 | PMunch | You will probably be able to just use Futhark to wrap liblo automatically |
10:29:51 | PMunch | Gets you the C-like interface though, so not as nice as a fully developed wrapper |
10:31:34 | FromDiscord | <jessatehcrow> i see.. |
11:11:08 | FromDiscord | <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:21 | FromDiscord | <kryp7on> it says "nim: command not found |
11:11:48 | PMunch | That's because your PATH isn't set up correctly |
11:13:01 | FromDiscord | <kryp7on> It actually says: `zsh: command not found: nim` |
11:13:05 | PMunch | And which `export` command? |
11:13:13 | FromDiscord | <kryp7on> and command was `export PATH=etc.` |
11:13:44 | PMunch | Yeah, that's not a command you're supposed to execute, that's something you should put in your shell config |
11:14:00 | PMunch | .zshrc if it's the same as on Linux |
11:14:04 | FromDiscord | <kryp7on> yea |
11:14:05 | FromDiscord | <kryp7on> it says |
11:14:08 | FromDiscord | <kryp7on> `export ZSH="$HOME/.oh-my-zsh` |
11:14:22 | FromDiscord | <kryp7on> now I am not sure how to put Nim into ZSH path 😅 |
11:14:22 | PMunch | That's something else |
11:14:40 | PMunch | You shouldn't put it in your ZSH path, you should put it in the PATH variable |
11:14:47 | PMunch | Those are two different variables |
11:15:37 | FromDiscord | <kryp7on> I did it firstly, put it into PATH variable |
11:15:45 | FromDiscord | <kryp7on> but my CLI is iTerm which is using ZSH |
11:16:39 | PMunch | iTerm is your terminal emulator, ZSH is your shell |
11:16:47 | FromDiscord | <kryp7on> thats right |
11:17:02 | PMunch | But when you ran the `export` command in your shell you only set the PATH variable for that shell |
11:17:20 | FromDiscord | <kryp7on> that means it should work |
11:17:24 | FromDiscord | <kryp7on> but it doesnt for some reason |
11:17:26 | PMunch | You need to put that line in your .zshrc file so that the PATH get set every time you start ZSH |
11:18:04 | FromDiscord | <kryp7on> Ill try that. I just need to google what was that path for Nim, bcs I closed shell and lost line |
11:18:05 | PMunch | You 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:06 | FromDiscord | <kryp7on> bruh |
11:18:44 | FromDiscord | <kryp7on> it disappeared from $PATH |
11:18:50 | FromDiscord | <kryp7on> I ran it when I installed it, it was there |
11:19:11 | FromDiscord | <kryp7on> do you remember whats the line for PATH setting for Nim? |
11:19:13 | PMunch | Do you want me to tell you a third time why that happened? |
11:19:49 | PMunch | Probably it's `export PATH=$PATH:<wherever Nim got installed>` |
11:19:59 | FromDiscord | <kryp7on> oh yea |
11:20:05 | FromDiscord | <kryp7on> it was temporary written in PATH |
11:20:08 | PMunch | You probably also want to add `.nimble/bin` |
11:20:09 | FromDiscord | <nnsee> In reply to @kryp7on "it disappeared from $PATH": modifications to environment variables only last for the session where they were modified |
11:20:15 | FromDiscord | <kryp7on> when I closed CLI, it deleted |
11:20:20 | PMunch | Yup |
11:21:02 | PMunch | `.nimble/bin` contains all the binaries you can install via Nimble, including helper tools for certain libraries |
11:21:15 | FromDiscord | <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:40 | FromDiscord | <kryp7on> In reply to @nnsee "if you want it": @pmunch Thanks guys, this worked! :)) |
11:30:50 | FromDiscord | <ziyu4huang> Hi, is there any nim compile time benchmark compare to C++ or other popular lanaguage such as Rust ? |
11:32:31 | PMunch | Like how long stuff takes to compile? |
11:40:56 | NimEventer | New thread by gilarc: Nim Slack Community, see https://forum.nim-lang.org/t/10583 |
11:41:13 | FromDiscord | <ziyu4huang> yes, it's know that cpp take long time to compile due to language complexit and template, how Nim solve it ? |
11:56:56 | FromDiscord | <Chronos [She/Her]> Nim isn't much better with it's compile times for big projects tbh |
12:43:10 | PMunch | The work on incremental compilation will hopefully help though |
12:46:43 | FromDiscord | <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:22 | FromDiscord | <kryp7on> sent a long message, see http://ix.io/4Kr5 |
12:49:40 | * | derpydoo joined #nim |
12:50:58 | FromDiscord | <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:07 | PMunch | kryp7on, if you want to make sure that you don't change an assignment by accident |
12:52:24 | PMunch | Or just to make it clear to the reader that this assignment won't change |
12:53:03 | FromDiscord | <nnsee> In reply to @nnsee "`#include` is pretty primitive": Sorry, I'm really tired, I thought you meant `#define` not `#include` |
12:53:12 | FromDiscord | <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:18 | PMunch | Unless you use crazy macros I've found Nim to compile quite fast compared to C++ |
12:53:45 | FromDiscord | <nnsee> In reply to @deech4592 "Right, Nim doesn't have": in my (anecdotal) experience, you're right |
12:54:07 | FromDiscord | <deech4592> (edit) "In reply to @nnsee "`#include` is pretty primitive": Right, Nim doesn't have the ... issuewhere" added "C++" | "C++" => "where" |
12:54:11 | PMunch | But I have heard that it is a concern for some of the larger codebases out there |
12:54:34 | FromDiscord | <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:39 | FromDiscord | <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:14 | FromDiscord | <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:59 | FromDiscord | <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:07 | FromDiscord | <deech4592> The compiler builds from scratch in 3 mins on my 8-core i7, 16GB RAM machine. |
12:57:28 | FromDiscord | <Chronos [She/Her]> Yeah I wouldn't know how C++ compares to Nim |
12:57:45 | FromDiscord | <deech4592> `clang` takes 4 hours. |
12:58:38 | FromDiscord | <Chronos [She/Her]> That sounds horrible actually |
12:59:02 | FromDiscord | <Chronos [She/Her]> I don't know any massively big project, besides the compiler, it could be compared to |
12:59:08 | FromDiscord | <nnsee> to be fair, Nim's compile time could be counted as `[nim's own compile time] + [gcc/clang compile time]` :D |
13:01:27 | FromDiscord | <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:38 | FromDiscord | <kryp7on> In reply to @chronos.vitaqua "Immutable data at runtime,": thank you guys @pmunch |
13:05:58 | FromDiscord | <nnsee> fwiw I alleviate a lot of my no-IC pains with ccache |
13:06:04 | * | PMunch quit (Quit: Leaving) |
13:06:48 | FromDiscord | <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:51 | FromDiscord | <kryp7on> (edit) "way>" => "way?" |
13:11:42 | * | CO2 quit (Quit: WeeChat 4.1.1) |
13:12:43 | FromDiscord | <griffith1deadly> In reply to @kryp7on "I am wondering: did": large projects/companies have their own defined code syntax, and it's enforced |
13:14:33 | FromDiscord | <griffith1deadly> example https://status-im.github.io/nim-style-guide/ |
13:46:16 | * | dragsbruh joined #nim |
13:46:25 | dragsbruh | hi? |
13:50:29 | FromDiscord | <nnsee> hello |
13:51:28 | * | PMunch joined #nim |
13:53:06 | dragsbruh | I kind of have a problem\ |
13:53:11 | dragsbruh | with os module |
13:53:23 | FromDiscord | <nnsee> what's your problem? |
13:53:56 | dragsbruh | this is the code: |
13:53:56 | dragsbruh | import os |
13:53:57 | dragsbruh | discard setCurrentDir(newDir: "/"); |
13:54:25 | * | dragsbruh quit (Quit: Client closed) |
13:54:34 | * | dragsbruh joined #nim |
13:54:52 | dragsbruh | can u help |
13:56:07 | * | dragsbruh quit (Client Quit) |
13:56:11 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Krq |
13:56:38 | FromDiscord | <nnsee> In reply to @dragsbruh "discard setCurrentDir(newDir: "/");": that's not valid syntax |
13:56:41 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Krs |
13:57:17 | FromDiscord | <nnsee> drop the semicolon at the end of the line, and use an equals sign instead of a colon (or, yeah just `"/"`) |
13:58:40 | FromDiscord | <griffith1deadly> also discard work only with functions that has return type (primitives e.x) |
13:58:50 | FromDiscord | <griffith1deadly> (edit) "e.x)" => "ex)" |
13:58:56 | FromDiscord | <Chronos [She/Her]> That seems like some sus code lol |
14:05:53 | FromDiscord | <kryp7on> In reply to @chronos.vitaqua "That seems like some": what is wrong with code? 😄 |
14:07:08 | FromDiscord | <Chronos [She/Her]> Why would you need to go to the root dir :p |
14:07:26 | FromDiscord | <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:18 | FromDiscord | <kryp7on> oh, you mean its ransomware? 😄 |
14:16:53 | FromDiscord | <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:07 | FromDiscord | <kryp7on> even if Im CS student, and in that time I was making PoC ransomware |
14:17:26 | FromDiscord | <kryp7on> (edit) "what" => "why" |
14:24:29 | FromDiscord | <Chronos [She/Her]> Ah fair |
14:25:22 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "Why would you need": maybe they were just using it as an example |
14:25:57 | FromDiscord | <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:44 | FromDiscord | <nnsee> i was writing an example for them demonstrating the changing of the directory but i couldn't find the cwd proc? |
14:27:00 | FromDiscord | <Chronos [She/Her]> Fair |
14:27:31 | FromDiscord | <odexine> In reply to @nnsee "i was writing an": https://nim-lang.org/docs/ospaths2.html#getCurrentDir |
14:27:33 | FromDiscord | <odexine> moved |
14:27:48 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "speaking of which, am": https://nim-lang.org/docs/ospaths2.html#getCurrentDir |
14:27:50 | FromDiscord | <Chronos [She/Her]> Ah before me |
14:32:29 | FromDiscord | <nnsee> ah, thanks |
14:32:34 | FromDiscord | <nnsee> not sure why google didn't show me that |
14:39:17 | FromDiscord | <Chronos [She/Her]> Probably because it moved |
14:39:29 | FromDiscord | <Chronos [She/Her]> Typically I find searching the index with phrases works |
14:48:28 | * | CO2 joined #nim |
15:08:13 | FromDiscord | <nnsee> i tried that, but apparently didn't use the magic phrases |
15:08:18 | FromDiscord | <nnsee> (edit) "phrases" => "phrase" |
15:16:46 | PMunch | Just in case anyone wants to play around with my weird little exception thing from earlier: https://github.com/PMunch/labeltry |
15:22:40 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KrQ |
15:25:39 | FromDiscord | <jviega> Interesting, PMunch. Did you hear back from FOSDEM? |
15:28:13 | FromDiscord | <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:58 | FromDiscord | <jviega> Haha okay! Hopefully it's not an issue. I'm planning on it. |
15:32:04 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "i tried that, but": 'current' got it for me lol |
16:01:11 | NimEventer | New Nimble package! astiife - AST IIFE for nim. Generate code with AST., see https://github.com/xjzh123/astiife |
16:03:25 | FromDiscord | <Chronos [She/Her]> Isn't that just macros with extra steps? |
16:19:32 | FromDiscord | <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:52 | FromDiscord | <Chronos [She/Her]> Not even on the frontend yet, nowhere near, but thinking of applications of it |
16:26:31 | FromDiscord | <griffith1deadly> how i can get pointer to closure? |
16:44:20 | * | NimBot joined #nim |
16:44:38 | * | FromDiscord joined #nim |
16:48:18 | FromDiscord | <_gumbercules> In reply to @griffith1deadly "how i can get": can you elaborate here on what you're trying to do? |
16:48:34 | FromDiscord | <_gumbercules> because I'm not sure why you would want to do this |
16:50:18 | FromDiscord | <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:48 | FromDiscord | <_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:41 | FromDiscord | <_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4Ks8 |
16:54:20 | FromDiscord | <_gumbercules> and you can call `foo` simply with `myFooPtr()` |
16:55:42 | FromDiscord | <_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:28 | FromDiscord | <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:34 | FromDiscord | <_gumbercules> I mean you can try `cast` but I doubt it will work |
17:00:41 | FromDiscord | <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:25 | FromDiscord | <_gumbercules> gotcha - yeah I figured something like that was going to be screwy |
17:04:43 | FromDiscord | <_gumbercules> I wasn't aware of / forgot about `rawProc` |
17:11:25 | FromDiscord | <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:39 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Ksh |
17:11:55 | FromDiscord | <_gumbercules> In reply to @sys64 "I have some progress": your shader failed to compile... |
17:11:58 | FromDiscord | <griffith1deadly> destination - rawProc, environtment - rawEnv |
17:12:22 | FromDiscord | <_gumbercules> In reply to @griffith1deadly "destination - rawProc, environtment": yeah, this is sounding more familiar |
17:12:48 | FromDiscord | <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:22 | FromDiscord | <griffith1deadly> In reply to @sys64 "Yeah I noticed But": because for Emscripten you need shaders for gles3/gles2 |
17:13:28 | FromDiscord | <griffith1deadly> not default gl |
17:14:00 | * | rockcavera joined #nim |
17:17:25 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "ahaha, it doesn't work": Why do you need a closure specifically? |
17:18:23 | FromDiscord | <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:29 | FromDiscord | <_gumbercules> In reply to @griffith1deadly "because i can generate": what are you making, if you don't mind sharing? |
17:20:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "because for Emscripten you": Oh alright |
17:21:38 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "because i can generate": Ah |
17:31:55 | FromDiscord | <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:23 | FromDiscord | <System64 ~ Flandre Scarlet> or alternatively, do you know a replacement library for OpenGL? |
17:37:23 | FromDiscord | <griffith1deadly> sent a long message, see http://ix.io/4Kst |
17:37:43 | FromDiscord | <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:20 | FromDiscord | <griffith1deadly> In reply to @sys64 "And do you know": sorry, i don't use any version of gl for myself |
17:39:25 | FromDiscord | <griffith1deadly> In reply to @sys64 "or alternatively, do you": sokol-nim |
17:41:38 | FromDiscord | <_gumbercules> In reply to @griffith1deadly "i want to make": very cool! |
17:41:44 | FromDiscord | <_gumbercules> I use sokol-nim |
17:41:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "I use sokol-nim": From Sokam? By seeing the name |
17:41:59 | FromDiscord | <_gumbercules> No |
17:42:17 | FromDiscord | <_gumbercules> by https://github.com/floooh |
17:42:25 | FromDiscord | <_gumbercules> https://github.com/floooh/sokol |
17:43:45 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice |
17:45:33 | FromDiscord | <_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1168969017277562952/chrome_L3lOJ4938h_online-video-cutter.com_1.mp4?ex=6553b23c&is=65413d3c&hm=fbe5654e98386e409dbee798fd3c6bddfbcfa5da45c41e346a16ec820bfa6662& |
17:45:40 | FromDiscord | <_gumbercules> is a video of my project using sokol-nim |
17:46:01 | FromDiscord | <_gumbercules> and I've used imgui wtih sokol in other Nim and Odin projects |
17:47:32 | Amun-Ra | btw. sokół [IPA ˈsɔkuw] is polish for falcon |
17:48:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "": Quite interesting! |
17:48:27 | FromDiscord | <System64 ~ Flandre Scarlet> Btw did someone already worked with Emscripten? I have problems with infinite loops |
17:52:12 | FromDiscord | <_gumbercules> In reply to @sys64 "Btw did someone already": what kinds of problems? |
17:52:21 | FromDiscord | <_gumbercules> In reply to @Amun-Ra "btw. sokół [IPA ˈsɔkuw]": Russian as well I believe |
17:53:07 | FromDiscord | <_gumbercules> `сокол` in Russian |
17:53:28 | FromDiscord | <griffith1deadly> is sokol better than raylib? |
17:53:34 | FromDiscord | <_gumbercules> they're very different |
17:53:48 | FromDiscord | <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:09 | FromDiscord | <_gumbercules> Sokol is an abstraction over a bunch of the various graphics APIs - OpenGL, Metal, D3D11, WebGPU |
17:54:15 | Amun-Ra | _gumbercules: yes, the only difference is the pronouciation of 'o' vs 'ó' |
17:54:42 | FromDiscord | <_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:47 | FromDiscord | <_gumbercules> let me dig up docs for you |
17:54:55 | FromDiscord | <_gumbercules> there are a couple of ways to do it |
17:55:13 | FromDiscord | <_gumbercules> https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop |
17:55:32 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Ksy |
17:55:35 | FromDiscord | <System64 ~ Flandre Scarlet> Blank page |
17:55:36 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=4Ksy" => "https://play.nim-lang.org/#ix=4Ksz" |
17:55:58 | FromDiscord | <_gumbercules> yeah, that's because async doesn't work the same - you're better off bundling assets |
17:56:07 | FromDiscord | <_gumbercules> https://emscripten.org/docs/porting/files/packaging_files.html |
17:56:10 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/treeform/nim_emscripten_tutorial/blob/master/step2.nim↵I followed this |
17:56:31 | FromDiscord | <_gumbercules> I have no idea about ^ - I haven't used treeform's tutorials re: emscripten |
17:56:39 | FromDiscord | <_gumbercules> if you want to see how I'm doing it |
17:57:35 | FromDiscord | <_gumbercules> `--embed-file etc/sokol/shaders --preload-file etc/assets` in my call to `emcc` |
17:57:49 | FromDiscord | <_gumbercules> so I pass them via `passC` |
17:57:50 | FromDiscord | <System64 ~ Flandre Scarlet> I don't use any assets here |
17:58:18 | FromDiscord | <_gumbercules> oh - I thought you meant you were loading something - if the page never loads I'd check out the JS console |
17:58:29 | FromDiscord | <System64 ~ Flandre Scarlet> Nothing in the JS console |
17:58:32 | FromDiscord | <_gumbercules> hrm |
17:59:21 | FromDiscord | <_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:36 | FromDiscord | <_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:19 | FromDiscord | <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:27 | FromDiscord | <System64 ~ Flandre Scarlet> This is a simple Dear ImGUI app |
18:07:51 | FromDiscord | <_gumbercules> get rid of the while loop and replace it with an if |
18:08:01 | FromDiscord | <_gumbercules> you're looping infinitely inside of an infinite loop |
18:08:36 | FromDiscord | <_gumbercules> here I mean: |
18:08:37 | FromDiscord | <System64 ~ Flandre Scarlet> Oh |
18:08:43 | FromDiscord | <_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4KsD |
18:08:48 | FromDiscord | <_gumbercules> make that `if not window.windowShouldClose:` |
18:09:14 | FromDiscord | <_gumbercules> better even would be to do `if window.windowShouldClose: cleanup` |
18:10:26 | FromDiscord | <_gumbercules> `if not` and `while not` require extra brain juice |
18:13:45 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KsG |
18:13:59 | FromDiscord | <_gumbercules> yeah something like that |
18:14:20 | FromDiscord | <_gumbercules> there might be a more graceful way to terminate the emscripten main loop but 🤷 |
18:14:24 | FromDiscord | <System64 ~ Flandre Scarlet> Still have a blank page |
18:14:34 | FromDiscord | <_gumbercules> alright, let me continue digging |
18:15:02 | FromDiscord | <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:14 | FromDiscord | <Chronos [She/Her]> This is with the `nimcall` calling procedure |
18:16:08 | FromDiscord | <_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:11 | FromDiscord | <_gumbercules> index.html? |
18:16:19 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
18:16:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "index.html?": This one yeah |
18:16:26 | FromDiscord | <_gumbercules> thanks, let me grab my other laptop, be back in a few |
18:16:35 | FromDiscord | <System64 ~ Flandre Scarlet> alright! Thanks! |
18:23:31 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "This is with the": what are the advantages between the two? |
18:24:44 | FromDiscord | <Chronos [She/Her]> All procs in Nim, unless `importc`ed or the compiler is told otherwise, are `nimcall` |
18:26:42 | FromDiscord | <_gumbercules> looks like there may be some file paths in the build settings specific to your system possibly |
18:26:47 | FromDiscord | <_gumbercules> I've also never used `confy` |
18:26:58 | FromDiscord | <_gumbercules> let me see if I can figure out how to get it building |
18:29:19 | FromDiscord | <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:22 | FromDiscord | <_gumbercules> @System64 ~ Flandre Scarlet how do you normally build this? `nimble install`? |
18:29:38 | FromDiscord | <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:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "<@380360389377916939> how do you": ``nimble build -b:cpp -d:emscripten |
18:30:00 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "-d:emscripten" => "-d:emscripten``" |
18:30:54 | FromDiscord | <_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:16 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "okay cool, got it": Alright! Thanks! |
18:31:41 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "i can just add": Ah fair |
18:35:18 | FromDiscord | <_gumbercules> In reply to @sys64 "Alright! Thanks!": https://media.discordapp.net/attachments/371759389889003532/1168981536960413777/image.png?ex=6553bde5&is=654148e5&hm=e6ac5069cd317b94ea9d0f5ac8c05751e0f90a724403fef41cd4a1d058503101& |
18:35:30 | FromDiscord | <_gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4KsN |
18:35:31 | FromDiscord | <_gumbercules> and no problem |
18:35:38 | FromDiscord | <_gumbercules> happy to help |
18:36:11 | FromDiscord | <nnsee> In reply to @_gumbercules "": do you have font hinting/AA turned off? |
18:36:31 | FromDiscord | <nnsee> ah, are you running it over RDP? |
18:36:42 | FromDiscord | <Chronos [She/Her]> Why is the output of Argon hashes as bytes (from Libsodium) much smaller than Argon hashes when ascii encoded? |
18:36:44 | FromDiscord | <nnsee> reminds me of java |
18:36:54 | FromDiscord | <Chronos [She/Her]> Is the ascii encoded version containing more data? |
18:37:16 | FromDiscord | <_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:24 | FromDiscord | <_gumbercules> not my code - just helping to get it compiled / running |
18:37:36 | FromDiscord | <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:50 | FromDiscord | <nnsee> In reply to @_gumbercules "it's imgui running in": I meant the chrome tab and URL bar |
18:37:57 | FromDiscord | <Chronos [She/Her]> Isn't ascii 127 chars that can be used? |
18:38:14 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KsT |
18:38:18 | FromDiscord | <Chronos [She/Her]> That aren't special chars |
18:38:19 | arkanoid | could you please help me understand this error message? https://play.nim-lang.org/#ix=4KsS |
18:38:25 | FromDiscord | <_gumbercules> oh yeah - I have a bunch of windows GUI options disabled |
18:38:46 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "Isn't ascii 127 chars": yep, and that's only half of the full range :p |
18:38:56 | FromDiscord | <_gumbercules> specifically around GUI aesthetics |
18:39:10 | FromDiscord | <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:11 | FromDiscord | <_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1168982515940331561/image.png?ex=6553bece&is=654149ce&hm=e4affeb8d4db02aedfb9c917833df6e3789c4e0a6aaee4988f6ba27db0b06223& |
18:39:11 | FromDiscord | <nnsee> I'm not sure it's 127, it's probably lower+upper+digits+some symbols |
18:39:30 | FromDiscord | <Chronos [She/Her]> I wonder why the output here is much different |
18:39:48 | FromDiscord | <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:27 | FromDiscord | <Chronos [She/Her]> Fair, thanks Ras aha |
18:40:36 | FromDiscord | <nnsee> In reply to @_gumbercules "": ooof, i couldn't stand that :p |
18:40:39 | FromDiscord | <Chronos [She/Her]> I'm assuming some other data is stored but it's not clear as to what |
18:40:58 | arkanoid | the error says that I cant add an element to a seq, but the type maches |
18:41:01 | arkanoid | *matches |
18:41:07 | FromDiscord | <Chronos [She/Her]> Actually |
18:41:43 | FromDiscord | <_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:55 | FromDiscord | <_gumbercules> once I turned them off and ran with it for about a week I stopped caring I guess |
18:42:19 | FromDiscord | <_gumbercules> I used this PC primarily for astrophotography for a while and preserving battery life mattered more than readable fonts |
18:42:43 | FromDiscord | <Chronos [She/Her]> Bytes format is key derivatin while the string is made for storage |
18:42:48 | FromDiscord | <_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:03 | FromDiscord | <Chronos [She/Her]> Apparently it's fine to store the bytes in a db but clearly is missing some stuff still |
18:46:46 | FromDiscord | <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:08 | FromDiscord | <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:29 | FromDiscord | <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:48 | FromDiscord | <Phil> Personally I'd try to sort by problem domain |
18:52:50 | FromDiscord | <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:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "": To delete? |
18:54:11 | FromDiscord | <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:42 | FromDiscord | <System64 ~ Flandre Scarlet> Finally it works! https://media.discordapp.net/attachments/371759389889003532/1168987177334620260/image.png?ex=6553c325&is=65414e25&hm=13ed59bcb81d6806357e16ab0b32f5258cc60242c5eb93f7c632ebc5d92389e5& |
18:58:53 | FromDiscord | <Phil> Might actually make sense to refactor Snorlogue with that in mind as it currently follows the technical split |
18:59:23 | FromDiscord | <Phil> Then again, Snorlogue isn't really a large application nor does it solve a ton of problems, so feels like overengineering =/ |
19:03:31 | FromDiscord | <System64 ~ Flandre Scarlet> Does WASM supports threading? |
19:04:12 | * | neceve joined #nim |
19:12:33 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "If you can split": Hm, a bit hard though |
19:13:05 | FromDiscord | <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:55 | FromDiscord | <_gumbercules> In reply to @sys64 "To delete?": no sorry - I was just sharing a screenshot of my windows GUI settings |
19:13:59 | FromDiscord | <_gumbercules> In reply to @sys64 "Does WASM supports threading?": yes but it's more trouble than it's worth |
19:14:09 | FromDiscord | <_gumbercules> my strong advice is don't go there unless you have a really good reason to |
19:14:14 | FromDiscord | <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:30 | FromDiscord | <_gumbercules> the browser doesn't behave like a native app |
19:14:47 | FromDiscord | <Phil> A what now? |
19:15:04 | FromDiscord | <Phil> Oh, directed at jtv, apparently I need to google what a `.a` file is |
19:15:28 | FromDiscord | <jviega> Like a .so but statically linkable |
19:15:39 | FromDiscord | <Chronos [She/Her]> In reply to @jviega "Anyone know if there": That's for static linking, right? |
19:15:41 | FromDiscord | <Phil> Ahhh check, yeah SO gave the same |
19:15:43 | Amun-Ra | .a is an equivalent of windows' .lib |
19:15:55 | FromDiscord | <Chronos [She/Her]> Idk what either means |
19:16:03 | FromDiscord | <Chronos [She/Her]> Not a Windows user lol |
19:16:29 | FromDiscord | <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:48 | FromDiscord | <Phil> Or module, depending on how large or small your "technical" problems are that you're solving |
19:16:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "my strong advice is": My app uses multithreading for file export |
19:17:30 | FromDiscord | <System64 ~ Flandre Scarlet> it copies the synth context to the thread and the thread manages to create the file and save it |
19:18:06 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "That's what a "utils"": Fair |
19:18:08 | FromDiscord | <_gumbercules> yeah - I'm just saying in a wasm context I'd' find a way to do that with callbacks or something |
19:18:13 | FromDiscord | <_gumbercules> instead of using multiple threads |
19:18:23 | FromDiscord | <_gumbercules> emscripten + wasm even |
19:18:46 | FromDiscord | <_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:03 | FromDiscord | <Chronos [She/Her]> So global utils module everything uses? Or separated into something by dir? |
19:19:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "https://emscripten.org/docs/porting/pthreads.html a": I think Nim uses pthreads |
19:19:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kt5 |
19:19:44 | FromDiscord | <_gumbercules> pthreads are simply OS threads on linux |
19:20:00 | FromDiscord | <_gumbercules> https://man7.org/linux/man-pages/man7/pthreads.7.html |
19:20:01 | FromDiscord | <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:08 | FromDiscord | <Phil> (edit) "out.." => "out." |
19:20:19 | FromDiscord | <_gumbercules> windows has it's own threading implementation, same with macOS |
19:20:27 | FromDiscord | <_gumbercules> actually macos might use pthreads |
19:20:30 | FromDiscord | <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:31 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kt7 |
19:20:37 | FromDiscord | <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:48 | FromDiscord | <leorize> pthreads is just the interface |
19:20:58 | FromDiscord | <System64 ~ Flandre Scarlet> I don't think you can write on the disk with WASM/Emscripten |
19:20:59 | FromDiscord | <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:06 | FromDiscord | <_gumbercules> In reply to @sys64 "I don't think you": you need to use the virtual file system |
19:21:18 | FromDiscord | <Chronos [She/Her]> Lol |
19:21:18 | FromDiscord | <_gumbercules> https://emscripten.org/docs/api_reference/Filesystem-API.html |
19:21:20 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kt8 |
19:21:22 | FromDiscord | <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:35 | FromDiscord | <Phil> Similar problems may warrant code duplication just so you can cover them freely |
19:21:52 | FromDiscord | <_gumbercules> In reply to @leorize "pthreads is just the": yeah, my bad |
19:21:58 | FromDiscord | <Phil> (edit) "cover" => "change" | "changethem freely ... " added "and independently from one another" |
19:22:06 | FromDiscord | <Chronos [She/Her]> So that I don't accidentally break code between them? |
19:22:08 | FromDiscord | <leorize> it doesn't look bad tbh↵(@Chronos [She/Her]) |
19:22:09 | FromDiscord | <Chronos [She/Her]> Ah makes sense |
19:22:33 | FromDiscord | <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:35 | FromDiscord | <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:40 | FromDiscord | <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:47 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Basically, the idea is": Gucci o7 |
19:23:12 | FromDiscord | <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:16 | FromDiscord | <Phil> (if you don't have tests) |
19:23:45 | FromDiscord | <Chronos [She/Her]> I defo should add tests tbh |
19:23:46 | FromDiscord | <_gumbercules> sorry I meant to link here @flani : https://emscripten.org/docs/porting/files/index.html |
19:23:53 | FromDiscord | <Chronos [She/Her]> Procrastinating n them rn tho lol |
19:23:59 | FromDiscord | <_gumbercules> fuck - that's not the correct person, sorry flani |
19:24:04 | FromDiscord | <_gumbercules> @System64 ~ Flandre Scarlet https://emscripten.org/docs/porting/files/index.html |
19:24:16 | FromDiscord | <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:31 | FromDiscord | <Chronos [She/Her]> Yeah, actually did that before you said so aha |
19:24:33 | FromDiscord | <Phil> That also helps lay out the task each module should solve |
19:25:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "<@380360389377916939> https://emscripten.org/docs/p": So I'd need to make bindings for Nim? |
19:25:53 | FromDiscord | <Chronos [She/Her]> Naming files is the hardest part aha |
19:26:07 | FromDiscord | <_gumbercules> I'm sure they exist somewhere - if not it should be pretty trivial to do so |
19:26:21 | FromDiscord | <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:57 | FromDiscord | <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:59 | FromDiscord | <Chronos [She/Her]> Fair |
19:27:11 | FromDiscord | <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:20 | FromDiscord | <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:55 | FromDiscord | <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:33 | FromDiscord | <Phil> I think I even wrote myself the Readme file I recommended you write for yourself |
19:30:02 | FromDiscord | <Chronos [She/Her]> Yeah that makes sense |
19:30:12 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Ktg |
19:30:13 | FromDiscord | <Chronos [She/Her]> I'm doing this now :p |
19:30:38 | FromDiscord | <_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:44 | FromDiscord | <_gumbercules> https://stackoverflow.com/questions/54384684/webassembly-emscripten-write-files-to-disk-from-within-browser |
19:32:48 | FromDiscord | <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:06 | FromDiscord | <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:21 | FromDiscord | <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:39 | FromDiscord | <_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:44 | FromDiscord | <_gumbercules> but this is the way essentially |
19:38:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "yeah - there's a": So I need to do a binding for Nim ? |
19:38:31 | FromDiscord | <_gumbercules> no, sorry - it's a Nim library |
19:38:42 | FromDiscord | <_gumbercules> https://github.com/yglukhov/jsbind/ |
19:38:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "no, sorry - it's": Oh ! It will help me à lot ! |
19:38:59 | FromDiscord | <System64 ~ Flandre Scarlet> Thanks ! |
19:44:02 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "~~Honestly this is kinda": I don't understand that lol |
19:48:31 | FromDiscord | <Phil> As in sentence is confusing or as in "I dunno about domain driven design" ? |
19:49:14 | FromDiscord | <Elegantbeef> Domain driven design is when you write variable names that are valid domain names |
19:50:07 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Kto |
19:50:30 | FromDiscord | <leorize> make a proc and it'll work |
19:50:49 | FromDiscord | <Elegantbeef> Nim does have an implicit `string -> cstring` converter but it warns, though on JS it's perfectly safe |
19:50:57 | FromDiscord | <Phil> In reply to @Elegantbeef "Domain driven design is": domaindrivendesign is when your variable is somestuff.com |
19:55:04 | FromDiscord | <user2m> sent a code paste, see https://paste.rs/WNZBo |
19:55:19 | FromDiscord | <user2m> In reply to @leorize "make a proc and": what do you mean? |
19:56:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ktp |
19:57:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ktq |
19:57:38 | FromDiscord | <user2m> In reply to @Elegantbeef "The easiest way to": ah ok |
20:12:30 | arkanoid | I'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:24 | FromDiscord | <Elegantbeef> Relying on undefined behaviour that the release logic accidently protects you from |
20:14:00 | arkanoid | O_o |
20:16:23 | FromDiscord | <Elegantbeef> Valgrind and other friends will help you here |
20:16:34 | Amun-Ra | especially friends |
20:16:44 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Ktv |
20:16:48 | FromDiscord | <Elegantbeef> Given what you last talked about I assume you're doing C interop? |
20:16:56 | arkanoid | my debug code is already compiled with -fsanitize=address, and it already passes |
20:17:03 | arkanoid | and release works perfectly |
20:17:09 | Amun-Ra | arkanoid: add undefined |
20:17:34 | FromDiscord | <Elegantbeef> `network{.importc: "_network".}: Network` |
20:18:32 | arkanoid | also -fsanitize=address,undefined compiles without warning |
20:18:51 | Amun-Ra | and how it runs? |
20:19:23 | arkanoid | Amun-Ra: slow but fine |
20:19:47 | Amun-Ra | hmm |
20:20:14 | Amun-Ra | do you add any other defs to danger? --opt? |
20:20:16 | FromDiscord | <leorize> does it still produce wrong result? |
20:20:22 | Amun-Ra | perhaps something optimizes out |
20:20:41 | arkanoid | to 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:44 | FromDiscord | <Elegantbeef> Danger and release by default optimize the same |
20:21:02 | FromDiscord | <Elegantbeef> Danger only removes checks which allows the C compiler to optimise more aggresively |
20:21:06 | arkanoid | I've added "opt:speed" |
20:21:09 | FromDiscord | <leorize> there's also the potential that you're causing side-effects via asserts |
20:21:32 | Amun-Ra | right, that's why I ansked whether any other defs where added manually |
20:22:03 | Amun-Ra | arkanoid: can you paste the code somewhere? |
20:22:04 | arkanoid | well, 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:17 | arkanoid | Amun-Ra: I'll paste it |
20:22:46 | FromDiscord | <Elegantbeef> That doesn't matter the default optimization is for speed |
20:31:22 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "As in sentence is": Both :p |
20:41:24 | FromDiscord | <Elegantbeef> Pmunch are you still on? |
20:42:25 | FromDiscord | <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:34 | FromDiscord | <System64 ~ Flandre Scarlet> While compiling to Emscripten |
20:53:13 | PMunch | @Elegantbeef, yup |
20:55:24 | FromDiscord | <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:19 | PMunch | @Elegantbeef, are you? |
21:01:39 | FromDiscord | <pmunch> Ah pings don't survive across all the bridges |
21:01:49 | FromDiscord | <pmunch> Elegantbeef\: yes I'm still online |
21:01:56 | FromDiscord | <pmunch> But probably not for long |
21:03:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4KtD |
21:03:41 | FromDiscord | <jviega> Is there a way to see my link line when compiling? |
21:04:35 | FromDiscord | <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:22 | PMunch | Maybe with `--listCmd`? |
21:05:34 | FromDiscord | <jviega> Will try, thank you |
21:05:52 | FromDiscord | <jviega> Perfect, thanks |
21:06:07 | PMunch | @Elegantbeef, well that has some interesting side effects |
21:06:55 | PMunch | Now `getLabel` in a `finally` block won't show `NoLabel` when nothing raised, and things probably can't be nested properly any longer |
21:09:25 | FromDiscord | <Elegantbeef> Alternatively you might also be interested in https://play.nim-lang.org/#ix=4KtF which allows nested labels |
21:09:26 | FromDiscord | <Elegantbeef> But you do not technically need the double raise |
21:09:27 | FromDiscord | <Elegantbeef> Put a `defer` that sets it back to `NoLabel` |
21:09:29 | FromDiscord | <Elegantbeef> Actually the defer doesn't work |
21:10:24 | PMunch | How bad is a double raise, just out of curiosity |
21:10:39 | PMunch | I thought it would just restart the raising process without too much work |
21:11:56 | FromDiscord | <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:56 | FromDiscord | <jviega> Hmm, I'm missing something on these massive lines. what do I need to pick up _cmdCount and _cmdLine? |
21:13:20 | PMunch | Oh it does the full unwind twice.. |
21:13:24 | PMunch | Yeah that's not great |
21:13:38 | FromDiscord | <Elegantbeef> It's just food for thought, I'm now outta here to freeze my ass off 😄 |
21:14:21 | PMunch | Maybe try with `--genScript:on` to get compile script in your .nimcache folder. I used that when debugging Ratel stuff |
21:14:31 | PMunch | @Elegantbeef, freeze your ass off? |
21:14:52 | FromDiscord | <jviega> Thanks |
21:14:56 | PMunch | Yeah it could definitely be better, not sure how much work I should put into this little experiment though :P |
21:17:06 | FromDiscord | <Elegantbeef> Yea going to walk my dogs |
21:17:12 | FromDiscord | <Elegantbeef> Not that it's really cold out 😄 |
21:17:49 | PMunch | I'm going to get a snow, uhm, remover machine? |
21:17:58 | PMunch | What on earth do you call those? |
21:18:27 | PMunch | Like one of these: https://haugalandbatsenter.no/images/product/7d3fe5f0-6984-4c20-996c-60337d2189d8.jpg?7c27d3d3-ce09-d4bb-c82b-a9a38c47 |
21:19:43 | FromDiscord | <fowl.mouth> Snow blower |
21:19:50 | PMunch | That's it! |
21:20:18 | FromDiscord | <fowl.mouth> It’s snowing here, first snow of the season |
21:21:04 | PMunch | We had some snow a couple weeks back, but it looks like it's more here to stay this time |
21:21:26 | PMunch | And of course the yearly total chaos down south :P |
21:21:43 | PMunch | Always 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:44 | FromDiscord | <Chronos [She/Her]> Wondering if it's a good idea to make it so everything has to operate on an `Application` type |
21:51:56 | FromDiscord | <Chronos [She/Her]> (Better names accepted lol) |
21:52:27 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> Opposed to what? |
21:53:48 | FromDiscord | <Chronos [She/Her]> Just defining everything as variables and grabbing them as necessary from whatever file it's defined in |
21:54:22 | FromDiscord | <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:12 | FromDiscord | <Elegantbeef> globals r bad |
21:58:27 | PMunch | Yeah, don't do globals |
21:59:16 | FromDiscord | <Chronos [She/Her]> 👍 |
22:02:28 | * | PMunch quit (Quit: leaving) |
22:14:22 | FromDiscord | <bostonboston> Anyone have any practical examples of using `mixin` |
22:20:01 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/writeups/codereuse.html \:d |
22:20:39 | FromDiscord | <Elegantbeef> https://github.com/beef331/gooey/blob/master/src/gooey.nim↵https://github.com/beef331/truss3d/blob/master/src/truss3D/atlasser.nim |
22:21:21 | FromDiscord | <pmunch> So this is interesting: https://play.nim-lang.org/#ix=4KtM |
22:21:56 | FromDiscord | <pmunch> In an exception you can goto back into the state machine case. |
22:22:38 | FromDiscord | <pmunch> I wonder what happens with variables local to the try scope then you do that 🤔 |
22:23:33 | FromDiscord | <pmunch> Could be useful to refresh an expired token and jump back where it failed. |
22:42:34 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KtR |
22:42:57 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1169043862275231784/message.txt?ex=6553f7f0&is=654182f0&hm=acbab67672ea9e1b69c37879d62b1932fe77f8fa34513cc63fa2de580613832e& |
22:58:56 | FromDiscord | <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:11 | FromDiscord | <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:21 | FromDiscord | <_gumbercules> In reply to @sys64 "": it appears the `extern c` is getting applied / generated twice. Not sure why... |
23:21:28 | FromDiscord | <_gumbercules> that's the underlying problem though |
23:23:34 | * | advesperacit quit () |
23:31:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "it appears the `extern": I fixed the problem with ``--define:jsbindNoEmJs`` |
23:36:38 | FromDiscord | <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:58 | FromDiscord | <_gumbercules> ah yeah I think I had to do that as well in my project |
23:38:07 | FromDiscord | <_gumbercules> although I don't even know if I'm using jsbind anymore 🤷 |
23:40:01 | FromDiscord | <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:09 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "I" => "I'm" |
23:41:03 | FromDiscord | <_gumbercules> you need to set the size of the thread pool via configuration |
23:41:18 | FromDiscord | <_gumbercules> and yeah - you can't block on the main thread |
23:41:40 | FromDiscord | <_gumbercules> well you can but you shouldn't |
23:41:42 | FromDiscord | <_gumbercules> it's going to break your app |
23:49:58 | * | oprypin quit (Quit: Bye) |
23:50:09 | * | oprypin joined #nim |