<< 20-01-2023 >>

00:09:17FromDiscord<sOkam!> what could be making an app run at `10%` of its `-d:release` performance when its running on `-d:debug`?↵I understand debug is for debugging, and im used to this causing like a 30-50% decrease in performance in a pure C engine. but.. 90%? 🧩↵so its making me curious on what's going on in the background
00:13:56FromDiscord<Elegantbeef> Debug doesnt have any optimisations
00:13:57FromDiscord<Elegantbeef> So that's why
00:17:18FromDiscord<sOkam!> In reply to @Elegantbeef "Debug doesnt have any": what i mean is what type of optimizations are those
00:18:01FromDiscord<Elegantbeef> All of them look at the c compiler's O flags
00:18:31FromDiscord<sOkam!> how can i find them?
00:19:38FromDiscord<pyolyokh> turn up verbosity, or look at the nim.cfg files that nim tells you it's using when you compile something
00:19:54FromDiscord<sOkam!> also, is `--passC:"-O2"` good too add, or is it implied by -d:release?
00:20:01FromDiscord<sOkam!> (edit) "too" => "to"
00:23:50FromDiscord<Elegantbeef> Release does O3 iirc
00:24:01FromDiscord<Elegantbeef> `--listCmd` and refer to your C compiler's flags
00:32:40FromDiscord<sOkam!> `-O3 -fno-strict-aliasing -fno-ident`, the rest seems the same 🤔
00:35:43FromDiscord<sOkam!> how can i know if a C compiler flag could create issues for compiling nim?
00:38:32FromDiscord<pyolyokh> there's no way to know.
00:39:06*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
00:39:19FromDiscord<pyolyokh> which is about the same answer I'd give to "how can i know if a C compiler flag would create issues for compiling C?", since c compiler devs are insane.
00:39:49FromDiscord<pyolyokh> the safe thing to do is not bother with it. People mostly use Nim by default. The defaults are probably safe.
00:45:28*argonica quit (Quit: Leaving)
00:51:01*argonica joined #nim
01:46:06FromDiscord<sOkam!> whats different between `--debugger:native` and not passing the option?
01:46:42FromDiscord<jtv> If you don't pass it, the executable doesn't get the right bits for the native OS debugger to get debug info out of it.
01:46:56FromDiscord<jtv> So if you're used to gdb or lldb you need it
01:47:00FromDiscord<sOkam!> so its like passing the `-g` option to gcc?
01:47:07FromDiscord<jtv> Yeah
01:47:10FromDiscord<sOkam!> kk ty
01:47:55FromDiscord<sOkam!> also, what happens if you pass `-d:debug` when the nim.cfg file contains `-d:release` as a default? is it overwritten, or do both get sent?
01:48:28FromDiscord<jtv> I think the command line takes precedence, but should be easy to confirm
01:51:08FromDiscord<sOkam!> `gc: orc; opt: speed; options: -d:release` i passed debug on cli 😔
01:52:53FromDiscord<jtv> Boo
01:55:55FromDiscord<sOkam!> how do you guys do conditional compilation in nim?↵do you just use nimble for calling `nim c ...` with exec, or is there a better way?
01:56:19FromDiscord<jtv> The "while ... elif ... else" statement
01:56:23FromDiscord<sOkam!> I was using nimble build, expecting that was the intended and so i kept going with it... but i have little to no control over the options this way
01:56:41FromDiscord<jtv> Erm, "when"
01:57:14FromDiscord<jtv> "when is basically #if
01:57:20FromDiscord<Elegantbeef> `config.nims`
01:57:23FromDiscord<Elegantbeef> If using nimble
01:57:31FromDiscord<jtv> Oh yeah that too
01:57:31FromDiscord<Elegantbeef> When is more magical
01:57:46FromDiscord<jtv> Yes, it's better than #if 🙂
01:57:51FromDiscord<sOkam!> but can you really configure options with the config.nims file?
01:57:56FromDiscord<jtv> Yup
01:58:05FromDiscord<sOkam!> how do you do them?
01:58:20FromDiscord<jtv> It's all compile time nim, you just write code in there
01:58:23FromDiscord<Elegantbeef> `--define:release`
01:58:26FromDiscord<Elegantbeef> `switch("define", "release")`
01:58:55FromDiscord<sOkam!> oh, the nims file can take when defined statements?
01:59:51FromDiscord<Elegantbeef> It can figure the project
02:02:59FromDiscord<sOkam!> is the config.nims file parsed before or after the nimble file?↵as in, if i define a variable in one, can it be used in the other automatically, or do they need to be imported?
02:11:50FromDiscord<ringabout> In reply to @turbo "I wrote up a": @turbo Nice article! It should help build this application on M1 MacOS https://github.com/tridactyl/native_messenger/pull/9
02:12:51FromDiscord<jtv> In reply to @Elegantbeef "Just a quick comment": /Users/viega/dev/con4m/src/con4m/builtins.nim(23, 32) Error: type mismatch: got 'typeof(nil)' for 'nil' but expected 'VarStack'
02:13:31FromDiscord<Elegantbeef> Is varstack a ref/ptr?
02:13:35*FromDiscord quit (Remote host closed the connection)
02:13:48*FromDiscord joined #nim
02:14:05FromDiscord<ringabout> Or a distinct?
02:14:07FromDiscord<jtv> Nope just a ref
02:14:29FromDiscord<pyolyokh> `VarStack = seq[RuntimeFrame]`
02:14:41FromDiscord<Elegantbeef> `= @[]`
02:14:56FromDiscord<Elegantbeef> or `VarStack(@[])`
02:15:00FromDiscord<jtv> Oh, good point yeah, been so long since I was in that code. Got it
02:15:29FromDiscord<jtv> Thanks
02:16:42FromDiscord<jtv> Much better, ta
02:17:09FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIp
02:18:15FromDiscord<sOkam!> is `release` not an identifier, when used with a `when defined release`?
02:18:23FromDiscord<jtv> debug isn't I don't think
02:18:31FromDiscord<jtv> release is for sure
02:18:38FromDiscord<Elegantbeef> `defined(release) and not defined(debug)`
02:20:27*azimut_ joined #nim
02:21:26FromDiscord<sOkam!> whats different about the parenthesis here? i thought they could be ommited and they would mean the same thing 🤔
02:21:26*azimut quit (Quit: ZNC - https://znc.in)
02:21:54FromDiscord<pyolyokh> parentheses aren't omittable in general. What Nim has is a command syntax
02:22:14FromDiscord<pyolyokh> <https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax>
02:24:28FromDiscord<sOkam!> ic
02:33:36FromDiscord<Elegantbeef> If unclear `a b c d` is parsed as `a(b(c), d)`
02:34:33FromDiscord<jtv> Is there a logic to that, or just was how the inherent ambiguities were resolved?
02:34:37FromDiscord<sOkam!> is there a default -clean option of sorts?
02:34:52FromDiscord<demotomohiro> !eval echo echo sizeof sizeof sizeof int
02:34:56NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <void>
02:35:10FromDiscord<demotomohiro> !eval echo sizeof sizeof sizeof int
02:35:16NimBot8
02:35:45FromDiscord<pyolyokh> In reply to @sOkam! "is there a default": what would that do?
02:37:28FromDiscord<sOkam!> In reply to @pyolyokh "what would that do?": remove the nimcache folder and the binary to start over
02:37:40FromDiscord<Elegantbeef> `-f`
02:38:18FromDiscord<sOkam!> yeah, but forcing is a different thing. i guess it can work, but -f is meant to be used together with something else for building
02:38:24FromDiscord<Elegantbeef> or `--forceBuild`
02:39:26FromDiscord<sOkam!> `nimble clean`, as i understand it, means "hey, nimble, search everything that you have built so far, and remove it if its there"
02:41:34FromDiscord<Elegantbeef> That's literally `-f` afaik
02:42:36FromDiscord<sOkam!> not really. with -f you are saying "build even if what im asking you to build already exists"
02:43:08FromDiscord<sOkam!> clean is just cleaning as a separate thing
02:43:27FromDiscord<sOkam!> its not handy like all of the time, but when its helpful its really handy
02:44:05FromDiscord<ringabout> Package update bot seems to have been down for a few days
02:48:41FromDiscord<demotomohiro> Maybe there is no command that just remove intermediate `.nim.c` or `.nim.c.o` files.↵If you know the nimcache path, you can easily find the directory that contains build files to delete.↵If you put nimcache in tmpfs or ramdisk, it will be deleted after reboot.
02:50:35FromDiscord<sOkam!> In reply to @demotomohiro "Maybe there is no": yeah, problem is then you depend on removing with the os, and the buildsystem instantly becomes non-portable 😔
02:51:42FromDiscord<sOkam!> if there is a way to remove files with nimscript, then im unaware of it. so sorry if there is
02:54:07FromDiscord<pyolyokh> your VCS might have a command, like 'git clean', that you can use instead of nimscript
02:54:35FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIt
02:55:58FromDiscord<Elegantbeef> `--verbosity: 3`
02:56:31FromDiscord<demotomohiro> You don't need to care about warnings comes from C code generated by Nim.
02:57:09FromDiscord<demotomohiro> Nim actually run C compiler with parameters that suppress warnings.
02:57:13FromDiscord<sOkam!> yeah, i was just curious
02:59:09FromDiscord<sOkam!> In reply to @Elegantbeef "`--verbosity: 3`": i think its still aliasing the CC message 🤔
03:02:23FromDiscord<demotomohiro> If you use GCC as backend C compiler, Nim call it with `-w` option that suppress all warnings.
03:03:28FromDiscord<sOkam!> ohh, i didn't know what that -w was. that makes sense
03:15:19FromDiscord<sOkam!> is it possible to supress the -w in some way?
03:15:49FromDiscord<sOkam!> i know its not useful for everyday use, but trying to understand whats going on an the aliasing is getting in the way a lot
03:21:03FromDiscord<demotomohiro> It seems `-w` option is set in here: https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg#L198
03:22:08FromDiscord<demotomohiro> So creating `nim.cfg` in the same directory of your nim file and overwrite `gcc.options.always` might works.
03:22:11*arkurious quit (Quit: Leaving)
03:22:32FromDiscord<sOkam!> kk tyty ✍️
03:23:57FromDiscord<sOkam!> yep! worked
04:09:48FromDiscord<tfp> question, is there no find by predicate function for an iterable/seq in nim?
04:15:55FromDiscord<Elegantbeef> `filter`?
04:25:29*Figworm quit (Quit: Figworm)
04:28:44FromDiscord<tfp> i want something like findFirstWhere(predicate)
04:29:07FromDiscord<tfp> i just wrote my own but is it somewhere i can't find
04:44:03FromDiscord<huantian> I don’t think so, haven’t come across one myself
04:44:25FromDiscord<huantian> Might be good to add something like that to sequtils tbo
05:00:52FromDiscord<sOkam!> sent a code paste, see https://paste.rs/phw
05:01:08FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4lIU" => "https://paste.rs/mSx"
05:05:27FromDiscord<sOkam!> oh wait, i know why. -O3 is not being passed there
05:09:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIW
05:11:29FromDiscord<Rika> defining release in config will not make defined(release) true iirc
05:11:52FromDiscord<sOkam!> 😔
05:12:17FromDiscord<sOkam!> is there any other way to default to release when not given any options, like this idea here?
05:14:36FromDiscord<Elegantbeef> it should now rika afaik
05:14:47FromDiscord<Elegantbeef> Maybe not in 1.6
05:15:21FromDiscord<Elegantbeef> Yea it does
05:15:57FromDiscord<sOkam!> why is it misbehaving then? its skipping -O3 entirely from the commands 🤔
05:16:09FromDiscord<Elegantbeef> Oh nvm misunderstood
05:16:22*tiorock joined #nim
05:16:22*tiorock quit (Changing host)
05:16:22*tiorock joined #nim
05:16:22*rockcavera is now known as Guest5451
05:16:22*Guest5451 quit (Killed (cadmium.libera.chat (Nickname regained by services)))
05:16:22*tiorock is now known as rockcavera
05:17:40FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIX
05:18:18FromDiscord<Elegantbeef> I dont get why you're manually passing `-O3`
05:18:56FromDiscord<sOkam!> i was just trying to test different options, to see how they performed. and wanted to try -O2, but is hardcoded as O3
05:18:56FromDiscord<Elegantbeef> release is implicitly `-O3`
05:19:35FromDiscord<sOkam!> was giving the example of o3 because its default and that shouldn't break unless my code was wrong in some way
05:19:54*tiorock joined #nim
05:19:54*rockcavera is now known as Guest1518
05:19:54*tiorock is now known as rockcavera
05:21:14FromDiscord<Rika> isnt release implicitly O2 and not O3
05:22:09FromDiscord<sOkam!> depends on the system, but for most it seems to be O3
05:22:18FromDiscord<sOkam!> https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg#L198
05:22:28FromDiscord<sOkam!> (edit) "https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg#L198" => "https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg"
05:23:06*Guest1518 quit (Ping timeout: 256 seconds)
05:27:34FromDiscord<Phil> In reply to @jos "i just wrote my": the zerofunctional lib provides a "find" proc, though it's not terribly well documented:↵https://github.com/zero-functional/zero-functional
05:27:45FromDiscord<Phil> (edit) "lib" => "package"
05:30:54*jkl quit (Quit: Gone.)
05:31:56FromDiscord<tfp> aaaa
05:32:29*jkl joined #nim
05:32:33FromDiscord<tfp> thanks
05:57:17FromDiscord<sOkam!> I've gone from 37fps to 150fps in debug build. Not too shabby for a few hours of battling the build options 🙃
05:58:08FromDiscord<Elegantbeef> Are you even debug build anymore?
05:59:30FromDiscord<sOkam!> wdym?
06:00:20FromDiscord<Elegantbeef> Debug ideally is fast to build
06:03:30FromDiscord<sOkam!> i will tell you in some months when the engine is bigger, but at the moment is just a couple of seconds longer 🤷‍♂️
06:03:41*azimut_ quit (Remote host closed the connection)
06:03:58FromDiscord<huantian> Personally I’d say that’s the difference between debug and release for a small project lol
06:04:06FromDiscord<Elegantbeef> Yea that is
06:04:35*azimut joined #nim
06:04:40FromDiscord<sOkam!> 37fps in an almost empty scene, when the target framerate for physics is 125, is totally unusable though 😔
06:05:01FromDiscord<huantian> Yeah true
06:05:32FromDiscord<Elegantbeef> I'd question whether you're working around a problem
06:06:09FromDiscord<sOkam!> i don't know what you mean
06:07:34FromDiscord<Elegantbeef> I mean are you using compiler optimisation to avoid a performance issue that your engine has
06:09:07FromDiscord<sOkam!> i don't follow. the engine runs at 350fps when in release mode
06:09:21FromDiscord<Elegantbeef> Ok?
06:10:00FromDiscord<Elegantbeef> 350fps for an empty scene is abysmal
06:10:04FromDiscord<sOkam!> im just trying to:↵- understand how to configure the buildsystem, to the level of configurability that im used to in C↵- trying different options to see what works better or worse
06:10:34FromDiscord<Elegantbeef> I'm wondering if you're leaning on optimisations instead of fixing an underlying code problem
06:10:36FromDiscord<sOkam!> In reply to @Elegantbeef "350fps for an empty": yeah, i totally get that. but im not trying to solve that with this. im just learning and this is just one step in that process
06:10:47FromDiscord<Elegantbeef> Even with a debug build on my game my FPS is in the thousands iirc
06:11:04FromDiscord<sOkam!> In reply to @Elegantbeef "I'm wondering if you're": well if the code problem is there, i haven't found it yet. basically because i haven't started searching for it
06:11:38FromDiscord<Elegantbeef> Yes i know different hardware, but yea
06:11:56FromDiscord<huantian> I mean something between a debug and release mode might be helpful in tbe diagnosis and optimization process
06:12:09FromDiscord<huantian> So I wouldn’t completely discredit it as long it’s a stopgap
06:12:12FromDiscord<sOkam!> is it possible to compile that project in my system to compare? i would love to have a reference
06:13:04FromDiscord<sOkam!> because my pc is like the average boy from 7-8y ago, so its not very performant in most situations already
06:13:05FromDiscord<Elegantbeef> My project isnt the hardest to compile, but requires manually `nimble develop`ing all it's depps
06:14:42FromDiscord<sOkam!> maybe you could build mine instead and run it?↵i don't know how to share it, though, since its not yet on github or anywhere 🤔
06:15:34FromDiscord<Elegantbeef> I'd rather not get into the habit of trusting random binaries, but i suppose i could take one for the team
06:15:54FromDiscord<sOkam!> was thinking of source files
06:18:50FromDiscord<Elegantbeef> Whew i thought i was wrong for a second with my time conversion
06:19:14FromDiscord<Elegantbeef> For my game framework i get around 4.7kfps on release and debug
06:19:30FromDiscord<Elegantbeef> Though it's a ryzen 5600x and rx480
06:19:39FromDiscord<Elegantbeef> I didnt get much worse with a xeon1231v3
06:20:04FromDiscord<Elegantbeef> If you trust random binaries i could ship you a debug and release of my project
06:20:38FromDiscord<Elegantbeef> I guess assuming you have a modern glibc 😄
06:21:39FromDiscord<sOkam!> im on linux
06:21:46FromDiscord<sOkam!> arch, so i assume i do 🙂
06:22:08FromDiscord<Elegantbeef> So you want my sketchy files?
06:23:10FromDiscord<sOkam!> https://ufile.io/c1t6y697
06:23:56FromDiscord<sOkam!> (edit) "https://ufile.io/c1t6y697" => "https://ufile.io/c1t6y697↵`nimble build` is the default. should run unless i did something wrong. haven't tried windows, though so no clue there"
06:25:29FromDiscord<Elegantbeef> `Error: unhandled exception: cannot open: /tmp/bleh/reid/bin/log/gl.log [IOError]` nice
06:25:47FromDiscord<sOkam!> yeah, i think it expects the folders to write to them
06:26:36FromDiscord<Elegantbeef> No "WaterBottle.gltf"
06:26:45FromDiscord<sOkam!> `mkdir ./bin`, `mkdir ./bin/log` and symlink res to bin/res
06:27:40FromDiscord<sOkam!> basically everything is expected to live in bin, where the binary is, but they are symlinks at the moment since its all temp
06:28:17FromDiscord<sOkam!> when you load you will see no bottle, press `v` and it will reset you closer to where it is
06:29:52FromDiscord<Elegantbeef> No tut.vert
06:30:10FromDiscord<sOkam!> same, missing symlink
06:31:36FromDiscord<sOkam!> https://media.discordapp.net/attachments/371759389889003532/1065881261295534080/image.png
06:32:17FromDiscord<sOkam!> that one is a bit entangled at the moment, sorry about the subsubsubdirs. they will be moved eventually
06:35:06FromDiscord<Elegantbeef> Is that debug?
06:35:38FromDiscord<Elegantbeef> I guess not given `nimble run`
06:35:42FromDiscord<Elegantbeef> I get around 400fps
06:36:36FromDiscord<Elegantbeef> how do you have 5ms delay
06:37:28FromDiscord<sOkam!> if you do either nimble build or nimble run, it will both take the defaults afaik
06:37:53FromDiscord<sOkam!> there is nimble release if you need to, but its the same if im not mistaken in what i did
06:38:26FromDiscord<sOkam!> In reply to @Elegantbeef "how do you have": delay is the accumulator from that fixyourtimestep article
06:43:58FromDiscord<sOkam!> In reply to @Elegantbeef "I get around 400fps": ty for the reference. im probably doing something wrong in the rendering or something. will take a look ✍️
06:46:40FromDiscord<Elegantbeef> Think i found the reason your fps is so bad, just need to check though
06:51:04FromDiscord<Elegantbeef> Yep
06:51:05FromDiscord<Elegantbeef> You're rendering the UI on the CPU every frame
06:51:05FromDiscord<Elegantbeef> Removing `ui.update` i go up to 10kfps
06:51:27FromDiscord<Elegantbeef> If you're wondering how i found this i used `vallgrind yourProgram` waited the 20 minutes for it to load the window
06:51:40FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1065886310851694743/image.png
06:51:41FromDiscord<Elegantbeef> Then i noticed this
06:52:14FromDiscord<Elegantbeef> Looked at the callers of that, noticed a lot of pixie code
06:52:40FromDiscord<Elegantbeef> Put 2 + 2 together and uncommented `ui.update()`
06:54:14FromDiscord<Elegantbeef> I mean commented `ui.update`
06:54:40FromDiscord<Elegantbeef> I see you're using boxy, it does not seem it's made for very dynamic GUI
06:55:33FromDiscord<Elegantbeef> For rapidly updating UI you're likely best to bake an atlas and quads to render that
06:55:51FromDiscord<Elegantbeef> This way changing a character is just calculating 4 points, instead of rendering text
06:56:36FromDiscord<Elegantbeef> Also it doesnt help the way you're making the strings is heavily garbage creating
06:58:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lJ9
06:58:29FromDiscord<Elegantbeef> You have strformat which can optimise this a bit
06:59:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lJb
07:00:43FromDiscord<Elegantbeef> @sOkam!\: just so you read my inanity
07:04:27FromDiscord<sOkam!> In reply to @Elegantbeef "Removing `ui.update` i go": jeez, really?
07:04:32FromDiscord<sOkam!> i had no clue it was that expensive
07:04:49FromDiscord<Elegantbeef> Yea boxy does cpu rendered gui, which is very expensive for constantly updating
07:05:05FromDiscord<sOkam!> crap
07:05:06FromDiscord<Elegantbeef> Ideally what you do is only render what changes
07:05:30FromDiscord<Elegantbeef> So constant text is stored to a texture and a quad, updating text is then rerendered and uploaded
07:05:50FromDiscord<Elegantbeef> But it's still better to use texture atlasing
07:06:18FromDiscord<sOkam!> ic. so im reuploading the fonts every frame, basically?
07:06:37FromDiscord<Elegantbeef> Well you're re rendering the image on the cpu then uploading it to the gpu
07:06:44FromDiscord<Elegantbeef> That's quite costly, the CPU sucks at rendering
07:06:52FromDiscord<sOkam!> ah yeah, totally can see that
07:07:33FromDiscord<Elegantbeef> It'd use more memory but boxy could try to cache the textures
07:07:34FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lJd
07:08:14FromDiscord<Elegantbeef> I do have to say it's a mostly clean project(minus your oddities)
07:08:34FromDiscord<sOkam!> plenty of oddities
07:08:36FromDiscord<sOkam!> 😄
07:08:41*kenran joined #nim
07:08:46FromDiscord<sOkam!> but tysm
07:08:54FromDiscord<Elegantbeef> `var a :Type` is just the worst
07:09:19FromDiscord<sOkam!> `for file in folder: nimpretty file` 🙂
07:10:36FromDiscord<sOkam!> i personally find it more readable when the noise of the type is all together in one "word" separated from the name of the thing. its faster (for me) to skim over it without the distraction of the weird symbols next to the word
07:10:45FromDiscord<sOkam!> but i'm aware most people really hate that
07:22:04FromDiscord<pyryrin> Are strings in nim unicode strings
07:22:21FromDiscord<Elegantbeef> They're encoding indifferent
07:22:40FromDiscord<Elegantbeef> Strings in Nim are really just binary buffers
07:22:59FromDiscord<Elegantbeef> `std/unicode` implements utf8 operations for them
07:44:01*PMunch joined #nim
07:55:26*rockcavera quit (Remote host closed the connection)
08:06:29*azimut quit (Ping timeout: 255 seconds)
08:26:19FromDiscord<pmp-p> if i have a `func nimStringFromStdString(s: std_string_const_ref):` how can i get the cpp name of "s" or force set it so i can access it in .emit block (actually i get `sm79be3Q6YxMAnikZVrbdegg` ) on; nim-git / clang / backend:cpp) Note that the code previously could build on nim-1.6.10 wich gcc profile
08:27:15FromDiscord<pmp-p> project that does not build with clang profile is https://github.com/rdb/nim-panda3d
08:32:12FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lJu
08:32:28FromDiscord<pyolyokh> got confused by the second example for a while - it not being in an array is key.
08:32:40FromDiscord<ringabout> Yeah, backtick work.
08:34:01FromDiscord<ringabout> (edit) "work." => "works."
08:34:54FromDiscord<ringabout> The devel has mangled all parameters in case of conflicts. https://github.com/nim-lang/Nim/pull/21121
08:35:45FromDiscord<pmp-p> ouch
08:41:44FromDiscord<pmp-p> no macro to get arguments mangled name by position from inside generated code ?
08:43:51FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lJw
08:46:32FromDiscord<pmp-p> thx !
09:17:22*jjido joined #nim
09:35:07*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:02:37FromDiscord<Mathmatix> Hey, I just stumbled over nim. How is the performance compared to other compiled languages like Rust, C, and C++?
10:09:19FromDiscord<pyolyokh> the line I've heard is that naive Nim is about half as fast. If you write code without care for the details, you'll get waste. Apart from that, there are all kinds of benchmarks. <https://forum.nim-lang.org/t/9688> had some interesting discussion on a csv comparison with Rust.
10:27:58*Jjp137 quit (Quit: Leaving)
10:28:08*Jjp137 joined #nim
10:41:55FromDiscord<michaelb.eth> In reply to @Mathmatix "Hey, I just stumbled": When experimenting with comparisons, make sure to pass `--define:release` (or `-d:release`) to invocations of `nim c`, if you're comparing against production builds with Rust, etc. You can also pass e.g. `--opt:speed`.
10:42:09FromDiscord<Mathmatix> In reply to @pyolyokh "the line I've heard": Nice! Half as fast means without any optimization and after tweaking on the same level?
10:42:13FromDiscord<michaelb.eth> (edit) "In reply to @Mathmatix "Hey, I just stumbled": When experimenting with comparisons, make sure to pass `--define:release` (or `-d:release`) to invocations of `nim c`, ... if" added "i.e."
10:43:31FromDiscord<Rika> half as fast means without doing anything and writing the naive solution or so i think
10:54:57FromDiscord<ieltan> Hey guys I currently have a lapse in memory and i need your help to find the word that i am looking for
10:55:35FromDiscord<ieltan> When you have to do repetitive stuff over and over and that you make an abstraction so that you dont have to deal with it, what is it that you are reducing/eliminating ?
10:55:42FromDiscord<ieltan> (not complexity)
10:56:03FromDiscord<enthus1ast> I asked chatgpt
10:56:08FromDiscord<enthus1ast> The word you are looking for is "redundancy". Redundancy is the process of eliminating unnecessary or repetitive tasks in order to simplify a process or system.
10:57:55FromDiscord<ieltan> It's almost that
10:58:03FromDiscord<ieltan> ask him to try again
10:58:23FromDiscord<enthus1ast> It's almost that. Any other word?↵↵Another word that is related to eliminating repetitive tasks is "automation". Automation is the process of using technology to automate or streamline a process or system.
10:58:26FromDiscord<enthus1ast> mh
10:58:45FromDiscord<ieltan> People usually use that word to describe Rust
10:58:48FromDiscord<ieltan> argh
10:59:15FromDiscord<Rika> verbosity
10:59:19FromDiscord<Rika> verbose
10:59:21FromDiscord<Rika> rust is verbose
10:59:35FromDiscord<michaelb.eth> In reply to @ieltan "When you have to": Maybe DRY?↵“don’t repeat yourself
11:00:29FromDiscord<enthus1ast> sent a long message, see http://ix.io/4lJV
11:00:30FromDiscord<ieltan> In reply to @michaelb.eth "Maybe DRY? “*don’t repeat": No because this is a case where you cannot help but repeat and repeat BUT we're almost there
11:00:56FromDiscord<Rika> mfw
11:00:59FromDiscord<ieltan> Chat GPT having molded brain disorder
11:01:36FromDiscord<ieltan> In reply to @Rika "verbosity": A synonym of that word
11:01:53FromDiscord<ieltan> I think its multiple words
11:01:55FromDiscord<ieltan> but i am not sure
11:02:00FromDiscord<michaelb.eth> In reply to @ieltan "A synonym of that": ‘tarded?
11:02:04FromDiscord<enthus1ast> "wordiness"?
11:02:09FromDiscord<pmp-p> In reply to @ieltan "When you have to": maybe you are reducing boilerplate
11:02:15FromDiscord<ieltan> context is programming
11:02:20FromDiscord<ieltan> In reply to @pmp-p "maybe you are reducing": This is it
11:02:23FromDiscord<ieltan> Thanks you very much
11:02:26FromDiscord<pmp-p> yw
11:02:41FromDiscord<Rika> damn i was about to say pleonastic :baqua:
11:02:54FromDiscord<ieltan> 😭
11:03:45FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4lJX
11:03:54FromDiscord<Rika> "verbiferousness"
11:03:56FromDiscord<Rika> jesus
11:04:00FromDiscord<Rika> wtf is prolixity
11:04:03FromDiscord<Rika> wtf is garrulity
11:04:08FromDiscord<Rika> are these even words
11:09:33Zevvpoxility is a bit like gregariousness or bedizenment
11:09:53Zevvor longiloquence
11:10:11FromDiscord<Rika> gregariousness is at least recognisable
11:11:23Zevvgarrulity is more like loquaciousness or garrulousness
11:11:30FromDiscord<0ffh> In reply to @michaelb.eth "When experimenting with comparisons,": I think for a fair comparison to C or C++ you should also ``checks:off``, because they don't have runtime checks either. Not sure about Rust.
11:11:40*jjido joined #nim
11:12:54FromDiscord<0ffh> @Mathmatix
11:17:42FromDiscord<michaelb.eth> sent a long message, see https://paste.rs/D42
11:18:06FromDiscord<michaelb.eth> (edit) "http://ix.io/4lK1" => "http://ix.io/4lK0"
11:18:43FromDiscord<Rika> it is very rare for the overhead of orc to be unacceptable i would say...
11:18:51FromDiscord<michaelb.eth> totally agree
11:26:45FromDiscord<michaelb.eth> In reply to @0ffh "I think for a": Makes sense, but you have to consider the trade-offs. With its `checks`, Nim offers more safety by default than C/C++, so if that's one of the reasons you're choosing the language, then turning them off may not be a great idea when comparing performance.
11:27:22FromDiscord<michaelb.eth> (edit) "In reply to @0ffh "I think for a": Makes sense, but you have to consider the trade-offs. With its `checks`, Nim offers more safety by default than C/C++, so if that's one of the reasons you're choosing the language, then turning them off ... may" added "(if you're depending on them to assist you in writing correct programs)"
11:44:16*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
11:45:32FromDiscord<0ffh> sent a long message, see http://ix.io/4lK7
11:46:49FromDiscord<0ffh> (edit) "http://ix.io/4lK7" => "http://ix.io/4lK8"
11:48:10FromDiscord<michaelb.eth> > Do you know if Nim has such an option too?↵↵great question, but tbh I'm not sure!
11:49:44FromDiscord<michaelb.eth> I think it is... hunting for something I'm currently vaguely recalling :p
11:49:51FromDiscord<ringabout> It probably works.
11:50:12FromDiscord<ringabout> `{.push checks:off}` or something
11:50:31FromDiscord<michaelb.eth> yeah something like that, finding a github link to an example...
11:50:36FromDiscord<ringabout> (edit) "checks:off}`" => "checks:off.}`"
11:50:50FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4lKa
11:51:11FromDiscord<0ffh> In reply to @ringabout "`{.push checks:off.}` or something": Yeah, like this or similar at least!
11:51:32FromDiscord<0ffh> I can guess what ``boundChecks: off`` does.
11:52:23FromDiscord<0ffh> I need to delve deeper into the Docs, so many hidden gems!
11:56:34FromDiscord<michaelb.eth> indeed, but it's one giant friggin' web page (the Manual, anway)... there's stuff I "found" in there a couple of years after reading the whole thing... but maybe there's not really a better way to organize it... at least google site-searching (`site:... inurl:...`) it turns up answers quickly once you know the fundamentals of Nim-vocbulary
11:57:18FromDiscord<michaelb.eth> (edit) "indeed, but it's one giant friggin' web page (the Manual, anway)... there's stuff I "found" in there a couple of years after reading the whole thing... but maybe there's not really a better way to organize it... at least google site-searching ... (`site:..." added "it" | removed "it"
11:57:31FromDiscord<michaelb.eth> (edit) "quickly" => "easily"
11:57:36FromDiscord<michaelb.eth> (edit) "Nim-vocbulary" => "Nim-vocabulary"
11:57:54FromDiscord<0ffh> In reply to @michaelb.eth "indeed, but it's one": I'm still searching for a page that lists all these in-line compiler pragmas, haven't found it yet... 😂
11:58:20FromDiscord<0ffh> I'm reasonably sure there must be one... somewhere
11:58:27FromDiscord<michaelb.eth> silver searcher or ripgrep (etc) in a clone of the repo... it's your only hope
11:59:30FromDiscord<0ffh> In reply to @michaelb.eth "silver searcher or ripgrep": And there I thought old Ben Kenobi was our only hope. 😁
12:00:26FromDiscord<michaelb.eth> https://github.com/ggreer/the_silver_searcher#readme↵he may be the best we've got
12:00:35FromDiscord<michaelb.eth> (edit) "https://github.com/ggreer/the_silver_searcher#readme↵he" => "https://github.com/ggreer/the_silver_searcher#readme↵ggreer, he"
12:16:46FromDiscord<michaelb.eth> In reply to @0ffh "And there I thought": it could be worse, you know.. imagine you're stuck needing to dig through the GnuCOBOL FAQ and all you have is a mobile data plan and "find in page": https://gnucobol.sourceforge.io/faq/index.html↵(don't actually try to load that page on a cellular internet connection)
12:17:15FromDiscord<michaelb.eth> (edit) "page":" => "page" in your phone's browser:"
12:22:15FromDiscord<Rika> who are you to tell me what to do
12:23:58FromDiscord<michaelb.eth> edited
12:24:35Zevvringabout: ping
12:24:44FromDiscord<ringabout> pong
12:25:25Zevvhey; clang has a directive to enforce tail call optimization: it requires the return to be a function call to a function with the same signture, and will ensure the call is a jmp
12:25:53ZevvI have a nasty hack that .emit.s a return so I can use this from nim, which allowed me to speed up npeg with 25%
12:26:15ZevvI'd love it if nim could support this natively soemhow, but the problem is that stuff always goes into `result` first
12:26:49Zevvi'm not familiar with that part of the compiler, do you have some tips for me on where to start poking around to make a POC to make this work?
12:27:20Zevvbasically what I need is that nim will not do `result = foo(); return result` but emit `return foo()` straight away
12:27:32FromDiscord<Mathmatix> In reply to @michaelb.eth "My internet connection went": Thanks! I Never wrote something in nim and just stumbled over the language yesterday. But i read that you can disable GC completely and do everything by hand? If that’s the case that is super interesting to have the flexibility!
12:27:47FromDiscord<Mathmatix> (edit) "In reply to @michaelb.eth "My internet connection went": Thanks! I Never wrote something in nim and just stumbled over the language yesterday. But i read that you can disable GC completely and do everything by hand? If that’s the case that is super interesting to have the flexibility! ... " added "I will later read the article Btw"
12:28:06FromDiscord<Phil> In reply to @Mathmatix "Thanks! I Never wrote": You can, though keep in mind that may affect which std lib modules you may be able to use
12:28:40FromDiscord<djazz> PMunch, did you see my Futhark PR? Small enum fix
12:29:18FromDiscord<michaelb.eth> In reply to @Mathmatix "Thanks! I Never wrote": you can disable gc completely, just consider that will require programmer competence on your part comparable to writing your program in another language where you are responsible for managing memory manually
12:29:58FromDiscord<Phil> I'd argue unless the environment you code in absolutely demands it, that it's a lot easier to deal with nim's move semantics and control that way when things are moved/copied than it is to deal with manual memory management
12:30:13FromDiscord<michaelb.eth> totally agree
12:30:19PMunch@djazz, yeah I saw that one. Still not entirely sure what the original problem was and how this fixes it..
12:30:34FromDiscord<Phil> And that already should provide a really good amount of optimization possibilities
12:31:16FromDiscord<Mathmatix> For sure! I just like that you have the flexibility. Of course for most tasks the overhead Of GC won’t matter. I will definitely follow nim and see how it evolves 🙂 maybe I will try out some small projects in it. Already have some Rust, Python and C,C++ experience. So let’s see
12:31:47PMunch@Mathmatix, with that background you should be able to pick up Nim pretty quickly
12:31:57FromDiscord<michaelb.eth> In reply to @Mathmatix "For sure! I just": good luck, and have fun! the community is always here if you have questions or difficulties!
12:32:31FromDiscord<djazz> PMunch, because you cant do const somevar: cuchar = 123 (type mismatch)
12:32:39FromDiscord<Phil> Had a lot of fun with it in webdev, I can say that much↵Finally found a framework/combination of libs that doesn't expose me to so much indirect implicit magic stuff
12:32:40FromDiscord<djazz> cuchar is not an int, its a char
12:32:57FromDiscord<Mathmatix> In reply to @michaelb.eth "good luck, and have": Thanks you guys! It’s always nice when programming languages have friendly communities. The rust discord server is also super helpful and friendly.
12:33:16FromDiscord<Phil> "Finally" being last year when I stumbled over my personal fav among nim webdev frameworks
12:33:46PMunch@djazz, ah right
12:33:58PMunchMoving the type to the right makes Nim convert to that type
12:34:03FromDiscord<djazz> `Error: type mismatch: got 'int literal(123)' for '123' but expected 'char'`
12:34:10FromDiscord<michaelb.eth> In reply to @Isofruit ""Finally" being last year": re: webdev, are you using Nim for mainly backend or frontend, or both equally?
12:34:49FromDiscord<Phil> Completely backend.↵Already had a backend/frontend separation going before (Django - Angular) and I wasn't about to rewrite ~10k loc backend AND several thousand lines of frontend
12:34:55FromDiscord<ringabout> Zevv: hi, I think you might start from `semProcAux`, `semProcBody` and `addResult` where `result` might be handled.
12:35:02FromDiscord<djazz> PMunch: so either change cuchar (which is deprecated) to uint8 or merge my fix
12:35:21Zevvringabout: cool, thanks
12:35:37FromDiscord<djazz> but enums can also contain chars so idk
12:35:49FromDiscord<djazz> C doesnt care, its just another number
12:37:19FromDiscord<Phil> On an unrelated sidenote: Boy am I looking forward to the nim-docker-images for choosenim to work again
12:37:30FromDiscord<Phil> (edit) "nim-docker-images" => "nim-docker-image"
12:37:35FromDiscord<michaelb.eth> In reply to @Isofruit "Completely backend. Already had": Makes sense. I hadn't done anything webdev related in some time, though that used to be my bread-and-butter. But when I needed to get back into it in recent months, I found Svelte/Kit a breath of fresh air (not advertising, just recounting personal experience). My backend is in Nim and exposed via JSON-RPC.
12:38:37FromDiscord<Phil> In reply to @michaelb.eth "Makes sense. I hadn't": I tend to just use Prologue and make a REST API in combination with jsony and norm
12:38:48FromDiscord<Phil> And constructor
12:38:51FromDiscord<Phil> Still loving constructor
12:40:22PMunch@djazz, yeah I'm not sure what to do about the whole cuchar being deprecated thing..
12:40:29PMunchFeels wrong to just make them uint8
12:40:34FromDiscord<djazz> mhm
12:41:06PMunchThrowing away type information feels a bit dirty
12:41:11FromDiscord<ringabout> Probably copy the definition `cuchar`.
12:41:15FromDiscord<ringabout> (edit) "Probably copy the definition ... `cuchar`." added "of"
12:41:28PMunchBut maybe I'll change it and add a switch with --useCuchar or something
12:41:55PMunchZevv, quick question, have you ever used nmqtt against AWS?
12:42:22ZevvPMunch: I never used it against anything other than mosquitto I think
12:42:30Zevvi wrote it, never used it, and gave it away :)
12:42:52PMunchHaha, okay
12:42:58FromDiscord<Phil> In reply to @michaelb.eth "Makes sense. I hadn't": I actually struggle to see any way where Angular could make my life meaningfully easier other than writing tests and routing... the way angular intends for you to handle routing is crap and belongs burned in a fire
12:43:14FromDiscord<Phil> (edit) "In reply to @michaelb.eth "Makes sense. I hadn't": I actually struggle to see any way where Angular ... could" added "or any other framework"
12:43:47FromDiscord<Phil> The entire idea of "lets have multiple places that can spawn components based on the route" is terrible and a mistake and worse than the idea of nullpointers
12:47:10PMunchI'm toying around with some type-based routing
12:47:26PMunchI think it could be pretty cool, but I'm afraid it might be a touch too magic..
12:48:33FromDiscord<Phil> So far, the ultimate routing has been done by Django for me and others only need to replicate that (+ maybe add the ability to deal with stuff like resolvers, not sure if those as a concept exist outside of Angular)
12:49:01PMunchHow does Django do it?
12:49:45FromDiscord<Phil> Give me a way to associate URL-patterns with names, then allow me to generate (in templates or whereever needed) those URLs with just the name and the parameters required to fill thepattern.
12:50:35FromDiscord<Phil> I do not give a hoot if the url to my overview page is /overthefloopymountains or /overview or /oversight.↵Just give me a name that I can call it by and it'll get generated. If the URL changes I only need to change the pattern, not 50 places in my application
12:51:26PMunchHmm, not entirely sure how that differs from what e.g. Jester does
12:51:38FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4lKl
12:51:53FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4lKn
12:53:16FromDiscord<Phil> In reply to @PMunch "Hmm, not entirely sure": Haven't used jester so I couldn't tell you.↵I was mostly comparing Django with Angular because that's how my frontend migrated: Started with SSR on Django, then jumped to Angular
12:53:59FromDiscord<Phil> Haven't had to generate URLs since, since the Angular frontend decides which URL goes where, so no work on the backend parts are needed as that code is just no longer connected
12:54:25FromDiscord<Phil> (edit) "Haven't had to generate URLs ... since," added "in the backend"
12:55:34FromDiscord<Phil> In reply to @michaelb.eth "Fair enough. For me,": I heard many good things, I guess it's just the lack of need for changing that's making things different. I assume Svelte requires you to get your own routing lib?
12:56:48FromDiscord<michaelb.eth> SvelteKit has routing built-in, seems to cover a lot of bases, but I've never done crazy-advanced routing stuff, so ymmv
12:57:22FromDiscord<michaelb.eth> https://kit.svelte.dev/docs/routing
12:58:33FromDiscord<michaelb.eth> just note: docs do a fair amount of intermingling of server-side and client-side use cases, but generally take care to point out where something is only relevant/available server-side
12:59:23FromDiscord<michaelb.eth> anyway, I didn't have much trouble sorting out what I can / can't do in a SPA where my backend has nothing to do with svelte
13:00:23*kenran quit (Remote host closed the connection)
13:35:34FromDiscord<MartinSkou> I would like help. Trying to define some vars in the global scope:↵let KeyEnter: char = 13↵This does not work because 13 is an int. How can i make it a char?
13:37:16FromDiscord<djazz> char(13)
13:37:59FromDiscord<djazz> 13.char
13:38:06FromDiscord<djazz> char 13
13:39:21FromDiscord<MartinSkou> Thanks. But using this in a ↵case key↵of KeyEnter ↵gives me: cannot evaluate at compile time: KeyEnter
13:40:38FromDiscord<MartinSkou> ok fixet if i change it from let to const...
13:41:01FromDiscord<MartinSkou> guess that makes sense 🙂
13:42:57FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/igS
13:43:06FromDiscord<djazz> yeah
13:43:21FromDiscord<MartinSkou> yes, gets it now.
13:43:27FromDiscord<djazz> `'\0d'` also
13:44:22FromDiscord<djazz> (edit) "`'\0d'`" => "`'\x0d'`"
13:51:44FromDiscord<djazz> `'\13'`
13:53:20FromDiscord<Phil> In reply to @MartinSkou "yes, gets it now.": For further context, are you familiar with the concept of compile-time?
13:53:41FromDiscord<Phil> (edit) "compile-time?" => "compile-time (in contrast to runtime)?"
13:55:54FromDiscord<MartinSkou> In reply to @Isofruit "For further context, are": yes, sort of. thx.
14:03:00*genpaku quit (Remote host closed the connection)
14:04:45*genpaku joined #nim
14:05:09FromDiscord<Phil> In reply to @MartinSkou "yes, sort of. thx.": Then just for reference:↵let is runtime variables↵const is compile time variables↵case statements require that the things you compare against (the individual cases) are known at compile-time
14:23:08*argonica quit (Remote host closed the connection)
14:42:05*azimut joined #nim
14:45:22*PMunch quit (Quit: Leaving)
14:51:20FromDiscord<qb> Will `cast[ByteAddress](function)` give me the memory address of a function?
15:11:51*arkurious joined #nim
15:37:36*jmdaemon joined #nim
15:37:55*rockcavera joined #nim
15:39:48Amun-Raproc is already a pointer in Nim
15:40:13Amun-Rawhat do you plan to do with the pointer?
15:48:39FromDiscord<Nerve> What's the best way to slice off the first 500 rows of a datamancer frame? I'd imagine you'd use `tail()` but I can't find how to get the count of rows in the frame.
15:49:01FromDiscord<Nerve> (edit) "What's the best way to slice off the first 500 rows ... of" added "(and take the remainder)"
15:50:14FromDiscord<Nerve> Very counter-intuitively `count` seems to give the number of duplicate columns.
15:50:48FromDiscord<Nerve> (edit) "columns." => "rows."
15:50:53FromDiscord<Nerve> (edit) "rows." => "rows, not the total number."
15:51:40FromDiscord<Nerve> (edit) "the number" => "some sort" | "duplicate rows, not the total number." => "histogram for a column."
15:57:46*jmdaemon quit (Ping timeout: 256 seconds)
15:59:47*jmdaemon joined #nim
16:05:13FromDiscord<Nerve> Also can a `for` loop variable really not be reassigned? Must I resort to `while`?
16:07:01FromDiscord<Rika> In reply to @Nerve "Also can a `for`": Reassigned in what sense?
16:07:09FromDiscord<Rika> Some iterators have a mutable version
16:07:52FromDiscord<Nerve> Let's say I have a double loop (`i` outer, `j` inner), and depending on some inner loop condition I want to skip `i` ahead to the value of `j` before breaking the inner loop.
16:08:04FromDiscord<Rika> Nope
16:08:07FromDiscord<Rika> While loop
16:08:12FromDiscord<Nerve> Dang
16:08:26FromDiscord<Rika> I mean I guess you can call continue until I is equal to j
16:08:29FromDiscord<Rika> But eh
16:11:47*jmdaemon quit (Ping timeout: 268 seconds)
16:12:02FromDiscord<Dumb Dragon> do you want `i` to equal `j`?
16:12:57FromDiscord<Dumb Dragon> yeah you can't do that unfortunately
16:13:12FromDiscord<Dumb Dragon> I thought you could since I remember doing it once in the past but it turns out I was wrong
16:14:02FromDiscord<Dumb Dragon> ah no wait, that was changing the bounds of a range while in a loop
16:17:19FromDiscord<Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=4lLi
16:17:37FromDiscord<Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=4lLj
16:46:01FromDiscord<djazz> PMunch, hmm, when clang updated opir gave me this error. Solution is to reinstall futhark/recompile opir...↵`opir: error while loading shared libraries: libclang.so.13: cannot open shared object file: No such file or directory`
16:47:28*jmdaemon joined #nim
16:47:55FromDiscord<djazz> clang doesnt update major versions often though xD
17:15:14*om3ga quit (Quit: Bye)
17:25:37*om3ga joined #nim
17:46:20*jmdaemon quit (Ping timeout: 246 seconds)
18:09:06FromDiscord<Phil> Anyone with knowledge of `nimage` present?
18:36:57*azimut quit (Remote host closed the connection)
18:38:50*azimut joined #nim
19:10:08FromDiscord<Phil> Can you do "requires" blocks that only apply after a certain nim version?
19:13:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lMn
19:33:06FromDiscord<rakgew> inside the nimble file?
19:35:11FromDiscord<Phil> Yep
19:35:52FromDiscord<Phil> And just like that I can now guarantee that my connection pooling package will work for nim 1.6.10 as well as nim 2.0 assuming no further changes occur other than the db_connector split
19:41:30*kenran joined #nim
19:47:44FromDiscord<sOkam!> epic
19:49:30FromDiscord<Mr.Ender> Reading the 2.0 stuff what I'm getting is there may have to be some changes to things made in 1.6 to be usable in 2.0 nim?
19:52:22FromDiscord<Phil> In reply to @Mr.Ender "Reading the 2.0 stuff": As in what will you likely need to upgrade?
19:52:54FromDiscord<Mr.Ender> I may have not been clear but I kind of mean python 2 vs python 4
19:52:56FromDiscord<Mr.Ender> (edit) "4" => "3"
19:53:08FromDiscord<Mr.Ender> Where not all code works between the 2
19:53:12FromDiscord<Phil> Nah, there are some breaking changes but overall transition should be fairly smooth
19:53:19FromDiscord<Mr.Ender> Ok
19:54:38FromDiscord<Phil> I'm facing some issues because I'm running into the fact that I work with SQL db's, so I'm faced with the change that db_ modules are now split out into a separate db_connector package. I also previously didn't have decent CI/CD pipelines set up, so now I had to catch up on that work first and then could get to work on making the package nim 2.0 ready
19:55:07FromDiscord<Phil> Though that change was trivial, setting up all the tests was very much not. Really should write a blogpost for some of the folks here to post on their thing
20:42:55Amun-Rahmm, I found another compiler bug, Error: internal error: cannot inject destructors to node kind: nkClosedSymChoice
21:17:43FromDiscord<T0lk1en> Is there a way to check and see if my program is run with administrator privileges
21:17:56FromDiscord<T0lk1en> In nim
21:19:51Amun-Rageteuid (if run in posix)
21:20:10FromDiscord<T0lk1en> Windows
21:20:26*argonica joined #nim
21:20:31FromDiscord<Mustache Man> need some help with Weave for multithreading..
21:21:27FromDiscord<Mustache Man> as soon as I set up init(Weave) and exit(Weave), and add the --threads:on compile flag, running the program utilizes ALL my threads 100%
21:21:27Amun-RaT0lk1en: os.isAdmin
21:21:38FromDiscord<T0lk1en> Ty
21:24:01*argonica quit (Client Quit)
21:34:44FromDiscord<qb> In reply to @Amun-Ra "what do you plan": Im trying to hook a nim function which requires to get the actual memory address of the function. How would I dereference a proc if procs are pointers?
21:35:21FromDiscord<jtv> Are you doing this for the purposes of calling it from C???
21:40:01FromDiscord<Elegantbeef> You'd cast the pointer to the type you want then call it
21:40:30FromDiscord<enthus1ast> @qb\: a simple full example of hooking\: https://github.com/enthus1ast/nimhook
21:40:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lN0
21:45:49*argonica joined #nim
21:45:58Amun-RaI got segfault during compilation, hmm
21:46:26FromDiscord<Elegantbeef> Generally that's do to macros or incorrectly used types
21:46:30FromDiscord<Elegantbeef> due to\
21:54:47*argonica quit (Quit: Leaving)
22:00:20*azimut quit (Ping timeout: 255 seconds)
22:02:18*azimut joined #nim
22:03:39FromDiscord<keks> Hi all! Very simple question that I couldn't find answer to: how to take the first element from an iterator? I know I can do .toSeq[0] but it seems wasteful to convert an entire thing to a sequence. Thanks!
22:05:17FromDiscord<Elegantbeef> `for x in y: result = y; break`
22:06:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNa
22:06:37FromDiscord<Elegantbeef> Whoops `var res: typeof(iter)`
22:07:34Amun-RaI've found the reason of the segfault, I had: type Foo = Bar or Baz or Foo
22:09:10FromDiscord<keks> sent a code paste, see https://play.nim-lang.org/#ix=4lNc
22:09:34FromDiscord<keks> (edit) "https://play.nim-lang.org/#ix=4lNc" => "https://play.nim-lang.org/#ix=4lNd"
22:10:56FromDiscord<Phil> Erm... did nim 2.0 do something to std/smtp?
22:11:14FromDiscord<Elegantbeef> I think it's no longer in stdlib
22:11:22FromDiscord<Phil> That as well? Dangit
22:11:22FromDiscord<Elegantbeef> https://github.com/nim-lang/smtp
22:12:53Amun-Radoes uniform function call work with templates?
22:13:16FromDiscord<deech> Is it possible to _return_ a `static` type? eg. `proc p(s:static[string],...):(static[string],SomeType) = ...`?
22:13:46FromDiscord<Elegantbeef> No
22:13:58FromDiscord<Elegantbeef> Just return `string`
22:15:00FromDiscord<deech> But the contents of that `string` won't be available at compile time, right?
22:15:30FromDiscord<Elegantbeef> Of course they will if it's a procedure that runs at CTE
22:16:52FromDiscord<Elegantbeef> Works just as you expect
22:16:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNf
22:17:04*kenran quit (Remote host closed the connection)
22:17:06FromDiscord<Elegantbeef> `static T` is mostly just for "Hey this doesnt work with runtime values" or "This should be generically optimised for X values"
22:17:30FromDiscord<Elegantbeef> You can remove `static` in the above and it works just the same
22:17:36FromDiscord<Elegantbeef> Since the code can be evaluated statically
22:18:31FromDiscord<Elegantbeef> Atleast i think that answers you question
22:19:08FromDiscord<jtv> Yeah really, the most useful context for static is when you want to get values in macro parameters instead of NimNodes; for the most part every other context your code will "just work" statically unless it does anything on the fairly long list of things that can't be done statically 🙂
22:19:25FromDiscord<Elegantbeef> Well there are other useful cases for `static`
22:19:40FromDiscord<Elegantbeef> Static generics come to mind(Though they easily break) 😛
22:20:22FromDiscord<jtv> LOL I didn't say it was the ONLY useful context, but if it's something that easily breaks, not going to end up widely useful to many people I think 🙂
22:20:36FromDiscord<Elegantbeef> Hey everyone uses arrays!
22:21:00FromDiscord<Phil> I would like to carve out an exception for that one
22:21:16Amun-Rait works if T is an integer, fails if an object, https://play.nim-lang.org/#ix=4lNg
22:22:22FromDiscord<Elegantbeef> `f.test[: Foo](121)`
22:22:45FromDiscord<Elegantbeef> `f.test2[Foo](121` is parsed as `test2(f)[Foo](121)`
22:23:21Amun-Raoh
22:23:40Amun-RaI've never seen this construction before, thanks
22:23:51FromDiscord<Elegantbeef> `: Foo` tells it "this is a generic invocation of a procedure"
22:24:02FromDiscord<Elegantbeef> It's mentioned in the manual, but that's dry reading
22:24:12Amun-RaI see
22:24:20FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
22:24:39FromDiscord<jtv> When you're parsing, there's an ambiguity between whether that's going to be an array access or a type parameter, I assume there's no easy way to resolve that ambiguity later, yes?
22:25:03FromDiscord<jtv> It's a common problem which is one reason I was complaining about [] as the thing that denotes type params
22:25:23FromDiscord<Elegantbeef> Well you'd have a similar issue with any brackets
22:25:46FromDiscord<Elegantbeef> `Foo<A>(...)` could be `Foo < A > (...)` in Nim
22:26:32FromDiscord<jtv> Sure, but some languages use digraphs, or do something else entirely when the type params are needed
22:26:45FromDiscord<jtv> Like put them w/ the params with a backtick, etc
22:26:54FromDiscord<Elegantbeef> That doesnt work in the above
22:27:00FromDiscord<Elegantbeef> Since the return type is the generic
22:27:06FromDiscord<Elegantbeef> You cannot infer that from parameters
22:27:26FromDiscord<Elegantbeef> `let a = foo.test2(121)` has no return type
22:27:28FromDiscord<jtv> It does if you make the type parameters go before any runtime formals
22:27:29FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNh
22:27:59FromDiscord<jtv> Not saying Nim should change, just saying other languages can skirt the problem if they don't overload bracket types
22:28:09FromDiscord<Elegantbeef> `import letters`
22:28:13FromDiscord<Elegantbeef> or `import "."/letters`
22:28:30FromDiscord<Elegantbeef> `./letters` does not do what one imagines iirc
22:29:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNi
22:29:22FromDiscord<4zv4l> oh right it's just↵in letters.nim I have a table↵but it seems I need to import `std/tables` in the two files to make it work correctly
22:29:26FromDiscord<jtv> Nim's flexibility in tokenizing operators is fairly unique and cool, it's an okay tradeoff. But that UFCS in templates ambiguity is something everyone seems to bump into.
22:29:41FromDiscord<Elegantbeef> Yes 4, Nim does not bring modules that you import
22:29:51FromDiscord<Elegantbeef> You likely want to `export tables` in `letters`
22:29:55FromDiscord<jtv> You can't make the opposite decision though; arrays NEED to have priority
22:30:44FromDiscord<Elegantbeef> I mean it's a mild inconvenience, it's just not explained in documentation enough
22:30:44FromDiscord<Elegantbeef> People also bump into the whole command syntax existing
22:31:37FromDiscord<4zv4l> In reply to @Elegantbeef "You likely want to": export `std/tables` ?
22:31:51FromDiscord<Elegantbeef> Inside letters you will want to `export tables` yes
22:31:53FromDiscord<michaelb.eth> just `export tables`
22:32:12FromDiscord<Elegantbeef> Assuming you dont want to `import tables` in every module that imports `letters`
22:32:13FromDiscord<michaelb.eth> you don't qualify with `std/` in the export statement
22:32:31FromDiscord<Elegantbeef> Export works on symbols, `std/tables` is not a symbol
22:33:21FromDiscord<4zv4l> alright indeed it works, thanks !↵so if I make a module that requires other modules, I need to export them ?
22:33:56FromDiscord<Elegantbeef> need to
22:34:12FromDiscord<Elegantbeef> You export any modules that you feel the importer needs to use that module
22:34:30FromDiscord<Elegantbeef> Importing a module only gives you access to exported symbols
22:36:09FromDiscord<4zv4l> alright, I think I understand
22:36:57FromDiscord<4zv4l> since my table is const (comptime)↵I execute a function that take a string and from the table print each character in a ascii art way↵how could I check at compile time that the character as a key in the table ?
22:37:54FromDiscord<jtv> Yeah the command syntax thing I don't bump into because I have always believed the extra parens bring more clarity; that one I probably wouldn't have done myself
22:37:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNn
22:38:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNo
22:38:55FromDiscord<Elegantbeef> But no clue exactly what you're doing
22:39:41FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNp
22:40:00FromDiscord<4zv4l> and if possible, I wanna check at compile time that the `print` string contains only char that are in the letter table
22:40:11FromDiscord<Elegantbeef> So make a `print(s: static string)`
22:41:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNr
22:41:33*azimut_ joined #nim
22:42:11FromDiscord<4zv4l> only the static part will be ran at compile time ?↵the rest of the print proc will be ran at runtime ?
22:42:40FromDiscord<Elegantbeef> Of course
22:42:44FromDiscord<Elegantbeef> `static` means static
22:43:15FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNw
22:43:17FromDiscord<Elegantbeef> Yep should work
22:43:22FromDiscord<jtv> Well, in regular english static usually means "non-changing" so more like const. But in the compiler world, it means "compile time" 🙂
22:43:32*azimut quit (Ping timeout: 255 seconds)
22:44:20FromDiscord<4zv4l> `asciiart.nim(6, 16) Error: type mismatch: got <void, char>`↵line 6 is `assert c in letters`
22:44:52FromDiscord<4zv4l> c is the char one, letters is `const` so also compile time so shouldn't be void right ?
22:45:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNy
22:46:39FromDiscord<4zv4l> yeah I don't get why it says letters is void
22:46:55FromDiscord<4zv4l> I don't need to do like `letters.keys` or something similar ?
22:46:56FromDiscord<Elegantbeef> Is letters' in scope?
22:47:22FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNz
22:47:22FromDiscord<Elegantbeef> `letters.hasKey(c)` likely
22:47:54FromDiscord<Elegantbeef> Oh wait no i see the issue
22:48:00FromDiscord<Elegantbeef> You named your module the same as a top level variable
22:48:08FromDiscord<michaelb.eth> so, `import ./letters` introduces a symbol `letters` into the module, and that's masking the `letters` that's exported by the module
22:48:11FromDiscord<michaelb.eth> my guess anyway
22:48:14FromDiscord<Elegantbeef> you need to do `assert c in letters.letters`
22:48:21FromDiscord<Elegantbeef> Or name your modules and variables sanely
22:48:28FromDiscord<Elegantbeef> `letters.nim` is a terrible module name
22:48:29FromDiscord<4zv4l> is it better this or put the constant in uppercase ?
22:48:39FromDiscord<4zv4l> In reply to @Elegantbeef "`letters.nim` is a terrible": well it contains the letters idk xD
22:48:42FromDiscord<Elegantbeef> It's better to name things sensibly
22:49:09FromDiscord<4zv4l> In reply to @michaelb.eth "so, `import ./letters` introduces": yeah makes sense
22:49:24FromDiscord<michaelb.eth> if you name the constant `Letters` in `letters.nim` you should be able to do `assert c in Letters`
22:50:03FromDiscord<Elegantbeef> Alternatively if you name it `letterTable` it also would work
22:50:25FromDiscord<Elegantbeef> `letters` to me is `{'a'..z', 'A'..'Z'}` or the array equivlent
22:50:54FromDiscord<Elegantbeef> It's not a look up table for whatever you're doing(Morse code?)
22:51:00FromDiscord<4zv4l> well the static bloc works great
22:51:22FromDiscord<Elegantbeef> The east bloc, the west bloc, and the static bloc
22:51:34FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNA
22:51:36FromDiscord<4zv4l> for all letters
22:51:38FromDiscord<Elegantbeef> Perfect name for a tutorial on Nim compile time evaluation
22:51:41FromDiscord<Elegantbeef> I see
22:51:42FromDiscord<4zv4l> to print them on a same line
22:52:12FromDiscord<4zv4l> In reply to @Elegantbeef "The east bloc, the": there is a east and west bloc too ? or that's a joke 🥹
22:52:15FromDiscord<jtv> You going to do full fonts w/ unicode? 🙂
22:52:24FromDiscord<Elegantbeef> There is a east and west bloc in history
22:52:36FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/Eastern_Bloc
22:52:37FromDiscord<4zv4l> In reply to @jtv "You going to do": oh no no, just alphabet in uppercase A-Z
22:53:01FromDiscord<4zv4l> In reply to @Elegantbeef "There is a east": oh ok this way↵not in Nim
22:53:30FromDiscord<Elegantbeef> If you havent read any of my written tutorials, i tend to lean on shitty jokes
22:54:32FromDiscord<4zv4l> well that's actually pretty nice joke↵I like joke about knowledge xD
22:56:21FromDiscord<Elegantbeef> > If you have ever looked at library bindings for C code, you have certainly seen the scary pointer keyword. At first reading you may get nervous, scared and maybe even pee a little.↵Just to confirm my high brow writing style
22:57:29FromDiscord<4zv4l> oh jeez
22:57:49FromDiscord<4zv4l> I don't see why everyone call pointer scary xD
22:57:58FromDiscord<Elegantbeef> Ignorance
22:58:18FromDiscord<Elegantbeef> Also they're nilable
22:58:36FromDiscord<4zv4l> it's like my application security who always says↵"there are two kind of C programmers, those who do not understand pointers and those who lie"
22:58:45FromDiscord<4zv4l> (edit) "it's like my application security ... who" added "teacher"
22:58:57FromDiscord<Elegantbeef> well C has untyped pointers
22:59:02FromDiscord<Elegantbeef> So they deserve what they get
22:59:42FromDiscord<4zv4l> I find default c type really confusing↵that's what I like from Nim and Zig↵like `u8` or `uint8` over `char`
22:59:46FromDiscord<4zv4l> (edit) "type" => "types"
23:00:07FromDiscord<Elegantbeef> Meh i look at C's `T` and vomit
23:00:27FromDiscord<Elegantbeef> In what world is `T` indexable, but also possibly a singly allocated value
23:01:58FromDiscord<4zv4l> anytime I criticise C my uncle tells me "they did what they could with what they got"
23:02:32FromDiscord<Elegantbeef> Pascal existed
23:02:46FromDiscord<4zv4l> well I don't really know Pascal to be honest
23:02:52FromDiscord<4zv4l> I saw a bit of Fortran but that's it
23:03:01FromDiscord<4zv4l> Nim was made ouf of Fortran right ?
23:03:12FromDiscord<Elegantbeef> What?
23:03:23FromDiscord<Elegantbeef> Nim is inspired by Pascal/Module/Oberon to a high degree
23:04:37FromDiscord<4zv4l> > The first version of the Nim compiler was written in Pascal using the Free Pascal compiler.
23:04:39FromDiscord<4zv4l> indeed my bad
23:04:41FromDiscord<4zv4l> xD
23:05:01FromDiscord<4zv4l> well I don't know Pascal very well
23:05:45FromDiscord<sOkam!> In reply to @4zv4l "I find default c": i always have a `types.hpp` or `types.h` full of aliases to C types whenever I have to touch any of those langs. i'm not writing unsigned char everytime i want to create a damn string, lul
23:06:33FromDiscord<sOkam!> zig got it right in this aspect, imo. the type names are gold
23:06:39FromDiscord<etra> Hello, does anyone knows if there's any library like this one: <https://github.com/sharksforarms/deku> in nim?
23:06:53FromDiscord<Elegantbeef> The worst part is `MyType` and `MyType` are two different types in C but the compiler doesnt know
23:07:08FromDiscord<sOkam!> also that, ye
23:07:36FromDiscord<amadan> In reply to @etra "Hello, does anyone knows": maybe this https://github.com/sealmove/binarylang
23:07:55FromDiscord<sOkam!> it polutes the whole project with counters and pointer incrementing everywhere, and it can become a big mess
23:08:14FromDiscord<Elegantbeef> Dont know if flatty/frosty respects bitsizes, but it might be the right thing
23:17:31FromDiscord<michaelb.eth> In reply to @etra "Hello, does anyone knows": maybe nim-serialization could be helpful, though I may misunderstand what you're looking for↵↵https://github.com/status-im/nim-serialization
23:17:38FromDiscord<michaelb.eth> (edit) "for↵↵https://github.com/status-im/nim-serialization" => "for=↵https://github.com/status-im/nim-serialization"
23:18:12FromDiscord<Elegantbeef> They want a binary serialiser that properly handles bitfields
23:18:28FromDiscord<Elegantbeef> Though reality that's not to complicated in Nim
23:18:36FromDiscord<michaelb.eth> (edit) "for=↵https://github.com/status-im/nim-serialization" => "for↵https://github.com/status-im/nim-serialization"
23:18:54FromDiscord<Elegantbeef> Atleast for types that dont have any heap allocated memory
23:24:56FromDiscord<Elegantbeef> Actually i take it back the endianness is a bit difficult to reason
23:27:59FromDiscord<etra> In reply to @amadan "maybe this https://github.com/sealmove/binarylang": I think this is somewhat the thing I was looking for, thanks!