00:09:17 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> Debug doesnt have any optimisations |
00:13:57 | FromDiscord | <Elegantbeef> So that's why |
00:17:18 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Debug doesnt have any": what i mean is what type of optimizations are those |
00:18:01 | FromDiscord | <Elegantbeef> All of them look at the c compiler's O flags |
00:18:31 | FromDiscord | <sOkam!> how can i find them? |
00:19:38 | FromDiscord | <pyolyokh> turn up verbosity, or look at the nim.cfg files that nim tells you it's using when you compile something |
00:19:54 | FromDiscord | <sOkam!> also, is `--passC:"-O2"` good too add, or is it implied by -d:release? |
00:20:01 | FromDiscord | <sOkam!> (edit) "too" => "to" |
00:23:50 | FromDiscord | <Elegantbeef> Release does O3 iirc |
00:24:01 | FromDiscord | <Elegantbeef> `--listCmd` and refer to your C compiler's flags |
00:32:40 | FromDiscord | <sOkam!> `-O3 -fno-strict-aliasing -fno-ident`, the rest seems the same 🤔 |
00:35:43 | FromDiscord | <sOkam!> how can i know if a C compiler flag could create issues for compiling nim? |
00:38:32 | FromDiscord | <pyolyokh> there's no way to know. |
00:39:06 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
00:39:19 | FromDiscord | <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:49 | FromDiscord | <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:06 | FromDiscord | <sOkam!> whats different between `--debugger:native` and not passing the option? |
01:46:42 | FromDiscord | <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:56 | FromDiscord | <jtv> So if you're used to gdb or lldb you need it |
01:47:00 | FromDiscord | <sOkam!> so its like passing the `-g` option to gcc? |
01:47:07 | FromDiscord | <jtv> Yeah |
01:47:10 | FromDiscord | <sOkam!> kk ty |
01:47:55 | FromDiscord | <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:28 | FromDiscord | <jtv> I think the command line takes precedence, but should be easy to confirm |
01:51:08 | FromDiscord | <sOkam!> `gc: orc; opt: speed; options: -d:release` i passed debug on cli 😔 |
01:52:53 | FromDiscord | <jtv> Boo |
01:55:55 | FromDiscord | <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:19 | FromDiscord | <jtv> The "while ... elif ... else" statement |
01:56:23 | FromDiscord | <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:41 | FromDiscord | <jtv> Erm, "when" |
01:57:14 | FromDiscord | <jtv> "when is basically #if |
01:57:20 | FromDiscord | <Elegantbeef> `config.nims` |
01:57:23 | FromDiscord | <Elegantbeef> If using nimble |
01:57:31 | FromDiscord | <jtv> Oh yeah that too |
01:57:31 | FromDiscord | <Elegantbeef> When is more magical |
01:57:46 | FromDiscord | <jtv> Yes, it's better than #if 🙂 |
01:57:51 | FromDiscord | <sOkam!> but can you really configure options with the config.nims file? |
01:57:56 | FromDiscord | <jtv> Yup |
01:58:05 | FromDiscord | <sOkam!> how do you do them? |
01:58:20 | FromDiscord | <jtv> It's all compile time nim, you just write code in there |
01:58:23 | FromDiscord | <Elegantbeef> `--define:release` |
01:58:26 | FromDiscord | <Elegantbeef> `switch("define", "release")` |
01:58:55 | FromDiscord | <sOkam!> oh, the nims file can take when defined statements? |
01:59:51 | FromDiscord | <Elegantbeef> It can figure the project |
02:02:59 | FromDiscord | <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:50 | FromDiscord | <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:51 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Is varstack a ref/ptr? |
02:13:35 | * | FromDiscord quit (Remote host closed the connection) |
02:13:48 | * | FromDiscord joined #nim |
02:14:05 | FromDiscord | <ringabout> Or a distinct? |
02:14:07 | FromDiscord | <jtv> Nope just a ref |
02:14:29 | FromDiscord | <pyolyokh> `VarStack = seq[RuntimeFrame]` |
02:14:41 | FromDiscord | <Elegantbeef> `= @[]` |
02:14:56 | FromDiscord | <Elegantbeef> or `VarStack(@[])` |
02:15:00 | FromDiscord | <jtv> Oh, good point yeah, been so long since I was in that code. Got it |
02:15:29 | FromDiscord | <jtv> Thanks |
02:16:42 | FromDiscord | <jtv> Much better, ta |
02:17:09 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIp |
02:18:15 | FromDiscord | <sOkam!> is `release` not an identifier, when used with a `when defined release`? |
02:18:23 | FromDiscord | <jtv> debug isn't I don't think |
02:18:31 | FromDiscord | <jtv> release is for sure |
02:18:38 | FromDiscord | <Elegantbeef> `defined(release) and not defined(debug)` |
02:20:27 | * | azimut_ joined #nim |
02:21:26 | FromDiscord | <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:54 | FromDiscord | <pyolyokh> parentheses aren't omittable in general. What Nim has is a command syntax |
02:22:14 | FromDiscord | <pyolyokh> <https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax> |
02:24:28 | FromDiscord | <sOkam!> ic |
02:33:36 | FromDiscord | <Elegantbeef> If unclear `a b c d` is parsed as `a(b(c), d)` |
02:34:33 | FromDiscord | <jtv> Is there a logic to that, or just was how the inherent ambiguities were resolved? |
02:34:37 | FromDiscord | <sOkam!> is there a default -clean option of sorts? |
02:34:52 | FromDiscord | <demotomohiro> !eval echo echo sizeof sizeof sizeof int |
02:34:56 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <void> |
02:35:10 | FromDiscord | <demotomohiro> !eval echo sizeof sizeof sizeof int |
02:35:16 | NimBot | 8 |
02:35:45 | FromDiscord | <pyolyokh> In reply to @sOkam! "is there a default": what would that do? |
02:37:28 | FromDiscord | <sOkam!> In reply to @pyolyokh "what would that do?": remove the nimcache folder and the binary to start over |
02:37:40 | FromDiscord | <Elegantbeef> `-f` |
02:38:18 | FromDiscord | <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:24 | FromDiscord | <Elegantbeef> or `--forceBuild` |
02:39:26 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> That's literally `-f` afaik |
02:42:36 | FromDiscord | <sOkam!> not really. with -f you are saying "build even if what im asking you to build already exists" |
02:43:08 | FromDiscord | <sOkam!> clean is just cleaning as a separate thing |
02:43:27 | FromDiscord | <sOkam!> its not handy like all of the time, but when its helpful its really handy |
02:44:05 | FromDiscord | <ringabout> Package update bot seems to have been down for a few days |
02:48:41 | FromDiscord | <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:35 | FromDiscord | <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:42 | FromDiscord | <sOkam!> if there is a way to remove files with nimscript, then im unaware of it. so sorry if there is |
02:54:07 | FromDiscord | <pyolyokh> your VCS might have a command, like 'git clean', that you can use instead of nimscript |
02:54:35 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIt |
02:55:58 | FromDiscord | <Elegantbeef> `--verbosity: 3` |
02:56:31 | FromDiscord | <demotomohiro> You don't need to care about warnings comes from C code generated by Nim. |
02:57:09 | FromDiscord | <demotomohiro> Nim actually run C compiler with parameters that suppress warnings. |
02:57:13 | FromDiscord | <sOkam!> yeah, i was just curious |
02:59:09 | FromDiscord | <sOkam!> In reply to @Elegantbeef "`--verbosity: 3`": i think its still aliasing the CC message 🤔 |
03:02:23 | FromDiscord | <demotomohiro> If you use GCC as backend C compiler, Nim call it with `-w` option that suppress all warnings. |
03:03:28 | FromDiscord | <sOkam!> ohh, i didn't know what that -w was. that makes sense |
03:15:19 | FromDiscord | <sOkam!> is it possible to supress the -w in some way? |
03:15:49 | FromDiscord | <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:03 | FromDiscord | <demotomohiro> It seems `-w` option is set in here: https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg#L198 |
03:22:08 | FromDiscord | <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:32 | FromDiscord | <sOkam!> kk tyty ✍️ |
03:23:57 | FromDiscord | <sOkam!> yep! worked |
04:09:48 | FromDiscord | <tfp> question, is there no find by predicate function for an iterable/seq in nim? |
04:15:55 | FromDiscord | <Elegantbeef> `filter`? |
04:25:29 | * | Figworm quit (Quit: Figworm) |
04:28:44 | FromDiscord | <tfp> i want something like findFirstWhere(predicate) |
04:29:07 | FromDiscord | <tfp> i just wrote my own but is it somewhere i can't find |
04:44:03 | FromDiscord | <huantian> I don’t think so, haven’t come across one myself |
04:44:25 | FromDiscord | <huantian> Might be good to add something like that to sequtils tbo |
05:00:52 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/phw |
05:01:08 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4lIU" => "https://paste.rs/mSx" |
05:05:27 | FromDiscord | <sOkam!> oh wait, i know why. -O3 is not being passed there |
05:09:03 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIW |
05:11:29 | FromDiscord | <Rika> defining release in config will not make defined(release) true iirc |
05:11:52 | FromDiscord | <sOkam!> 😔 |
05:12:17 | FromDiscord | <sOkam!> is there any other way to default to release when not given any options, like this idea here? |
05:14:36 | FromDiscord | <Elegantbeef> it should now rika afaik |
05:14:47 | FromDiscord | <Elegantbeef> Maybe not in 1.6 |
05:15:21 | FromDiscord | <Elegantbeef> Yea it does |
05:15:57 | FromDiscord | <sOkam!> why is it misbehaving then? its skipping -O3 entirely from the commands 🤔 |
05:16:09 | FromDiscord | <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:40 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lIX |
05:18:18 | FromDiscord | <Elegantbeef> I dont get why you're manually passing `-O3` |
05:18:56 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> release is implicitly `-O3` |
05:19:35 | FromDiscord | <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:14 | FromDiscord | <Rika> isnt release implicitly O2 and not O3 |
05:22:09 | FromDiscord | <sOkam!> depends on the system, but for most it seems to be O3 |
05:22:18 | FromDiscord | <sOkam!> https://github.com/nim-lang/Nim/blob/9afb466d733bc16f5ac0fef7477c2ac919046eb2/config/nim.cfg#L198 |
05:22:28 | FromDiscord | <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:34 | FromDiscord | <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:45 | FromDiscord | <Phil> (edit) "lib" => "package" |
05:30:54 | * | jkl quit (Quit: Gone.) |
05:31:56 | FromDiscord | <tfp> aaaa |
05:32:29 | * | jkl joined #nim |
05:32:33 | FromDiscord | <tfp> thanks |
05:57:17 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> Are you even debug build anymore? |
05:59:30 | FromDiscord | <sOkam!> wdym? |
06:00:20 | FromDiscord | <Elegantbeef> Debug ideally is fast to build |
06:03:30 | FromDiscord | <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:58 | FromDiscord | <huantian> Personally I’d say that’s the difference between debug and release for a small project lol |
06:04:06 | FromDiscord | <Elegantbeef> Yea that is |
06:04:35 | * | azimut joined #nim |
06:04:40 | FromDiscord | <sOkam!> 37fps in an almost empty scene, when the target framerate for physics is 125, is totally unusable though 😔 |
06:05:01 | FromDiscord | <huantian> Yeah true |
06:05:32 | FromDiscord | <Elegantbeef> I'd question whether you're working around a problem |
06:06:09 | FromDiscord | <sOkam!> i don't know what you mean |
06:07:34 | FromDiscord | <Elegantbeef> I mean are you using compiler optimisation to avoid a performance issue that your engine has |
06:09:07 | FromDiscord | <sOkam!> i don't follow. the engine runs at 350fps when in release mode |
06:09:21 | FromDiscord | <Elegantbeef> Ok? |
06:10:00 | FromDiscord | <Elegantbeef> 350fps for an empty scene is abysmal |
06:10:04 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> I'm wondering if you're leaning on optimisations instead of fixing an underlying code problem |
06:10:36 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> Even with a debug build on my game my FPS is in the thousands iirc |
06:11:04 | FromDiscord | <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:38 | FromDiscord | <Elegantbeef> Yes i know different hardware, but yea |
06:11:56 | FromDiscord | <huantian> I mean something between a debug and release mode might be helpful in tbe diagnosis and optimization process |
06:12:09 | FromDiscord | <huantian> So I wouldn’t completely discredit it as long it’s a stopgap |
06:12:12 | FromDiscord | <sOkam!> is it possible to compile that project in my system to compare? i would love to have a reference |
06:13:04 | FromDiscord | <sOkam!> because my pc is like the average boy from 7-8y ago, so its not very performant in most situations already |
06:13:05 | FromDiscord | <Elegantbeef> My project isnt the hardest to compile, but requires manually `nimble develop`ing all it's depps |
06:14:42 | FromDiscord | <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:34 | FromDiscord | <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:54 | FromDiscord | <sOkam!> was thinking of source files |
06:18:50 | FromDiscord | <Elegantbeef> Whew i thought i was wrong for a second with my time conversion |
06:19:14 | FromDiscord | <Elegantbeef> For my game framework i get around 4.7kfps on release and debug |
06:19:30 | FromDiscord | <Elegantbeef> Though it's a ryzen 5600x and rx480 |
06:19:39 | FromDiscord | <Elegantbeef> I didnt get much worse with a xeon1231v3 |
06:20:04 | FromDiscord | <Elegantbeef> If you trust random binaries i could ship you a debug and release of my project |
06:20:38 | FromDiscord | <Elegantbeef> I guess assuming you have a modern glibc 😄 |
06:21:39 | FromDiscord | <sOkam!> im on linux |
06:21:46 | FromDiscord | <sOkam!> arch, so i assume i do 🙂 |
06:22:08 | FromDiscord | <Elegantbeef> So you want my sketchy files? |
06:23:10 | FromDiscord | <sOkam!> https://ufile.io/c1t6y697 |
06:23:56 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> `Error: unhandled exception: cannot open: /tmp/bleh/reid/bin/log/gl.log [IOError]` nice |
06:25:47 | FromDiscord | <sOkam!> yeah, i think it expects the folders to write to them |
06:26:36 | FromDiscord | <Elegantbeef> No "WaterBottle.gltf" |
06:26:45 | FromDiscord | <sOkam!> `mkdir ./bin`, `mkdir ./bin/log` and symlink res to bin/res |
06:27:40 | FromDiscord | <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:17 | FromDiscord | <sOkam!> when you load you will see no bottle, press `v` and it will reset you closer to where it is |
06:29:52 | FromDiscord | <Elegantbeef> No tut.vert |
06:30:10 | FromDiscord | <sOkam!> same, missing symlink |
06:31:36 | FromDiscord | <sOkam!> https://media.discordapp.net/attachments/371759389889003532/1065881261295534080/image.png |
06:32:17 | FromDiscord | <sOkam!> that one is a bit entangled at the moment, sorry about the subsubsubdirs. they will be moved eventually |
06:35:06 | FromDiscord | <Elegantbeef> Is that debug? |
06:35:38 | FromDiscord | <Elegantbeef> I guess not given `nimble run` |
06:35:42 | FromDiscord | <Elegantbeef> I get around 400fps |
06:36:36 | FromDiscord | <Elegantbeef> how do you have 5ms delay |
06:37:28 | FromDiscord | <sOkam!> if you do either nimble build or nimble run, it will both take the defaults afaik |
06:37:53 | FromDiscord | <sOkam!> there is nimble release if you need to, but its the same if im not mistaken in what i did |
06:38:26 | FromDiscord | <sOkam!> In reply to @Elegantbeef "how do you have": delay is the accumulator from that fixyourtimestep article |
06:43:58 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> Think i found the reason your fps is so bad, just need to check though |
06:51:04 | FromDiscord | <Elegantbeef> Yep |
06:51:05 | FromDiscord | <Elegantbeef> You're rendering the UI on the CPU every frame |
06:51:05 | FromDiscord | <Elegantbeef> Removing `ui.update` i go up to 10kfps |
06:51:27 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1065886310851694743/image.png |
06:51:41 | FromDiscord | <Elegantbeef> Then i noticed this |
06:52:14 | FromDiscord | <Elegantbeef> Looked at the callers of that, noticed a lot of pixie code |
06:52:40 | FromDiscord | <Elegantbeef> Put 2 + 2 together and uncommented `ui.update()` |
06:54:14 | FromDiscord | <Elegantbeef> I mean commented `ui.update` |
06:54:40 | FromDiscord | <Elegantbeef> I see you're using boxy, it does not seem it's made for very dynamic GUI |
06:55:33 | FromDiscord | <Elegantbeef> For rapidly updating UI you're likely best to bake an atlas and quads to render that |
06:55:51 | FromDiscord | <Elegantbeef> This way changing a character is just calculating 4 points, instead of rendering text |
06:56:36 | FromDiscord | <Elegantbeef> Also it doesnt help the way you're making the strings is heavily garbage creating |
06:58:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lJ9 |
06:58:29 | FromDiscord | <Elegantbeef> You have strformat which can optimise this a bit |
06:59:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lJb |
07:00:43 | FromDiscord | <Elegantbeef> @sOkam!\: just so you read my inanity |
07:04:27 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Removing `ui.update` i go": jeez, really? |
07:04:32 | FromDiscord | <sOkam!> i had no clue it was that expensive |
07:04:49 | FromDiscord | <Elegantbeef> Yea boxy does cpu rendered gui, which is very expensive for constantly updating |
07:05:05 | FromDiscord | <sOkam!> crap |
07:05:06 | FromDiscord | <Elegantbeef> Ideally what you do is only render what changes |
07:05:30 | FromDiscord | <Elegantbeef> So constant text is stored to a texture and a quad, updating text is then rerendered and uploaded |
07:05:50 | FromDiscord | <Elegantbeef> But it's still better to use texture atlasing |
07:06:18 | FromDiscord | <sOkam!> ic. so im reuploading the fonts every frame, basically? |
07:06:37 | FromDiscord | <Elegantbeef> Well you're re rendering the image on the cpu then uploading it to the gpu |
07:06:44 | FromDiscord | <Elegantbeef> That's quite costly, the CPU sucks at rendering |
07:06:52 | FromDiscord | <sOkam!> ah yeah, totally can see that |
07:07:33 | FromDiscord | <Elegantbeef> It'd use more memory but boxy could try to cache the textures |
07:07:34 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lJd |
07:08:14 | FromDiscord | <Elegantbeef> I do have to say it's a mostly clean project(minus your oddities) |
07:08:34 | FromDiscord | <sOkam!> plenty of oddities |
07:08:36 | FromDiscord | <sOkam!> 😄 |
07:08:41 | * | kenran joined #nim |
07:08:46 | FromDiscord | <sOkam!> but tysm |
07:08:54 | FromDiscord | <Elegantbeef> `var a :Type` is just the worst |
07:09:19 | FromDiscord | <sOkam!> `for file in folder: nimpretty file` 🙂 |
07:10:36 | FromDiscord | <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:45 | FromDiscord | <sOkam!> but i'm aware most people really hate that |
07:22:04 | FromDiscord | <pyryrin> Are strings in nim unicode strings |
07:22:21 | FromDiscord | <Elegantbeef> They're encoding indifferent |
07:22:40 | FromDiscord | <Elegantbeef> Strings in Nim are really just binary buffers |
07:22:59 | FromDiscord | <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:19 | FromDiscord | <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:15 | FromDiscord | <pmp-p> project that does not build with clang profile is https://github.com/rdb/nim-panda3d |
08:32:12 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lJu |
08:32:28 | FromDiscord | <pyolyokh> got confused by the second example for a while - it not being in an array is key. |
08:32:40 | FromDiscord | <ringabout> Yeah, backtick work. |
08:34:01 | FromDiscord | <ringabout> (edit) "work." => "works." |
08:34:54 | FromDiscord | <ringabout> The devel has mangled all parameters in case of conflicts. https://github.com/nim-lang/Nim/pull/21121 |
08:35:45 | FromDiscord | <pmp-p> ouch |
08:41:44 | FromDiscord | <pmp-p> no macro to get arguments mangled name by position from inside generated code ? |
08:43:51 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lJw |
08:46:32 | FromDiscord | <pmp-p> thx ! |
09:17:22 | * | jjido joined #nim |
09:35:07 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
10:02:37 | FromDiscord | <Mathmatix> Hey, I just stumbled over nim. How is the performance compared to other compiled languages like Rust, C, and C++? |
10:09:19 | FromDiscord | <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:55 | FromDiscord | <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:09 | FromDiscord | <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:13 | FromDiscord | <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:31 | FromDiscord | <Rika> half as fast means without doing anything and writing the naive solution or so i think |
10:54:57 | FromDiscord | <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:35 | FromDiscord | <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:42 | FromDiscord | <ieltan> (not complexity) |
10:56:03 | FromDiscord | <enthus1ast> I asked chatgpt |
10:56:08 | FromDiscord | <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:55 | FromDiscord | <ieltan> It's almost that |
10:58:03 | FromDiscord | <ieltan> ask him to try again |
10:58:23 | FromDiscord | <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:26 | FromDiscord | <enthus1ast> mh |
10:58:45 | FromDiscord | <ieltan> People usually use that word to describe Rust |
10:58:48 | FromDiscord | <ieltan> argh |
10:59:15 | FromDiscord | <Rika> verbosity |
10:59:19 | FromDiscord | <Rika> verbose |
10:59:21 | FromDiscord | <Rika> rust is verbose |
10:59:35 | FromDiscord | <michaelb.eth> In reply to @ieltan "When you have to": Maybe DRY?↵“don’t repeat yourself” |
11:00:29 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/4lJV |
11:00:30 | FromDiscord | <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:56 | FromDiscord | <Rika> mfw |
11:00:59 | FromDiscord | <ieltan> Chat GPT having molded brain disorder |
11:01:36 | FromDiscord | <ieltan> In reply to @Rika "verbosity": A synonym of that word |
11:01:53 | FromDiscord | <ieltan> I think its multiple words |
11:01:55 | FromDiscord | <ieltan> but i am not sure |
11:02:00 | FromDiscord | <michaelb.eth> In reply to @ieltan "A synonym of that": ‘tarded? |
11:02:04 | FromDiscord | <enthus1ast> "wordiness"? |
11:02:09 | FromDiscord | <pmp-p> In reply to @ieltan "When you have to": maybe you are reducing boilerplate |
11:02:15 | FromDiscord | <ieltan> context is programming |
11:02:20 | FromDiscord | <ieltan> In reply to @pmp-p "maybe you are reducing": This is it |
11:02:23 | FromDiscord | <ieltan> Thanks you very much |
11:02:26 | FromDiscord | <pmp-p> yw |
11:02:41 | FromDiscord | <Rika> damn i was about to say pleonastic :baqua: |
11:02:54 | FromDiscord | <ieltan> 😭 |
11:03:45 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4lJX |
11:03:54 | FromDiscord | <Rika> "verbiferousness" |
11:03:56 | FromDiscord | <Rika> jesus |
11:04:00 | FromDiscord | <Rika> wtf is prolixity |
11:04:03 | FromDiscord | <Rika> wtf is garrulity |
11:04:08 | FromDiscord | <Rika> are these even words |
11:09:33 | Zevv | poxility is a bit like gregariousness or bedizenment |
11:09:53 | Zevv | or longiloquence |
11:10:11 | FromDiscord | <Rika> gregariousness is at least recognisable |
11:11:23 | Zevv | garrulity is more like loquaciousness or garrulousness |
11:11:30 | FromDiscord | <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:54 | FromDiscord | <0ffh> @Mathmatix |
11:17:42 | FromDiscord | <michaelb.eth> sent a long message, see https://paste.rs/D42 |
11:18:06 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/4lK1" => "http://ix.io/4lK0" |
11:18:43 | FromDiscord | <Rika> it is very rare for the overhead of orc to be unacceptable i would say... |
11:18:51 | FromDiscord | <michaelb.eth> totally agree |
11:26:45 | FromDiscord | <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:22 | FromDiscord | <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:32 | FromDiscord | <0ffh> sent a long message, see http://ix.io/4lK7 |
11:46:49 | FromDiscord | <0ffh> (edit) "http://ix.io/4lK7" => "http://ix.io/4lK8" |
11:48:10 | FromDiscord | <michaelb.eth> > Do you know if Nim has such an option too?↵↵great question, but tbh I'm not sure! |
11:49:44 | FromDiscord | <michaelb.eth> I think it is... hunting for something I'm currently vaguely recalling :p |
11:49:51 | FromDiscord | <ringabout> It probably works. |
11:50:12 | FromDiscord | <ringabout> `{.push checks:off}` or something |
11:50:31 | FromDiscord | <michaelb.eth> yeah something like that, finding a github link to an example... |
11:50:36 | FromDiscord | <ringabout> (edit) "checks:off}`" => "checks:off.}`" |
11:50:50 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4lKa |
11:51:11 | FromDiscord | <0ffh> In reply to @ringabout "`{.push checks:off.}` or something": Yeah, like this or similar at least! |
11:51:32 | FromDiscord | <0ffh> I can guess what ``boundChecks: off`` does. |
11:52:23 | FromDiscord | <0ffh> I need to delve deeper into the Docs, so many hidden gems! |
11:56:34 | FromDiscord | <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:18 | FromDiscord | <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:31 | FromDiscord | <michaelb.eth> (edit) "quickly" => "easily" |
11:57:36 | FromDiscord | <michaelb.eth> (edit) "Nim-vocbulary" => "Nim-vocabulary" |
11:57:54 | FromDiscord | <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:20 | FromDiscord | <0ffh> I'm reasonably sure there must be one... somewhere |
11:58:27 | FromDiscord | <michaelb.eth> silver searcher or ripgrep (etc) in a clone of the repo... it's your only hope |
11:59:30 | FromDiscord | <0ffh> In reply to @michaelb.eth "silver searcher or ripgrep": And there I thought old Ben Kenobi was our only hope. 😁 |
12:00:26 | FromDiscord | <michaelb.eth> https://github.com/ggreer/the_silver_searcher#readme↵he may be the best we've got |
12:00:35 | FromDiscord | <michaelb.eth> (edit) "https://github.com/ggreer/the_silver_searcher#readme↵he" => "https://github.com/ggreer/the_silver_searcher#readme↵ggreer, he" |
12:16:46 | FromDiscord | <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:15 | FromDiscord | <michaelb.eth> (edit) "page":" => "page" in your phone's browser:" |
12:22:15 | FromDiscord | <Rika> who are you to tell me what to do |
12:23:58 | FromDiscord | <michaelb.eth> edited |
12:24:35 | Zevv | ringabout: ping |
12:24:44 | FromDiscord | <ringabout> pong |
12:25:25 | Zevv | hey; 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:53 | Zevv | I 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:15 | Zevv | I'd love it if nim could support this natively soemhow, but the problem is that stuff always goes into `result` first |
12:26:49 | Zevv | i'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:20 | Zevv | basically what I need is that nim will not do `result = foo(); return result` but emit `return foo()` straight away |
12:27:32 | FromDiscord | <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:47 | FromDiscord | <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:06 | FromDiscord | <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:40 | FromDiscord | <djazz> PMunch, did you see my Futhark PR? Small enum fix |
12:29:18 | FromDiscord | <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:58 | FromDiscord | <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:13 | FromDiscord | <michaelb.eth> totally agree |
12:30:19 | PMunch | @djazz, yeah I saw that one. Still not entirely sure what the original problem was and how this fixes it.. |
12:30:34 | FromDiscord | <Phil> And that already should provide a really good amount of optimization possibilities |
12:31:16 | FromDiscord | <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:47 | PMunch | @Mathmatix, with that background you should be able to pick up Nim pretty quickly |
12:31:57 | FromDiscord | <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:31 | FromDiscord | <djazz> PMunch, because you cant do const somevar: cuchar = 123 (type mismatch) |
12:32:39 | FromDiscord | <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:40 | FromDiscord | <djazz> cuchar is not an int, its a char |
12:32:57 | FromDiscord | <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:16 | FromDiscord | <Phil> "Finally" being last year when I stumbled over my personal fav among nim webdev frameworks |
12:33:46 | PMunch | @djazz, ah right |
12:33:58 | PMunch | Moving the type to the right makes Nim convert to that type |
12:34:03 | FromDiscord | <djazz> `Error: type mismatch: got 'int literal(123)' for '123' but expected 'char'` |
12:34:10 | FromDiscord | <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:49 | FromDiscord | <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:55 | FromDiscord | <ringabout> Zevv: hi, I think you might start from `semProcAux`, `semProcBody` and `addResult` where `result` might be handled. |
12:35:02 | FromDiscord | <djazz> PMunch: so either change cuchar (which is deprecated) to uint8 or merge my fix |
12:35:21 | Zevv | ringabout: cool, thanks |
12:35:37 | FromDiscord | <djazz> but enums can also contain chars so idk |
12:35:49 | FromDiscord | <djazz> C doesnt care, its just another number |
12:37:19 | FromDiscord | <Phil> On an unrelated sidenote: Boy am I looking forward to the nim-docker-images for choosenim to work again |
12:37:30 | FromDiscord | <Phil> (edit) "nim-docker-images" => "nim-docker-image" |
12:37:35 | FromDiscord | <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:37 | FromDiscord | <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:48 | FromDiscord | <Phil> And constructor |
12:38:51 | FromDiscord | <Phil> Still loving constructor |
12:40:22 | PMunch | @djazz, yeah I'm not sure what to do about the whole cuchar being deprecated thing.. |
12:40:29 | PMunch | Feels wrong to just make them uint8 |
12:40:34 | FromDiscord | <djazz> mhm |
12:41:06 | PMunch | Throwing away type information feels a bit dirty |
12:41:11 | FromDiscord | <ringabout> Probably copy the definition `cuchar`. |
12:41:15 | FromDiscord | <ringabout> (edit) "Probably copy the definition ... `cuchar`." added "of" |
12:41:28 | PMunch | But maybe I'll change it and add a switch with --useCuchar or something |
12:41:55 | PMunch | Zevv, quick question, have you ever used nmqtt against AWS? |
12:42:22 | Zevv | PMunch: I never used it against anything other than mosquitto I think |
12:42:30 | Zevv | i wrote it, never used it, and gave it away :) |
12:42:52 | PMunch | Haha, okay |
12:42:58 | FromDiscord | <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:14 | FromDiscord | <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:47 | FromDiscord | <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:10 | PMunch | I'm toying around with some type-based routing |
12:47:26 | PMunch | I think it could be pretty cool, but I'm afraid it might be a touch too magic.. |
12:48:33 | FromDiscord | <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:01 | PMunch | How does Django do it? |
12:49:45 | FromDiscord | <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:35 | FromDiscord | <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:26 | PMunch | Hmm, not entirely sure how that differs from what e.g. Jester does |
12:51:38 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4lKl |
12:51:53 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4lKn |
12:53:16 | FromDiscord | <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:59 | FromDiscord | <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:25 | FromDiscord | <Phil> (edit) "Haven't had to generate URLs ... since," added "in the backend" |
12:55:34 | FromDiscord | <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:48 | FromDiscord | <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:22 | FromDiscord | <michaelb.eth> https://kit.svelte.dev/docs/routing |
12:58:33 | FromDiscord | <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:23 | FromDiscord | <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:34 | FromDiscord | <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:16 | FromDiscord | <djazz> char(13) |
13:37:59 | FromDiscord | <djazz> 13.char |
13:38:06 | FromDiscord | <djazz> char 13 |
13:39:21 | FromDiscord | <MartinSkou> Thanks. But using this in a ↵case key↵of KeyEnter ↵gives me: cannot evaluate at compile time: KeyEnter |
13:40:38 | FromDiscord | <MartinSkou> ok fixet if i change it from let to const... |
13:41:01 | FromDiscord | <MartinSkou> guess that makes sense 🙂 |
13:42:57 | FromDiscord | <demotomohiro> sent a code paste, see https://paste.rs/igS |
13:43:06 | FromDiscord | <djazz> yeah |
13:43:21 | FromDiscord | <MartinSkou> yes, gets it now. |
13:43:27 | FromDiscord | <djazz> `'\0d'` also |
13:44:22 | FromDiscord | <djazz> (edit) "`'\0d'`" => "`'\x0d'`" |
13:51:44 | FromDiscord | <djazz> `'\13'` |
13:53:20 | FromDiscord | <Phil> In reply to @MartinSkou "yes, gets it now.": For further context, are you familiar with the concept of compile-time? |
13:53:41 | FromDiscord | <Phil> (edit) "compile-time?" => "compile-time (in contrast to runtime)?" |
13:55:54 | FromDiscord | <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:09 | FromDiscord | <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:20 | FromDiscord | <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:48 | Amun-Ra | proc is already a pointer in Nim |
15:40:13 | Amun-Ra | what do you plan to do with the pointer? |
15:48:39 | FromDiscord | <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:01 | FromDiscord | <Nerve> (edit) "What's the best way to slice off the first 500 rows ... of" added "(and take the remainder)" |
15:50:14 | FromDiscord | <Nerve> Very counter-intuitively `count` seems to give the number of duplicate columns. |
15:50:48 | FromDiscord | <Nerve> (edit) "columns." => "rows." |
15:50:53 | FromDiscord | <Nerve> (edit) "rows." => "rows, not the total number." |
15:51:40 | FromDiscord | <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:13 | FromDiscord | <Nerve> Also can a `for` loop variable really not be reassigned? Must I resort to `while`? |
16:07:01 | FromDiscord | <Rika> In reply to @Nerve "Also can a `for`": Reassigned in what sense? |
16:07:09 | FromDiscord | <Rika> Some iterators have a mutable version |
16:07:52 | FromDiscord | <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:04 | FromDiscord | <Rika> Nope |
16:08:07 | FromDiscord | <Rika> While loop |
16:08:12 | FromDiscord | <Nerve> Dang |
16:08:26 | FromDiscord | <Rika> I mean I guess you can call continue until I is equal to j |
16:08:29 | FromDiscord | <Rika> But eh |
16:11:47 | * | jmdaemon quit (Ping timeout: 268 seconds) |
16:12:02 | FromDiscord | <Dumb Dragon> do you want `i` to equal `j`? |
16:12:57 | FromDiscord | <Dumb Dragon> yeah you can't do that unfortunately |
16:13:12 | FromDiscord | <Dumb Dragon> I thought you could since I remember doing it once in the past but it turns out I was wrong |
16:14:02 | FromDiscord | <Dumb Dragon> ah no wait, that was changing the bounds of a range while in a loop |
16:17:19 | FromDiscord | <Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=4lLi |
16:17:37 | FromDiscord | <Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=4lLj |
16:46:01 | FromDiscord | <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:55 | FromDiscord | <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:06 | FromDiscord | <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:08 | FromDiscord | <Phil> Can you do "requires" blocks that only apply after a certain nim version? |
19:13:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lMn |
19:33:06 | FromDiscord | <rakgew> inside the nimble file? |
19:35:11 | FromDiscord | <Phil> Yep |
19:35:52 | FromDiscord | <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:44 | FromDiscord | <sOkam!> epic |
19:49:30 | FromDiscord | <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:22 | FromDiscord | <Phil> In reply to @Mr.Ender "Reading the 2.0 stuff": As in what will you likely need to upgrade? |
19:52:54 | FromDiscord | <Mr.Ender> I may have not been clear but I kind of mean python 2 vs python 4 |
19:52:56 | FromDiscord | <Mr.Ender> (edit) "4" => "3" |
19:53:08 | FromDiscord | <Mr.Ender> Where not all code works between the 2 |
19:53:12 | FromDiscord | <Phil> Nah, there are some breaking changes but overall transition should be fairly smooth |
19:53:19 | FromDiscord | <Mr.Ender> Ok |
19:54:38 | FromDiscord | <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:07 | FromDiscord | <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:55 | Amun-Ra | hmm, I found another compiler bug, Error: internal error: cannot inject destructors to node kind: nkClosedSymChoice |
21:17:43 | FromDiscord | <T0lk1en> Is there a way to check and see if my program is run with administrator privileges |
21:17:56 | FromDiscord | <T0lk1en> In nim |
21:19:51 | Amun-Ra | geteuid (if run in posix) |
21:20:10 | FromDiscord | <T0lk1en> Windows |
21:20:26 | * | argonica joined #nim |
21:20:31 | FromDiscord | <Mustache Man> need some help with Weave for multithreading.. |
21:21:27 | FromDiscord | <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:27 | Amun-Ra | T0lk1en: os.isAdmin |
21:21:38 | FromDiscord | <T0lk1en> Ty |
21:24:01 | * | argonica quit (Client Quit) |
21:34:44 | FromDiscord | <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:21 | FromDiscord | <jtv> Are you doing this for the purposes of calling it from C??? |
21:40:01 | FromDiscord | <Elegantbeef> You'd cast the pointer to the type you want then call it |
21:40:30 | FromDiscord | <enthus1ast> @qb\: a simple full example of hooking\: https://github.com/enthus1ast/nimhook |
21:40:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lN0 |
21:45:49 | * | argonica joined #nim |
21:45:58 | Amun-Ra | I got segfault during compilation, hmm |
21:46:26 | FromDiscord | <Elegantbeef> Generally that's do to macros or incorrectly used types |
21:46:30 | FromDiscord | <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:39 | FromDiscord | <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:17 | FromDiscord | <Elegantbeef> `for x in y: result = y; break` |
22:06:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNa |
22:06:37 | FromDiscord | <Elegantbeef> Whoops `var res: typeof(iter)` |
22:07:34 | Amun-Ra | I've found the reason of the segfault, I had: type Foo = Bar or Baz or Foo |
22:09:10 | FromDiscord | <keks> sent a code paste, see https://play.nim-lang.org/#ix=4lNc |
22:09:34 | FromDiscord | <keks> (edit) "https://play.nim-lang.org/#ix=4lNc" => "https://play.nim-lang.org/#ix=4lNd" |
22:10:56 | FromDiscord | <Phil> Erm... did nim 2.0 do something to std/smtp? |
22:11:14 | FromDiscord | <Elegantbeef> I think it's no longer in stdlib |
22:11:22 | FromDiscord | <Phil> That as well? Dangit |
22:11:22 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/smtp |
22:12:53 | Amun-Ra | does uniform function call work with templates? |
22:13:16 | FromDiscord | <deech> Is it possible to _return_ a `static` type? eg. `proc p(s:static[string],...):(static[string],SomeType) = ...`? |
22:13:46 | FromDiscord | <Elegantbeef> No |
22:13:58 | FromDiscord | <Elegantbeef> Just return `string` |
22:15:00 | FromDiscord | <deech> But the contents of that `string` won't be available at compile time, right? |
22:15:30 | FromDiscord | <Elegantbeef> Of course they will if it's a procedure that runs at CTE |
22:16:52 | FromDiscord | <Elegantbeef> Works just as you expect |
22:16:56 | FromDiscord | <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:06 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> You can remove `static` in the above and it works just the same |
22:17:36 | FromDiscord | <Elegantbeef> Since the code can be evaluated statically |
22:18:31 | FromDiscord | <Elegantbeef> Atleast i think that answers you question |
22:19:08 | FromDiscord | <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:25 | FromDiscord | <Elegantbeef> Well there are other useful cases for `static` |
22:19:40 | FromDiscord | <Elegantbeef> Static generics come to mind(Though they easily break) 😛 |
22:20:22 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> Hey everyone uses arrays! |
22:21:00 | FromDiscord | <Phil> I would like to carve out an exception for that one |
22:21:16 | Amun-Ra | it works if T is an integer, fails if an object, https://play.nim-lang.org/#ix=4lNg |
22:22:22 | FromDiscord | <Elegantbeef> `f.test[: Foo](121)` |
22:22:45 | FromDiscord | <Elegantbeef> `f.test2[Foo](121` is parsed as `test2(f)[Foo](121)` |
22:23:21 | Amun-Ra | oh |
22:23:40 | Amun-Ra | I've never seen this construction before, thanks |
22:23:51 | FromDiscord | <Elegantbeef> `: Foo` tells it "this is a generic invocation of a procedure" |
22:24:02 | FromDiscord | <Elegantbeef> It's mentioned in the manual, but that's dry reading |
22:24:12 | Amun-Ra | I see |
22:24:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
22:24:39 | FromDiscord | <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:03 | FromDiscord | <jtv> It's a common problem which is one reason I was complaining about [] as the thing that denotes type params |
22:25:23 | FromDiscord | <Elegantbeef> Well you'd have a similar issue with any brackets |
22:25:46 | FromDiscord | <Elegantbeef> `Foo<A>(...)` could be `Foo < A > (...)` in Nim |
22:26:32 | FromDiscord | <jtv> Sure, but some languages use digraphs, or do something else entirely when the type params are needed |
22:26:45 | FromDiscord | <jtv> Like put them w/ the params with a backtick, etc |
22:26:54 | FromDiscord | <Elegantbeef> That doesnt work in the above |
22:27:00 | FromDiscord | <Elegantbeef> Since the return type is the generic |
22:27:06 | FromDiscord | <Elegantbeef> You cannot infer that from parameters |
22:27:26 | FromDiscord | <Elegantbeef> `let a = foo.test2(121)` has no return type |
22:27:28 | FromDiscord | <jtv> It does if you make the type parameters go before any runtime formals |
22:27:29 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNh |
22:27:59 | FromDiscord | <jtv> Not saying Nim should change, just saying other languages can skirt the problem if they don't overload bracket types |
22:28:09 | FromDiscord | <Elegantbeef> `import letters` |
22:28:13 | FromDiscord | <Elegantbeef> or `import "."/letters` |
22:28:30 | FromDiscord | <Elegantbeef> `./letters` does not do what one imagines iirc |
22:29:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNi |
22:29:22 | FromDiscord | <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:26 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> Yes 4, Nim does not bring modules that you import |
22:29:51 | FromDiscord | <Elegantbeef> You likely want to `export tables` in `letters` |
22:29:55 | FromDiscord | <jtv> You can't make the opposite decision though; arrays NEED to have priority |
22:30:44 | FromDiscord | <Elegantbeef> I mean it's a mild inconvenience, it's just not explained in documentation enough |
22:30:44 | FromDiscord | <Elegantbeef> People also bump into the whole command syntax existing |
22:31:37 | FromDiscord | <4zv4l> In reply to @Elegantbeef "You likely want to": export `std/tables` ? |
22:31:51 | FromDiscord | <Elegantbeef> Inside letters you will want to `export tables` yes |
22:31:53 | FromDiscord | <michaelb.eth> just `export tables` |
22:32:12 | FromDiscord | <Elegantbeef> Assuming you dont want to `import tables` in every module that imports `letters` |
22:32:13 | FromDiscord | <michaelb.eth> you don't qualify with `std/` in the export statement |
22:32:31 | FromDiscord | <Elegantbeef> Export works on symbols, `std/tables` is not a symbol |
22:33:21 | FromDiscord | <4zv4l> alright indeed it works, thanks !↵so if I make a module that requires other modules, I need to export them ? |
22:33:56 | FromDiscord | <Elegantbeef> need to |
22:34:12 | FromDiscord | <Elegantbeef> You export any modules that you feel the importer needs to use that module |
22:34:30 | FromDiscord | <Elegantbeef> Importing a module only gives you access to exported symbols |
22:36:09 | FromDiscord | <4zv4l> alright, I think I understand |
22:36:57 | FromDiscord | <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:54 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNn |
22:38:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNo |
22:38:55 | FromDiscord | <Elegantbeef> But no clue exactly what you're doing |
22:39:41 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNp |
22:40:00 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> So make a `print(s: static string)` |
22:41:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNr |
22:41:33 | * | azimut_ joined #nim |
22:42:11 | FromDiscord | <4zv4l> only the static part will be ran at compile time ?↵the rest of the print proc will be ran at runtime ? |
22:42:40 | FromDiscord | <Elegantbeef> Of course |
22:42:44 | FromDiscord | <Elegantbeef> `static` means static |
22:43:15 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNw |
22:43:17 | FromDiscord | <Elegantbeef> Yep should work |
22:43:22 | FromDiscord | <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:20 | FromDiscord | <4zv4l> `asciiart.nim(6, 16) Error: type mismatch: got <void, char>`↵line 6 is `assert c in letters` |
22:44:52 | FromDiscord | <4zv4l> c is the char one, letters is `const` so also compile time so shouldn't be void right ? |
22:45:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lNy |
22:46:39 | FromDiscord | <4zv4l> yeah I don't get why it says letters is void |
22:46:55 | FromDiscord | <4zv4l> I don't need to do like `letters.keys` or something similar ? |
22:46:56 | FromDiscord | <Elegantbeef> Is letters' in scope? |
22:47:22 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNz |
22:47:22 | FromDiscord | <Elegantbeef> `letters.hasKey(c)` likely |
22:47:54 | FromDiscord | <Elegantbeef> Oh wait no i see the issue |
22:48:00 | FromDiscord | <Elegantbeef> You named your module the same as a top level variable |
22:48:08 | FromDiscord | <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:11 | FromDiscord | <michaelb.eth> my guess anyway |
22:48:14 | FromDiscord | <Elegantbeef> you need to do `assert c in letters.letters` |
22:48:21 | FromDiscord | <Elegantbeef> Or name your modules and variables sanely |
22:48:28 | FromDiscord | <Elegantbeef> `letters.nim` is a terrible module name |
22:48:29 | FromDiscord | <4zv4l> is it better this or put the constant in uppercase ? |
22:48:39 | FromDiscord | <4zv4l> In reply to @Elegantbeef "`letters.nim` is a terrible": well it contains the letters idk xD |
22:48:42 | FromDiscord | <Elegantbeef> It's better to name things sensibly |
22:49:09 | FromDiscord | <4zv4l> In reply to @michaelb.eth "so, `import ./letters` introduces": yeah makes sense |
22:49:24 | FromDiscord | <michaelb.eth> if you name the constant `Letters` in `letters.nim` you should be able to do `assert c in Letters` |
22:50:03 | FromDiscord | <Elegantbeef> Alternatively if you name it `letterTable` it also would work |
22:50:25 | FromDiscord | <Elegantbeef> `letters` to me is `{'a'..z', 'A'..'Z'}` or the array equivlent |
22:50:54 | FromDiscord | <Elegantbeef> It's not a look up table for whatever you're doing(Morse code?) |
22:51:00 | FromDiscord | <4zv4l> well the static bloc works great |
22:51:22 | FromDiscord | <Elegantbeef> The east bloc, the west bloc, and the static bloc |
22:51:34 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lNA |
22:51:36 | FromDiscord | <4zv4l> for all letters |
22:51:38 | FromDiscord | <Elegantbeef> Perfect name for a tutorial on Nim compile time evaluation |
22:51:41 | FromDiscord | <Elegantbeef> I see |
22:51:42 | FromDiscord | <4zv4l> to print them on a same line |
22:52:12 | FromDiscord | <4zv4l> In reply to @Elegantbeef "The east bloc, the": there is a east and west bloc too ? or that's a joke 🥹 |
22:52:15 | FromDiscord | <jtv> You going to do full fonts w/ unicode? 🙂 |
22:52:24 | FromDiscord | <Elegantbeef> There is a east and west bloc in history |
22:52:36 | FromDiscord | <Elegantbeef> https://en.wikipedia.org/wiki/Eastern_Bloc |
22:52:37 | FromDiscord | <4zv4l> In reply to @jtv "You going to do": oh no no, just alphabet in uppercase A-Z |
22:53:01 | FromDiscord | <4zv4l> In reply to @Elegantbeef "There is a east": oh ok this way↵not in Nim |
22:53:30 | FromDiscord | <Elegantbeef> If you havent read any of my written tutorials, i tend to lean on shitty jokes |
22:54:32 | FromDiscord | <4zv4l> well that's actually pretty nice joke↵I like joke about knowledge xD |
22:56:21 | FromDiscord | <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:29 | FromDiscord | <4zv4l> oh jeez |
22:57:49 | FromDiscord | <4zv4l> I don't see why everyone call pointer scary xD |
22:57:58 | FromDiscord | <Elegantbeef> Ignorance |
22:58:18 | FromDiscord | <Elegantbeef> Also they're nilable |
22:58:36 | FromDiscord | <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:45 | FromDiscord | <4zv4l> (edit) "it's like my application security ... who" added "teacher" |
22:58:57 | FromDiscord | <Elegantbeef> well C has untyped pointers |
22:59:02 | FromDiscord | <Elegantbeef> So they deserve what they get |
22:59:42 | FromDiscord | <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:46 | FromDiscord | <4zv4l> (edit) "type" => "types" |
23:00:07 | FromDiscord | <Elegantbeef> Meh i look at C's `T` and vomit |
23:00:27 | FromDiscord | <Elegantbeef> In what world is `T` indexable, but also possibly a singly allocated value |
23:01:58 | FromDiscord | <4zv4l> anytime I criticise C my uncle tells me "they did what they could with what they got" |
23:02:32 | FromDiscord | <Elegantbeef> Pascal existed |
23:02:46 | FromDiscord | <4zv4l> well I don't really know Pascal to be honest |
23:02:52 | FromDiscord | <4zv4l> I saw a bit of Fortran but that's it |
23:03:01 | FromDiscord | <4zv4l> Nim was made ouf of Fortran right ? |
23:03:12 | FromDiscord | <Elegantbeef> What? |
23:03:23 | FromDiscord | <Elegantbeef> Nim is inspired by Pascal/Module/Oberon to a high degree |
23:04:37 | FromDiscord | <4zv4l> > The first version of the Nim compiler was written in Pascal using the Free Pascal compiler. |
23:04:39 | FromDiscord | <4zv4l> indeed my bad |
23:04:41 | FromDiscord | <4zv4l> xD |
23:05:01 | FromDiscord | <4zv4l> well I don't know Pascal very well |
23:05:45 | FromDiscord | <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:33 | FromDiscord | <sOkam!> zig got it right in this aspect, imo. the type names are gold |
23:06:39 | FromDiscord | <etra> Hello, does anyone knows if there's any library like this one: <https://github.com/sharksforarms/deku> in nim? |
23:06:53 | FromDiscord | <Elegantbeef> The worst part is `MyType` and `MyType` are two different types in C but the compiler doesnt know |
23:07:08 | FromDiscord | <sOkam!> also that, ye |
23:07:36 | FromDiscord | <amadan> In reply to @etra "Hello, does anyone knows": maybe this https://github.com/sealmove/binarylang |
23:07:55 | FromDiscord | <sOkam!> it polutes the whole project with counters and pointer incrementing everywhere, and it can become a big mess |
23:08:14 | FromDiscord | <Elegantbeef> Dont know if flatty/frosty respects bitsizes, but it might be the right thing |
23:17:31 | FromDiscord | <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:38 | FromDiscord | <michaelb.eth> (edit) "for↵↵https://github.com/status-im/nim-serialization" => "for=↵https://github.com/status-im/nim-serialization" |
23:18:12 | FromDiscord | <Elegantbeef> They want a binary serialiser that properly handles bitfields |
23:18:28 | FromDiscord | <Elegantbeef> Though reality that's not to complicated in Nim |
23:18:36 | FromDiscord | <michaelb.eth> (edit) "for=↵https://github.com/status-im/nim-serialization" => "for↵https://github.com/status-im/nim-serialization" |
23:18:54 | FromDiscord | <Elegantbeef> Atleast for types that dont have any heap allocated memory |
23:24:56 | FromDiscord | <Elegantbeef> Actually i take it back the endianness is a bit difficult to reason |
23:27:59 | FromDiscord | <etra> In reply to @amadan "maybe this https://github.com/sealmove/binarylang": I think this is somewhat the thing I was looking for, thanks! |