<< 16-03-2023 >>

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:10NimEventerNew thread by Naterlarsen: Trying To Slice the Characters Where Needed., see https://forum.nim-lang.org/t/10007
00:53:09FromDiscord<Spark> Just a question
00:53:24FromDiscord<Spark> is `-d:nimNoLentIterators` safe?
00:53:27FromDiscord<Spark> just checking
00:54:07FromDiscord<Spark> is anyone online?
00:54:27FromDiscord<Spark> (edit) removed "anyone online?"
01:01:19FromDiscord<Spark> oh yeah
01:01:20FromDiscord<Spark> and
01:01:43FromDiscord<Spark> how do I turn a `lent` type back to normal?
01:08:49FromDiscord<kfdvh> In reply to @Spark "how do I turn": copy?
01:14:03FromDiscord<huantian> `let someCopy = someLent`
01:14:24FromDiscord<kfdvh> what is `lent` and `owned`
01:14:40FromDiscord<huantian> owned is an old thing that doesn't matter anymore
01:15:09FromDiscord<kfdvh> what's lent
01:16:12FromDiscord<huantian> see https://nim-lang.org/docs/destructors.html#lent-type
01:17:39FromDiscord<huantian> it's a pointer, which lets you use the value without copying it
01:18:57FromDiscord<huantian> kinda like an immutable reference
01:28:02FromDiscord<kfdvh> I have code that push `ref T` onto C library and then retrieves it. Anything I need to do?
01:28:56FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qW2
01:43:33FromDiscord<ElegantBeef> `GcRef` and `GcUnref`
01:43:40FromDiscord<tobealive> sent a long message, see http://ix.io/4qW4
01:43:53FromDiscord<ElegantBeef> References in Nim are pointers taht are ref counted
01:44:09FromDiscord<ElegantBeef> You can do `from module import proc` but almost no one does it
01:44:32FromDiscord<ElegantBeef> Idiomatic Nim imports modules and all their exported symbols
01:45:15FromDiscord<ElegantBeef> You also do not need to memcpy, just do `b = a`
01:45:22FromDiscord<ElegantBeef> References are pointers
01:46:40FromDiscord<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:51FromDiscord<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:07FromDiscord<Elegantbeef> Ping
01:50:06FromDiscord<ringabout> Pong
01:50:20FromDiscord<Elegantbeef> Oh ringabout the CI is borked eh? 😄
01:51:03FromDiscord<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:44FromDiscord<Elegantbeef> I do not follow
01:51:48FromDiscord<ringabout> Nope? It is usually flaky.
01:52:03FromDiscord<Elegantbeef> If you import procedures from a module, how does it matter that some variation requires X things
01:52:20FromDiscord<Elegantbeef> I mean it seems really flaky right now
01:54:07FromDiscord<ringabout> Yeah
02:00:49FromDiscord<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:09FromDiscord<Elegantbeef> `when isMainModule: ...`?
02:01:13FromDiscord<tobealive> Same for using every other module that will import the main moudle
02:01:39FromDiscord<Elegantbeef> If you have to selectively import things you're doing modules wrong
02:02:22FromDiscord<ringabout> Why JS backend doesn't support lambda lifting? Does it hurt the code size too much to lift?
02:02:55FromDiscord<Elegantbeef> I wonder does it even need it, do JS closures not map well enough?
02:06:10FromDiscord<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:55FromDiscord<ringabout> Yeah, closure iterators and some bugs https://github.com/nim-lang/Nim/issues/12492
02:56:30FromDiscord<ringabout> And since now we can copy https://github.com/nim-works/nimskull/pull/586
02:58:27FromDiscord<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:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWd
02:59:34FromDiscord<Elegantbeef> Maybe i am just glorified chatgpt
02:59:51FromDiscord<Iliketwertles> idk if chatgpt knows nim tho, never tried lol
03:02:13FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1085759896512909373/image.png
03:04:04FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1085760365842944083/image.png
03:04:13FromDiscord<ringabout> Isn't bing clever?
03:04:21FromDiscord<ringabout> (edit) "Isn't bing ... clever?" added "more"
03:04:36FromDiscord<Iliketwertles> pickle fetch hehe https://media.discordapp.net/attachments/371759389889003532/1085760499691561041/screenshot_2023-03-15-230417.png
03:04:43FromDiscord<Elegantbeef> No clue it refuses to call people that uses it a cunt
03:05:53FromDiscord<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:29FromDiscord<Iliketwertles> the stuff above worked with a little modification
03:06:32FromDiscord<Iliketwertles> ¯\_(ツ)_/¯
03:06:48FromDiscord<Elegantbeef> Sure but it's always easier to use the tool proper
03:06:54FromDiscord<Iliketwertles> good idea for future reference tho
03:07:19FromDiscord<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:00FromDiscord<Iliketwertles> found an issue in my cat remake oh no
03:11:57FromDiscord<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:04FromDiscord<Iliketwertles> ok i fixed it
03:16:25FromDiscord<Iliketwertles> was only reading one line from stdin but i stole some code from another project
03:16:47FromDiscord<Iliketwertles> doesnt like odd characters
03:17:08FromDiscord<Iliketwertles> me neither so its fine
03:22:18FromDiscord<kfdvh> is it possible to have `ref` of opaque type?
03:22:44FromDiscord<kfdvh> I want to have vtable without closure
03:23:44FromDiscord<Elegantbeef> What does that even mean?
03:29:35*derpydoo quit (Ping timeout: 260 seconds)
03:30:10FromDiscord<demotomohiro> You can create vtable with an array/object of proc pointers with `nimcall` or other calling convention.
03:39:51FromDiscord<kfdvh> In reply to @demotomohiro "You can create vtable": that was the approach I know
03:55:28NimEventerNew 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:58FromDiscord<ricky> wish nim had `reflexpr` like cxx23 bros..
04:11:11FromDiscord<Elegantbeef> What behaviour are you after?
04:12:56FromDiscord<Elegantbeef> Nim's macro system can do everything that C++'s reflexpr can do afaik
04:13:35FromDiscord<ricky> i havent been lucky enough to write nim in a while tbh, that is good to know tho
04:13:37FromDiscord<ricky> thx 😎
04:15:21FromDiscord<Elegantbeef> You can also do quite a lot with just compile time procedures
04:17:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWs
04:38:47onetwo3whats the differencce beween parseInt and parseInt()
04:39:29FromDiscord<Elegantbeef> One is a pointer procedure the other is calling
04:40:13onetwo3could u explain like im a retard please
04:40:33onetwo3because when i test it theres no difference in output
04:40:45FromDiscord<Elegantbeef> Oh you mean command syntax
04:40:49FromDiscord<Elegantbeef> Look at the manual for command syntax
04:41:00onetwo3the 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:11FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWA
05:33:23FromDiscord<Rika> overloading?
05:33:50FromDiscord<Girvo> My `none` usage is wrong too, but ignore that
05:33:53FromDiscord<Girvo> Overloading?
05:34:46FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4qWC
05:35:08FromDiscord<Girvo> Ah right I'm with ya
05:35:11FromDiscord<Girvo> Yeah might be the way to go for this
05:36:31FromDiscord<Girvo> Oh man now I've run into a more fun problem haha
05:36:44FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWD
05:37:08FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWE
05:37:55FromDiscord<Elegantbeef> Task is an object
05:38:13FromDiscord<Elegantbeef> `cast[object](ptr)` is wrong
05:38:19FromDiscord<Girvo> Oh you're right!
05:45:46FromDiscord<Rika> In reply to @Elegantbeef "`cast[object](ptr)` is wrong": cursed lol
05:46:37FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWH
05:48:50FromDiscord<Elegantbeef> How do you invoke?
05:49:25FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWI
05:49:46FromDiscord<Elegantbeef> `a1[]` is invalid
05:49:46FromDiscord<Girvo> `internalFunc` itself is called directly by `xTaskCreatePinnedToCore` internall in C
05:50:40FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWJ
05:51:01FromDiscord<Rika> i dont understand
05:51:35FromDiscord<kfdvh> (edit) "https://play.nim-lang.org/#ix=4qWJ" => "https://play.nim-lang.org/#ix=4qWK"
05:51:35FromDiscord<Elegantbeef> Girvo use a debug compiler is what i'd say
05:52:11FromDiscord<Rika> In reply to @kfdvh "is there a way": i dont understand what you're looking for
05:52:30FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWL
05:52:36FromDiscord<Girvo> oops I meant this: https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
05:52:49FromDiscord<kfdvh> In reply to @Rika "i dont understand what": I need to write callback hell but without indentation
05:53:40FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWM
05:54:14FromDiscord<kfdvh> Nim syntax says I must indent 1 level per nested callback
05:54:18FromDiscord<Rika> needs to be curried?
05:55:33FromDiscord<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:28FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWN
05:57:10FromDiscord<Rika> i dont think it would happen because its not very straightforward what that means
05:57:32FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qWO
05:57:33FromDiscord<Rika> yes
05:57:36FromDiscord<Rika> i know
05:57:44FromDiscord<Rika> what i mean is that its not very obvious that it means that
05:58:04FromDiscord<Girvo> Beef: https://pastebin.com/tAZJn7Z9
05:58:05FromDiscord<kfdvh> is there a library/macro that does that
05:58:44FromDiscord<Elegantbeef> Girvo in ccgexprs put an echo on the node 😄
05:58:51FromDiscord<Elegantbeef> line 2994
06:00:20FromDiscord<Girvo> sent a code paste, see https://paste.rs/pRO
06:00:27FromDiscord<Elegantbeef> `echo n` should work
06:00:48FromDiscord<Girvo> Okay sweet
06:01:19FromDiscord<Girvo> I need to koch build again yeah?
06:01:36FromDiscord<Elegantbeef> `./koch temp c myNim.nim`
06:05:30FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWR
06:06:34FromDiscord<Elegantbeef> So the task ident is the issue
06:07:01FromDiscord<Girvo> I just renamed it to `tsk` but same error it seems. I have a theory, I'm having a look now
06:07:15FromDiscord<Girvo> Ah. No, that wasn't it, damn it
06:07:32FromDiscord<Elegantbeef> How is this being called?
06:08:15FromDiscord<Girvo> Thats the thing, it's being called inside C code (`xCreateTaskPinnedToCore`)
06:08:20FromDiscord<Girvo> I never call it myself
06:08:38FromDiscord<Elegantbeef> How does the C call it though
06:08:41FromDiscord<Elegantbeef> Cause it's a generic
06:08:48FromDiscord<Elegantbeef> So you have to pass it somehow
06:09:06FromDiscord<Girvo> One sec
06:10:04FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4qWT
06:10:07FromDiscord<Girvo> So the issue is that _these_ aren't generic
06:10:10FromDiscord<Girvo> Right?
06:10:40FromDiscord<Girvo> One nice thing I guess is if it is, then the `pointer` can become `ptr T` directly
06:11:57FromDiscord<Elegantbeef> Likely
06:12:58FromDiscord<Girvo> It's a nicer binding instead of void pointer, too, I'd hope. I'll test it ou
06:12:58FromDiscord<Girvo> t
06:18:48FromDiscord<Girvo> Yep, got it. Its compiling correctly at least now! Now to see if it does what it's supposed to do
06:19:09FromDiscord<Girvo> Is it possible to increment/decrement the ref count for a `ref object` type myself?
06:19:11FromDiscord<Elegantbeef> I'm actually really confused where the error came from
06:19:34FromDiscord<Elegantbeef> `GcRef` and `GcUnref`
06:20:02FromDiscord<Elegantbeef> Where you passing a generic proc name to a proc parameter without a generic parameter?
06:20:03FromDiscord<Elegantbeef> Were\
06:20:16FromDiscord<Girvo> Indirectly, but yes I believe so
06:21:23FromDiscord<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:46FromDiscord<Elegantbeef> Weird that it compiled
06:22:23FromDiscord<Girvo> It didn't really though, it choked trying to compile?
06:22:37FromDiscord<Elegantbeef> It got passed static analysis so that's 'compiled' 😄
06:22:42FromDiscord<Girvo> Ahhhh right haha
06:22:45FromDiscord<Elegantbeef> got past\
06:22:57FromDiscord<Girvo> Its more that it choked the static analysis stuff altogether I think haha
06:23:06FromDiscord<Elegantbeef> I mean it was in code gen
06:23:24FromDiscord<Elegantbeef> Codegen is past where this should error
06:23:33FromDiscord<Elegantbeef> \Trying to reproduce this now
06:23:38FromDiscord<Girvo> Oh interesting
06:23:53FromDiscord<Girvo> This is on 1.16.10 btw
06:24:12FromDiscord<Elegantbeef> I mean it also errored on devel if that's what you build the devel compiler with
06:24:41FromDiscord<Girvo> Uh maybe. I just ran `./koch boot` inside the 1.16.10 checkout I have haha
06:24:48FromDiscord<Elegantbeef> Ah
06:25:04FromDiscord<Elegantbeef> Also it's 1.6.10
06:25:08FromDiscord<Girvo> Yeah that one
06:25:16FromDiscord<Girvo> I'll try to put together a minimal test case for it
06:25:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qWW
06:26:43FromDiscord<Elegantbeef> Also i know you like rust, so... https://github.com/beef331/fungus
06:28:35FromDiscord<Girvo> Oooooooh 😄
06:29:29FromDiscord<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:29FromDiscord<Elegantbeef> I also realise now i have not tested if static parameters work, they should... but who knows
06:33:04FromDiscord<Girvo> Thats actually really neat, I've basically done that myself the long way
06:33:17FromDiscord<Girvo> And tbh basic pattern matching is enough
06:33:21FromDiscord<Girvo> For my use cases anyway
06:33:58FromDiscord<Elegantbeef> I just look at rust's `if let` and how limited it was and say "Yea it's good nuff"
06:34:19FromDiscord<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:43Amun-Rado you check whether new_seq etc returns nil?
07:56:13FromDiscord<Elegantbeef> Nope seqs are no longer nilable
07:57:02Amun-Rais not enough memory condition defined in nim or does it work like in f.e. rust?
07:57:10*rmt joined #nim
07:57:44FromDiscord<Elegantbeef> Nim panics on oom unless you use a outOfMem hook that doesnt presently function
07:57:54Amun-Raoh ;)
08:02:55Amun-RaI 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:16onetwo3how do i convert a string to a uint64
09:23:38PMunchonetwo3, depends on how you want to convert it
09:23:57onetwo3how?
09:24:05onetwo3parseInt(myString, base=10, uint=true)
09:24:07onetwo3like this?
09:25:37anddamhowdy, 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:40anddam"The code executable cannot continue because libgcc_s_seh-1.dll was not found. To fix the problem, try reinstalling the program"
09:26:00anddamso 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:24anddamhe is suggested to use a qt deploy tool, how should I go for nim instead?
09:29:47anddamI see the libs are in ~\.choosenim\toolchains\mingw64\bin\ but what's the proper way to prepare an executable for deploying?
09:31:04anddamoh I installed nim using choosenim
09:31:53PMunchonetwo3, 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:44PMunchAnd if you want a uint you do `myString.parseUint`
09:32:56PMunchhttps://nim-lang.org/docs/parseutils.html#parseUInt%2Cstring%2Cuint%2Cint
09:34:03PMunchanddam, if you want it totally portable you need to static link against that library
09:34:27anddamPMunch: yeah I am trying that from reading https://github.com/nimterop/nimterop/issues/248#issuecomment-685022058
09:34:58anddamI point is I am unaware about almost everything nim works, I tried `nim cpp --app:staticlib`
09:35:13anddamand got a fat nice
09:35:15anddamError: invocation of external linker program failed. The system cannot find the file specified.
09:35:26anddamc/I point/ c/the point/
09:35:37PMunchHaha, yeah that is for creating a static library
09:36:10anddamoh right, that's actually in --help
09:36:31PMunchMaybe try with `--passL:"-static-libgcc"`?
09:36:44PMunchhttps://unix.stackexchange.com/questions/633316/how-to-statically-link-missing-libgcc-s-seh-1-dll-and-libstdc-6-dll-dlls-for-9
09:37:15anddamI guess that's "pass to linker"
09:37:40onetwo3PMunch thanks
09:38:48PMunchanddam, correct
09:38:53PMunchpassC is pass to compiler
09:39:53anddamPMunch: success, in fact
09:40:08anddamwhat does --app:gui imply?
09:40:35PMunchIt's a Windows thing, basically it hides the terminal which pops up when you run a GUI application
09:41:06PMunchSay 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:26PMunchWith the --app:gui switch only the program window would show, no command line
09:41:49anddamthat would be when calling the program from a CLI or even by starting it, say, from explorer with double click?
09:42:24PMunchI believe so
09:42:40PMunchHaven't used Windows in about 10 years, so honestly don't quite know :P
09:42:58anddamwriting a GUI app in this context would be using MS apis, one of the many application runtimes?
09:43:16anddamoh I started with it a few months ago, still hating it strong
09:43:20PMunchWell any GUI library
09:43:26PMunchHating what?
09:43:29anddamwindows
09:43:33PMunchHaha :P
09:43:45PMunchWhy did switch? And what did you switch from?
09:43:48anddamwell, it and all the ecosystem, but the new job was a MS only shop
09:43:58PMunchAh, that always suck
09:44:07PMunchI make sure to mention it in interviews
09:44:09anddamI have been using macos and linux since, I guess more than 20 years
09:44:33PMunchAh, you've been using them all three
09:44:36anddamlast 10 linux systems only, I have decrapped all my setup
09:45:00PMunchYeah, the ability to tweak and build workflows in Linux is amazing
09:46:28anddamI 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:34anddamanyways
09:47:05anddamthe difference with the static build flag is a mere 16kB in the resulting exe
09:47:08anddama bit surprising
09:47:24PMunchWell, there are multiple factors there
09:47:41PMunchFirst of maybe the DLL wasn't that big
09:48:14PMunchSecond there might be some overhead in the executable format which negates the savings when using dynamic libraries
09:48:40PMunchI 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:18anddamahhh, a juicy "the application was unable to start correctly 0xc000007b."
09:53:20anddamsee 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:22PMunchHaha, perfectly sized table
09:58:54PMunchWas this with the -static-libgcc switch?
09:59:12PMunchMaybe try passing it to `passC` as well as `passL`
10:00:41anddamI am reading https://github.com/nim-lang/Nim/issues/19713
10:03:31anddamjeez I didn't get the season finale, tlsEmulation was turned off on windows, and… they replaced the gcc used with tdm-gcc?
10:04:18FromDiscord<ringabout> tlsEmulation was turned on windows by default
10:04:27anddamwilling 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:46anddamringabout: ok, but I am unsure how the issue (that I am experiencing now) was resolved
10:05:14FromDiscord<ringabout> Are sure they are of the same issue? Did you check the missing DLL?
10:05:19anddamI installed nim with choosenim last month or so
10:05:38anddamno I am not even aware how to do that
10:06:41anddamI remember there are MS tools to inspect PEs and the like, I do not even remember that suite name
10:06:47FromDiscord<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:24FromDiscord<ringabout> In reply to @anddam "I remember there are": https://www.dependencywalker.com/ can check missing dlls.
10:07:34FromDiscord<ringabout> (edit) "dlls." => "dlls on windows."
10:07:55anddamI am on choosenim v0.8.4 (2022-07-06 14:50:55) [windows/amd64] so that seems latest
10:08:13anddam Info: Version 1.6.10 already selected
10:08:14FromDiscord<ringabout> Nim version?
10:08:45FromDiscord<ringabout> What does `nim -v` give?
10:09:01anddam Nim Compiler Version 1.6.10 [Windows: amd64]
10:09:03anddamCompiled at 2022-11-21
10:09:05anddamCopyright (c) 2006-2021 by Andreas Rumpf
10:10:33FromDiscord<ringabout> That's weird. I use choosenim and 1.6.10, which works for me.
10:10:51FromDiscord<ringabout> What's does `gcc -v `gives?
10:10:58anddamoh but my issue is when I copy the .exe on a different system, with no ming64 installed
10:11:09anddamon my system, where I compile, it works just fine
10:11:59FromDiscord<ringabout> You probably need to ship some DLLs.
10:12:04anddamhttps://termbin.com/30g2
10:13:35anddamI am always a bit wary of closed source programs
10:13:40anddamI mean apropo dependencywalker
10:13:58anddamwell, not that all the other sheet I am using from MS is open…
10:14:33anddamthe toolset I was looking for is Sysinternals
10:16:34anddamok I'll play with this later
10:17:18FromDiscord<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:27anddamPMunch: kinda what you suggested https://forum.nim-lang.org/t/9368#61551
10:17:31FromDiscord<Andreas> (edit) "btelemetry" => "telemetry"
10:19:18FromDiscord<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:57PMunchanddam, 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:29anddamin fact it works, nice
10:22:36anddamnow I just get to understand dear-imgui
10:22:40anddamand nim
10:23:05anddambtw how do I interpolate a boolean value into a string? &"the flag is {myflag}" ?
10:24:40FromDiscord<4zv4l> is there a kind of 'last chance' proc I would use to write the error before my program crash ?
10:24:47FromDiscord<4zv4l> (edit) "would" => "can"
10:25:08anddamthanks all for the info
10:27:47FromDiscord<Andreas> @ShalokShalom hi, i just found a remark you made about lapce - have you done a plugin for nim-support ?
10:36:14PMunchanddam, 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:52FromDiscord<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:08FromDiscord<ShalokShalom> It sounded like not a good investment of my time
11:36:32FromDiscord<ShalokShalom> I still like the approach to implement a plugin system via wasm, that sounds good 👍🏻😊
11:39:34NimEventerNew thread by gs: Newbie needs help with locks and gcsafe and segfaults, see https://forum.nim-lang.org/t/10009
11:45:39FromDiscord<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:24FromDiscord<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:13FromDiscord<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:46FromDiscord<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:50FromDiscord<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:35PMunchDepends on how it crashes really @4zv4l
12:11:39FromDiscord<4zv4l> Well I really don’t know 🥹
12:11:45FromDiscord<4zv4l> I’ve no output from it
12:25:14*derpydoo quit (Quit: derpydoo)
12:40:42NimEventerNew 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:35FromDiscord<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:20FromDiscord<Zoom> Does anyone know why doesn't unicode export unicode\_ranges?
13:08:55*jerm quit (Ping timeout: 276 seconds)
13:14:14FromDiscord<Ecorous> @ringabout Talking about my PR, I can't seem to find the code in the latest commit. Where's it gone?
13:14:34FromDiscord<Ecorous> (PR was mentioned on github, but I want to do this here since it'll be easier)
13:14:43FromDiscord<Ecorous> The PR added getDataDir()
13:16:32FromDiscord<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:47FromDiscord<Ecorous> de65b38 is the commit where it was added
13:19:45FromDiscord<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:29NimEventerNew thread by vanderlei: How to sort 2d array?, see https://forum.nim-lang.org/t/10010
13:33:33FromDiscord<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:08FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qYE
13:35:11FromDiscord<4zv4l> any chance you can help telling me what happens here?
13:35:28PMunch@Rika, well baring a kernel panic or BSOD it wouldn't be impossible to write a tiny wrapper thing
13:35:54FromDiscord<ringabout> In reply to @4zv4l "any chance you can": Depends on your imports and Nim version
13:36:11FromDiscord<ringabout> You might run into https://github.com/nim-lang/Nim/issues/21531
13:39:37FromDiscord<4zv4l> Is there any fix for this ? It’s only happening with devel so maybe that’s normal
13:39:40FromDiscord<4zv4l> I don’t have it with stable
13:39:50FromDiscord<4zv4l> But with stable my program crashes
13:40:10FromDiscord<4zv4l> When I compile it from windows directly with devel it works without crashing
13:40:52FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#ix=4qYG
13:41:00FromDiscord<djazz> if i move the enum before the object, it works
13:43:13FromDiscord<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:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qYJ
13:53:30FromDiscord<djazz> install xelatex?
13:54:45*Guest31 joined #nim
13:55:08FromDiscord<Rika> In reply to @PMunch "<@259277943275126785>, well baring a": Well you also can’t handle a sig kill so
13:55:27FromDiscord<Rika> There’s probably a good amount more of cases where no additional code can run after receiving the error
13:55:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @djazz "install xelatex?": with nimble?
13:56:25FromDiscord<djazz> you're on windows, dunno how to install XeLaTeX there
13:56:36FromDiscord<djazz> no, not nimble lol
13:56:53Guest31I 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:08Guest31What is the right way to call that built in js function?
14:00:22Guest31Also - it seems that Nim has algebraic data types?
14:00:23Guest31https://gist.github.com/unclechu/eb37cc81e80afbbb5e74990b62ea21f6#file-algebraic_data_types_experiment-nim-L1-L6
14:00:28Guest31What is going on in this code?
14:03:18PMunch@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:52FromDiscord<Rika> In reply to @PMunch "<@259277943275126785>, oh I was": Oh, I see, that makes more sense
14:04:04FromDiscord<Rika> I was under the impression that it has to be part of the same binary
14:04:34FromDiscord<Rika> There’s always the problem of the wrapper dying before the real Programm
14:04:38FromDiscord<Rika> (edit) "Programm" => "program"
14:05:25FromDiscord<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:37PMunchOf 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:50FromDiscord<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:54FromDiscord<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:57FromDiscord<mprakhov> Hello, is it possible somehow to understand or log, when GB cleans up the object (call it's destructor)?
14:29:23FromDiscord<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:44FromDiscord<Zoom> Does it mean any unacessible file breaks any nimscript? If so, wow
14:37:04PMunch@Zoom, well you can always staticExec..
14:37:33PMunch@mprakhov, in theory yes, but why do you want to do this?
14:38:55FromDiscord<mprakhov> In reply to @PMunch "@mprakhov, in theory yes,": I want to double-check, that memory acquired by the objects is removing.
14:40:35PMunchWell the way you typically do that is with -d:useMalloc and valgrind
14:41:14PMunchOr 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:12NimEventerNew 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:12Guest31any thoughts on how to do algebraic data types in nim?
16:17:19Guest31are my messages visible?
16:19:54FromDiscord<Gumbercules> Nim refers to these as object variants
16:20:08FromDiscord<Gumbercules> The manual has a section on them
16:21:15FromDiscord<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:15NimEventerNew 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:46FromDiscord<auxym> wut, I thought Nim didn't even support tabs
17:04:18FromDiscord<Phil> nimpretty is one of those things where I'd love improvement, but the required knowledge level is just broken
17:07:20FromDiscord<auxym> https://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/
17:08:04FromDiscord<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:32FromDiscord<enthus1ast> can i get some information about the compiler that compiles the nim application? On compiletime?
17:37:32FromDiscord<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:56FromDiscord<enthus1ast> even when run on compile time
17:38:08FromDiscord<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:29FromDiscord<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:52Guest31In haskell, you can write GHC compiler plugins and you can get at the type resolved AST of the code
17:55:05Guest31Can you get at the type resolved AST of nim code?
17:55:13Guest31How might I go about this?
17:55:15*xet7 quit (Ping timeout: 260 seconds)
17:55:40*xet7 joined #nim
18:01:42FromDiscord<ShalokShalom> Guest31: You can get that for the untyped AST via:
18:01:50FromDiscord<ShalokShalom> import macros↵dumpTree:↵ var a = "Test"
18:01:59FromDiscord<ShalokShalom> So dumpTree
18:03:32*zgasma quit (Quit: leaving)
18:04:51Guest31I know about dumpTree
18:05:02FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0m
18:05:14Guest31was hoping for some pointers on where to poke in the nim compiler sources
18:05:24Guest31but I can just start reading them
18:05:32FromDiscord<enthus1ast> @jmgomez\: no this unfortunately does not work
18:05:38FromDiscord<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:56FromDiscord<jmgomez> In reply to @enthus1ast "<@726017160115126333>\: no this unfortunately": why is that?
18:05:57Guest31I know - but I'm interested in having access to the type resolved AST
18:06:06Guest31So I can do something like Clash Haskell
18:06:21Guest31anyways - has anybody here used Fidget?
18:06:39FromDiscord<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:57FromDiscord<enthus1ast> i guess this is the reason os.`/` fails in the first place
18:07:31FromDiscord<jmgomez> In reply to @enthus1ast "<@726017160115126333>\: on compile time": I see, so you are cross compiling
18:07:34FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4r0o
18:07:45FromDiscord<enthus1ast> this code should report different os'es but it does not
18:08:18FromDiscord<enthus1ast> or should it? I don't actually know \:)
18:08:18Guest31that is - nim fidget by treeform
18:08:32Guest31I tying to understand some of the constraints present in layout]
18:08:51FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0q
18:10:12FromDiscord<enthus1ast> i think this whole thing is a bigger issue, because when cross compiling, you cannot really slurp files correctly etc..
18:10:35FromDiscord<enthus1ast> when you want to construct paths and use DirSep etc.
18:16:11*Guest31 quit (Quit: Client closed)
18:17:12FromDiscord<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:36FromDiscord<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:56FromDiscord<firasuke> (edit) ":" => "":""
18:33:11*rmt quit (Ping timeout: 264 seconds)
18:37:34*derpydoo joined #nim
18:40:08FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4r0y
18:40:14FromDiscord<Hourglass [She/Her]> I am so confused why the program exits with no error
18:41:28FromDiscord<Hourglass [She/Her]> Wait
18:41:36*Guest31 joined #nim
18:41:36FromDiscord<Hourglass [She/Her]> 🤦‍♀️ I didn't init the window
19:08:39FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0F
19:09:56FromDiscord<Elegantbeef> It's a slice it cannot be saved to a variable
19:10:09FromDiscord<Elegantbeef> It's an unsafe operation to do that since Nim doesnt enforce the lifetime
19:12:26FromDiscord<Elegantbeef> In 20 years when Nim's borrow checker is functional it'll be valid code
19:14:21FromDiscord<sOkam!> kk
19:31:09FromDiscord<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:10FromDiscord<etra> ooc
19:33:03FromDiscord<jmgomez> sent a code paste, see https://paste.rs/Ps6
19:38:13FromDiscord<ElegantBeef> Uhh no clue what you mean
19:38:33FromDiscord<ElegantBeef> A type defined at runtime is best represented by an object variant if you ask me
19:39:02FromDiscord<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:28FromDiscord<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:40FromDiscord<ElegantBeef> That's the point of the object variant
19:42:12*Guest31 quit (Quit: Client closed)
19:42:39FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0I
19:42:53FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=4r0I" => "https://play.nim-lang.org/#ix=4r0J"
19:42:54FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/1go
19:42:54FromDiscord<ElegantBeef> You can represent all objects with that
19:43:42FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0K
19:44:13FromDiscord<ElegantBeef> Given you didnt give the error no
19:44:34FromDiscord<Elegantbeef> Ping
19:44:39FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4r0K" => "https://play.nim-lang.org/#ix=4r0L"
19:44:42FromDiscord<sOkam!> sry, typo. i meant run
19:44:49FromDiscord<sOkam!> it compiles, but segfaults when on
19:45:20FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0M
19:45:25FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4r0L" => "https://play.nim-lang.org/#ix=4r0N"
19:45:55FromDiscord<Elegantbeef> Your image should store a string not a cstring, that way it persists
19:46:10FromDiscord<Elegantbeef> Other than that i do not know
19:46:27FromDiscord<sOkam!> how am i going to store a string in gcnone?
19:46:27FromDiscord<Elegantbeef> The same way a json parser works jm
19:46:30FromDiscord<jmgomez> Im doing something "similar" backed by json atm, that ends up doing memory offsets manually
19:46:41FromDiscord<Elegantbeef> I mean i forgot you were using string
19:46:46FromDiscord<Elegantbeef> So i guess disregard
19:46:58FromDiscord<Elegantbeef> using gc\:none\
19:47:27FromDiscord<Elegantbeef> You either have the store data into a contiguous byte buffer or store data as object variants
19:47:30FromDiscord<sOkam!> i would use openArray[char] or byte but... don't know how to convert to cstring from those
19:47:37FromDiscord<Elegantbeef> One is purely untyped and requires guessing
19:47:51FromDiscord<Elegantbeef> `cast[cstring](oa[0].addr)`
19:48:07FromDiscord<Elegantbeef> But that's not the problem
19:48:13FromDiscord<Elegantbeef> Something is nil inside `write`
19:48:27FromDiscord<Elegantbeef> So either something needs init'd, allocated, or fixed
19:48:30FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4r0O
19:48:30FromDiscord<Elegantbeef> Use valgrind with it
19:49:56FromDiscord<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:35FromDiscord<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:41FromDiscord<sOkam!> now i'm getting that the openarray inside the Image type cannot be assigned to
19:53:19FromDiscord<sOkam!> In reply to @Elegantbeef "You either have the": how would you do each?
19:53:20FromDiscord<Elegantbeef> Again
19:53:26FromDiscord<Elegantbeef> You cannot store openarrays on fields
19:53:46FromDiscord<sOkam!> that's why i was using a cstring
19:53:54FromDiscord<sOkam!> i don't know how else to do it
19:53:57FromDiscord<Elegantbeef> Openarrays are parameters only and must be passed directly
19:53:57FromDiscord<Elegantbeef> That wasnt to you sokam, that was to jmgomez
19:54:04FromDiscord<Elegantbeef> You use a cstring it's fine
19:54:14FromDiscord<Elegantbeef> I said i forgot you were not using gcnone
19:55:05FromDiscord<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:09FromDiscord<sOkam!> then we back to the sigsegv
19:55:34FromDiscord<jmgomez> In reply to @Elegantbeef "That wasnt to you": what was for me? What openarrays are you referring to?
19:55:46FromDiscord<Elegantbeef> Jesus you two are lost in conversations
19:55:50FromDiscord<Elegantbeef> The object variants was to you
19:55:57FromDiscord<Elegantbeef> The openarray was to sokam
19:56:06FromDiscord<sOkam!> 😄
19:56:12FromDiscord<Elegantbeef> At this point i might aswell make a matrix account per conversation
19:56:18*rmnmjw joined #nim
19:56:31FromDiscord<Elegantbeef> firasuke you use split, either the iterator or procedure variant
19:57:04FromDiscord<jmgomez> xD I missed what sOkam said about variants then. You are just too kind beef 😛
19:57:05FromDiscord<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:36FromDiscord<sOkam!> i don't think i said anything about variants 🤔
19:57:43FromDiscord<Elegantbeef> `strutils` split
19:57:43FromDiscord<firasuke> (edit) "split" => "splitPath"
19:57:59FromDiscord<Elegantbeef> "How would you do each"
19:58:03FromDiscord<Elegantbeef> That was object variants
19:58:08FromDiscord<sOkam!> oh kk
19:58:09FromDiscord<firasuke> oh nvm
19:58:13FromDiscord<firasuke> split from strutils works
19:58:39FromDiscord<jmgomez> 😂
19:58:53FromDiscord<sOkam!> im so lost in why this is failing
19:59:26FromDiscord<Elegantbeef> Probably forgot to init something like i said
19:59:30FromDiscord<Elegantbeef> Or are misusing the API
19:59:57FromDiscord<sOkam!> how come that it writes when its 89, but not on 90?
20:00:19FromDiscord<Elegantbeef> no clue i havent ever use the API you're using
20:02:47FromDiscord<sOkam!> how do you turn an array[N, char] into a cstring?
20:03:30FromDiscord<sOkam!> just cast it?
20:09:35FromDiscord<jmgomez> doesnt `GC_ref` works with strings?
20:09:44FromDiscord<sOkam!> im in gcnone
20:10:23FromDiscord<jmgomez> If that's to me, it was a question rather than an answer
20:11:54FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r0X
20:12:18*derpydoo quit (Quit: derpydoo)
20:20:33FromDiscord<Elegantbeef> Not in the RCs↵(@jmgomez)
20:20:42FromDiscord<Elegantbeef> With arc/orc the len is stack allocated
20:20:55FromDiscord<Elegantbeef> No sokam that's incorrect since you do not ensure `carr[^1] == '\0'`
20:21:09FromDiscord<Elegantbeef> A Cstring conventionally is null terminated unless you use it with `len`
20:22:59FromDiscord<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:41FromDiscord<pmunch> Hmm, anyone know a good runtime templating thing for Nim?
21:07:54FromDiscord<pmunch> I know of multiple good compile-time ones \:P
21:08:16FromDiscord<Elegantbeef> Ctrl + V is pretty good 😛
21:08:30FromDiscord<Elegantbeef> I only joke cause I am vastly ignorant
21:08:49FromDiscord<⚶ Zeno> In reply to @Elegantbeef "Ctrl + V is": not without some CTRL + C's though :)
21:09:00FromDiscord<pmunch> Haha, I meant like allowing the user to supply files with templates and files with data and combining the two
21:09:30FromDiscord<Elegantbeef> This is where I just say "strutils.`%` exists"
21:14:54FromDiscord<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:40FromDiscord<jmgomez> this one https://github.com/enthus1ast/nimja
21:16:03FromDiscord<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:55FromDiscord<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:37FromDiscord<pmunch> Nimja is compiled isn't it?
21:19:06FromDiscord<jmgomez> ohh didnt know that, but maybe that's more power to you if you feed in in the vm
21:19:23FromDiscord<jmgomez> who cool that will be? That the user can put actual nim code?
21:19:38FromDiscord<jmgomez> (edit) "will" => "would"
21:20:07FromDiscord<pmunch> Haha, I am planning to allow dynamic library modules, wasn't really considering Nimscript
21:20:28FromDiscord<Elegantbeef> Psh not using wasm so people can securely share their modules
21:20:52FromDiscord<pmunch> What do you mean?
21:21:11FromDiscord<Elegantbeef> Wasm is sandboxed so it's generally safer than dynamic libraries
21:21:17FromDiscord<Elegantbeef> Plus it's cross platform 😄
21:21:20FromDiscord<pmunch> Hmm, fair
21:21:27FromDiscord<pmunch> That is a big benefit
21:21:35FromDiscord<pmunch> How is it speed wise?
21:21:45FromDiscord<Elegantbeef> Depends on the runtime you use
21:22:03FromDiscord<Elegantbeef> There are Jit'd runtimes and the like so they can be quite fast
21:22:15FromDiscord<pmunch> Actually, do you have a WASM plugin sample? I'd like to have a look at this
21:22:31FromDiscord<Elegantbeef> https://github.com/beef331/wasm3 look at wasm sources and the tests
21:22:39FromDiscord<pmunch> You've been raving on about it for so long it has got to have some merit to it 😋
21:22:47FromDiscord<Elegantbeef> Or i'm just an idiot
21:24:13FromDiscord<Elegantbeef> It's pretty much the same idea as a dynamic library it's just safer and cross platform
21:24:27FromDiscord<pmunch> Which are both great pluses
21:24:28FromDiscord<Elegantbeef> You expose procedures to the wasm module, the wasm module imports them like it's C Code
21:24:54FromDiscord<pmunch> Dynamic libraries crashing the entire application is no fun
21:25:01FromDiscord<Elegantbeef> Wait a minute i havent merged my wasm interop to main branch?!
21:25:06FromDiscord<pmunch> But that native performance though..
21:25:25FromDiscord<Elegantbeef> Yea wasm3 is just a VM with no JIT
21:25:38FromDiscord<pmunch> Hmm
21:25:40FromDiscord<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:11FromDiscord<pmunch> TBH I'm not sure how much speed I'd realistically need
21:26:36FromDiscord<pmunch> By the way, how many languages have an easy path to wasm?
21:27:07FromDiscord<Elegantbeef> Almost all system languages, there are also some compilers for JS, Python, Lua afaik
21:27:23FromDiscord<pmunch> Nice
21:28:12FromDiscord<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:27FromDiscord<Elegantbeef> Uh oh devel broke my code
21:29:08FromDiscord<pmunch> So WASM modules could just be loaded via a WASM loader dynamic library
21:29:17FromDiscord<pmunch> Haha, not giving me great confidence
21:30:02FromDiscord<Elegantbeef> I mean it broke interop code, you can just use wasm3 as a C library wrapped with futhark 😛
21:30:27FromDiscord<pmunch> Haha true
21:30:39FromDiscord<Elegantbeef> Or just use my wasm3 bindings
21:30:47FromDiscord<Elegantbeef> Since you an do `import wasm3/wasm3c`
21:30:49FromDiscord<pmunch> Still amazed by how nice it is to use Futharked Gtk
21:31:27FromDiscord<pmunch> I've literally had zero issues with it this far, seems rock solid
21:31:55FromDiscord<pmunch> Well, I did discover one little bug in Futhark, but nothing about the bindings it creates
21:32:11FromDiscord<pmunch> Just the output parameter being a bit borked
21:33:53FromDiscord<Elegantbeef> There fixed it for devel
21:34:06FromDiscord<Elegantbeef> Some issue with `[T: proc](p: static[T]`
21:35:13FromDiscord<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:15FromDiscord<Elegantbeef> I do have a hookable system for Host -\> VM https://github.com/beef331/wasm3/blob/master/tests/thosttowasm.nim#L6-L38
21:36:45FromDiscord<Elegantbeef> That code interacts with https://github.com/beef331/wasm3/blob/master/wasmsources/hostinterop.nim
21:37:34FromDiscord<Elegantbeef> Sorry that's actually VM -\> Host
21:37:41FromDiscord<Elegantbeef> Host -\> VM is quite complicated
21:37:45FromDiscord<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:50FromDiscord<pmunch> Hmm, I guess I'll have a look at it once I get this far
21:37:51FromDiscord<jmgomez> Maybe that can be useful
21:38:11FromDiscord<Elegantbeef> A wasm runtime is the best agnostic scripting backend if you ask me
21:38:41FromDiscord<jmgomez> The thing with NimScript on Nue's case is that you will be able to copy -> paste ideas into prod cod
21:38:41FromDiscord<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:17FromDiscord<sOkam!> is there a way to set an initial default value to all members of an array on initialization?
22:13:46FromDiscord<Elegantbeef> Make a proc
22:18:31FromDiscord<sOkam!> right, i guess. i was asking if there is an existing one that I don't know about
22:19:20FromDiscord<sOkam!> how do you return an array of a certain size with a proc, though?
22:19:28FromDiscord<Elegantbeef> `static int`
22:19:55FromDiscord<sOkam!> where?
22:20:16FromDiscord<sOkam!> like the point is that the size can vary, but its gonna be a certain size that i give on init
22:20:36FromDiscord<sOkam!> (edit) "vary," => "vary each time an array is initialized,"
22:20:56FromDiscord<Elegantbeef> As a parameter or a generic parameter
22:21:41FromDiscord<sOkam!> I've been trying, and failing
22:23:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1u
22:23:14FromDiscord<Elegantbeef> Or
22:23:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1v
22:24:12FromDiscord<sOkam!> ty, will try it
22:24:22FromDiscord<Elegantbeef> There is no try
22:24:38FromDiscord<sOkam!> is there a way to do the same for an object field?
22:25:07FromDiscord<Elegantbeef> Take in a var array
22:26:51FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1w
22:28:21FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4r1x
22:29:43FromDiscord<Elegantbeef> Static generic parameter
22:29:56FromDiscord<Elegantbeef> Use a nimble task to build both
22:31:38FromDiscord<!&luke> Oh
22:32:46FromDiscord<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:08FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1y
22:37:40FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1y" => "https://play.nim-lang.org/#ix=4r1z"
22:47:27FromDiscord<Livid> sent a long message, see http://ix.io/4r1D
22:47:53FromDiscord<Elegantbeef> `myProc[generic]`
22:49:05FromDiscord<Livid> oh, awesome, I'll test it out in a bit
22:49:32NimEventerNew 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:26NimEventerNew Nimble package! nimpretty_t - Use nimpretty with tab indentation., see https://github.com/tobealive/nimpretty_t
23:28:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1K
23:29:26FromDiscord<Elegantbeef> `\n` and `\0`
23:30:48FromDiscord<huantian> man I really don't understand your whitespace
23:30:53FromDiscord<huantian> why are the : and = hugging the t ype
23:30:56FromDiscord<huantian> (edit) "t ype" => "type"
23:30:59FromDiscord<sOkam!> oh true
23:31:20FromDiscord<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:38FromDiscord<Elegantbeef> huan the more disturbing thing is the `map_wmap_h+1`
23:31:41FromDiscord<sOkam!> := are related to type stuff, not to the name itself
23:31:42FromDiscord<Elegantbeef> Like spaces are costly
23:32:05FromDiscord<sOkam!> oh that's not common in my code,
23:32:24FromDiscord<huantian> In reply to @sOkam! ":= are related to": ehhh idk about `=`
23:32:33FromDiscord<huantian> it seperates the name/type from the value
23:32:39FromDiscord<huantian> it's not more related to the type than the value
23:32:43FromDiscord<sOkam!> spaces do that
23:32:58FromDiscord<sOkam!> its language-related stuff. all in one chunk
23:32:59FromDiscord<huantian> right so you should have a space before and after the `=`?
23:33:10FromDiscord<Elegantbeef> A name is just typed memory, checkmate sokam
23:33:18FromDiscord<sOkam!> 😄
23:33:25FromDiscord<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:39FromDiscord<sOkam!> 🤷‍♂️
23:34:02FromDiscord<sOkam!> its easier to skim-read a word without noise around it, and having spaces instead
23:35:08FromDiscord<Elegantbeef> It's all psycho-semantic
23:35:27FromDiscord<huantian> that's true I'm a psycho so maybe don't listen to me
23:35:59FromDiscord<Elegantbeef> Indeed
23:36:04FromDiscord<Elegantbeef> I seen huan kill atleast 3 people
23:36:11FromDiscord<Elegantbeef> Wait huan isnt a police officer
23:37:03*Notxor_ quit (Remote host closed the connection)
23:39:30FromDiscord<sOkam!> how would you define that multiline string without getting the newlines?
23:40:23FromDiscord<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:56FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1M
23:48:16FromDiscord<Elegantbeef> `result = newCall("cstring", newLit(res)`
23:48:30FromDiscord<Elegantbeef> you do not need the `\0`
23:48:40*jerm quit (Ping timeout: 252 seconds)
23:48:43FromDiscord<Elegantbeef> also it'd be `.add '\0'`
23:48:59FromDiscord<Elegantbeef> It might be `nnkConv.newTree(newLit(res))`
23:49:40FromDiscord<Elegantbeef> whoops `nnkConv.newTree(ident"cstring", newLit(res))`
23:52:07FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4r1N
23:52:39FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1N" => "https://play.nim-lang.org/#ix=4r1O"
23:53:37FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4r1O" => "https://play.nim-lang.org/#ix=4r1P"
23:53:44arkanoidcould 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:25arkanoidthe code I'm compiling is just an echo "Hello, World!"
23:56:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4r1Q
23:56:18FromDiscord<Elegantbeef> Or `cstring` if you must
23:57:02FromDiscord<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:44arkanoidElegantbeef, thanks
23:58:32FromDiscord<sOkam!> that's still 256 🤔
23:58:56FromDiscord<sOkam!> iguess the length of a cstring doesn't add the null in nim?
23:59:22FromDiscord<Elegantbeef> seems it counts up to it and returns only the actual string portion
23:59:31FromDiscord<Elegantbeef> Which probably now that i think of it mimics C