<<06-03-2021>>

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:13saemHi folks.
00:54:38FromDiscord<ElegantBeef> Yellow
00:54:55FromDiscord<Yardanico> fellow
00:55:06FromDiscord<ElegantBeef> nimion
00:55:27FromDiscord<Yardanico> #FFC200
00:55:40saemIn 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:51FromDiscord<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:07FromDiscord<Yardanico> I couldn't actually run it
00:57:07FromDiscord<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:22FromDiscord<ElegantBeef> On linux?
00:57:36FromDiscord<ElegantBeef> Oh
00:57:39FromDiscord<ElegantBeef> Devel issue with nico
00:57:39FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2RPJ
00:57:43FromDiscord<Yardanico> classical
00:58:17FromDiscord<Yardanico> maybe
00:58:55FromDiscord<ElegantBeef> On my cpu i get > 150fps or around .005ms
00:58:58FromDiscord<Yardanico> is there any workaround?
00:59:03FromDiscord<ElegantBeef> Move to stable
00:59:14FromDiscord<Yardanico> anything other than that? :D
00:59:25FromDiscord<ElegantBeef> Devel caused the sdl2 inputs to completely break
00:59:31FromDiscord<Yardanico> and did you (I mean you and other nico people) figure out the commit?
00:59:31FromDiscord<ElegantBeef> I suppose i could ship a binary
00:59:33FromDiscord<Yardanico> that broke it
00:59:54FromDiscord<ElegantBeef> Well it seems like it's a commit related to enum/collisions
01:00:19FromDiscord<Yardanico> well if no one checks we'll get a stable release with broken nico :P
01:00:34FromDiscord<ElegantBeef> I did make an issue for impbox
01:00:43FromDiscord<ElegantBeef> But yea i'll take a whirl at finding it
01:02:06*Gustavo6046 joined #nim
01:02:44FromDiscord<Yardanico> nvm I can do it myself
01:02:48FromDiscord<Yardanico> the repro is pretty easy to do
01:02:59FromDiscord<ElegantBeef> Ok
01:03:28FromDiscord<Yardanico> wonder why nico defines its own sdl scancode enum if it uses sdl2_nim ?
01:03:35FromDiscord<Yardanico> its the same enum
01:03:38FromDiscord<ElegantBeef> probably js backend
01:03:46FromDiscord<Yardanico> oh okay
01:04:06FromDiscord<ElegantBeef> Which impbox plans on axing at some point so probably will die soon 😄
01:04:18FromDiscord<Yardanico> so on 1.4.4 everything works fine?
01:04:34FromDiscord<ElegantBeef> Yep
01:04:58FromDiscord<Yardanico> time to `git bisect`
01:05:22FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817563473667686471/unknown.png
01:06:49PrestigeHm why can I not import exitprocs
01:06:58FromDiscord<Yardanico> std/exitprocs
01:06:59FromDiscord<ElegantBeef> `std`
01:07:08FromDiscord<Yardanico> newer stdlib modules only exist in the std namespace
01:07:13FromDiscord<ElegantBeef> Cmon prestige no importing system modules without `std`
01:07:16FromDiscord<Yardanico> also old ones can be improted with it too, so it's better to just start using std :)
01:07:21FromDiscord<Yardanico> (edit) "improted" => "imported"
01:07:28PrestigeShouldn't I not need to require it if it's in system?
01:07:43FromDiscord<Yardanico> it's not in system
01:07:54FromDiscord<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:00FromDiscord<ElegantBeef> Wonder if a "Hint: importing a system module without `std` is no longer suggested" would make life better
01:09:01PrestigeI 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:13FromDiscord<Yardanico> what stable?
01:09:21Prestigelatest stable
01:09:30Prestige1.4.4
01:09:35FromDiscord<ElegantBeef> !eval import std/exitprocs
01:09:37NimBot<no output>
01:09:44FromDiscord<Yardanico> 🥴
01:10:00FromDiscord<Yardanico> @ElegantBeef here's your answer
01:10:04FromDiscord<Yardanico> 979148e863c4142a00632059f3e2a57f4ab0f960
01:10:15FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/15935
01:10:16FromDiscord<ElegantBeef> !eval echo NimVersion
01:10:18NimBot1.4.4
01:10:32Prestigeweird, maybe a nimsuggest issue then. Getting errors from my editor, but it compiles
01:10:43FromDiscord<ElegantBeef> Remember the editor is not to be trusted
01:10:50FromDiscord<ElegantBeef> It's a liar attempting to backstab you
01:10:51Prestigeunfortunately..
01:11:07FromDiscord<Yardanico> maybe you have an older nimsuggest somehow?
01:11:17FromDiscord<ElegantBeef> Want to see good tooling failure open up a C# project and do `var event = 10`
01:11:18saemOr it's looking in the wrong place?
01:11:31FromDiscord<flywind> In reply to @Yardanico "979148e863c4142a00632059f3e2a57f4ab0f960": so the issue is https://github.com/nim-lang/Nim/issues/16462
01:11:37FromDiscord<Yardanico> @flywind yeah probably
01:11:41FromDiscord<Yardanico> but might be different
01:12:00FromDiscord<Yardanico> In our case the thing is that "except" in the import statement doesn't hide the type
01:12:20FromDiscord<flywind> I see
01:12:28FromDiscord<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:29FromDiscord<Yardanico> I'll comment in that issue but it might be a different bug
01:13:47PrestigeApparently I was pointing to an older version of nimlsp I was debugging, seems good now
01:14:18FromDiscord<ElegantBeef> Ah so it wasnt the toolings fault it was the tools fault 😛
01:14:24Prestige:)
01:16:54FromDiscord<Yardanico> @ElegantBeef https://github.com/nim-lang/Nim/issues/16462#issuecomment-791825468
01:19:15FromDiscord<Yardanico> anyway @ElegantBeef you lied and there's a workaround :P https://media.discordapp.net/attachments/371759389889003532/817566965874163742/unknown.png
01:19:18FromDiscord<Yardanico> time to test dusty with devel
01:19:59FromDiscord<ElegantBeef> I did lie, i said use stable 😛
01:20:46FromDiscord<ElegantBeef> Averaged fps in the top and in console a frametime is printed
01:21:03FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817567422146936852/unknown.png
01:21:04FromDiscord<Yardanico> yeah I see
01:21:13FromDiscord<ElegantBeef> Ok so works fine
01:21:16FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817567469756874774/unknown.png
01:21:20FromDiscord<ElegantBeef> What's your CPU?
01:21:25FromDiscord<Yardanico> only uses 1 core though
01:21:31FromDiscord<Yardanico> Ryzen 7 3700X
01:21:46FromDiscord<ElegantBeef> The repo is setup to make 4 threads
01:22:11FromDiscord<ElegantBeef> It has to be using all 4 for that fps
01:22:16FromDiscord<Yardanico> but the cpu usage is at ~100%
01:22:18FromDiscord<Yardanico> not 400%
01:22:53FromDiscord<Yardanico> how do I change the thread count? I see `ThreadCount` but it has some alien math :D
01:22:59FromDiscord<ElegantBeef> Chunksize
01:23:04FromDiscord<ElegantBeef> A smaller base 8 value
01:23:10FromDiscord<Yardanico> 128?
01:23:11FromDiscord<ElegantBeef> welll base 2
01:23:14FromDiscord<ElegantBeef> Yea that'd work
01:23:43FromDiscord<ElegantBeef> That all should be calculated off threadsize but was hard coding it for testing math across different chunk sizes
01:23:43FromDiscord<Yardanico> yeah that works https://media.discordapp.net/attachments/371759389889003532/817568090639695912/unknown.png
01:23:47FromDiscord<Yardanico> also the fps becomes higher the more sand I have
01:23:49FromDiscord<Yardanico> XD
01:23:53FromDiscord<ElegantBeef> It's an average
01:24:01FromDiscord<Yardanico> now cpu is loaded at 1200%
01:24:09FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817568196391337984/unknown.png
01:24:13FromDiscord<ElegantBeef> Nice
01:24:30FromDiscord<Yardanico> no key to clear? :P
01:24:33FromDiscord<ElegantBeef> enter
01:24:37FromDiscord<ElegantBeef> or c to erase
01:24:39FromDiscord<Yardanico> and in the terminal there's this https://media.discordapp.net/attachments/371759389889003532/817568325705007104/unknown.png
01:24:41FromDiscord<Yardanico> with full screen of sand
01:24:45FromDiscord<ElegantBeef> Nice
01:24:58FromDiscord<Yardanico> and with empty screen https://media.discordapp.net/attachments/371759389889003532/817568404055523328/unknown.png
01:25:01FromDiscord<Yardanico> i didn't lie when I said it's slower
01:25:14FromDiscord<ElegantBeef> That's weird
01:25:17FromDiscord<dom96> Ooh. You making a sand game?
01:25:19FromDiscord<ElegantBeef> Nah
01:25:30FromDiscord<ElegantBeef> Made a sand simulation to compete against a C++ programmer in another server 😄
01:25:48FromDiscord<Rika> petty
01:26:03FromDiscord<ElegantBeef> Nah i did it originally just for a small hour long challenge
01:26:03FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817568675657678888/unknown.png
01:26:21FromDiscord<ElegantBeef> But then i learned he multithreaded it so i had to for fun
01:27:51FromDiscord<Yardanico> lets see if it gets faster with LTO PGO and march=native 🥴
01:27:59FromDiscord<ElegantBeef> Lol
01:28:11FromDiscord<ElegantBeef> My windows build was at like 50fps on his pc so clearly something is fucked
01:28:24FromDiscord<Yardanico> his CPU?
01:28:33FromDiscord<ElegantBeef> some i9 variant
01:28:38FromDiscord<ElegantBeef> So should be higher than mine
01:29:13FromDiscord<ElegantBeef> Even with only 8 threads being used
01:29:17*wasted_youth2 joined #nim
01:29:25FromDiscord<ElegantBeef> I did also send a 64 chunk size one which should've given more perf but barely any
01:29:56FromDiscord<Yardanico> oh yeah the debug PGO'd build is damn slow xD
01:30:03FromDiscord<Yardanico> (it's needed to actually generate the profiling data)
01:30:07FromDiscord<ElegantBeef> Yep
01:30:21FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/817569760061292584/unknown.png
01:30:56FromDiscord<Yardanico> winxp vibes https://media.discordapp.net/attachments/371759389889003532/817569905385537576/unknown.png
01:31:15FromDiscord<ElegantBeef> uhh
01:31:19FromDiscord<Yardanico> also sorry for asking such a personal question, but why do you use 1-space indentation in your .nimble file? :D
01:31:33FromDiscord<ElegantBeef> That was autogenerated by impbox
01:31:36FromDiscord<Yardanico> huh
01:31:51FromDiscord<ElegantBeef> Nicoboot autogenerates a nico project
01:31:55FromDiscord<Yardanico> I know
01:32:00FromDiscord<Yardanico> didn't know it was 1-space
01:33:05FromDiscord<Yardanico> yeah the FPS really grows
01:33:15FromDiscord<Yardanico> with an empty screen its at ~160-170, with a full one - ~220-230
01:33:33FromDiscord<ElegantBeef> Doesnt make any sense
01:33:45FromDiscord<Yardanico> ¯\_(ツ)_/¯
01:33:54FromDiscord<Yardanico> both the terminal and the app show that
01:33:55FromDiscord<Yardanico> so they're not lying
01:34:11FromDiscord<ElegantBeef> Well i could be mis calculating the frametime
01:34:20FromDiscord<Rika> inb4 reversed
01:34:34FromDiscord<ElegantBeef> Well it's clearly smooth just a question of how smooth 😛
01:34:54FromDiscord<Yardanico> smooth enough with my 16 threads :P
01:34:59FromDiscord<Yardanico> but I wouldn't want to see it run on a 2-core CPU
01:35:44FromDiscord<ElegantBeef> A 2 core cpu wouldnt even work with this algorithim
01:35:50FromDiscord<Yardanico> why?
01:36:12FromDiscord<ElegantBeef> Well it'd work but it wouldnt be ideal
01:36:15FromDiscord<Yardanico> yes
01:36:23FromDiscord<Yardanico> time to spend some time with powder toy
01:36:55FromDiscord<ElegantBeef> Basically you want threads equal to 1/4 the count of chunks
01:37:23FromDiscord<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:07FromDiscord<ElegantBeef> Which is why thread count has that funky formula
01:41:47FromDiscord<ElegantBeef> Really i should use `cpuinfo` to get the perfect number of threads on startup
01:42:34FromDiscord<Yardanico> nonon
01:42:51FromDiscord<ElegantBeef> yesyesye
01:42:53FromDiscord<Yardanico> @ElegantBeef https://nim-lang.org/docs/osproc.html#countProcessors
01:43:05FromDiscord<Yardanico> ah right
01:43:09FromDiscord<Yardanico> cpuinfo is a module anyway
01:43:18FromDiscord<ElegantBeef> Yes that's what i meant
01:43:27FromDiscord<Yardanico> but does it return number of cores or threads?
01:43:36FromDiscord<ElegantBeef> well what you linked internally calls it
01:43:55FromDiscord<Yardanico> yes I just mean if the behaviour is the same across OSes
01:44:03FromDiscord<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:32FromDiscord<ElegantBeef> It seems like it's properly implemented
01:44:35*njoseph joined #nim
01:44:47FromDiscord<Yardanico> that's unheard of!
01:44:48FromDiscord<Yardanico> /s
01:45:17FromDiscord<Yardanico> what are hpux and irix :D https://media.discordapp.net/attachments/371759389889003532/817573516420841482/unknown.png
01:45:27FromDiscord<ElegantBeef> i dont even know those unix impls 😛
01:45:31FromDiscord<Yardanico> ah, HP-UX and SGI IRIX
01:45:39FromDiscord<Yardanico> https://en.wikipedia.org/wiki/IRIX final release in 2006
01:46:18FromDiscord<Yardanico> that code was added 7 years ago https://media.discordapp.net/attachments/371759389889003532/817573772554534912/unknown.png
01:56:34leorize[m]does nim even accept hp-ux as a target?
01:57:41FromDiscord<Yardanico> that's the only define for hpux that exists in the code base :D
01:58:30FromDiscord<Yardanico> it's not even in the OsPlatform list https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L40
02:09:48FromDiscord<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:31FromDiscord<fenrave> are there any plans for threads:on to be the default
02:41:36leorize[m]yes, but it's deterred until orc is stabilized I think
02:42:10leorize[m]we will probably want Isolated[T] to be finalized also
02:46:30FromDiscord<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:35leorize[m]are you on windows?
02:50:39FromDiscord<impbox> yep
02:51:08leorize[m]there's no way out, sadly
02:52:30leorize[m]what nim version are you using?
02:52:41FromDiscord<impbox> ahh i can specify emcc.bat and it'll use that
02:52:56FromDiscord<impbox> 1.4.0
02:53:31*krux02 quit (Remote host closed the connection)
02:53:35leorize[m]sure .bat works
03:02:23*theelous3 quit (Read error: Connection reset by peer)
03:15:02FromDiscord<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:21FromDiscord<impbox> not sure where to find documentation for what's possible with these nims files if any exists
03:17:18leorize[m]wouldn't `-o` be passed by Nim?
03:18:19leorize[m]and there's std/compilesettings too if you need to get the value
03:20:34FromDiscord<impbox> hmm maybe. i'll try thanks
03:21:20FromDiscord<impbox> yes it does, thanks =)
03:32:35FromDiscord<impbox> hmm can you use a nimscript as nim.cfg?
03:33:24FromDiscord<impbox> for a whole directory rather than a single nim file
03:33:45leorize[m]config.nims is what you're looking for
03:34:05FromDiscord<impbox> ahh thank you
03:34:19FromDiscord<impbox> i had a feeling it existed
03:34:38FromDiscord<impbox> i feel like it should probably be documented in https://nim-lang.org/docs/nimc.html
03:36:34FromDiscord<exelotl> I think `projectName()` is what you're looking for r.e. getting the name of the main file
03:36:38FromDiscord<exelotl> https://nim-lang.org/docs/nimscript.html#projectName
03:37:07FromDiscord<impbox> @exelotl hmm perhaps, though i'm not sure what is considered to be a "project"
03:37:51FromDiscord<exelotl> I'm pretty sure it is just the "foo" in "nim c foo.nim"
03:38:50FromDiscord<impbox> @exelotl yep, you're correct
03:39:25FromDiscord<impbox> that works nicely, thanks
03:41:17FromDiscord<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:44xaceproc foobar(): int = (_, result) = execCmdEx(...) # undecleared identifier '_' -- is there no way i can get it work like this?
11:14:27liblq-devyou can do `result = execCmdEx(…)[0]`
11:14:29liblq-dever, `[1]`
11:15:32xaceah, thats right, tyo
11:15:36m4r35n357OK, 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:56m4r35n357general method
11:16:22m4r35n357hoep that make some sense
11:20:24FromDiscord<Clyybber> @timotheecour Hey, you there?
11:29:27*maier joined #nim
11:42:11liblq-devm4r35n357: 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:06m4r35n357liblq-dev, the docslook a bit opaque to my inexperienced eyes, but I'll have a go . . . cheers
11:52:31liblq-devbasically it allows you to use any arbitrary type as a special kind of parameter to a procedure, another type, etc
11:52:41liblq-devit's similar to C++ templates although much simpler in execution
11:52:53m4r35n357hmm, everything I have tried, including putting [T] in declaration and formal parameter, leads to "Error: undeclared identifier: 'Parameters'"
11:53:35liblq-devcan you show me the code?
11:53:39m4r35n357liblq-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:51m4r35n357liblq-dev, I can, let me think how to present it
11:54:16liblq-devalr i'm here to help
11:56:04m4r35n357I think it might take a couple of stages, first here is everything in one file: https://pastebin.com/YbVUfm1S
11:57:09liblq-devok, so what do you need to generic-ize here?
11:57:30m4r35n357the 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:50m4r35n357the physical model is h(), uq(), up() plot()
11:57:57m4r35n357and the parameters, of course
11:58:45m4r35n357I 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:46liblq-devyeah, is there anything that prevents you from putting the solve proc in a separate file and importing it?
11:59:25liblq-devgenerally i'd split the code into 3 modules if you need that – physical_model.nim, integrator.nim, main.nim
11:59:29m4r35n357the solve method is general code that needs to be called from arbitrary models
11:59:45m4r35n357so it can't know anything about the nature of the parameters
12:00:24m4r35n357the solve in c is here: https://github.com/m4r35n357/ODE-Playground/blob/dual/dual.c
12:00:47m4r35n357and the model is here: https://github.com/m4r35n357/ODE-Playground/blob/dual/h-newton.c
12:01:06m4r35n357that is probably the best way to describe what I am trying to achieve
12:01:32FromDiscord<Rika> inb4 concepts time
12:01:34m4r35n357it is what a typical integrator package needs to do to support user-defined models
12:01:37liblq-devso you want Parameters to be any arbitrary user-supplied type?
12:01:49m4r35n357yep ;)
12:02:20liblq-dev`proc solve*[T](args: seq[string], p: var T, uq, up, output: proc(p: var T, _: float))`
12:02:26m4r35n357in c I use a void pointer in solve(), and cast back in the client (model) code
12:02:51liblq-devi 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:01liblq-devbut that's the general idea
12:03:17m4r35n357liblq-dev, OK cheers, I need to use my brain now ;)
12:03:21liblq-devthen you can pass any arbitrary type to the `p` parameter