00:02:55 | * | cnx quit (Ping timeout: 256 seconds) |
00:03:10 | * | cnx joined #nim |
00:08:49 | * | dv^_^ quit (Quit: dv^_^) |
00:09:32 | * | dv^_^ joined #nim |
00:10:52 | * | azimut joined #nim |
00:27:02 | * | dv^_^ quit (Quit: dv^_^) |
00:27:43 | * | dv^_^ joined #nim |
00:28:10 | * | dv^_^ quit (Client Quit) |
00:28:47 | * | dv^_^ joined #nim |
00:45:10 | NimEventer | New thread by Naterlarsen: Trying To Slice the Characters Where Needed., see https://forum.nim-lang.org/t/10007 |
00:53:09 | FromDiscord | <Spark> Just a question |
00:53:24 | FromDiscord | <Spark> is `-d:nimNoLentIterators` safe? |
00:53:27 | FromDiscord | <Spark> just checking |
00:54:07 | FromDiscord | <Spark> is anyone online? |
00:54:27 | FromDiscord | <Spark> (edit) removed "anyone online?" |
01:01:19 | FromDiscord | <Spark> oh yeah |
01:01:20 | FromDiscord | <Spark> and |
01:01:43 | FromDiscord | <Spark> how do I turn a `lent` type back to normal? |
01:08:49 | FromDiscord | <kfdvh> In reply to @Spark "how do I turn": copy? |
01:14:03 | FromDiscord | <huantian> `let someCopy = someLent` |
01:14:24 | FromDiscord | <kfdvh> what is `lent` and `owned` |
01:14:40 | FromDiscord | <huantian> owned is an old thing that doesn't matter anymore |
01:15:09 | FromDiscord | <kfdvh> what's lent |
01:16:12 | FromDiscord | <huantian> see https://nim-lang.org/docs/destructors.html#lent-type |
01:17:39 | FromDiscord | <huantian> it's a pointer, which lets you use the value without copying it |
01:18:57 | FromDiscord | <huantian> kinda like an immutable reference |
01:28:02 | FromDiscord | <kfdvh> I have code that push `ref T` onto C library and then retrieves it. Anything I need to do? |
01:28:56 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qW2 |
01:43:33 | FromDiscord | <ElegantBeef> `GcRef` and `GcUnref` |
01:43:40 | FromDiscord | <tobealive> sent a long message, see http://ix.io/4qW4 |
01:43:53 | FromDiscord | <ElegantBeef> References in Nim are pointers taht are ref counted |
01:44:09 | FromDiscord | <ElegantBeef> You can do `from module import proc` but almost no one does it |
01:44:32 | FromDiscord | <ElegantBeef> Idiomatic Nim imports modules and all their exported symbols |
01:45:15 | FromDiscord | <ElegantBeef> You also do not need to memcpy, just do `b = a` |
01:45:22 | FromDiscord | <ElegantBeef> References are pointers |
01:46:40 | FromDiscord | <tobealive> Oh wow, it really works now. Might have been an lsp misleading error and I should have restarted my language server to doublecheck. ↵Thanks for pushing me to try again! |
01:48:51 | FromDiscord | <ElegantBeef> yea generally that type of import is only really used in disambiguation, but I cannot force you to code a specific way 😄 |
01:49:07 | FromDiscord | <Elegantbeef> Ping |
01:50:06 | FromDiscord | <ringabout> Pong |
01:50:20 | FromDiscord | <Elegantbeef> Oh ringabout the CI is borked eh? 😄 |
01:51:03 | FromDiscord | <tobealive> The thing is, when I write integration tests and import a whole module that requires cli input args the tests will also require those args.↵Importing the peaces that should be tested works. |
01:51:44 | FromDiscord | <Elegantbeef> I do not follow |
01:51:48 | FromDiscord | <ringabout> Nope? It is usually flaky. |
01:52:03 | FromDiscord | <Elegantbeef> If you import procedures from a module, how does it matter that some variation requires X things |
01:52:20 | FromDiscord | <Elegantbeef> I mean it seems really flaky right now |
01:54:07 | FromDiscord | <ringabout> Yeah |
02:00:49 | FromDiscord | <tobealive> If my main module requires an input file to be passed as argument, running all tests, it will fail on the test that have the main module imported, stating there are missing cli args. |
02:01:09 | FromDiscord | <Elegantbeef> `when isMainModule: ...`? |
02:01:13 | FromDiscord | <tobealive> Same for using every other module that will import the main moudle |
02:01:39 | FromDiscord | <Elegantbeef> If you have to selectively import things you're doing modules wrong |
02:02:22 | FromDiscord | <ringabout> Why JS backend doesn't support lambda lifting? Does it hurt the code size too much to lift? |
02:02:55 | FromDiscord | <Elegantbeef> I wonder does it even need it, do JS closures not map well enough? |
02:06:10 | FromDiscord | <tobealive> I following the recommendations and used testament for the test. I'll rethink 👍 |
02:14:06 | * | azimut quit (Remote host closed the connection) |
02:14:33 | * | azimut joined #nim |
02:38:49 | * | azimut quit (Remote host closed the connection) |
02:39:10 | * | azimut joined #nim |
02:54:55 | FromDiscord | <ringabout> Yeah, closure iterators and some bugs https://github.com/nim-lang/Nim/issues/12492 |
02:56:30 | FromDiscord | <ringabout> And since now we can copy https://github.com/nim-works/nimskull/pull/586 |
02:58:27 | FromDiscord | <Iliketwertles> given this string:↵`01:00.0 VGA compatible controller: NVIDIA Corporation TU116 [GeForce GTX 1650 SUPER] (rev a1)`↵is there a simple way to just print whats in the brackets without the brackets? |
02:59:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWd |
02:59:34 | FromDiscord | <Elegantbeef> Maybe i am just glorified chatgpt |
02:59:51 | FromDiscord | <Iliketwertles> idk if chatgpt knows nim tho, never tried lol |
03:02:13 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1085759896512909373/image.png |
03:04:04 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1085760365842944083/image.png |
03:04:13 | FromDiscord | <ringabout> Isn't bing clever? |
03:04:21 | FromDiscord | <ringabout> (edit) "Isn't bing ... clever?" added "more" |
03:04:36 | FromDiscord | <Iliketwertles> pickle fetch hehe https://media.discordapp.net/attachments/371759389889003532/1085760499691561041/screenshot_2023-03-15-230417.png |
03:04:43 | FromDiscord | <Elegantbeef> No clue it refuses to call people that uses it a cunt |
03:05:53 | FromDiscord | <demotomohiro> @Iliketwertles If it is an output from `lspci` or `lshw` command, using some command line options that output message in easy to parse format might be easier. |
03:06:29 | FromDiscord | <Iliketwertles> the stuff above worked with a little modification |
03:06:32 | FromDiscord | <Iliketwertles> ¯\_(ツ)_/¯ |
03:06:48 | FromDiscord | <Elegantbeef> Sure but it's always easier to use the tool proper |
03:06:54 | FromDiscord | <Iliketwertles> good idea for future reference tho |
03:07:19 | FromDiscord | <Elegantbeef> Like for my graffiti tool, i could've used `git log` without any other flags, but i have a nice 1 line format which is extremely easy to read 😄 |
03:10:00 | FromDiscord | <Iliketwertles> found an issue in my cat remake oh no |
03:11:57 | FromDiscord | <demotomohiro> https://www.man7.org/linux/man-pages/man8/lspci.8.html↵> If you intend to process the output of lspci automatically, please use one of the machine-readable output formats (-m, -vm, -vmm) described in this section. All other formats are likely to change between versions of lspci. |
03:16:04 | FromDiscord | <Iliketwertles> ok i fixed it |
03:16:25 | FromDiscord | <Iliketwertles> was only reading one line from stdin but i stole some code from another project |
03:16:47 | FromDiscord | <Iliketwertles> doesnt like odd characters |
03:17:08 | FromDiscord | <Iliketwertles> me neither so its fine |
03:22:18 | FromDiscord | <kfdvh> is it possible to have `ref` of opaque type? |
03:22:44 | FromDiscord | <kfdvh> I want to have vtable without closure |
03:23:44 | FromDiscord | <Elegantbeef> What does that even mean? |
03:29:35 | * | derpydoo quit (Ping timeout: 260 seconds) |
03:30:10 | FromDiscord | <demotomohiro> You can create vtable with an array/object of proc pointers with `nimcall` or other calling convention. |
03:39:51 | FromDiscord | <kfdvh> In reply to @demotomohiro "You can create vtable": that was the approach I know |
03:55:28 | NimEventer | New thread by Naterlarsen: Slicing a string of characters from a starting point until all is selected., see https://forum.nim-lang.org/t/10008 |
04:09:58 | FromDiscord | <ricky> wish nim had `reflexpr` like cxx23 bros.. |
04:11:11 | FromDiscord | <Elegantbeef> What behaviour are you after? |
04:12:56 | FromDiscord | <Elegantbeef> Nim's macro system can do everything that C++'s reflexpr can do afaik |
04:13:35 | FromDiscord | <ricky> i havent been lucky enough to write nim in a while tbh, that is good to know tho |
04:13:37 | FromDiscord | <ricky> thx 😎 |
04:15:21 | FromDiscord | <Elegantbeef> You can also do quite a lot with just compile time procedures |
04:17:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWs |
04:38:47 | onetwo3 | whats the differencce beween parseInt and parseInt() |
04:39:29 | FromDiscord | <Elegantbeef> One is a pointer procedure the other is calling |
04:40:13 | onetwo3 | could u explain like im a retard please |
04:40:33 | onetwo3 | because when i test it theres no difference in output |
04:40:45 | FromDiscord | <Elegantbeef> Oh you mean command syntax |
04:40:49 | FromDiscord | <Elegantbeef> Look at the manual for command syntax |
04:41:00 | onetwo3 | the parseInt function in strutils |
04:45:02 | * | derpydoo joined #nim |
05:02:57 | * | cm quit (Quit: Bye.) |
05:10:47 | * | cm joined #nim |
05:16:43 | * | arkurious quit (Quit: Leaving) |
05:24:58 | * | rockcavera quit (Remote host closed the connection) |
05:30:11 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWA |
05:33:23 | FromDiscord | <Rika> overloading? |
05:33:50 | FromDiscord | <Girvo> My `none` usage is wrong too, but ignore that |
05:33:53 | FromDiscord | <Girvo> Overloading? |
05:34:46 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4qWC |
05:35:08 | FromDiscord | <Girvo> Ah right I'm with ya |
05:35:11 | FromDiscord | <Girvo> Yeah might be the way to go for this |
05:36:31 | FromDiscord | <Girvo> Oh man now I've run into a more fun problem haha |
05:36:44 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWD |
05:37:08 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWE |
05:37:55 | FromDiscord | <Elegantbeef> Task is an object |
05:38:13 | FromDiscord | <Elegantbeef> `cast[object](ptr)` is wrong |
05:38:19 | FromDiscord | <Girvo> Oh you're right! |
05:45:46 | FromDiscord | <Rika> In reply to @Elegantbeef "`cast[object](ptr)` is wrong": cursed lol |
05:46:37 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWH |
05:48:50 | FromDiscord | <Elegantbeef> How do you invoke? |
05:49:25 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWI |
05:49:46 | FromDiscord | <Elegantbeef> `a1[]` is invalid |
05:49:46 | FromDiscord | <Girvo> `internalFunc` itself is called directly by `xTaskCreatePinnedToCore` internall in C |
05:50:40 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWJ |
05:51:01 | FromDiscord | <Rika> i dont understand |
05:51:35 | FromDiscord | <kfdvh> (edit) "https://play.nim-lang.org/#ix=4qWJ" => "https://play.nim-lang.org/#ix=4qWK" |
05:51:35 | FromDiscord | <Elegantbeef> Girvo use a debug compiler is what i'd say |
05:52:11 | FromDiscord | <Rika> In reply to @kfdvh "is there a way": i dont understand what you're looking for |
05:52:30 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWL |
05:52:36 | FromDiscord | <Girvo> oops I meant this: https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
05:52:49 | FromDiscord | <kfdvh> In reply to @Rika "i dont understand what": I need to write callback hell but without indentation |
05:53:40 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWM |
05:54:14 | FromDiscord | <kfdvh> Nim syntax says I must indent 1 level per nested callback |
05:54:18 | FromDiscord | <Rika> needs to be curried? |
05:55:33 | FromDiscord | <amadan> https://nim-lang.org/docs/sugar.html#%3D%3E.m%2Cuntyped%2Cuntyped↵Maybe this?↵More or less just a wrapper around doing `foo(proc (a: auto) = bar(proc (b: auto) = baz(proc (c: auto) = echo(a, b, c)))` |
05:56:28 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWN |
05:57:10 | FromDiscord | <Rika> i dont think it would happen because its not very straightforward what that means |
05:57:32 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWO |
05:57:33 | FromDiscord | <Rika> yes |
05:57:36 | FromDiscord | <Rika> i know |
05:57:44 | FromDiscord | <Rika> what i mean is that its not very obvious that it means that |
05:58:04 | FromDiscord | <Girvo> Beef: https://pastebin.com/tAZJn7Z9 |
05:58:05 | FromDiscord | <kfdvh> is there a library/macro that does that |
05:58:44 | FromDiscord | <Elegantbeef> Girvo in ccgexprs put an echo on the node 😄 |
05:58:51 | FromDiscord | <Elegantbeef> line 2994 |
06:00:20 | FromDiscord | <Girvo> sent a code paste, see https://paste.rs/pRO |
06:00:27 | FromDiscord | <Elegantbeef> `echo n` should work |
06:00:48 | FromDiscord | <Girvo> Okay sweet |
06:01:19 | FromDiscord | <Girvo> I need to koch build again yeah? |
06:01:36 | FromDiscord | <Elegantbeef> `./koch temp c myNim.nim` |
06:05:30 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWR |
06:06:34 | FromDiscord | <Elegantbeef> So the task ident is the issue |
06:07:01 | FromDiscord | <Girvo> I just renamed it to `tsk` but same error it seems. I have a theory, I'm having a look now |
06:07:15 | FromDiscord | <Girvo> Ah. No, that wasn't it, damn it |
06:07:32 | FromDiscord | <Elegantbeef> How is this being called? |
06:08:15 | FromDiscord | <Girvo> Thats the thing, it's being called inside C code (`xCreateTaskPinnedToCore`) |
06:08:20 | FromDiscord | <Girvo> I never call it myself |
06:08:38 | FromDiscord | <Elegantbeef> How does the C call it though |
06:08:41 | FromDiscord | <Elegantbeef> Cause it's a generic |
06:08:48 | FromDiscord | <Elegantbeef> So you have to pass it somehow |
06:09:06 | FromDiscord | <Girvo> One sec |
06:10:04 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWT |
06:10:07 | FromDiscord | <Girvo> So the issue is that _these_ aren't generic |
06:10:10 | FromDiscord | <Girvo> Right? |
06:10:40 | FromDiscord | <Girvo> One nice thing I guess is if it is, then the `pointer` can become `ptr T` directly |
06:11:57 | FromDiscord | <Elegantbeef> Likely |
06:12:58 | FromDiscord | <Girvo> It's a nicer binding instead of void pointer, too, I'd hope. I'll test it ou |
06:12:58 | FromDiscord | <Girvo> t |
06:18:48 | FromDiscord | <Girvo> Yep, got it. Its compiling correctly at least now! Now to see if it does what it's supposed to do |
06:19:09 | FromDiscord | <Girvo> Is it possible to increment/decrement the ref count for a `ref object` type myself? |
06:19:11 | FromDiscord | <Elegantbeef> I'm actually really confused where the error came from |
06:19:34 | FromDiscord | <Elegantbeef> `GcRef` and `GcUnref` |
06:20:02 | FromDiscord | <Elegantbeef> Where you passing a generic proc name to a proc parameter without a generic parameter? |
06:20:03 | FromDiscord | <Elegantbeef> Were\ |
06:20:16 | FromDiscord | <Girvo> Indirectly, but yes I believe so |
06:21:23 | FromDiscord | <Girvo> Basically while my call to xTaskCreate knew what T was, the xTaskCreate itself and xTaskCreatePinnedToCore (which it calls internally) did not -- they had no generic params at all, just took a proc with a `pointer` arg, so `T` for `innerFunc` was just empty, as far as I can tell |
06:21:46 | FromDiscord | <Elegantbeef> Weird that it compiled |
06:22:23 | FromDiscord | <Girvo> It didn't really though, it choked trying to compile? |
06:22:37 | FromDiscord | <Elegantbeef> It got passed static analysis so that's 'compiled' 😄 |
06:22:42 | FromDiscord | <Girvo> Ahhhh right haha |
06:22:45 | FromDiscord | <Elegantbeef> got past\ |
06:22:57 | FromDiscord | <Girvo> Its more that it choked the static analysis stuff altogether I think haha |
06:23:06 | FromDiscord | <Elegantbeef> I mean it was in code gen |
06:23:24 | FromDiscord | <Elegantbeef> Codegen is past where this should error |
06:23:33 | FromDiscord | <Elegantbeef> \Trying to reproduce this now |
06:23:38 | FromDiscord | <Girvo> Oh interesting |
06:23:53 | FromDiscord | <Girvo> This is on 1.16.10 btw |
06:24:12 | FromDiscord | <Elegantbeef> I mean it also errored on devel if that's what you build the devel compiler with |
06:24:41 | FromDiscord | <Girvo> Uh maybe. I just ran `./koch boot` inside the 1.16.10 checkout I have haha |
06:24:48 | FromDiscord | <Elegantbeef> Ah |
06:25:04 | FromDiscord | <Elegantbeef> Also it's 1.6.10 |
06:25:08 | FromDiscord | <Girvo> Yeah that one |
06:25:16 | FromDiscord | <Girvo> I'll try to put together a minimal test case for it |
06:25:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWW |
06:26:43 | FromDiscord | <Elegantbeef> Also i know you like rust, so... https://github.com/beef331/fungus |
06:28:35 | FromDiscord | <Girvo> Oooooooh 😄 |
06:29:29 | FromDiscord | <Elegantbeef> It doesnt have all the wild pattern matching, but I cannot be arsed to do that, basic pattern matching is the best I give |
06:30:29 | FromDiscord | <Elegantbeef> I also realise now i have not tested if static parameters work, they should... but who knows |
06:33:04 | FromDiscord | <Girvo> Thats actually really neat, I've basically done that myself the long way |
06:33:17 | FromDiscord | <Girvo> And tbh basic pattern matching is enough |
06:33:21 | FromDiscord | <Girvo> For my use cases anyway |
06:33:58 | FromDiscord | <Elegantbeef> I just look at rust's `if let` and how limited it was and say "Yea it's good nuff" |
06:34:19 | FromDiscord | <Girvo> haha |
07:12:04 | * | cnx quit (Read error: Connection reset by peer) |
07:38:35 | * | ltriant quit (Ping timeout: 264 seconds) |
07:41:00 | * | cnx joined #nim |
07:53:43 | Amun-Ra | do you check whether new_seq etc returns nil? |
07:56:13 | FromDiscord | <Elegantbeef> Nope seqs are no longer nilable |
07:57:02 | Amun-Ra | is not enough memory condition defined in nim or does it work like in f.e. rust? |
07:57:10 | * | rmt joined #nim |
07:57:44 | FromDiscord | <Elegantbeef> Nim panics on oom unless you use a outOfMem hook that doesnt presently function |
07:57:54 | Amun-Ra | oh ;) |
08:02:55 | Amun-Ra | I like lua approach on that issue |
08:15:27 | * | rmnmjw joined #nim |
08:31:00 | * | PMunch joined #nim |
08:49:51 | * | Notxor joined #nim |
09:17:41 | * | ltriant joined #nim |
09:21:16 | onetwo3 | how do i convert a string to a uint64 |
09:23:38 | PMunch | onetwo3, depends on how you want to convert it |
09:23:57 | onetwo3 | how? |
09:24:05 | onetwo3 | parseInt(myString, base=10, uint=true) |
09:24:07 | onetwo3 | like this? |
09:25:37 | anddam | howdy, I built a simple nimgl/imgui program using cpp backend, I get an exe of ~2.5MB that should have the dear-imgui library builtin, starting it on a different machine (where nim and the C toolchain are not installed) I get |
09:25:40 | anddam | "The code executable cannot continue because libgcc_s_seh-1.dll was not found. To fix the problem, try reinstalling the program" |
09:26:00 | anddam | so basically the same issue this guy has with Qt https://stackoverflow.com/questions/68961784/the-code-executable-cannot-continue-libgcc-s-seh-1-dll-was-not-found |
09:26:24 | anddam | he is suggested to use a qt deploy tool, how should I go for nim instead? |
09:29:47 | anddam | I see the libs are in ~\.choosenim\toolchains\mingw64\bin\ but what's the proper way to prepare an executable for deploying? |
09:31:04 | anddam | oh I installed nim using choosenim |
09:31:53 | PMunch | onetwo3, well as I said it depends on what you want. If you want to parse a number in a string, e.g. "127" -> 127 then `myString.parseInt` will suffice |
09:32:44 | PMunch | And if you want a uint you do `myString.parseUint` |
09:32:56 | PMunch | https://nim-lang.org/docs/parseutils.html#parseUInt%2Cstring%2Cuint%2Cint |
09:34:03 | PMunch | anddam, if you want it totally portable you need to static link against that library |
09:34:27 | anddam | PMunch: yeah I am trying that from reading https://github.com/nimterop/nimterop/issues/248#issuecomment-685022058 |
09:34:58 | anddam | I point is I am unaware about almost everything nim works, I tried `nim cpp --app:staticlib` |
09:35:13 | anddam | and got a fat nice |
09:35:15 | anddam | Error: invocation of external linker program failed. The system cannot find the file specified. |
09:35:26 | anddam | c/I point/ c/the point/ |
09:35:37 | PMunch | Haha, yeah that is for creating a static library |
09:36:10 | anddam | oh right, that's actually in --help |
09:36:31 | PMunch | Maybe try with `--passL:"-static-libgcc"`? |
09:36:44 | PMunch | https://unix.stackexchange.com/questions/633316/how-to-statically-link-missing-libgcc-s-seh-1-dll-and-libstdc-6-dll-dlls-for-9 |
09:37:15 | anddam | I guess that's "pass to linker" |
09:37:40 | onetwo3 | PMunch thanks |
09:38:48 | PMunch | anddam, correct |
09:38:53 | PMunch | passC is pass to compiler |
09:39:53 | anddam | PMunch: success, in fact |
09:40:08 | anddam | what does --app:gui imply? |
09:40:35 | PMunch | It's a Windows thing, basically it hides the terminal which pops up when you run a GUI application |
09:41:06 | PMunch | Say you wrote a GUI app and didn't use that switch the program would start, but it would also start a command line where you could see command line output |
09:41:26 | PMunch | With the --app:gui switch only the program window would show, no command line |
09:41:49 | anddam | that would be when calling the program from a CLI or even by starting it, say, from explorer with double click? |
09:42:24 | PMunch | I believe so |
09:42:40 | PMunch | Haven't used Windows in about 10 years, so honestly don't quite know :P |
09:42:58 | anddam | writing a GUI app in this context would be using MS apis, one of the many application runtimes? |
09:43:16 | anddam | oh I started with it a few months ago, still hating it strong |
09:43:20 | PMunch | Well any GUI library |
09:43:26 | PMunch | Hating what? |
09:43:29 | anddam | windows |
09:43:33 | PMunch | Haha :P |
09:43:45 | PMunch | Why did switch? And what did you switch from? |
09:43:48 | anddam | well, it and all the ecosystem, but the new job was a MS only shop |
09:43:58 | PMunch | Ah, that always suck |
09:44:07 | PMunch | I make sure to mention it in interviews |
09:44:09 | anddam | I have been using macos and linux since, I guess more than 20 years |
09:44:33 | PMunch | Ah, you've been using them all three |
09:44:36 | anddam | last 10 linux systems only, I have decrapped all my setup |
09:45:00 | PMunch | Yeah, the ability to tweak and build workflows in Linux is amazing |
09:46:28 | anddam | I liked macos but it's became too much of a walled garden, once my mbp broke several years ago I switched "temporarily" to a cheap notebook with a linux system, hasn't felt the need to go back since |
09:46:34 | anddam | anyways |
09:47:05 | anddam | the difference with the static build flag is a mere 16kB in the resulting exe |
09:47:08 | anddam | a bit surprising |
09:47:24 | PMunch | Well, there are multiple factors there |
09:47:41 | PMunch | First of maybe the DLL wasn't that big |
09:48:14 | PMunch | Second there might be some overhead in the executable format which negates the savings when using dynamic libraries |
09:48:40 | PMunch | I tried to squeeze some Linux binaries at some point, and as soon as you need a dynamic library the binary size goes above 1.4Mb IIRC |
09:50:18 | anddam | ahhh, a juicy "the application was unable to start correctly 0xc000007b." |
09:53:20 | anddam | see how even their HTML layout is crap https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 look for "0xC000007B" |
09:58:22 | PMunch | Haha, perfectly sized table |
09:58:54 | PMunch | Was this with the -static-libgcc switch? |
09:59:12 | PMunch | Maybe try passing it to `passC` as well as `passL` |
10:00:41 | anddam | I am reading https://github.com/nim-lang/Nim/issues/19713 |
10:03:31 | anddam | jeez I didn't get the season finale, tlsEmulation was turned off on windows, and… they replaced the gcc used with tdm-gcc? |
10:04:18 | FromDiscord | <ringabout> tlsEmulation was turned on windows by default |
10:04:27 | anddam | willing to follow this recommendation https://github.com/nim-lang/Nim/issues/19713#issuecomment-1099522557 do I just replace the .exe in ~\.choosenim (that sounds bad) or is there a proper way to handle a new compiler? |
10:04:46 | anddam | ringabout: ok, but I am unsure how the issue (that I am experiencing now) was resolved |
10:05:14 | FromDiscord | <ringabout> Are sure they are of the same issue? Did you check the missing DLL? |
10:05:19 | anddam | I installed nim with choosenim last month or so |
10:05:38 | anddam | no I am not even aware how to do that |
10:06:41 | anddam | I remember there are MS tools to inspect PEs and the like, I do not even remember that suite name |
10:06:47 | FromDiscord | <ringabout> The issue you mentioned is supposed to be solved on latest Nim. You might reinstall the latest choosenim and choose latest stable Nim binary. |
10:07:05 | * | jerm joined #nim |
10:07:24 | FromDiscord | <ringabout> In reply to @anddam "I remember there are": https://www.dependencywalker.com/ can check missing dlls. |
10:07:34 | FromDiscord | <ringabout> (edit) "dlls." => "dlls on windows." |
10:07:55 | anddam | I am on choosenim v0.8.4 (2022-07-06 14:50:55) [windows/amd64] so that seems latest |
10:08:13 | anddam | Info: Version 1.6.10 already selected |
10:08:14 | FromDiscord | <ringabout> Nim version? |
10:08:45 | FromDiscord | <ringabout> What does `nim -v` give? |
10:09:01 | anddam | Nim Compiler Version 1.6.10 [Windows: amd64] |
10:09:03 | anddam | Compiled at 2022-11-21 |
10:09:05 | anddam | Copyright (c) 2006-2021 by Andreas Rumpf |
10:10:33 | FromDiscord | <ringabout> That's weird. I use choosenim and 1.6.10, which works for me. |
10:10:51 | FromDiscord | <ringabout> What's does `gcc -v `gives? |
10:10:58 | anddam | oh but my issue is when I copy the .exe on a different system, with no ming64 installed |
10:11:09 | anddam | on my system, where I compile, it works just fine |
10:11:59 | FromDiscord | <ringabout> You probably need to ship some DLLs. |
10:12:04 | anddam | https://termbin.com/30g2 |
10:13:35 | anddam | I am always a bit wary of closed source programs |
10:13:40 | anddam | I mean apropo dependencywalker |
10:13:58 | anddam | well, not that all the other sheet I am using from MS is open… |
10:14:33 | anddam | the toolset I was looking for is Sysinternals |
10:16:34 | anddam | ok I'll play with this later |
10:17:18 | FromDiscord | <Andreas> Does anybody use the Lapce-Editor for devel ? i just tried and it feels fast and looks like vs-code without the btelemetry and other bloat. It's missing nim-lsp-support and they claim there is no plugin-api ? |
10:17:27 | anddam | PMunch: kinda what you suggested https://forum.nim-lang.org/t/9368#61551 |
10:17:31 | FromDiscord | <Andreas> (edit) "btelemetry" => "telemetry" |
10:19:18 | FromDiscord | <Andreas> (edit) "Does anybody use the Lapce-Editor for devel ? i just tried and it feels fast and looks like vs-code without the telemetry and other bloat. It's missing nim-lsp-support and they claim there is no plugin-api ... ?" added "?↵plugin have to be done in wasm - can we do wasm" |
10:21:57 | PMunch | anddam, yeah it's all about getting things statically linked (or shipping the DLLs, either though a normal installer or through a self unpacking archive) |
10:22:29 | anddam | in fact it works, nice |
10:22:36 | anddam | now I just get to understand dear-imgui |
10:22:40 | anddam | and nim |
10:23:05 | anddam | btw how do I interpolate a boolean value into a string? &"the flag is {myflag}" ? |
10:24:40 | FromDiscord | <4zv4l> is there a kind of 'last chance' proc I would use to write the error before my program crash ? |
10:24:47 | FromDiscord | <4zv4l> (edit) "would" => "can" |
10:25:08 | anddam | thanks all for the info |
10:27:47 | FromDiscord | <Andreas> @ShalokShalom hi, i just found a remark you made about lapce - have you done a plugin for nim-support ? |
10:36:14 | PMunch | anddam, sounds like you are looking for: https://nim-lang.org/docs/strformat.html |
10:43:55 | * | rmnmjw quit (Ping timeout: 248 seconds) |
10:44:16 | * | rmnmjw joined #nim |
11:10:58 | * | oprypin quit (Ping timeout: 246 seconds) |
11:11:34 | * | oprypin joined #nim |
11:18:35 | * | rmnmjw quit (Ping timeout: 248 seconds) |
11:35:52 | FromDiscord | <ShalokShalom> In reply to @Andreas "<@208199869301522432> hi, i just": No. It turned out, that the team had a different vision, or rather no real vision from my perspective |
11:36:08 | FromDiscord | <ShalokShalom> It sounded like not a good investment of my time |
11:36:32 | FromDiscord | <ShalokShalom> I still like the approach to implement a plugin system via wasm, that sounds good 👍🏻😊 |
11:39:34 | NimEventer | New thread by gs: Newbie needs help with locks and gcsafe and segfaults, see https://forum.nim-lang.org/t/10009 |
11:45:39 | FromDiscord | <ShalokShalom> In reply to @Andreas "<@208199869301522432> hi, i just": If you are interested into Lapce: It seems like a relatively low effort, to implement that. It's basically just marrying the LSP to it's client. |
11:46:24 | FromDiscord | <ShalokShalom> Just be prepared, that you get told, that documentation for stuff like that is not a good idea, since "it may change over time" |
11:50:30 | * | rmnmjw joined #nim |
12:01:13 | FromDiscord | <Andreas> In reply to @ShalokShalom "Just be prepared, that": sure, "docs may change over time", so having no docs seems to be a great idea - saves some effort 😉 i'll take a look and waste some time on that - thx.. |
12:01:46 | FromDiscord | <Andreas> (edit) "In reply to @ShalokShalom "Just be prepared, that": sure, "docs may change over time", so having no docs seems to be a great idea - saves some effort 😉 i'll take a look and waste some time on that - thx.. ... " added "maybe i'll write some docs if i get it working." |
12:06:50 | FromDiscord | <4zv4l> How can I do so when my program crashes it does a messagebox showing the message ? Since I don’t have a view on stdout/stdere |
12:09:35 | PMunch | Depends on how it crashes really @4zv4l |
12:11:39 | FromDiscord | <4zv4l> Well I really don’t know 🥹 |
12:11:45 | FromDiscord | <4zv4l> I’ve no output from it |
12:25:14 | * | derpydoo quit (Quit: derpydoo) |
12:40:42 | NimEventer | New post on r/nim by akatsukiCZ: Threading, see https://reddit.com/r/nim/comments/11st0qn/threading/ |
12:47:29 | * | jmdaemon quit (Ping timeout: 246 seconds) |
13:00:35 | FromDiscord | <ShalokShalom> In reply to @Andreas "sure, "docs may change": Actually they do have docs. They just hide it, and have no clear policy on why and when and to whom they open it. |
13:03:12 | * | rmnmjw quit (Read error: Connection reset by peer) |
13:03:20 | FromDiscord | <Zoom> Does anyone know why doesn't unicode export unicode\_ranges? |
13:08:55 | * | jerm quit (Ping timeout: 276 seconds) |
13:14:14 | FromDiscord | <Ecorous> @ringabout Talking about my PR, I can't seem to find the code in the latest commit. Where's it gone? |
13:14:34 | FromDiscord | <Ecorous> (PR was mentioned on github, but I want to do this here since it'll be easier) |
13:14:43 | FromDiscord | <Ecorous> The PR added getDataDir() |
13:16:32 | FromDiscord | <Ecorous> The file that it was added to doesn't exist anymore, and it doesn't show up in the diff (https://github.com/nim-lang/Nim/compare/de65b38...devel) |
13:16:47 | FromDiscord | <Ecorous> de65b38 is the commit where it was added |
13:19:45 | FromDiscord | <Ecorous> Oh nevermind, it's here: https://github.com/nim-lang/Nim/blob/devel/lib/std/private/osappdirs.nim |
13:20:51 | * | oprypin quit (Ping timeout: 260 seconds) |
13:21:27 | * | oprypin joined #nim |
13:27:29 | NimEventer | New thread by vanderlei: How to sort 2d array?, see https://forum.nim-lang.org/t/10010 |
13:33:33 | FromDiscord | <Rika> In reply to @4zv4l "is there a kind": Not for all kinds of crashing. There is always a crash where no additional code can be run after it |
13:35:02 | * | derpydoo joined #nim |
13:35:08 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qYE |
13:35:11 | FromDiscord | <4zv4l> any chance you can help telling me what happens here? |
13:35:28 | PMunch | @Rika, well baring a kernel panic or BSOD it wouldn't be impossible to write a tiny wrapper thing |
13:35:54 | FromDiscord | <ringabout> In reply to @4zv4l "any chance you can": Depends on your imports and Nim version |
13:36:11 | FromDiscord | <ringabout> You might run into https://github.com/nim-lang/Nim/issues/21531 |
13:39:37 | FromDiscord | <4zv4l> Is there any fix for this ? It’s only happening with devel so maybe that’s normal |
13:39:40 | FromDiscord | <4zv4l> I don’t have it with stable |
13:39:50 | FromDiscord | <4zv4l> But with stable my program crashes |
13:40:10 | FromDiscord | <4zv4l> When I compile it from windows directly with devel it works without crashing |
13:40:52 | FromDiscord | <djazz> sent a code paste, see https://play.nim-lang.org/#ix=4qYG |
13:41:00 | FromDiscord | <djazz> if i move the enum before the object, it works |
13:43:13 | FromDiscord | <ringabout> In reply to @djazz "I guess the order": Yeah, it is a know issue => https://github.com/nim-lang/Nim/issues/21268 |
13:53:18 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qYJ |
13:53:30 | FromDiscord | <djazz> install xelatex? |
13:54:45 | * | Guest31 joined #nim |
13:55:08 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, well baring a": Well you also can’t handle a sig kill so |
13:55:27 | FromDiscord | <Rika> There’s probably a good amount more of cases where no additional code can run after receiving the error |
13:55:45 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @djazz "install xelatex?": with nimble? |
13:56:25 | FromDiscord | <djazz> you're on windows, dunno how to install XeLaTeX there |
13:56:36 | FromDiscord | <djazz> no, not nimble lol |
13:56:53 | Guest31 | I want to open a file in nimJs with an API like this one: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle |
13:57:08 | Guest31 | What is the right way to call that built in js function? |
14:00:22 | Guest31 | Also - it seems that Nim has algebraic data types? |
14:00:23 | Guest31 | https://gist.github.com/unclechu/eb37cc81e80afbbb5e74990b62ea21f6#file-algebraic_data_types_experiment-nim-L1-L6 |
14:00:28 | Guest31 | What is going on in this code? |
14:03:18 | PMunch | @Rika, oh I was thinking having a tiny wrapper program which just started the actual program and checked if it was still alive. If not it would read a log and try to show a message |
14:03:52 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, oh I was": Oh, I see, that makes more sense |
14:04:04 | FromDiscord | <Rika> I was under the impression that it has to be part of the same binary |
14:04:34 | FromDiscord | <Rika> There’s always the problem of the wrapper dying before the real Programm |
14:04:38 | FromDiscord | <Rika> (edit) "Programm" => "program" |
14:05:25 | FromDiscord | <Nerve> Does anyone know how to compile Nimja templates for Windows when cross-compiling with mingw? The directory structure isn't translating, I keep getting `Error: cannot open file: \home\me\Sources\work-project\templates\a_template.html.nimja`. It's using Windows backslashes. |
14:05:37 | PMunch | Of course, but there's way fewer things which can go wrong in a program which just watches another program |
14:07:37 | * | rockcavera joined #nim |
14:27:50 | FromDiscord | <Zoom> There's no way to read the file statically besides staticRead, right? I can't catch the IOError on it in nimscript |
14:28:54 | FromDiscord | <Nerve> I think so? I tried `staticRead` with nimja's `compileTemplateStr` and it complained there was no `strVal` node. I think it needs a `const` string value? |
14:28:57 | FromDiscord | <mprakhov> Hello, is it possible somehow to understand or log, when GB cleans up the object (call it's destructor)? |
14:29:23 | FromDiscord | <mprakhov> (edit) "Hello, is it possible somehow to understand or log, when GB cleans up the ... object" added "memory (call" | removed "(call it's" |
14:32:44 | FromDiscord | <Zoom> Does it mean any unacessible file breaks any nimscript? If so, wow |
14:37:04 | PMunch | @Zoom, well you can always staticExec.. |
14:37:33 | PMunch | @mprakhov, in theory yes, but why do you want to do this? |
14:38:55 | FromDiscord | <mprakhov> In reply to @PMunch "@mprakhov, in theory yes,": I want to double-check, that memory acquired by the objects is removing. |
14:40:35 | PMunch | Well the way you typically do that is with -d:useMalloc and valgrind |
14:41:14 | PMunch | Or rather, the typical way is to trust the GC to do its job and not worry about it. That's kinda what it is there for |
14:45:44 | * | Guest31 quit (Quit: Client closed) |
14:53:12 | NimEventer | New thread by PeterG: All chr() up to 127 returns correct unicode character, but chr([128++]) returns �, see https://forum.nim-lang.org/t/10011 |
15:40:45 | * | PMunch quit (Quit: Leaving) |
16:16:34 | * | Guest31 joined #nim |
16:17:12 | Guest31 | any thoughts on how to do algebraic data types in nim? |
16:17:19 | Guest31 | are my messages visible? |
16:19:54 | FromDiscord | <Gumbercules> Nim refers to these as object variants |
16:20:08 | FromDiscord | <Gumbercules> The manual has a section on them |
16:21:15 | FromDiscord | <Gumbercules> In reply to @Guest31 "are my messages visible?": And yes they are |
16:25:53 | * | ixmpp quit (Quit: Gateway shutdown) |
16:26:04 | * | ixmpp joined #nim |
16:26:40 | * | arkurious joined #nim |
16:26:43 | * | Guest31 quit (Ping timeout: 260 seconds) |
16:41:55 | * | junaid_ joined #nim |
16:42:52 | * | junaid_ quit (Remote host closed the connection) |
17:01:15 | NimEventer | New post on r/nim by -tobehuman: nimpretty_t allows to use nimpretty with tab indentation, see https://reddit.com/r/nim/comments/11szqmn/nimpretty_t_allows_to_use_nimpretty_with_tab/ |
17:03:46 | FromDiscord | <auxym> wut, I thought Nim didn't even support tabs |
17:04:18 | FromDiscord | <Phil> nimpretty is one of those things where I'd love improvement, but the required knowledge level is just broken |
17:07:20 | FromDiscord | <auxym> https://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/ |
17:08:04 | FromDiscord | <auxym> When the guy who wrote Crafting Interpreters says it's the hardest thing they ever did, yeah, doesn't exactly give me hope I'd succeed at writing a formatter :S |
17:12:42 | * | jmdaemon joined #nim |
17:29:53 | * | azimut quit (Ping timeout: 255 seconds) |
17:35:32 | FromDiscord | <enthus1ast> can i get some information about the compiler that compiles the nim application? On compiletime? |
17:37:32 | FromDiscord | <enthus1ast> the issue i have is, that when cross compiling from eg linux to windows, the compiletime functions (getProjectPath) returns its path with unix line seperators "/" but functions like os.`/` use the windows line seperator `\` |
17:37:56 | FromDiscord | <enthus1ast> even when run on compile time |
17:38:08 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1085979678906527915): can i get some information about the compiler that currently compiles the nim application? On compiletime? |
17:44:35 | * | derpydoo quit (Ping timeout: 264 seconds) |
17:45:29 | FromDiscord | <enthus1ast> there is https://nim-lang.org/docs/compilesettings.html but this seems not to have the desired functionality |
17:51:25 | * | deadmarshal_ quit (Ping timeout: 260 seconds) |
17:54:23 | * | Guest31 joined #nim |
17:54:52 | Guest31 | In haskell, you can write GHC compiler plugins and you can get at the type resolved AST of the code |
17:55:05 | Guest31 | Can you get at the type resolved AST of nim code? |
17:55:13 | Guest31 | How might I go about this? |
17:55:15 | * | xet7 quit (Ping timeout: 260 seconds) |
17:55:40 | * | xet7 joined #nim |
18:01:42 | FromDiscord | <ShalokShalom> Guest31: You can get that for the untyped AST via: |
18:01:50 | FromDiscord | <ShalokShalom> import macros↵dumpTree:↵ var a = "Test" |
18:01:59 | FromDiscord | <ShalokShalom> So dumpTree |
18:03:32 | * | zgasma quit (Quit: leaving) |
18:04:51 | Guest31 | I know about dumpTree |
18:05:02 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0m |
18:05:14 | Guest31 | was hoping for some pointers on where to poke in the nim compiler sources |
18:05:24 | Guest31 | but I can just start reading them |
18:05:32 | FromDiscord | <enthus1ast> @jmgomez\: no this unfortunately does not work |
18:05:38 | FromDiscord | <jmgomez> In reply to @Guest31 "was hoping for some": point is you dont need to mess with the compiler in order to modify the AST in Nim |
18:05:56 | FromDiscord | <jmgomez> In reply to @enthus1ast "<@726017160115126333>\: no this unfortunately": why is that? |
18:05:57 | Guest31 | I know - but I'm interested in having access to the type resolved AST |
18:06:06 | Guest31 | So I can do something like Clash Haskell |
18:06:21 | Guest31 | anyways - has anybody here used Fidget? |
18:06:39 | FromDiscord | <enthus1ast> @jmgomez\: on compile time we are on linux, but on runtime we are on windows, so the defined(windows) reports windows already |
18:06:57 | FromDiscord | <enthus1ast> i guess this is the reason os.`/` fails in the first place |
18:07:31 | FromDiscord | <jmgomez> In reply to @enthus1ast "<@726017160115126333>\: on compile time": I see, so you are cross compiling |
18:07:34 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4r0o |
18:07:45 | FromDiscord | <enthus1ast> this code should report different os'es but it does not |
18:08:18 | FromDiscord | <enthus1ast> or should it? I don't actually know \:) |
18:08:18 | Guest31 | that is - nim fidget by treeform |
18:08:32 | Guest31 | I tying to understand some of the constraints present in layout] |
18:08:51 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0q |
18:10:12 | FromDiscord | <enthus1ast> i think this whole thing is a bigger issue, because when cross compiling, you cannot really slurp files correctly etc.. |
18:10:35 | FromDiscord | <enthus1ast> when you want to construct paths and use DirSep etc. |
18:16:11 | * | Guest31 quit (Quit: Client closed) |
18:17:12 | FromDiscord | <jmgomez> yes.. not sure if there is something built in with that, if you are building an exe maybe you can control it by args |
18:22:36 | FromDiscord | <firasuke> is there a better method to join two paths together with a `:` between them as part of the `PATH` env var? or should I stick to `path1 / : / path2`? |
18:22:56 | FromDiscord | <firasuke> (edit) ":" => "":"" |
18:33:11 | * | rmt quit (Ping timeout: 264 seconds) |
18:37:34 | * | derpydoo joined #nim |
18:40:08 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4r0y |
18:40:14 | FromDiscord | <Hourglass [She/Her]> I am so confused why the program exits with no error |
18:41:28 | FromDiscord | <Hourglass [She/Her]> Wait |
18:41:36 | * | Guest31 joined #nim |
18:41:36 | FromDiscord | <Hourglass [She/Her]> 🤦♀️ I didn't init the window |
19:08:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0F |
19:09:56 | FromDiscord | <Elegantbeef> It's a slice it cannot be saved to a variable |
19:10:09 | FromDiscord | <Elegantbeef> It's an unsafe operation to do that since Nim doesnt enforce the lifetime |
19:12:26 | FromDiscord | <Elegantbeef> In 20 years when Nim's borrow checker is functional it'll be valid code |
19:14:21 | FromDiscord | <sOkam!> kk |
19:31:09 | FromDiscord | <etra> In reply to @Elegantbeef "It's a slice it": is that a special compiler thing? or any type can be specified to do that? |
19:31:10 | FromDiscord | <etra> ooc |
19:33:03 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/Ps6 |
19:38:13 | FromDiscord | <ElegantBeef> Uhh no clue what you mean |
19:38:33 | FromDiscord | <ElegantBeef> A type defined at runtime is best represented by an object variant if you ask me |
19:39:02 | FromDiscord | <ElegantBeef> In reply to @etra "is that a special": It's compiler magic, but it's not dissimilar from a proc that returns `var T` or `lent T` |
19:41:28 | FromDiscord | <jmgomez> In reply to @ElegantBeef "A type defined at": the issue is that you dont know upfront all combination of possible types i.e. the user can be passing around structs that you dont necessarily know they exists.. |
19:41:40 | FromDiscord | <ElegantBeef> That's the point of the object variant |
19:42:12 | * | Guest31 quit (Quit: Client closed) |
19:42:39 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0I |
19:42:53 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4r0I" => "https://play.nim-lang.org/#ix=4r0J" |
19:42:54 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/1go |
19:42:54 | FromDiscord | <ElegantBeef> You can represent all objects with that |
19:43:42 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0K |
19:44:13 | FromDiscord | <ElegantBeef> Given you didnt give the error no |
19:44:34 | FromDiscord | <Elegantbeef> Ping |
19:44:39 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4r0K" => "https://play.nim-lang.org/#ix=4r0L" |
19:44:42 | FromDiscord | <sOkam!> sry, typo. i meant run |
19:44:49 | FromDiscord | <sOkam!> it compiles, but segfaults when on |
19:45:20 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0M |
19:45:25 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4r0L" => "https://play.nim-lang.org/#ix=4r0N" |
19:45:55 | FromDiscord | <Elegantbeef> Your image should store a string not a cstring, that way it persists |
19:46:10 | FromDiscord | <Elegantbeef> Other than that i do not know |
19:46:27 | FromDiscord | <sOkam!> how am i going to store a string in gcnone? |
19:46:27 | FromDiscord | <Elegantbeef> The same way a json parser works jm |
19:46:30 | FromDiscord | <jmgomez> Im doing something "similar" backed by json atm, that ends up doing memory offsets manually |
19:46:41 | FromDiscord | <Elegantbeef> I mean i forgot you were using string |
19:46:46 | FromDiscord | <Elegantbeef> So i guess disregard |
19:46:58 | FromDiscord | <Elegantbeef> using gc\:none\ |
19:47:27 | FromDiscord | <Elegantbeef> You either have the store data into a contiguous byte buffer or store data as object variants |
19:47:30 | FromDiscord | <sOkam!> i would use openArray[char] or byte but... don't know how to convert to cstring from those |
19:47:37 | FromDiscord | <Elegantbeef> One is purely untyped and requires guessing |
19:47:51 | FromDiscord | <Elegantbeef> `cast[cstring](oa[0].addr)` |
19:48:07 | FromDiscord | <Elegantbeef> But that's not the problem |
19:48:13 | FromDiscord | <Elegantbeef> Something is nil inside `write` |
19:48:27 | FromDiscord | <Elegantbeef> So either something needs init'd, allocated, or fixed |
19:48:30 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0O |
19:48:30 | FromDiscord | <Elegantbeef> Use valgrind with it |
19:49:56 | FromDiscord | <Elegantbeef> Yea what you're doing is pretty much one solution, the other is to generate an object variant instead and operate on that |
19:51:35 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Yea what you're doing": okay, maybe it's more clean and easy to change the interop later on |
19:52:41 | FromDiscord | <sOkam!> now i'm getting that the openarray inside the Image type cannot be assigned to |
19:53:19 | FromDiscord | <sOkam!> In reply to @Elegantbeef "You either have the": how would you do each? |
19:53:20 | FromDiscord | <Elegantbeef> Again |
19:53:26 | FromDiscord | <Elegantbeef> You cannot store openarrays on fields |
19:53:46 | FromDiscord | <sOkam!> that's why i was using a cstring |
19:53:54 | FromDiscord | <sOkam!> i don't know how else to do it |
19:53:57 | FromDiscord | <Elegantbeef> Openarrays are parameters only and must be passed directly |
19:53:57 | FromDiscord | <Elegantbeef> That wasnt to you sokam, that was to jmgomez |
19:54:04 | FromDiscord | <Elegantbeef> You use a cstring it's fine |
19:54:14 | FromDiscord | <Elegantbeef> I said i forgot you were not using gcnone |
19:55:05 | FromDiscord | <firasuke> so I have a `PATH` env var which is a bunch of paths separated by a colon `:`, how can I each path into a separate string? |
19:55:09 | FromDiscord | <sOkam!> then we back to the sigsegv |
19:55:34 | FromDiscord | <jmgomez> In reply to @Elegantbeef "That wasnt to you": what was for me? What openarrays are you referring to? |
19:55:46 | FromDiscord | <Elegantbeef> Jesus you two are lost in conversations |
19:55:50 | FromDiscord | <Elegantbeef> The object variants was to you |
19:55:57 | FromDiscord | <Elegantbeef> The openarray was to sokam |
19:56:06 | FromDiscord | <sOkam!> 😄 |
19:56:12 | FromDiscord | <Elegantbeef> At this point i might aswell make a matrix account per conversation |
19:56:18 | * | rmnmjw joined #nim |
19:56:31 | FromDiscord | <Elegantbeef> firasuke you use split, either the iterator or procedure variant |
19:57:04 | FromDiscord | <jmgomez> xD I missed what sOkam said about variants then. You are just too kind beef 😛 |
19:57:05 | FromDiscord | <firasuke> In reply to @Elegantbeef "firasuke you use split,": split relies on `/` as the separator, I want to split using `:` as the separator |
19:57:36 | FromDiscord | <sOkam!> i don't think i said anything about variants 🤔 |
19:57:43 | FromDiscord | <Elegantbeef> `strutils` split |
19:57:43 | FromDiscord | <firasuke> (edit) "split" => "splitPath" |
19:57:59 | FromDiscord | <Elegantbeef> "How would you do each" |
19:58:03 | FromDiscord | <Elegantbeef> That was object variants |
19:58:08 | FromDiscord | <sOkam!> oh kk |
19:58:09 | FromDiscord | <firasuke> oh nvm |
19:58:13 | FromDiscord | <firasuke> split from strutils works |
19:58:39 | FromDiscord | <jmgomez> 😂 |
19:58:53 | FromDiscord | <sOkam!> im so lost in why this is failing |
19:59:26 | FromDiscord | <Elegantbeef> Probably forgot to init something like i said |
19:59:30 | FromDiscord | <Elegantbeef> Or are misusing the API |
19:59:57 | FromDiscord | <sOkam!> how come that it writes when its 89, but not on 90? |
20:00:19 | FromDiscord | <Elegantbeef> no clue i havent ever use the API you're using |
20:02:47 | FromDiscord | <sOkam!> how do you turn an array[N, char] into a cstring? |
20:03:30 | FromDiscord | <sOkam!> just cast it? |
20:09:35 | FromDiscord | <jmgomez> doesnt `GC_ref` works with strings? |
20:09:44 | FromDiscord | <sOkam!> im in gcnone |
20:10:23 | FromDiscord | <jmgomez> If that's to me, it was a question rather than an answer |
20:11:54 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0X |
20:12:18 | * | derpydoo quit (Quit: derpydoo) |
20:20:33 | FromDiscord | <Elegantbeef> Not in the RCs↵(@jmgomez) |
20:20:42 | FromDiscord | <Elegantbeef> With arc/orc the len is stack allocated |
20:20:55 | FromDiscord | <Elegantbeef> No sokam that's incorrect since you do not ensure `carr[^1] == '\0'` |
20:21:09 | FromDiscord | <Elegantbeef> A Cstring conventionally is null terminated unless you use it with `len` |
20:22:59 | FromDiscord | <jmgomez> gotcha, thing was that they were being destroyed in each iteration. I just created the UE String directly outside the copyMemory loop and hold them in an array that gets out after the processEvent call is done |
21:07:41 | FromDiscord | <pmunch> Hmm, anyone know a good runtime templating thing for Nim? |
21:07:54 | FromDiscord | <pmunch> I know of multiple good compile-time ones \:P |
21:08:16 | FromDiscord | <Elegantbeef> Ctrl + V is pretty good 😛 |
21:08:30 | FromDiscord | <Elegantbeef> I only joke cause I am vastly ignorant |
21:08:49 | FromDiscord | <⚶ Zeno> In reply to @Elegantbeef "Ctrl + V is": not without some CTRL + C's though :) |
21:09:00 | FromDiscord | <pmunch> Haha, I meant like allowing the user to supply files with templates and files with data and combining the two |
21:09:30 | FromDiscord | <Elegantbeef> This is where I just say "strutils.`%` exists" |
21:14:54 | FromDiscord | <jmgomez> I mostly use strFormat but I think there is a Jinja (Ninja?) implementation in Nim. If you are thinking to something GTK/UI related maybe it's a good idea to use that since it's a well known format |
21:15:40 | FromDiscord | <jmgomez> this one https://github.com/enthus1ast/nimja |
21:16:03 | FromDiscord | <pmunch> Well I'm working on a Markdown editor, and I want to allow the user to supply their own templates to put the Markdown (with frontmatter variables) into |
21:16:55 | FromDiscord | <pmunch> So for example for my website I could grab the HTML I use to render that, add in some template variables, and now I can see in realtime what my posts will look like |
21:17:37 | FromDiscord | <pmunch> Nimja is compiled isn't it? |
21:19:06 | FromDiscord | <jmgomez> ohh didnt know that, but maybe that's more power to you if you feed in in the vm |
21:19:23 | FromDiscord | <jmgomez> who cool that will be? That the user can put actual nim code? |
21:19:38 | FromDiscord | <jmgomez> (edit) "will" => "would" |
21:20:07 | FromDiscord | <pmunch> Haha, I am planning to allow dynamic library modules, wasn't really considering Nimscript |
21:20:28 | FromDiscord | <Elegantbeef> Psh not using wasm so people can securely share their modules |
21:20:52 | FromDiscord | <pmunch> What do you mean? |
21:21:11 | FromDiscord | <Elegantbeef> Wasm is sandboxed so it's generally safer than dynamic libraries |
21:21:17 | FromDiscord | <Elegantbeef> Plus it's cross platform 😄 |
21:21:20 | FromDiscord | <pmunch> Hmm, fair |
21:21:27 | FromDiscord | <pmunch> That is a big benefit |
21:21:35 | FromDiscord | <pmunch> How is it speed wise? |
21:21:45 | FromDiscord | <Elegantbeef> Depends on the runtime you use |
21:22:03 | FromDiscord | <Elegantbeef> There are Jit'd runtimes and the like so they can be quite fast |
21:22:15 | FromDiscord | <pmunch> Actually, do you have a WASM plugin sample? I'd like to have a look at this |
21:22:31 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasm3 look at wasm sources and the tests |
21:22:39 | FromDiscord | <pmunch> You've been raving on about it for so long it has got to have some merit to it 😋 |
21:22:47 | FromDiscord | <Elegantbeef> Or i'm just an idiot |
21:24:13 | FromDiscord | <Elegantbeef> It's pretty much the same idea as a dynamic library it's just safer and cross platform |
21:24:27 | FromDiscord | <pmunch> Which are both great pluses |
21:24:28 | FromDiscord | <Elegantbeef> You expose procedures to the wasm module, the wasm module imports them like it's C Code |
21:24:54 | FromDiscord | <pmunch> Dynamic libraries crashing the entire application is no fun |
21:25:01 | FromDiscord | <Elegantbeef> Wait a minute i havent merged my wasm interop to main branch?! |
21:25:06 | FromDiscord | <pmunch> But that native performance though.. |
21:25:25 | FromDiscord | <Elegantbeef> Yea wasm3 is just a VM with no JIT |
21:25:38 | FromDiscord | <pmunch> Hmm |
21:25:40 | FromDiscord | <Elegantbeef> So it's not as fast as native, i havent benchmarked it but it was one of the faster VM'd wasm environments |
21:26:11 | FromDiscord | <pmunch> TBH I'm not sure how much speed I'd realistically need |
21:26:36 | FromDiscord | <pmunch> By the way, how many languages have an easy path to wasm? |
21:27:07 | FromDiscord | <Elegantbeef> Almost all system languages, there are also some compilers for JS, Python, Lua afaik |
21:27:23 | FromDiscord | <pmunch> Nice |
21:28:12 | FromDiscord | <pmunch> I guess worst case scenario I could allow loader modules. Like you can load one module which then exposes more modules to the system |
21:28:27 | FromDiscord | <Elegantbeef> Uh oh devel broke my code |
21:29:08 | FromDiscord | <pmunch> So WASM modules could just be loaded via a WASM loader dynamic library |
21:29:17 | FromDiscord | <pmunch> Haha, not giving me great confidence |
21:30:02 | FromDiscord | <Elegantbeef> I mean it broke interop code, you can just use wasm3 as a C library wrapped with futhark 😛 |
21:30:27 | FromDiscord | <pmunch> Haha true |
21:30:39 | FromDiscord | <Elegantbeef> Or just use my wasm3 bindings |
21:30:47 | FromDiscord | <Elegantbeef> Since you an do `import wasm3/wasm3c` |
21:30:49 | FromDiscord | <pmunch> Still amazed by how nice it is to use Futharked Gtk |
21:31:27 | FromDiscord | <pmunch> I've literally had zero issues with it this far, seems rock solid |
21:31:55 | FromDiscord | <pmunch> Well, I did discover one little bug in Futhark, but nothing about the bindings it creates |
21:32:11 | FromDiscord | <pmunch> Just the output parameter being a bit borked |
21:33:53 | FromDiscord | <Elegantbeef> There fixed it for devel |
21:34:06 | FromDiscord | <Elegantbeef> Some issue with `[T: proc](p: static[T]` |
21:35:13 | FromDiscord | <Elegantbeef> There is a small caveat with interop though, it's not just pass a pointer and access fields, you have to move data inbetween Host and VM |
21:36:15 | FromDiscord | <Elegantbeef> I do have a hookable system for Host -\> VM https://github.com/beef331/wasm3/blob/master/tests/thosttowasm.nim#L6-L38 |
21:36:45 | FromDiscord | <Elegantbeef> That code interacts with https://github.com/beef331/wasm3/blob/master/wasmsources/hostinterop.nim |
21:37:34 | FromDiscord | <Elegantbeef> Sorry that's actually VM -\> Host |
21:37:41 | FromDiscord | <Elegantbeef> Host -\> VM is quite complicated |
21:37:45 | FromDiscord | <jmgomez> Didnt know wasm3 existed. I want (in the future, after I complete the vm and some other stuff in NUE) to add a layer to the plugin to support more langs |
21:37:50 | FromDiscord | <pmunch> Hmm, I guess I'll have a look at it once I get this far |
21:37:51 | FromDiscord | <jmgomez> Maybe that can be useful |
21:38:11 | FromDiscord | <Elegantbeef> A wasm runtime is the best agnostic scripting backend if you ask me |
21:38:41 | FromDiscord | <jmgomez> The thing with NimScript on Nue's case is that you will be able to copy -> paste ideas into prod cod |
21:38:41 | FromDiscord | <pmunch> First I want to get some file navigation stuff and templates working |
21:57:01 | * | oprypin quit (Ping timeout: 256 seconds) |
21:58:26 | * | oprypin joined #nim |
22:13:17 | FromDiscord | <sOkam!> is there a way to set an initial default value to all members of an array on initialization? |
22:13:46 | FromDiscord | <Elegantbeef> Make a proc |
22:18:31 | FromDiscord | <sOkam!> right, i guess. i was asking if there is an existing one that I don't know about |
22:19:20 | FromDiscord | <sOkam!> how do you return an array of a certain size with a proc, though? |
22:19:28 | FromDiscord | <Elegantbeef> `static int` |
22:19:55 | FromDiscord | <sOkam!> where? |
22:20:16 | FromDiscord | <sOkam!> like the point is that the size can vary, but its gonna be a certain size that i give on init |
22:20:36 | FromDiscord | <sOkam!> (edit) "vary," => "vary each time an array is initialized," |
22:20:56 | FromDiscord | <Elegantbeef> As a parameter or a generic parameter |
22:21:41 | FromDiscord | <sOkam!> I've been trying, and failing |
22:23:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1u |
22:23:14 | FromDiscord | <Elegantbeef> Or |
22:23:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1v |
22:24:12 | FromDiscord | <sOkam!> ty, will try it |
22:24:22 | FromDiscord | <Elegantbeef> There is no try |
22:24:38 | FromDiscord | <sOkam!> is there a way to do the same for an object field? |
22:25:07 | FromDiscord | <Elegantbeef> Take in a var array |
22:26:51 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1w |
22:28:21 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4r1x |
22:29:43 | FromDiscord | <Elegantbeef> Static generic parameter |
22:29:56 | FromDiscord | <Elegantbeef> Use a nimble task to build both |
22:31:38 | FromDiscord | <!&luke> Oh |
22:32:46 | FromDiscord | <sOkam!> you could also use a table of targets, and pass the subdirectory to the path of each |
22:34:56 | * | Notxor quit (Read error: Connection reset by peer) |
22:35:00 | * | Notxor_ joined #nim |
22:36:08 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1y |
22:37:40 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1y" => "https://play.nim-lang.org/#ix=4r1z" |
22:47:27 | FromDiscord | <Livid> sent a long message, see http://ix.io/4r1D |
22:47:53 | FromDiscord | <Elegantbeef> `myProc[generic]` |
22:49:05 | FromDiscord | <Livid> oh, awesome, I'll test it out in a bit |
22:49:32 | NimEventer | New post on r/nim by Mekelaina: Any Ideas on how to define the main entry point for Nim programs?, see https://reddit.com/r/nim/comments/11t8y47/any_ideas_on_how_to_define_the_main_entry_point/ |
23:00:26 | NimEventer | New Nimble package! nimpretty_t - Use nimpretty with tab indentation., see https://github.com/tobealive/nimpretty_t |
23:28:03 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1K |
23:29:26 | FromDiscord | <Elegantbeef> `\n` and `\0` |
23:30:48 | FromDiscord | <huantian> man I really don't understand your whitespace |
23:30:53 | FromDiscord | <huantian> why are the : and = hugging the t ype |
23:30:56 | FromDiscord | <huantian> (edit) "t ype" => "type" |
23:30:59 | FromDiscord | <sOkam!> oh true |
23:31:20 | FromDiscord | <sOkam!> In reply to @huantian "why are the :": because the name is more important than the type, so its more visible that way |
23:31:38 | FromDiscord | <Elegantbeef> huan the more disturbing thing is the `map_wmap_h+1` |
23:31:41 | FromDiscord | <sOkam!> := are related to type stuff, not to the name itself |
23:31:42 | FromDiscord | <Elegantbeef> Like spaces are costly |
23:32:05 | FromDiscord | <sOkam!> oh that's not common in my code, |
23:32:24 | FromDiscord | <huantian> In reply to @sOkam! ":= are related to": ehhh idk about `=` |
23:32:33 | FromDiscord | <huantian> it seperates the name/type from the value |
23:32:39 | FromDiscord | <huantian> it's not more related to the type than the value |
23:32:43 | FromDiscord | <sOkam!> spaces do that |
23:32:58 | FromDiscord | <sOkam!> its language-related stuff. all in one chunk |
23:32:59 | FromDiscord | <huantian> right so you should have a space before and after the `=`? |
23:33:10 | FromDiscord | <Elegantbeef> A name is just typed memory, checkmate sokam |
23:33:18 | FromDiscord | <sOkam!> 😄 |
23:33:25 | FromDiscord | <huantian> also regarding `:`, in normal english the `:` hugs the word beforehand so I think it looks kinda weird when it hugs the type lol |
23:33:39 | FromDiscord | <sOkam!> 🤷♂️ |
23:34:02 | FromDiscord | <sOkam!> its easier to skim-read a word without noise around it, and having spaces instead |
23:35:08 | FromDiscord | <Elegantbeef> It's all psycho-semantic |
23:35:27 | FromDiscord | <huantian> that's true I'm a psycho so maybe don't listen to me |
23:35:59 | FromDiscord | <Elegantbeef> Indeed |
23:36:04 | FromDiscord | <Elegantbeef> I seen huan kill atleast 3 people |
23:36:11 | FromDiscord | <Elegantbeef> Wait huan isnt a police officer |
23:37:03 | * | Notxor_ quit (Remote host closed the connection) |
23:39:30 | FromDiscord | <sOkam!> how would you define that multiline string without getting the newlines? |
23:40:23 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues/21327#issuecomment-1416489029 |
23:42:08 | * | azimut joined #nim |
23:43:07 | * | jerm joined #nim |
23:47:56 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1M |
23:48:16 | FromDiscord | <Elegantbeef> `result = newCall("cstring", newLit(res)` |
23:48:30 | FromDiscord | <Elegantbeef> you do not need the `\0` |
23:48:40 | * | jerm quit (Ping timeout: 252 seconds) |
23:48:43 | FromDiscord | <Elegantbeef> also it'd be `.add '\0'` |
23:48:59 | FromDiscord | <Elegantbeef> It might be `nnkConv.newTree(newLit(res))` |
23:49:40 | FromDiscord | <Elegantbeef> whoops `nnkConv.newTree(ident"cstring", newLit(res))` |
23:52:07 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1N |
23:52:39 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1N" => "https://play.nim-lang.org/#ix=4r1O" |
23:53:37 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1O" => "https://play.nim-lang.org/#ix=4r1P" |
23:53:44 | arkanoid | could you please refresh me the current way to get smaller executable on nim stable on linux? I'm doing "nim --cc:clang --panics:on --gc:arc -d:release --opt:size c hello && strip -s hello" |
23:55:25 | arkanoid | the code I'm compiling is just an echo "Hello, World!" |
23:56:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1Q |
23:56:18 | FromDiscord | <Elegantbeef> Or `cstring` if you must |
23:57:02 | FromDiscord | <Elegantbeef> I know you can statically link musl in some cases which reduces the binary size but you mostly have all the flags |
23:57:44 | arkanoid | Elegantbeef, thanks |
23:58:32 | FromDiscord | <sOkam!> that's still 256 🤔 |
23:58:56 | FromDiscord | <sOkam!> iguess the length of a cstring doesn't add the null in nim? |
23:59:22 | FromDiscord | <Elegantbeef> seems it counts up to it and returns only the actual string portion |
23:59:31 | FromDiscord | <Elegantbeef> Which probably now that i think of it mimics C |