00:20:25 | * | Jesin quit (Quit: Leaving) |
00:26:01 | * | Jjp137 quit (Read error: No route to host) |
00:26:33 | * | Jjp137 joined #nim |
00:29:58 | * | Jesin joined #nim |
00:46:41 | * | Gustavo6046 quit (Ping timeout: 258 seconds) |
00:54:13 | saem | Hi folks. |
00:54:38 | FromDiscord | <ElegantBeef> Yellow |
00:54:55 | FromDiscord | <Yardanico> fellow |
00:55:06 | FromDiscord | <ElegantBeef> nimion |
00:55:27 | FromDiscord | <Yardanico> #FFC200 |
00:55:40 | saem | In terms of figuring out what's being worked on in the compiler, I look at recent commits and PRs by various peeps. Making sense of it is challenging admittedly. |
00:56:51 | FromDiscord | <ElegantBeef> Hey yard i see you starred dusty, could i bother you to build it/run it to test the performance on your pc? |
00:57:07 | FromDiscord | <Yardanico> I couldn't actually run it |
00:57:07 | FromDiscord | <ElegantBeef> I need to track down why the one build i sent to someone was running at 40fps on a cpu better than mine |
00:57:22 | FromDiscord | <ElegantBeef> On linux? |
00:57:36 | FromDiscord | <ElegantBeef> Oh |
00:57:39 | FromDiscord | <ElegantBeef> Devel issue with nico |
00:57:39 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2RPJ |
00:57:43 | FromDiscord | <Yardanico> classical |
00:58:17 | FromDiscord | <Yardanico> maybe |
00:58:55 | FromDiscord | <ElegantBeef> On my cpu i get > 150fps or around .005ms |
00:58:58 | FromDiscord | <Yardanico> is there any workaround? |
00:59:03 | FromDiscord | <ElegantBeef> Move to stable |
00:59:14 | FromDiscord | <Yardanico> anything other than that? :D |
00:59:25 | FromDiscord | <ElegantBeef> Devel caused the sdl2 inputs to completely break |
00:59:31 | FromDiscord | <Yardanico> and did you (I mean you and other nico people) figure out the commit? |
00:59:31 | FromDiscord | <ElegantBeef> I suppose i could ship a binary |
00:59:33 | FromDiscord | <Yardanico> that broke it |
00:59:54 | FromDiscord | <ElegantBeef> Well it seems like it's a commit related to enum/collisions |
01:00:19 | FromDiscord | <Yardanico> well if no one checks we'll get a stable release with broken nico :P |
01:00:34 | FromDiscord | <ElegantBeef> I did make an issue for impbox |
01:00:43 | FromDiscord | <ElegantBeef> But yea i'll take a whirl at finding it |
01:02:06 | * | Gustavo6046 joined #nim |
01:02:44 | FromDiscord | <Yardanico> nvm I can do it myself |
01:02:48 | FromDiscord | <Yardanico> the repro is pretty easy to do |
01:02:59 | FromDiscord | <ElegantBeef> Ok |
01:03:28 | FromDiscord | <Yardanico> wonder why nico defines its own sdl scancode enum if it uses sdl2_nim ? |
01:03:35 | FromDiscord | <Yardanico> its the same enum |
01:03:38 | FromDiscord | <ElegantBeef> probably js backend |
01:03:46 | FromDiscord | <Yardanico> oh okay |
01:04:06 | FromDiscord | <ElegantBeef> Which impbox plans on axing at some point so probably will die soon ๐ |
01:04:18 | FromDiscord | <Yardanico> so on 1.4.4 everything works fine? |
01:04:34 | FromDiscord | <ElegantBeef> Yep |
01:04:58 | FromDiscord | <Yardanico> time to `git bisect` |
01:05:22 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817563473667686471/unknown.png |
01:06:49 | Prestige | Hm why can I not import exitprocs |
01:06:58 | FromDiscord | <Yardanico> std/exitprocs |
01:06:59 | FromDiscord | <ElegantBeef> `std` |
01:07:08 | FromDiscord | <Yardanico> newer stdlib modules only exist in the std namespace |
01:07:13 | FromDiscord | <ElegantBeef> Cmon prestige no importing system modules without `std` |
01:07:16 | FromDiscord | <Yardanico> also old ones can be improted with it too, so it's better to just start using std :) |
01:07:21 | FromDiscord | <Yardanico> (edit) "improted" => "imported" |
01:07:28 | Prestige | Shouldn't I not need to require it if it's in system? |
01:07:43 | FromDiscord | <Yardanico> it's not in system |
01:07:54 | FromDiscord | <Yardanico> there's https://nim-lang.org/docs/system.html#addQuitProc%2Cproc%29 but it's deprecated because you need to use std/exitprocs instead |
01:09:00 | FromDiscord | <ElegantBeef> Wonder if a "Hint: importing a system module without `std` is no longer suggested" would make life better |
01:09:01 | Prestige | I see no indication in the docs that I need to do that, also import std/exitprocs still says it can't be found. Is this not available on stable? |
01:09:13 | FromDiscord | <Yardanico> what stable? |
01:09:21 | Prestige | latest stable |
01:09:30 | Prestige | 1.4.4 |
01:09:35 | FromDiscord | <ElegantBeef> !eval import std/exitprocs |
01:09:37 | NimBot | <no output> |
01:09:44 | FromDiscord | <Yardanico> ๐ฅด |
01:10:00 | FromDiscord | <Yardanico> @ElegantBeef here's your answer |
01:10:04 | FromDiscord | <Yardanico> 979148e863c4142a00632059f3e2a57f4ab0f960 |
01:10:15 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/15935 |
01:10:16 | FromDiscord | <ElegantBeef> !eval echo NimVersion |
01:10:18 | NimBot | 1.4.4 |
01:10:32 | Prestige | weird, maybe a nimsuggest issue then. Getting errors from my editor, but it compiles |
01:10:43 | FromDiscord | <ElegantBeef> Remember the editor is not to be trusted |
01:10:50 | FromDiscord | <ElegantBeef> It's a liar attempting to backstab you |
01:10:51 | Prestige | unfortunately.. |
01:11:07 | FromDiscord | <Yardanico> maybe you have an older nimsuggest somehow? |
01:11:17 | FromDiscord | <ElegantBeef> Want to see good tooling failure open up a C# project and do `var event = 10` |
01:11:18 | saem | Or it's looking in the wrong place? |
01:11:31 | FromDiscord | <flywind> In reply to @Yardanico "979148e863c4142a00632059f3e2a57f4ab0f960": so the issue is https://github.com/nim-lang/Nim/issues/16462 |
01:11:37 | FromDiscord | <Yardanico> @flywind yeah probably |
01:11:41 | FromDiscord | <Yardanico> but might be different |
01:12:00 | FromDiscord | <Yardanico> In our case the thing is that "except" in the import statement doesn't hide the type |
01:12:20 | FromDiscord | <flywind> I see |
01:12:28 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2RPR |
01:13:05 | * | grobe0ba quit (Quit: ZNC 1.7.5 - https://znc.in) |
01:13:17 | * | grobe0ba joined #nim |
01:13:29 | FromDiscord | <Yardanico> I'll comment in that issue but it might be a different bug |
01:13:47 | Prestige | Apparently I was pointing to an older version of nimlsp I was debugging, seems good now |
01:14:18 | FromDiscord | <ElegantBeef> Ah so it wasnt the toolings fault it was the tools fault ๐ |
01:14:24 | Prestige | :) |
01:16:54 | FromDiscord | <Yardanico> @ElegantBeef https://github.com/nim-lang/Nim/issues/16462#issuecomment-791825468 |
01:19:15 | FromDiscord | <Yardanico> anyway @ElegantBeef you lied and there's a workaround :P https://media.discordapp.net/attachments/371759389889003532/817566965874163742/unknown.png |
01:19:18 | FromDiscord | <Yardanico> time to test dusty with devel |
01:19:59 | FromDiscord | <ElegantBeef> I did lie, i said use stable ๐ |
01:20:46 | FromDiscord | <ElegantBeef> Averaged fps in the top and in console a frametime is printed |
01:21:03 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817567422146936852/unknown.png |
01:21:04 | FromDiscord | <Yardanico> yeah I see |
01:21:13 | FromDiscord | <ElegantBeef> Ok so works fine |
01:21:16 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817567469756874774/unknown.png |
01:21:20 | FromDiscord | <ElegantBeef> What's your CPU? |
01:21:25 | FromDiscord | <Yardanico> only uses 1 core though |
01:21:31 | FromDiscord | <Yardanico> Ryzen 7 3700X |
01:21:46 | FromDiscord | <ElegantBeef> The repo is setup to make 4 threads |
01:22:11 | FromDiscord | <ElegantBeef> It has to be using all 4 for that fps |
01:22:16 | FromDiscord | <Yardanico> but the cpu usage is at ~100% |
01:22:18 | FromDiscord | <Yardanico> not 400% |
01:22:53 | FromDiscord | <Yardanico> how do I change the thread count? I see `ThreadCount` but it has some alien math :D |
01:22:59 | FromDiscord | <ElegantBeef> Chunksize |
01:23:04 | FromDiscord | <ElegantBeef> A smaller base 8 value |
01:23:10 | FromDiscord | <Yardanico> 128? |
01:23:11 | FromDiscord | <ElegantBeef> welll base 2 |
01:23:14 | FromDiscord | <ElegantBeef> Yea that'd work |
01:23:43 | FromDiscord | <ElegantBeef> That all should be calculated off threadsize but was hard coding it for testing math across different chunk sizes |
01:23:43 | FromDiscord | <Yardanico> yeah that works https://media.discordapp.net/attachments/371759389889003532/817568090639695912/unknown.png |
01:23:47 | FromDiscord | <Yardanico> also the fps becomes higher the more sand I have |
01:23:49 | FromDiscord | <Yardanico> XD |
01:23:53 | FromDiscord | <ElegantBeef> It's an average |
01:24:01 | FromDiscord | <Yardanico> now cpu is loaded at 1200% |
01:24:09 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817568196391337984/unknown.png |
01:24:13 | FromDiscord | <ElegantBeef> Nice |
01:24:30 | FromDiscord | <Yardanico> no key to clear? :P |
01:24:33 | FromDiscord | <ElegantBeef> enter |
01:24:37 | FromDiscord | <ElegantBeef> or c to erase |
01:24:39 | FromDiscord | <Yardanico> and in the terminal there's this https://media.discordapp.net/attachments/371759389889003532/817568325705007104/unknown.png |
01:24:41 | FromDiscord | <Yardanico> with full screen of sand |
01:24:45 | FromDiscord | <ElegantBeef> Nice |
01:24:58 | FromDiscord | <Yardanico> and with empty screen https://media.discordapp.net/attachments/371759389889003532/817568404055523328/unknown.png |
01:25:01 | FromDiscord | <Yardanico> i didn't lie when I said it's slower |
01:25:14 | FromDiscord | <ElegantBeef> That's weird |
01:25:17 | FromDiscord | <dom96> Ooh. You making a sand game? |
01:25:19 | FromDiscord | <ElegantBeef> Nah |
01:25:30 | FromDiscord | <ElegantBeef> Made a sand simulation to compete against a C++ programmer in another server ๐ |
01:25:48 | FromDiscord | <Rika> petty |
01:26:03 | FromDiscord | <ElegantBeef> Nah i did it originally just for a small hour long challenge |
01:26:03 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817568675657678888/unknown.png |
01:26:21 | FromDiscord | <ElegantBeef> But then i learned he multithreaded it so i had to for fun |
01:27:51 | FromDiscord | <Yardanico> lets see if it gets faster with LTO PGO and march=native ๐ฅด |
01:27:59 | FromDiscord | <ElegantBeef> Lol |
01:28:11 | FromDiscord | <ElegantBeef> My windows build was at like 50fps on his pc so clearly something is fucked |
01:28:24 | FromDiscord | <Yardanico> his CPU? |
01:28:33 | FromDiscord | <ElegantBeef> some i9 variant |
01:28:38 | FromDiscord | <ElegantBeef> So should be higher than mine |
01:29:13 | FromDiscord | <ElegantBeef> Even with only 8 threads being used |
01:29:17 | * | wasted_youth2 joined #nim |
01:29:25 | FromDiscord | <ElegantBeef> I did also send a 64 chunk size one which should've given more perf but barely any |
01:29:56 | FromDiscord | <Yardanico> oh yeah the debug PGO'd build is damn slow xD |
01:30:03 | FromDiscord | <Yardanico> (it's needed to actually generate the profiling data) |
01:30:07 | FromDiscord | <ElegantBeef> Yep |
01:30:21 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/817569760061292584/unknown.png |
01:30:56 | FromDiscord | <Yardanico> winxp vibes https://media.discordapp.net/attachments/371759389889003532/817569905385537576/unknown.png |
01:31:15 | FromDiscord | <ElegantBeef> uhh |
01:31:19 | FromDiscord | <Yardanico> also sorry for asking such a personal question, but why do you use 1-space indentation in your .nimble file? :D |
01:31:33 | FromDiscord | <ElegantBeef> That was autogenerated by impbox |
01:31:36 | FromDiscord | <Yardanico> huh |
01:31:51 | FromDiscord | <ElegantBeef> Nicoboot autogenerates a nico project |
01:31:55 | FromDiscord | <Yardanico> I know |
01:32:00 | FromDiscord | <Yardanico> didn't know it was 1-space |
01:33:05 | FromDiscord | <Yardanico> yeah the FPS really grows |
01:33:15 | FromDiscord | <Yardanico> with an empty screen its at ~160-170, with a full one - ~220-230 |
01:33:33 | FromDiscord | <ElegantBeef> Doesnt make any sense |
01:33:45 | FromDiscord | <Yardanico> ยฏ\_(ใ)_/ยฏ |
01:33:54 | FromDiscord | <Yardanico> both the terminal and the app show that |
01:33:55 | FromDiscord | <Yardanico> so they're not lying |
01:34:11 | FromDiscord | <ElegantBeef> Well i could be mis calculating the frametime |
01:34:20 | FromDiscord | <Rika> inb4 reversed |
01:34:34 | FromDiscord | <ElegantBeef> Well it's clearly smooth just a question of how smooth ๐ |
01:34:54 | FromDiscord | <Yardanico> smooth enough with my 16 threads :P |
01:34:59 | FromDiscord | <Yardanico> but I wouldn't want to see it run on a 2-core CPU |
01:35:44 | FromDiscord | <ElegantBeef> A 2 core cpu wouldnt even work with this algorithim |
01:35:50 | FromDiscord | <Yardanico> why? |
01:36:12 | FromDiscord | <ElegantBeef> Well it'd work but it wouldnt be ideal |
01:36:15 | FromDiscord | <Yardanico> yes |
01:36:23 | FromDiscord | <Yardanico> time to spend some time with powder toy |
01:36:55 | FromDiscord | <ElegantBeef> Basically you want threads equal to 1/4 the count of chunks |
01:37:23 | FromDiscord | <ElegantBeef> Since i checkboard them into a grid so that race conditions can only happen if particles fly at greater than half a chunk's width in a single iteration |
01:38:07 | FromDiscord | <ElegantBeef> Which is why thread count has that funky formula |
01:41:47 | FromDiscord | <ElegantBeef> Really i should use `cpuinfo` to get the perfect number of threads on startup |
01:42:34 | FromDiscord | <Yardanico> nonon |
01:42:51 | FromDiscord | <ElegantBeef> yesyesye |
01:42:53 | FromDiscord | <Yardanico> @ElegantBeef https://nim-lang.org/docs/osproc.html#countProcessors |
01:43:05 | FromDiscord | <Yardanico> ah right |
01:43:09 | FromDiscord | <Yardanico> cpuinfo is a module anyway |
01:43:18 | FromDiscord | <ElegantBeef> Yes that's what i meant |
01:43:27 | FromDiscord | <Yardanico> but does it return number of cores or threads? |
01:43:36 | FromDiscord | <ElegantBeef> well what you linked internally calls it |
01:43:55 | FromDiscord | <Yardanico> yes I just mean if the behaviour is the same across OSes |
01:44:03 | FromDiscord | <Yardanico> on linux for me it seems to return 16 correctly |
01:44:14 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:44:32 | FromDiscord | <ElegantBeef> It seems like it's properly implemented |
01:44:35 | * | njoseph joined #nim |
01:44:47 | FromDiscord | <Yardanico> that's unheard of! |
01:44:48 | FromDiscord | <Yardanico> /s |
01:45:17 | FromDiscord | <Yardanico> what are hpux and irix :D https://media.discordapp.net/attachments/371759389889003532/817573516420841482/unknown.png |
01:45:27 | FromDiscord | <ElegantBeef> i dont even know those unix impls ๐ |
01:45:31 | FromDiscord | <Yardanico> ah, HP-UX and SGI IRIX |
01:45:39 | FromDiscord | <Yardanico> https://en.wikipedia.org/wiki/IRIX final release in 2006 |
01:46:18 | FromDiscord | <Yardanico> that code was added 7 years ago https://media.discordapp.net/attachments/371759389889003532/817573772554534912/unknown.png |
01:56:34 | leorize[m] | does nim even accept hp-ux as a target? |
01:57:41 | FromDiscord | <Yardanico> that's the only define for hpux that exists in the code base :D |
01:58:30 | FromDiscord | <Yardanico> it's not even in the OsPlatform list https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L40 |
02:09:48 | FromDiscord | <ElegantBeef> @Yardanico well now the thread count is dynamically calculated |
02:22:30 | * | lritter quit (Ping timeout: 256 seconds) |
02:23:07 | * | lritter joined #nim |
02:38:31 | FromDiscord | <fenrave> are there any plans for threads:on to be the default |
02:41:36 | leorize[m] | yes, but it's deterred until orc is stabilized I think |
02:42:10 | leorize[m] | we will probably want Isolated[T] to be finalized also |
02:46:30 | FromDiscord | <impbox> looks like nim is adding `.exe` onto the end of `clang.exe:` eg. `--clang.exe:emcc`: results in `Requested command not found: \'emcc.exe -c -w`, is there a way to disable it trying to add .exe? emcc exists but emcc.exe does not |
02:50:35 | leorize[m] | are you on windows? |
02:50:39 | FromDiscord | <impbox> yep |
02:51:08 | leorize[m] | there's no way out, sadly |
02:52:30 | leorize[m] | what nim version are you using? |
02:52:41 | FromDiscord | <impbox> ahh i can specify emcc.bat and it'll use that |
02:52:56 | FromDiscord | <impbox> 1.4.0 |
02:53:31 | * | krux02 quit (Remote host closed the connection) |
02:53:35 | leorize[m] | sure .bat works |
03:02:23 | * | theelous3 quit (Read error: Connection reset by peer) |
03:15:02 | FromDiscord | <impbox> in a compilation nims file eg. `nim c foo.nim` it looks at `foo.nims` for settings, is there a way I can get the string "foo" eg. I have a line `switch("passL", "-o foo.html --shell-file shell_minimal.html -s USE_SDL=2")` but i'd like the "foo.html" to use whatever the output name is. so if i do `nim c -o:bar foo.nim` it'll have ``switch("passL", "-o bar.html --shell-file shell_minimal.html -s USE_SDL=2")` |
03:15:21 | FromDiscord | <impbox> not sure where to find documentation for what's possible with these nims files if any exists |
03:17:18 | leorize[m] | wouldn't `-o` be passed by Nim? |
03:18:19 | leorize[m] | and there's std/compilesettings too if you need to get the value |
03:20:34 | FromDiscord | <impbox> hmm maybe. i'll try thanks |
03:21:20 | FromDiscord | <impbox> yes it does, thanks =) |
03:32:35 | FromDiscord | <impbox> hmm can you use a nimscript as nim.cfg? |
03:33:24 | FromDiscord | <impbox> for a whole directory rather than a single nim file |
03:33:45 | leorize[m] | config.nims is what you're looking for |
03:34:05 | FromDiscord | <impbox> ahh thank you |
03:34:19 | FromDiscord | <impbox> i had a feeling it existed |
03:34:38 | FromDiscord | <impbox> i feel like it should probably be documented in https://nim-lang.org/docs/nimc.html |
03:36:34 | FromDiscord | <exelotl> I think `projectName()` is what you're looking for r.e. getting the name of the main file |
03:36:38 | FromDiscord | <exelotl> https://nim-lang.org/docs/nimscript.html#projectName |
03:37:07 | FromDiscord | <impbox> @exelotl hmm perhaps, though i'm not sure what is considered to be a "project" |
03:37:51 | FromDiscord | <exelotl> I'm pretty sure it is just the "foo" in "nim c foo.nim" |
03:38:50 | FromDiscord | <impbox> @exelotl yep, you're correct |
03:39:25 | FromDiscord | <impbox> that works nicely, thanks |
03:41:17 | FromDiscord | <impbox> using both projectName and compileSettings I can get a nice default and allow overriding with -o |
04:00:52 | * | asdflkj quit (Ping timeout: 265 seconds) |
04:22:42 | * | spiderstew joined #nim |
04:24:31 | * | spiderstew_ quit (Ping timeout: 272 seconds) |
04:32:35 | * | Stephen[m]2 joined #nim |
04:43:33 | * | abm quit (Read error: Connection reset by peer) |
06:04:49 | * | vicfred quit (Quit: Leaving) |
06:58:57 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:07:32 | * | lritter quit (Ping timeout: 256 seconds) |
07:36:15 | * | gpanders quit (Ping timeout: 268 seconds) |
07:37:05 | * | gpanders joined #nim |
08:46:56 | * | maier joined #nim |
09:00:53 | * | maier quit (Ping timeout: 256 seconds) |
09:09:48 | * | superbia joined #nim |
10:36:11 | * | krux02 joined #nim |
10:47:21 | * | Gustavo6046 quit (Ping timeout: 265 seconds) |
11:03:36 | * | blackpawn quit (Ping timeout: 240 seconds) |
11:08:26 | * | blackpawn joined #nim |
11:08:44 | xace | proc foobar(): int = (_, result) = execCmdEx(...) # undecleared identifier '_' -- is there no way i can get it work like this? |
11:14:27 | liblq-dev | you can do `result = execCmdEx(โฆ)[0]` |
11:14:29 | liblq-dev | er, `[1]` |
11:15:32 | xace | ah, thats right, tyo |
11:15:36 | m4r35n357 | OK, today's question, is there a way of emulating "void pointers" in nim to pass model-specific data to a general method? I've experimented with object types, but the model data object has to be defined in a separate file from the general method, and is invisible despite using an asteisk, and is invisible to the |
11:15:56 | m4r35n357 | general method |
11:16:22 | m4r35n357 | hoep that make some sense |
11:20:24 | FromDiscord | <Clyybber> @timotheecour Hey, you there? |
11:29:27 | * | maier joined #nim |
11:42:11 | liblq-dev | m4r35n357: check out generics https://nim-lang.org/docs/manual.html#generics |
11:45:41 | * | johannes_ joined #nim |
11:46:36 | * | johannes_ is now known as kenran |
11:51:06 | m4r35n357 | liblq-dev, the docslook a bit opaque to my inexperienced eyes, but I'll have a go . . . cheers |
11:52:31 | liblq-dev | basically it allows you to use any arbitrary type as a special kind of parameter to a procedure, another type, etc |
11:52:41 | liblq-dev | it's similar to C++ templates although much simpler in execution |
11:52:53 | m4r35n357 | hmm, everything I have tried, including putting [T] in declaration and formal parameter, leads to "Error: undeclared identifier: 'Parameters'" |
11:53:35 | liblq-dev | can you show me the code? |
11:53:39 | m4r35n357 | liblq-dev, it sounds like what I need, but I can't make it fit with my code (I don't know any c++) |
11:53:51 | m4r35n357 | liblq-dev, I can, let me think how to present it |
11:54:16 | liblq-dev | alr i'm here to help |
11:56:04 | m4r35n357 | I think it might take a couple of stages, first here is everything in one file: https://pastebin.com/YbVUfm1S |
11:57:09 | liblq-dev | ok, so what do you need to generic-ize here? |
11:57:30 | m4r35n357 | the Parameters object (was a tuple before I started doing this bit) needs to be with the physical model, and the solve method needs to be in an "integrator" module |
11:57:50 | m4r35n357 | the physical model is h(), uq(), up() plot() |
11:57:57 | m4r35n357 | and the parameters, of course |
11:58:45 | m4r35n357 | I can post some c that does the thing I want to achieve (this is a port of working code), if that would help |
11:58:46 | liblq-dev | yeah, is there anything that prevents you from putting the solve proc in a separate file and importing it? |
11:59:25 | liblq-dev | generally i'd split the code into 3 modules if you need that โ physical_model.nim, integrator.nim, main.nim |
11:59:29 | m4r35n357 | the solve method is general code that needs to be called from arbitrary models |
11:59:45 | m4r35n357 | so it can't know anything about the nature of the parameters |
12:00:24 | m4r35n357 | the solve in c is here: https://github.com/m4r35n357/ODE-Playground/blob/dual/dual.c |
12:00:47 | m4r35n357 | and the model is here: https://github.com/m4r35n357/ODE-Playground/blob/dual/h-newton.c |
12:01:06 | m4r35n357 | that is probably the best way to describe what I am trying to achieve |
12:01:32 | FromDiscord | <Rika> inb4 concepts time |
12:01:34 | m4r35n357 | it is what a typical integrator package needs to do to support user-defined models |
12:01:37 | liblq-dev | so you want Parameters to be any arbitrary user-supplied type? |
12:01:49 | m4r35n357 | yep ;) |
12:02:20 | liblq-dev | `proc solve*[T](args: seq[string], p: var T, uq, up, output: proc(p: var T, _: float))` |
12:02:26 | m4r35n357 | in c I use a void pointer in solve(), and cast back in the client (model) code |
12:02:51 | liblq-dev | i merged the three `uq, up, output` procs into a single type because they all have the same signature (parameters are `var T, float`) |
12:03:01 | liblq-dev | but that's the general idea |
12:03:17 | m4r35n357 | liblq-dev, OK cheers, I need to use my brain now ;) |
12:03:21 | liblq-dev | then you can pass any arbitrary type to the `p` parameter |
12:03:32 | liblq-dev | and the compiler will "instantiate" the procedure with that type |
12:03:46 | liblq-dev | which basically means re-writing it so that the actual type you pass in is used |
12:04:37 | m4r35n357 | that sounds like what I need, I'll give it a go (for some reason cut 'n' paste doesn't work in xchat these days!) |
12:16:43 | * | maier quit (Ping timeout: 245 seconds) |
12:20:21 | * | kenran quit (Quit: leaving) |
12:37:43 | m4r35n357 | liblq-dev, got a bit messy with my "current" code, so I went back to the code (all in one file) that I posted, and applied the signature you posted (needed to alter symplectic() too). Now I'm getting an indentation error . . . can't work out what I did wrong: https://pastebin.com/scfM1axZ |
12:39:11 | m4r35n357 | here is the diff if that helps . . . https://pastebin.com/jraqqq0W |
12:42:18 | m4r35n357 | liblq-dev, OK I see what I did ;) |
12:42:54 | m4r35n357 | but after restoring the "=" I get: Error: typeless parameters are obsolete |
12:43:08 | m4r35n357 | I will attempt to restore the parameters . . . |
12:48:30 | liblq-dev | you still need to give `up, uq` types |
12:48:51 | liblq-dev | so `uq, up: proc (var T, _: float)` |
12:49:08 | liblq-dev | you can replace the _ with `h` since that's what you had previously |
12:50:53 | m4r35n357 | I think I have done that, if I understand you meaning |
12:51:41 | m4r35n357 | here is what I have now: https://pastebin.com/JwjQMk5s |
12:52:49 | m4r35n357 | not sure what I am not doing |
12:55:13 | liblq-dev | yeah that's what i meant |
12:55:36 | m4r35n357 | so it should compile like that? |
12:56:23 | m4r35n357 | the error message is a bit wordy, but it seems to not like the "plot" function parameter to solve() |
12:58:13 | FromDiscord | <shirleyquirk> first type mismatch at position: 5โต required type for output: proc (p: var T, _: float){.closure.}โต but expression 'plot' is of type: proc (p: Parameters, t: float){.gcsafe, locks: 0.} |
12:58:14 | liblq-dev | well, what's the error? |
12:58:36 | liblq-dev | `plot` accepts a `Parameters` instead of a `var Parameters` |
12:58:54 | liblq-dev | you need to change that |
12:59:14 | m4r35n357 | yes, have just done that ;) |
13:00:09 | m4r35n357 | but I don't think I have done it properly, as I am getting a compilation error . . |
13:00:43 | m4r35n357 | liblq-dev, AHA! missing bracket |
13:01:24 | m4r35n357 | liblq-dev, and now it works! I can put the stuff into module files now! |
13:01:36 | m4r35n357 | thanks for the help |
13:02:12 | liblq-dev | np |
13:02:52 | m4r35n357 | that was pretty hairy, I went into object types, ref objects etc, nice that it works with my tuple |
13:04:42 | m4r35n357 | but now I have used generics in Nim for the first time so that is a good thing |
13:15:31 | m4r35n357 | liblq-dev, just confirming that everything is now working with three files, the model calling a dual module and a symplectic module, nice! thx again for the help |
13:15:48 | liblq-dev | cool to see that it works! |
13:17:24 | m4r35n357 | yep, now I have example code in Nim for the future, for pretty much anything that needs operator overloading (the killer feature for me) |
13:45:51 | * | ^Q-Master^ quit (Ping timeout: 246 seconds) |
13:56:42 | * | superbia quit (Quit: WeeChat 3.0) |
14:03:43 | * | j joined #nim |
14:16:19 | * | Q-Master joined #nim |
14:21:12 | * | Q-Master quit (Ping timeout: 246 seconds) |
14:24:16 | * | tane joined #nim |
14:25:22 | xace | `sorted(data, cmp = proc (a, b: mytipe): int { if formatTime(a.startTime) < formatTime(b.startTime): result = -1 elif formatTime(a.startTime) > formatTime(b.startTime): result = 1 else: result = 0 } )` # gives me got <int literal(-1)> but expected 'seq[mytype]', what am i doing wrong? |
14:33:45 | * | Q-Master joined #nim |
14:38:23 | * | D_ quit (Ping timeout: 245 seconds) |
14:39:29 | * | D_ joined #nim |
14:44:05 | Oddmonger | i have written a module, with a test function for it. So for testing, i have put test() in the module, but is it possible to execute ยซ test() ยป only if the source is called directly, and not as a module ? |
14:44:21 | * | Vladar joined #nim |
14:46:01 | xace | https://play.nim-lang.org/#ix=2RT4 here is an easier example of my problem. how do I get the sorted() function working? i need to call my own lambda function because the actual data needs to be pre-processed before the comparison is made |
14:48:05 | leorize[m] | xace: remove the curly braces |
14:48:39 | Oddmonger | to be clearer,with Lua i would do like that: if not package.loaded[modname] then โฆ (with modname got from arg[0] ) |
14:48:44 | leorize[m] | though I wouldn't recommend `sorted()` unless you need a copy |
14:49:20 | leorize[m] | Oddmonger: `when isMainModule: test()`? |
14:49:28 | xace | leorize[m]: my only requirement is that i can "reformat". if you have a better suggestion than sorted i'd be happy yo switch |
14:50:17 | Oddmonger | really, isMainModule exists ?! Whoo, thank you leorize[m] ! |
14:51:08 | leorize[m] | xace: wdym by "reformat"? |
14:51:23 | Oddmonger | i was searching in nim pragmas something like ยซ {.isMain.} ยป |
14:51:45 | leorize[m] | xace: `sort()` is the mutable variant of `sorted()` that works directly on the buffer, which will save you some allocations |
14:52:20 | * | j quit (Quit: K-Lined) |
14:52:41 | * | j joined #nim |
14:53:29 | xace | leorize[m]: from what i can tell `sort()` doesnt allow my to pass on my own comparison function. I need my comparisong function to run formatTime() on the input paramters |
14:53:45 | leorize[m] | you need to transform the array? |
14:54:11 | xace | leorize[m]: well only for the comparison, but then i need the data back in its current form |
14:54:47 | leorize[m] | https://nim-lang.org/docs/algorithm.html#sort%2CopenArray%5BT%5D%2Cproc%28T%2CT%29 <- it does take a proc |
14:55:13 | * | jess quit (Quit: K-Lined) |
14:55:41 | xace | jesus, ive been browsing that page for a while and still didnt run into that variant for sort |
15:19:00 | ForumUpdaterBot | New thread by SebastianM: How to embed objects in another objects, see https://forum.nim-lang.org/t/7584 |
15:54:22 | * | xet7 joined #nim |
16:06:19 | * | asdflkj joined #nim |
16:07:00 | * | asdflkj quit (Client Quit) |
16:19:36 | m4r35n357 | Any devs around? I have spt |
16:19:41 | m4r35n357 | yuk! |
16:20:20 | m4r35n357 | I have spotted what _looks like_ a compiler "oddity". Not sure if it is a bug or feature. |
16:21:39 | leorize[m] | what did you find? |
16:21:46 | m4r35n357 | I have a function that was (mistakenly on my part) being called from a module I imported (I have now moved it). |
16:22:36 | m4r35n357 | Not only should it not have been in scope (AFAICT), but it overrode a local "let" variable of the same name |
16:23:26 | leorize[m] | can you create a reproducible sample? |
16:23:27 | m4r35n357 | The diff I made is at https://github.com/m4r35n357/ODE-Playground/commit/8f0d6e4f970ef2716f1b3dbcb2dfb4e36ef0943d |
16:23:49 | m4r35n357 | you should be able to expand it to see the module function and the "let" variable |
16:24:09 | m4r35n357 | expand symplectic.nim |
16:24:31 | m4r35n357 | is that useful? |
16:24:44 | * | abm joined #nim |
16:25:25 | leorize[m] | so what's the issue? |
16:25:26 | m4r35n357 | I moved a call to a function h(...) from symplectic.nim to h_newton.nim, where it belongs |
16:25:41 | m4r35n357 | how was the function called previously? |
16:26:06 | m4r35n357 | It is not defined in symplectic.nim, and in any case it has no asterisk appended |
16:26:22 | m4r35n357 | and it overrides a local float with the same name |
16:26:26 | leorize[m] | generic binding I believe |
16:26:56 | m4r35n357 | shouldn't the compiler have noticed the name clash? |
16:27:22 | leorize[m] | overloading triggered on this one |
16:27:38 | leorize[m] | it's quite normal |
16:27:43 | m4r35n357 | BTW I am not an expert and "generic binding" is something I would have to look up |
16:27:59 | m4r35n357 | so you can nuke local variables with impunity? |
16:28:41 | leorize[m] | !eval var a = 0; proc a(i: int): int = a; echo a(10); echo a |
16:28:42 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: redefinition of 'a'; previous declaration here: /usercode/in.nim(1, 5) |
16:28:54 | leorize[m] | hmm |
16:30:22 | leorize[m] | !eval var a = 0; proc a(i: int): int = i; echo a(10); echo a |
16:30:23 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: redefinition of 'a'; previous declaration here: /usercode/in.nim(1, 5) |
16:31:19 | leorize[m] | m4r35n357: the term is known as `mixin` in Nim's manual |
16:32:03 | m4r35n357 | OK so it is a feature ;) Dangerous in the wrong hands (mine!) |
16:32:05 | FromDiscord | <Yardanico> Oh leorize this is a common gotcha with the eval |
16:32:45 | FromDiscord | <Yardanico> Ah I thought you wanted a proc |
16:33:06 | FromDiscord | <Yardanico> !eval var a = 0; let b = proc(i: int): int = (i); echo b(10); echo a |
16:33:08 | NimBot | Compile failed: /usercode/in.nim(1, 41) Error: expression 'i' is of type 'int' and has to be used (or discarded) |
16:33:41 | leorize[m] | I guess it didn't error in a generic due to template instantiation |
16:33:46 | FromDiscord | <Yardanico> !eval var a = 0; let b = proc(i: int): int = (result = i); echo b(10); echo a |
16:33:48 | NimBot | Compile failed: /usercode/in.nim(1, 59) Error: undeclared identifier: 'b' |
16:34:51 | m4r35n357 | leorize[m], the function is not anything generic AFAICT, it is very literal. The only generic thing is one parameter, p |
16:35:22 | m4r35n357 | p is a tuple |
16:36:00 | * | Gustavo6046 joined #nim |
16:36:09 | FromDiscord | <Yardanico> That makes it a generic :) |
16:36:13 | leorize[m] | it's not your function, it's about how generics is done in the compiler |
16:36:35 | m4r35n357 | Dunno if this helps, but the local variable "h" is used correctly, despite sharing a name with the function |
16:36:40 | leorize[m] | I think generics still largely share the instantiation code with templates |
16:36:43 | * | xet7 quit (Remote host closed the connection) |
16:37:05 | m4r35n357 | The code was 100% working before and after my "fix" |
16:38:16 | leorize[m] | which makes the `h` variable binds locally (gensym-ed), but `h` in a "function call" state become a mixin-able symbol |
16:40:18 | m4r35n357 | The main issue from my POV is that it seems to break encapsulation (client code "leaking" into called module code). Am I just repeating myself now? ;) |
16:40:54 | leorize[m] | see `bind` in the manual |
16:40:58 | m4r35n357 | OK |
16:41:16 | leorize[m] | which has the property of forced binding at the referenced scope |
16:41:52 | leorize[m] | you shouldn't need it most of the time though |
16:43:55 | m4r35n357 | Well I certainly didn't need it here ;) |
16:48:35 | m4r35n357 | I think that means that I don't have to use any parameters at all to call "outer level" functions, like f() from within a called module |
16:48:56 | m4r35n357 | which will certainly shorten the parameter list for solve() |
16:50:05 | leorize[m] | yes, though concepts is intended to be the type checked variant for this |
16:50:13 | m4r35n357 | the fact that this behaviour seems to be triggered by making an unrelated parameter generic is even more confusing to me |
16:51:08 | m4r35n357 | but going back to the non-generic version to check is not going to help, because it was all in one file at the time |
16:51:14 | leorize[m] | in a way it can be classified รก a bug :p |
16:51:22 | leorize[m] | as* |
16:52:17 | m4r35n357 | leorize[m], OK well since I don't fully understand the issue and have fixed it anyway, I'd better leave it now, thanks for looking at this for me |
16:56:02 | m4r35n357 | OK I just tested one thing, I made a 0-parameter function test() in my calling code, and the compiler says it is undefined in symplectic. So h() is "special" somehow? |
17:00:36 | * | himu joined #nim |
17:13:23 | leorize[m] | yes, since it was referencing the generic parameter |
17:23:46 | m4r35n357 | leorize[m], ah OK, I see |
17:24:49 | * | waleee-cl joined #nim |
17:31:43 | FromDiscord | <zidsal> I'm trying to generate a `$` proc for the types I generated with a macro. When I echo result.repr the returned result is valid nim code however when I run it I getโต` Error: illformed AST: v: races` is there an easy way to debug this? |
17:33:19 | * | xet7 joined #nim |
17:36:37 | leorize[m] | use treeRepr |
17:37:33 | leorize[m] | post your tree somewhere and I can help taking a look at it |
17:44:13 | FromDiscord | <zidsal> @leorize https://pastebin.com/SUVTTHH5 I've made a super stripped down version I'm going make the nim code by hand and see what dumpTree looks like |
17:47:10 | leorize[m] | params has to be a list of identdefs |
17:52:34 | * | xet7 quit (Remote host closed the connection) |
17:53:24 | * | xet7 joined #nim |
17:58:43 | * | kenran joined #nim |
17:59:17 | ForumUpdaterBot | New thread by Mrhdias: How to segment the code into different files? , see https://forum.nim-lang.org/t/7585 |
18:10:09 | FromDiscord | <zidsal> @leorize thanks that did the trick |
18:32:40 | FromDiscord | <Clyybber> @Araq https://github.com/nim-lang/Nim/pull/17277 :) |
18:42:31 | * | j is now known as jess |
18:54:02 | FromDiscord | <Quant> I am a trader at a prop trading firm. some1 msg me if you can code and want to work on some algos |
18:57:04 | FromDiscord | <Recruit_main707> @Quant you may wanna create a forum thread, it will be easier to keep in contact and find people |
19:16:20 | * | vicfred joined #nim |
19:25:22 | * | himu quit (Quit: Konversation terminated!) |
19:25:48 | * | Perkol joined #nim |
19:30:37 | * | muffindrake joined #nim |
19:41:29 | * | kenran quit (Remote host closed the connection) |
19:41:44 | * | maier joined #nim |
19:45:17 | FromDiscord | <Recruit_main707> he left :( |
19:48:01 | FromDiscord | <Unaimend> So if I want that people get the latest version of my package I always have to create a new git tag and update my nimble file? |
19:48:45 | FromDiscord | <Unaimend> Would't that mean that I end up with tag numbers in the hundreds or am I missing sth? |
19:49:09 | FromDiscord | <Rika> That's what most software does I believe |
19:49:23 | FromDiscord | <Rika> Not abnormal to have hundreds of tags I think |
19:54:38 | FromGitter | <deech> How do I debug a macro that expands to an ill-typed AST? `expandMacros` doesn't work. |
19:55:05 | leorize[m] | add an echo result at the end? :p |
19:55:22 | FromGitter | <deech> In the macro? |
19:55:26 | leorize[m] | yea |
19:55:28 | FromDiscord | <konsumlamm> In reply to @Unaimend "Would't that mean that": just don't create a new tag for every small change ยฏ\_(ใ)_/ยฏ |
19:55:53 | FromDiscord | <Unaimend> but then people would get an old version wouldnt they? |
19:56:17 | leorize[m] | @Unaimend what's the issue with hundreds of tags? |
19:56:34 | FromDiscord | <konsumlamm> In reply to @Unaimend "but then people would": can't they wait for the enxt update? |
19:56:40 | leorize[m] | it's not like they take up space or anything |
19:56:50 | FromDiscord | <Yardanico> yeah, tags are just named commits aren't they |
19:56:57 | FromDiscord | <konsumlamm> i'm just saying you don't need to make a new release for every commit or something like that |
19:57:08 | leorize[m] | you absolutely can :p |
19:57:22 | leorize[m] | see any of disruptek's software |
19:57:35 | FromDiscord | <Unaimend> In reply to @konsumlamm "i'm just saying you": Yeah sure, but especially at the beginning most of my changes are breaking changes ๐ |
19:57:56 | leorize[m] | just go wild while you're not 1.0 yet |
19:57:58 | FromGitter | <deech> leorize, that worked. |
19:58:08 | FromDiscord | <konsumlamm> people can always use the github HEAD too, if they want the latest version |
19:58:17 | leorize[m] | never use that |
19:58:28 | FromDiscord | <Unaimend> In reply to @leorize "never use that": why not ? |
19:58:43 | leorize[m] | nimble don't understand that and you'll always get the outdated version while developing |
19:59:11 | FromDiscord | <konsumlamm> ๐ค |
19:59:19 | FromDiscord | <konsumlamm> RIP |
19:59:25 | leorize[m] | so nimble fetch this HEAD once, cache it |
19:59:38 | FromDiscord | <konsumlamm> sounds like a bug that should be fixed |
19:59:49 | leorize[m] | then never updates it |
20:01:43 | FromDiscord | <Unaimend> In reply to @konsumlamm "sounds like a bug": Yeah, I would agree |
20:02:27 | leorize[m] | it's simply impossible given the way nimble "installs" stuff rn |
20:02:56 | leorize[m] | you can of course use the much better nimph :p |
20:13:21 | FromDiscord | <Unaimend> so we have to package managers now? |
20:13:39 | FromDiscord | <Unaimend> if nimph is just better why are not officially using this one? |
20:14:20 | FromDiscord | <gcao> sent a code paste, see https://paste.rs/sFm |
20:14:33 | FromDiscord | <gcao> (edit) "https://play.nim-lang.org/#ix=2RVG" => "https://paste.rs/FVj" |
20:15:15 | leorize[m] | nim has that feature actually |
20:15:38 | FromDiscord | <gcao> really? let me compile and run it |
20:16:13 | leorize[m] | @Unaimend it never got the promotion it deserves: https://github.com/disruptek/nimph |
20:16:23 | leorize[m] | and ofc it doesn't help that it's creator is now banned |
20:16:35 | leorize[m] | @gcao well the syntax is a bit different, wait a bit |
20:16:52 | FromDiscord | <Unaimend> disruptek is banned? |
20:17:11 | FromDiscord | <Unaimend> This is the second guy from which I heard that he was banned |
20:17:21 | * | maier quit (Ping timeout: 264 seconds) |
20:17:44 | FromDiscord | <Unaimend> In reply to @leorize "<@287576619718279178> it never got": Do you know why he was banned? |
20:18:42 | FromDiscord | <Unaimend> In reply to @leorize "<@287576619718279178> it never got": Cant tag you in oftopic, so do you know why he was banned? |
20:19:10 | leorize[m] | personal insults at dom96 on Nim's public channels |
20:19:20 | FromGitter | <ynfle> @gcao https://play.nim-lang.org/#ix=2RVO |
20:19:24 | FromDiscord | <Unaimend> ahh ok, seems reasonable |
20:19:39 | * | lritter joined #nim |
20:21:17 | leorize[m] | @gcao https://play.nim-lang.org/#ix=2RVQ |
20:21:45 | leorize[m] | you can do it like ynfle if you want to cast from a pointer or smt |
20:22:23 | FromDiscord | <gcao> @yanfa @leorize thank you. that's great. I should be able to improve my code with this new knowledge ๐ |
20:23:49 | FromDiscord | <Unaimend> is there anyway to incorporate git hub wiki and nim docs? |
20:24:05 | FromDiscord | <Unaimend> (edit) "is there anyway to incorporate git hub wiki and nim docs? ... " added "i.e how do you guys document your packages" |
20:24:30 | * | Perkol quit (Remote host closed the connection) |
20:24:52 | leorize[m] | I generate docs into github pages |
20:25:31 | leorize[m] | https://alaviss.github.io/nim-sys/ <- something like that |
20:26:12 | leorize[m] | https://github.com/alaviss/nim-sys/blob/master/.github/workflows/ci.yml#L76 <- here's the automation if you're interested |
20:26:16 | FromDiscord | <Unaimend> In reply to @leorize "https://alaviss.github.io/nim-sys/ <- something lik": But this is really fcking ugly |
20:27:01 | leorize[m] | you can write your own css and stuff |
20:27:09 | FromDiscord | <Unaimend> But I will still do it this way I think and then just add wiki pages for more elaborate example |
20:27:11 | leorize[m] | I'm lazy so I just use the default styles |
20:28:38 | liblq-dev | "ugly" doesn't necessarily have to refer to layout. |
20:28:42 | liblq-dev | er, styling. |
20:28:46 | FromDiscord | <Unaimend> We should probably standardize so stuff ASAP, if not we will probably have 100 different solutions by NIM 2.0 |
20:28:56 | FromDiscord | <Yardanico> AAAAAAAAAAAAAAAAAAAAAA |
20:28:57 | leorize[m] | you can also inquiry @haxscramper for his docgen once it's done, which IIRC should be more flexible and can help you produce markdown |
20:28:58 | FromDiscord | <Yardanico> WHY NIM |
20:28:59 | liblq-dev | i'm pretty sure they're referring to the fact that theindex.html blows. |
20:28:59 | FromDiscord | <Yardanico> NIM |
20:29:02 | FromDiscord | <Yardanico> NEW INDENTED MODULA |
20:29:03 | FromDiscord | <Yardanico> AAAAAAAAAAAAAAAAAA |
20:29:16 | liblq-dev | yard are you ok |
20:29:24 | liblq-dev | should i call an ambulance |
20:29:25 | FromDiscord | <Unaimend> I think there activated a trigger ๐ |
20:29:28 | FromDiscord | <Yardanico> why do people scream NIM |
20:29:30 | FromDiscord | <Yardanico> NIIIIIIIIIIIIIIIIIIM |
20:29:31 | leorize[m] | @Unaimend you can't standardize when all of them sucks :p |
20:29:58 | liblq-dev | ah some people are just like that |
20:30:00 | liblq-dev | i see people writing LUA all over the place |
20:30:05 | FromDiscord | <Yardanico> but why |
20:30:08 | FromDiscord | <Yardanico> they don't write PYTHON do they |
20:30:13 | FromDiscord | <Yardanico> JAVASCRIPTY |
20:30:14 | FromDiscord | <Yardanico> (edit) "JAVASCRIPTY" => "JAVASCRIPT" |
20:30:15 | FromDiscord | <Unaimend> nim deserves to be screamed so everybody knows about it |
20:30:21 | FromDiscord | <Unaimend> maybe i am from the COBOL age |
20:31:15 | liblq-dev | let's scream RUST and GO too |
20:31:22 | liblq-dev | let's do that to every single language out there |
20:31:27 | liblq-dev | even ENGLISH |
20:31:53 | leorize[m] | go's logo is GO so it seems appropriate |
20:31:58 | FromDiscord | <dom96> That is actually a good question |
20:32:05 | FromDiscord | <dom96> I often wonder why people write NIM |
20:32:20 | FromDiscord | <dom96> Guess because acronyms are typically 3 letters? |
20:33:08 | leorize[m] | maybe because it doesn't map into any commonly known english word so they thought it's an acronym? |
20:33:10 | FromDiscord | <Unaimend> I have actually now idea why mind wanted to press shift there |
20:34:06 | FromDiscord | <Unaimend> My is was like "My mind is telling me no, but my body, my body is telling me PRESS SHIFT" |
20:34:12 | FromDiscord | <Unaimend> (edit) "is" => "it" |
20:35:01 | FromDiscord | <Unaimend> In reply to @leorize "<@287576619718279178> you can't standardize": welcome to my live as a bioinformatician |
20:35:42 | FromDiscord | <Unaimend> we everything is "standardized" by consensus |
20:35:57 | FromDiscord | <Yardanico> that's better than nothing :P |
20:36:00 | FromDiscord | <Unaimend> (edit) "we" => "where" |
20:36:14 | leorize[m] | that's how it is done everywhere I believe |
20:37:08 | FromDiscord | <Unaimend> We cant have to much standards if we have no standards at all https://media.discordapp.net/attachments/371759389889003532/817858349659848754/4a5001b7beea096457f480c8808572428b-09-roll-safe.png |
20:37:53 | FromDiscord | <Unaimend> (edit) "much" => "many" |
20:38:44 | FromDiscord | <Unaimend> What would also be nice if my documentation could would actually be checked for errors automatically |
20:39:14 | FromDiscord | <Unaimend> (edit) "could" => "code" |
20:39:39 | leorize[m] | runnableExamples? |
20:40:23 | FromDiscord | <Yardanico> yep that exists |
20:41:04 | FromDiscord | <Unaimend> In reply to @Yardanico "yep that exists": So I probably should read the nim doc page |
20:44:10 | FromDiscord | <Unaimend> In reply to @leorize "runnableExamples?": is this documented somewhere? |
20:44:53 | leorize[m] | I'm not sure |
20:45:00 | FromDiscord | <konsumlamm> https://nim-lang.github.io/Nim/system.html#runnableExamples%2Cstring%2Cuntyped |
20:45:23 | * | maier joined #nim |
20:45:36 | leorize[m] | Nim has a documentation organization issue |
20:46:27 | FromDiscord | <Unaimend> Shouldnt this be mentioned in the Doc Gen Toolguide โตhttps://nim-lang.org/docs/docgen.html |
20:49:19 | FromDiscord | <Unaimend> so not sure if this a good idea, but could I use includ to put each runnableExample in its own file . So my proc heads dont get cluttered with documentation? |
20:49:58 | * | maier quit (Ping timeout: 260 seconds) |
20:50:45 | leorize[m] | then you'll have to use yet another poorly documented feature which i would not recommend |
20:51:09 | FromDiscord | <konsumlamm> In reply to @Unaimend "Shouldnt this be mentioned": ye, probably |
20:52:00 | FromDiscord | <Unaimend> In reply to @leorize "then you'll have to": ๐ |
20:52:03 | FromDiscord | <konsumlamm> In reply to @Unaimend "so not sure if": you mean one file per proc? that doesn't sound like a scalable approach |
20:52:14 | FromDiscord | <Unaimend> In reply to @konsumlamm "you mean one file": yeah, thats true |
20:52:45 | leorize[m] | it's doable if you write it in reStructuredText |
20:53:18 | FromDiscord | <Unaimend> In reply to @leorize "it's doable if you": does this work with runnableExample? |
20:53:51 | leorize[m] | no, you need a special feature in Nim's code blocks directive |
20:54:32 | FromDiscord | <konsumlamm> your examples shouldn't be too big anyway, so i don't really see the problem |
20:55:44 | FromDiscord | <Unaimend> Yeah but it adds up and makes the file navigation a little bit more annoying I suppose. |
20:56:57 | leorize[m] | you need a text editor with folding support I guess |
20:57:06 | FromDiscord | <Unaimend> So would anybody be interested in writing a tutorial on how to properly document nim code and maybe also integrate it into git, I could do it alone but then it surely would take longer |
20:57:18 | FromDiscord | <Unaimend> In reply to @leorize "you need a text": I totally forgot that I have those things |
20:57:39 | FromDiscord | <Unaimend> Even added my nvim config so folding levels are saved |
20:57:46 | FromDiscord | <Unaimend> (edit) "added" => "edited" |
21:01:15 | FromDiscord | <konsumlamm> In reply to @Unaimend "So would anybody be": what does that have to do with git? |
21:01:37 | FromDiscord | <Unaimend> I mean the git workflow for automatic generating github pages documenation for packages |
21:02:05 | FromDiscord | <konsumlamm> ah, that's a nice idea |
21:03:05 | FromDiscord | <Unaimend> But I have never worked on all those things so I could use a little help |
21:03:48 | * | ^Q-Master^ joined #nim |
21:04:11 | * | Q-Master quit (Read error: Connection reset by peer) |
21:05:17 | * | NimBot joined #nim |
21:22:02 | * | xet7 quit (Remote host closed the connection) |
21:46:20 | * | maier joined #nim |
21:50:44 | * | maier quit (Ping timeout: 260 seconds) |
22:29:27 | FromDiscord | <Hi02Hi> What happened to nimble.directory ? Im getting a 502 |
22:31:26 | FromDiscord | <Yardanico> works fine for me |
22:32:06 | FromDiscord | <Yardanico> it's an unofficial (or semi-official) website though, you might want to ask federico3 if you have problems with it (he made it and hosts it) |
22:33:00 | federico3 | Hi02Hi: 502 on a specific page? |
22:33:30 | FromDiscord | <Hi02Hi> wierd, its working now |
22:34:27 | FromDiscord | <Hi02Hi> it was the main page before |
22:36:32 | federico3 | aha it restarted 11 mins ago |
22:53:06 | FromDiscord | <ajusa> Anyone know what I'm doing wrong here? First time using async/await in Nim: https://play.nim-lang.org/#ix=2RWO |
22:55:37 | FromDiscord | <Solitude> await works only in {.async.} procedures |
22:55:38 | FromDiscord | <Solitude> https://nim-lang.org/docs/asyncnet.html#examples-chat-server |
22:55:48 | FromDiscord | <Solitude> https://nim-lang.org/docs/asyncdispatch.html |
22:58:40 | FromDiscord | <ajusa> Cool, thanks! I wrapped everything in a `main` proc, and called waitFor on it which should be what I need! |
22:59:01 | FromDiscord | <queersorceress> is there an existing package or module that implements a worker thread as a queue that i can perform inter-thread communication with? i'm not 100% clear if that fits inside of nim's threading model or not, as the docs don't really click with me. it looks like the `taskqueue` and `threadproxy` packages might do what i'm looking for, but it doesn't seem all that clear to me. |
23:01:53 | FromDiscord | <queersorceress> this is slightly complicated as i'm working in an environment where i don't control the threads i'm on, so i need to dispatch work to a single worker thread to safely perform certain types of operations (like file i/o) while i wait for the results, using a queue seems like the easiest way but i'm not sure i see any existing solutions -- as i really don't want to implement this myself. |
23:09:37 | * | maier joined #nim |
23:13:00 | * | maier quit (Client Quit) |
23:13:56 | * | robertmeta quit (Ping timeout: 240 seconds) |
23:13:56 | * | sirn quit (Ping timeout: 240 seconds) |
23:16:00 | * | robertmeta joined #nim |
23:16:06 | * | sirn joined #nim |
23:16:38 | * | vicfred quit (Quit: Leaving) |
23:33:40 | Prestige | Has anyone tried making a treesitter grammar for Nim? I'm not see anything, at least |
23:41:05 | * | tane quit (Quit: Leaving) |
23:48:33 | FromDiscord | <Unaimend> So what is the recommend nim ui framework at the moment? |
23:49:04 | FromDiscord | <konsumlamm> bold of you to assume there is one /s |
23:53:18 | FromDiscord | <Unaimend> In reply to @konsumlamm "bold of you to": So I plan on writing a program to draw graphs(as defined in graph theory, not real analysis) |
23:54:30 | FromDiscord | <konsumlamm> son't ask me, idk shit about ui frameworks |
23:54:34 | FromDiscord | <konsumlamm> don't |
23:54:38 | * | vicfred joined #nim |
23:54:41 | FromDiscord | <Unaimend> As far as is see there is fidget, nim-lang/ui or NiGui |
23:54:54 | FromDiscord | <Unaimend> but nim-lang/ui did not see any love for quite some time |
23:55:07 | Prestige | There are qt and gtk bindings |
23:57:22 | FromDiscord | <ElegantBeef> You also have plotting programs |
23:57:23 | FromDiscord | <ajusa> fidget is undergoing a v2 rewrite afaik, so you might want to wait on that (not sure if it has already started).โตI've tried NiGui, and I liked it. It would probably be good for simpler GUI apps. If you want to make something that is super cross platform, then the qt bindings are pretty good |
23:57:26 | FromDiscord | <ElegantBeef> libraries |
23:57:56 | * | Jjp137 quit (Ping timeout: 240 seconds) |
23:57:58 | FromDiscord | <ElegantBeef> Ah i fell for the first use of the word graphs ๐ |