<< 19-04-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:00:41*junland joined #nim
00:03:06*Jesin quit (Quit: Leaving)
00:07:35*Jesin joined #nim
00:10:50skrylar[m]i saw this came out recently https://haxe.org/blog/shirogames-stack/ and gave me a few minutes of pause
00:20:11FromDiscord<KingDarBoja> WHAT
00:20:13FromDiscord<KingDarBoja> DUDE
00:20:30FromDiscord<KingDarBoja> I remember I was trying to mod one of Shiro Games
00:20:50FromDiscord<KingDarBoja> But then devs said it wasn't allowed on some QA I think
00:20:56FromDiscord<KingDarBoja> I know some dude is still modding that
00:23:23*FromDiscord <KingDarBoja> For instance our 3D game Northgard requires less than 500 MB of memory to run.
00:24:14FromDiscord<KingDarBoja> I don't remember how much memory it was, need to check that again
00:27:02*theelous3 joined #nim
00:28:23FromDiscord<KingDarBoja> I have to admit, that was a great article to read
00:38:14skrylar[m]yea it made me reconsider haxe since i saw a youtube about the article, looked around a little bit. i've been doing the low level gles2 stuff in nim and kind of sighed since on the haxe side that's pretty much already done
00:38:35*NimBot joined #nim
00:39:53skrylar[m]some of its not super hard. i have a very basic little meshing module that lets me just pop out quads and it builds the vertex tables in the background
00:40:13FromGitter<zetashift> Yeah Haxe is great
00:40:22FromGitter<zetashift> but their docs are even worse than Nim lol
00:40:34skrylar[m]haxe is also not self hosted which is what made me go meh
00:40:51FromGitter<zetashift> iirc they were/are working on an OCaml -> Haxe part
00:40:55FromGitter<zetashift> so it becomes self hosted
00:41:20skrylar[m]i looked around and all i found was a 2014 thread of people asking why it was still ocaml and were told because the devs like it that way
00:41:25skrylar[m]but
00:41:42skrylar[m]haxe also has a lot of things i don't miss like capitalization and objects owning their procs
00:42:37FromDiscord<KingDarBoja> What is self hosted in this case?
00:42:50skrylar[m]compiler written in itself
00:42:50FromDiscord<KingDarBoja> Also not sure what you doing skrylar, sorry, newbie here
00:43:01FromDiscord<KingDarBoja> Oh
00:43:10FromGitter<zetashift> 'objects owning their procs' ?
00:43:28skrylar[m]class Bleh { public void Doit() { .. } }
00:43:48FromGitter<zetashift> ah like that
00:44:07FromGitter<zetashift> doesn't that boil down to OOP vs procedural?
00:44:12disruptekCAPITALIZATION IS AMAZING THOUGH
00:44:20skrylar[m]nim assumes foo.bar is bar(foo) and you're done, haxe does the c# thing where you have to define it with the object or do an extension class which makes you wonder what the point is
00:44:38skrylar[m]"wow you can make a class that *isn't really a class* but just looks like one for the sole purpose of bolting a method on to another class"
00:45:23skrylar[m]but yeah they have a couple of really neat things like lime and haxeflixel
00:46:05disruptekYOU CAN'T SPELL KOOP WITHOUT OOP
00:46:27FromDiscord<KingDarBoja> KOOP?
00:46:35skrylar[m]compile speeds in my nim code are still pretty snappy so .. eh.
00:46:40*lritter joined #nim
00:46:49disruptekyou're probably using it wrong. 😁
00:47:06skrylar[m]well yes i only allow macros for syntax sugar
00:47:49skrylar[m]the people who were here some months ago writing cryptomonies and bignum libs with heavy generator macros had a lot of pain, but honestly the Go philosophy of bake it all to the vcs is the right one if you aren't using lisp
00:49:13skrylar[m]part of why gtk-rs takes 30 seconds to compile hello world is it sits there deep tracing through piles of macros every single build, whereas in lisp you compile everything as you see it and macros actually get baked down as you go, so you never re-scan old macros unless you are specifically building a proc that uses it
00:49:32skrylar[m]afaik nim and rust have to suffer through the macro expansion every build, so.
00:49:43disrupteknot after ic.
00:49:59skrylar[m]is that actually working now
00:50:10disruptekwell, no.
00:50:26*skrylar[m] throws a paper ball at disruptek
00:50:51disrupteki'm making progress; i'm just slow.
00:53:00disruptekpeak cognitive ability is reached at age 20 and goes downhill from there.
00:53:57skrylar[m]was poking around with janet and saw `make-image` was kind of interesting. loading modules just 'runs' it in to its own environment, importing then copies the symbols in to the current environment, but then `make-image` accepts an environment table and spits it out in something you can load later. which .. has the interesting bit where you can have a bunch of self-generating code that deletes itself and the image will just be
00:53:57skrylar[m]the built module :think:
00:57:14skrylar[m]i dont think i've often seen systems save the final result of loading a module.. usually they just compile that part to bytecode too
00:58:11*endragor joined #nim
00:58:22disruptekthat's sorta how our backend cache works at the moment.
00:58:35*dwdv quit (Ping timeout: 250 seconds)
00:59:06skrylar[m]well if you want some nice hashing stuff, i have a working blake2{b,s} in skyhash.
00:59:34skrylar[m]they have a mode that does tree hashing
01:00:17disruptekwhat kinda trees?
01:00:51skrylar[m]spruce
01:00:59disruptekfair enough.
01:01:21disruptekwe actually record all the mutations to a module and cache each of them individually.
01:01:57skrylar[m]it probably wouldn't help actually because you can merkle hash with just about anything, and an incremental compiler doesn't really need the height protection
01:02:13skrylar[m]i juts remember a whitepaper for one of those smart contract systems and they were using them to track memory changes
01:02:22disruptekall our doorways have been enlarged with clyybber's head.
01:02:43skrylar[m]were hashing pages and basing runtime costs on pages dirtied after a run completed
01:02:51*endragor quit (Ping timeout: 260 seconds)
01:04:16disrupteki guess that's a way to do it.
01:04:36*skrylar[m] is admittedly not a compilederp. spent most of the day reading the texbook to make the text on gui's pretty ._.
01:05:00disruptekme neither.
01:06:20FromDiscord<Elegant Beef> so a glfw function for getting the x11 window returns a pointer, to use with the xlib i need that as a TWindow, so how do I manage this?
01:06:26*chemist69 quit (Ping timeout: 246 seconds)
01:08:36*chemist69 joined #nim
01:09:21skrylar[m]~~by using SDL~~ check if the binding you are using equates twindow with a pointer or if it does something special with it. if they're both void pointers, just cast it with dot or cast
01:09:40FromDiscord<Elegant Beef> I mean i suppose i could use sdl
01:09:53FromDiscord<Elegant Beef> When this doesnt work ill probably hop over to sdl
01:10:15skrylar[m]in all liklihood they are both pointers in the wrappers
01:10:22skrylar[m]when this happens you just cast it
01:11:23skrylar[m]then we judge whoever gave you the raw pointer type harshly
01:12:02FromDiscord<Elegant Beef> ok
01:12:07skrylar[m](if it were instead a named pointer type like it should have been you can write a `converter` to implicitly cast it to the other type, so you can maintain some semblance of type safety)
01:12:23FromDiscord<Elegant Beef> yea just a rawdog pointer so i was scared to do anything with it πŸ˜„
01:13:28skrylar[m]eh then make your own getter that does the cast and gives you the right type
01:18:12*lritter quit (Ping timeout: 256 seconds)
01:18:59*lritter joined #nim
01:19:06FromDiscord<Elegant Beef> Well that doesnt seem to crash it, as much as `glinit` is
01:22:58skrylar[m]does glfw actually return a twindow
01:23:13FromDiscord<Elegant Beef> I couldnt find a twindow, it returned a pointer
01:23:28FromDiscord<Elegant Beef> Think i have a bigger issue of attempting to use imgui for my status bars
01:24:52FromDiscord<Elegant Beef> Since i dont think i can thread the rendering, and XNextEvent blocks until it gets an event
01:27:30skrylar[m]https://stackoverflow.com/questions/8592292/how-to-quit-the-blocking-of-xlibs-xnextevent :b
01:27:45FromGitter<s0kil> Could I modify an JavaScript object prototype from Nim? Even though Nim supports UFCS?
01:28:57skrylar[m]you could always use emit to force it, although nim won't be aware of it type-wise
01:31:42*endragor joined #nim
01:38:06*endragor quit (Ping timeout: 256 seconds)
01:41:53*Jjp137 joined #nim
01:43:36FromGitter<s0kil> @skrylar Could you show quick example?
01:46:23leorizeufcs doesn't affect anything?
01:51:18FromDiscord<Elegant Beef> So yea the pointer works, i have bars being drawn on my screen but the gl part isnt so need to figure out how to draw to multiple windows from 1 thread
01:56:02*krux02_ quit (Remote host closed the connection)
01:58:40*theelous3 quit (Ping timeout: 256 seconds)
02:19:35*muffindrake quit (Ping timeout: 246 seconds)
02:21:52*muffindrake joined #nim
02:34:03*endragor joined #nim
02:35:21FromDiscord<Chiqqum_Ngbata> Is there already a function in std to turn a version string into tuple[major: int, minor: int, patch: int] ?
02:37:25FromDiscord<Rika> i dont think so, no
02:45:10FromDiscord<KingDarBoja> This sounds very semver so better split and put that into a tuple
02:46:36disruptekwe used to have this feature but no one used it, so it was removed.
02:49:31*dddddd quit (Ping timeout: 250 seconds)
03:00:22FromDiscord<Chiqqum_Ngbata> Just the function you mean? : (
03:01:03FromDiscord<KingDarBoja> The good thing is that prob you can search the git history and find the proc that had the functionality
03:01:05disruptekno; lots of features were removed.
03:01:18FromDiscord<KingDarBoja> Oh yikes
03:01:25FromDiscord<Chiqqum_Ngbata> I don't need to know how to do it. I've already done it for another project, just wondering if I'm typing unnecessarily
03:01:43FromDiscord<KingDarBoja> Ah okie dokie...
03:01:58FromDiscord<Chiqqum_Ngbata> The `since` stuff wasn't removed right?
03:05:08disrupteksince no one used it?
03:08:17*chemist69 quit (Ping timeout: 272 seconds)
03:09:05*chemist69 joined #nim
03:13:17FromGitter<awr1> is there a way in nim to convert a single UTF-16 character to a `Rune`? The `encodings` module seems a little heavyweight
03:13:24FromGitter<awr1> since it is string -> string
03:15:59FromGitter<awr1> i suppose MultiByteToWideChar() should be fine, and then i assume i should be able to cast it to a Rune?
03:16:57FromGitter<awr1> err
03:16:58FromGitter<awr1> WideCharToMultiByte()
03:16:59FromGitter<awr1> i mean
03:28:53FromDiscord<KingDarBoja> I am interested on what you doing awr1
03:29:21FromDiscord<KingDarBoja> Like, trying to get a entire char like `\n` from some string is a bit messy if you ask me
03:29:39disrupteki like to read them 2-bits at a time.
03:29:42FromDiscord<KingDarBoja> And yeah, I heard unicode module is pretty heavyweight
03:29:43disruptekcleaner that way.
03:29:51FromDiscord<KingDarBoja> πŸ€”
03:30:17skrylar[m]@ElegantBeef you have to activate the gl contexts, issue the draw calls and flush, move to next context ..
03:31:14leorize@awr1: encodings module is heavyweight because it gotta verify the formatting too
03:31:22leorizeand unicode spec is nowhere near "small"
03:31:42FromDiscord<KingDarBoja> Any example ?
03:32:02disruptekyeah, but i'm not supposed to post dick pics online.
03:32:08FromDiscord<KingDarBoja> I remember Variount guidance and I ended up reading one cahr and then using a if to check if the next one was something
03:32:12FromDiscord<KingDarBoja> LOL
03:32:27FromGitter<awr1> i'm trying to get WM_CHAR messages
03:39:09FromDiscord<KingDarBoja> Win4Life
03:47:07zacharycarterjob system almost working with fibers :D - https://github.com/zacharycarter/junkers
03:47:38zacharycarterala https://www.gdcvault.com/play/1022186/Parallelizing-the-Naughty-Dog-Engine
03:56:24FromGitter<awr1> what on earth
03:56:36FromGitter<awr1> RegisterClassEx() is giving me "The specified system semaphore name was not found."
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:47*supakeen joined #nim
04:11:00*Romanson joined #nim
04:11:47skrylar[m]hmm you can do a big chunk of unicode simply
04:12:11skrylar[m]when you get to the stuff that needs the character database though. oof.
04:12:42*waleee-cl quit (Quit: Connection closed for inactivity)
04:39:00lmariscal0641All the nim packages without submodules and as bare weights 1.39gb curious note
04:39:56*lmariscal0641 is now known as lmariscal
04:40:09*lmariscal quit (Changing host)
04:40:09*lmariscal joined #nim
04:50:28FromDiscord<Rika> ok
04:55:04*narimiran joined #nim
04:58:41FromDiscord<KingDarBoja> 🧐
04:59:30*narimiran quit (Client Quit)
05:28:47shashlick@leorize - you around?
05:33:29FromDiscord<KingDarBoja> He has joined the dark side
05:56:05*zacharycarter quit (Ping timeout: 256 seconds)
06:13:29*bra-ket quit (*.net *.split)
06:13:30*nerdrat[m] quit (*.net *.split)
06:13:31*unclechu quit (*.net *.split)
06:15:21*nerdrat[m] joined #nim
06:15:21*bra-ket joined #nim
06:18:56*unclechu joined #nim
06:21:37*solitudesf joined #nim
06:25:01leorizeshashlick: yea but I'm gonna sleep now
06:25:38leorizeAraq: can you review this? https://github.com/nim-lang/Nim/pull/13201
06:25:39disbotβž₯ Make file descriptors from stdlib non-inheritable by default
06:26:07Araqleorize: upcoming week is PR week
06:26:18leorizesure
06:26:28Araqwill review it, thanks for your patience
06:26:35Araqit looked good last time though
06:43:23shashlickAraq: does importc work on static inline functions with {.header.}
06:45:58PrestigeIs there a place where all pragmas are documented?
06:46:51shashlickThe manual
06:48:11FromDiscord<Gary M> so I have a weird situation with this syntax highlighting right now. Considering how procedures can be used without parentheses, how am I supposed to parse the different between procedures and variables like
06:48:11FromDiscord<Gary M>
06:48:11FromDiscord<Gary M> init addr vk
06:48:12FromDiscord<Gary M> (proc) (proc) (var)
06:48:25FromDiscord<Gary M> difference*
06:50:13FromDiscord<Gary M> it's all done with regex matching
06:51:33Prestigeshashlick: they're just spread out between the different sections? I haven't found like, a list
06:52:57shashlickhttps://nim-lang.github.io/Nim/manual.html#pragmas
06:53:46Prestigeah I was trying the search feature on that page and didnt see it come up
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:52*gmpreussner joined #nim
07:27:37*xcm quit (Remote host closed the connection)
07:29:49*xcm joined #nim
07:45:42Prestigeleorize: What do you think about separating nim.nvim's ftdetect into different filetypes?
07:46:32PrestigeI'm using PMunch's nimlsp for nim files but it throws tons of errors for nimscript, because nim.nvim sets *.nims files as a nim file
07:46:37Prestigefiletype*
07:52:19*zacharycarter joined #nim
07:56:45*zacharycarter quit (Ping timeout: 250 seconds)
08:01:55*gangstacat quit (Quit: Ĝis!)
08:07:41*ftsf joined #nim
08:10:26*gangstacat joined #nim
08:11:12*xcm quit (Remote host closed the connection)
08:11:50ftsfhmm anyone have a simple example of how to use async httpclient?
08:13:22ftsfwhat does "Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]" mean?
08:13:27*xcm joined #nim
08:13:39ftsfwhen I call poll()
08:16:49*jds_dizzy_ joined #nim
08:18:21ftsfalso, does httpclient work in the js backend?
08:25:07*jds_dizzy_ quit (Remote host closed the connection)
08:25:36*mrgaturus joined #nim
08:29:30*Hideki_ joined #nim
08:30:23*Hideki_ quit (Remote host closed the connection)
08:30:27*mrgaturus quit (Quit: Quit)
08:34:36FromGitter<jorjun_twitter> Tech I like keeps getting bought. Is nim safe?
08:35:09*Hideki_ joined #nim
08:36:11*Romanson quit (Quit: Connection closed for inactivity)
08:36:33nerdrat[m]<dom96 "nerdrat, please report this as a"> Here is the issue report on github https://github.com/dom96/choosenim/issues/194 . I'll stick with the buggy one until newer release I fixed the problem by replacing manually corrupted files.
08:36:35disbotβž₯ Choosenim v0.6.0: Toolchain extraction results in corruption of vital `Nim v1.2.0` files after `choosenim update stable` ; snippet at 12https://play.nim-lang.org/#ix=2iDk
08:41:26*couven92 joined #nim
08:50:18*dwdv joined #nim
08:54:30*Hideki_ quit (Remote host closed the connection)
08:57:07Araqftsf: pretty sure it doesn't, but see karax and friends for how to do http requests
08:57:11*Hideki_ joined #nim
08:57:13*Hideki_ quit (Remote host closed the connection)
08:57:53*Hideki_ joined #nim
08:58:00*couven92 quit (Read error: Connection reset by peer)
08:58:23*couven92 joined #nim
08:59:57*Hideki_ quit (Remote host closed the connection)
09:00:12*Hideki_ joined #nim
09:00:13*Hideki_ quit (Remote host closed the connection)
09:00:53*Hideki_ joined #nim
09:02:39*vegai joined #nim
09:06:05*Hideki_ quit (Ping timeout: 250 seconds)
09:21:30*couven92 quit (Read error: Connection reset by peer)
09:21:56*couven92 joined #nim
09:23:22*Hideki_ joined #nim
09:35:23FromGitter<alehander92> happy Easter, guys !
09:35:31Yardanicoorthodox easter you mean :P
09:35:31FromGitter<alehander92> /going back to holidaaays/
09:35:36FromGitter<alehander92> yeah, yeah
09:35:40FromGitter<alehander92> well, almost
09:35:43Yardanicowell yeah, happy easter to you too
09:35:57FromGitter<alehander92> orthodox country Easter, e.g. protestants here(like me) also celebrate it today
09:36:02FromGitter<alehander92> thank you
09:36:19FromGitter<alehander92> russian brothers :P :) as people love to say
09:36:24*dddddd joined #nim
09:39:37supakeen@alehander92: Happy paskha :)
09:39:57Yardanicosupakeen: are you slavic too? :P
09:40:26supakeenNo, but at my church there's a bunch of people from those areas :)
09:41:00Yardanicooh guess I only got 3 more chapters to finish before my first Lox interpreter implementation (as in the book) will be completed
09:41:50FromGitter<alehander92> supakeen is it an OCA church?
09:41:56FromGitter<alehander92> happy paskha to you :)
09:42:57supakeen@alehander92: It's an English speaking catholic church in the Netherlands so it combines people from a lot of communities who have come here. It's not eastern orthodox :)
09:43:48FromGitter<alehander92> cool! its interesting that some of our catholics(using the eastern rite) also celebrate today IIRC
09:44:13supakeenYou celebrate with the community!
09:45:19FromGitter<alehander92> exactly :)
09:45:52supakeenNot that we really can right now normally there used to be big celebrations for easter a few weeks back but with all the lockdowns it's all on-line.
09:47:26FromGitter<alehander92> here the orthodox churches are still open iirc but with big restrictions
09:48:50FromGitter<alehander92> but our lockdown overally is not so severe i think, mostly almost no intercity travel and no going to parks + masks outside, but you can still walk on the streets
09:51:45FromGitter<jorjun_twitter> Anyone can assist with an enum problem I have? https://pastebin.com/Y8mncarL
09:52:34*zacharycarter joined #nim
09:53:33Yardanicohttps://play.nim-lang.org/#ix=2iDQ ?
09:54:04*hax-scramper quit (Read error: Connection reset by peer)
09:54:04Yardanicoactually "echo numeral" will work just fine too
09:54:12Yardanicoon line 16
09:54:24Yardanicobut on line 20 your $ was applied to numeral.repeat, not to numeral
09:54:54Yardanicoecho calls $ for everything that's passed to it by default
09:54:54*hax-scramper joined #nim
09:55:58FromGitter<jorjun_twitter> Aha, I tried brackets, like this but no joy: $(numeral).repeat n_repeat
09:56:07Yardanicothat would still apply to numeral.repeat
09:56:41FromDiscord<Chiqqum_Ngbata> Has anyone seen custom stream implementation?
09:56:43FromGitter<jorjun_twitter> ($numeral).repeat n_repeat boom. Thanks so much
09:56:46*zacharycarter quit (Ping timeout: 256 seconds)
10:14:51*Hideki_ quit (Remote host closed the connection)
10:18:24*liblq-dev joined #nim
10:37:16*endragor quit (Remote host closed the connection)
10:42:39*natrys joined #nim
10:51:13*Hideki_ joined #nim
10:51:15*Vladar joined #nim
10:55:00*couven92 quit (Read error: Connection reset by peer)
10:55:24*couven92 joined #nim
11:00:48*theelous3 joined #nim
11:10:30dom96nerdrat[m], your issue implies that you've used choosenim 0.4.0 previously and that it worked, is that correct? Can I assume that this issue does not happen with 0.4.0?
11:11:25dom96ftsf, can you show us your code? That usually means there is nothing for the async loop to do, i.e. nothing is pending.
11:12:05*xcm is now known as Guest5856
11:12:05*Guest5856 quit (Killed (weber.freenode.net (Nickname regained by services)))
11:13:55*xcm joined #nim
11:15:49*Hideki_ quit (Ping timeout: 264 seconds)
11:16:16*Hideki_ joined #nim
11:18:37FromDiscord<__ibrahim__> noob question: can i just throw the generated C code into wasm and expect it to work?
11:20:53FromGitter<sealmove> is there a range limitation for enums?
11:22:32*dwdv quit (Quit: quit)
11:23:32*couven92 quit (Read error: Connection reset by peer)
11:23:58*couven92 joined #nim
11:25:06FromGitter<sealmove> I get: ⏎ fatal.nim(49) sysFatal ⏎ Error: unhandled exception: over- or underflow [OverflowError]
11:25:19FromGitter<sealmove> when trying to use large values for enums
11:25:54FromGitter<sealmove> example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e9c3542c7dcfc14e2cefa53]
11:26:26*zacharycarter joined #nim
11:26:46*couven92 quit (Read error: Connection reset by peer)
11:27:13*konvertex joined #nim
11:27:13*couven92 joined #nim
11:28:13*Hideki_ quit (Remote host closed the connection)
11:29:07*Hideki_ joined #nim
11:33:14*Hideki_ quit (Ping timeout: 240 seconds)
11:33:22*krux02 joined #nim
11:46:15*Hideki_ joined #nim
11:50:56FromGitter<Yardanico> 9223372036854775806 works fine
11:58:53Amun_Rahmm, is it me or FileStream's setPosition does not support whence
12:00:23YardanicoAmun_Ra: wdym "whence"? setPosition for "Stream" in general doesn't support specifying "from" or maybe I misunderstood you
12:00:33Yardanicowith setPosition you set the current positition in the stream
12:01:21Amun_RaYardanico: I wouldn't expect set/cur/end in a Stream but it's FileStream
12:01:30Yardanicoso?
12:01:38YardanicoFileStream *is* Stream
12:01:41YardanicoStream is basically an interface
12:02:43Amun_Rahmm, I have to switch to File and implement my own readUints
12:02:57YardanicoI really can't understand the problem you're having, sorry
12:03:20YardanicoreadUint will work just fine for FileStream
12:04:11Amun_RaI need to set position X bytes from the end and read the structure from there
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:39*supakeen joined #nim
12:07:40*Guest91062 quit (Ping timeout: 256 seconds)
12:09:06*dadada joined #nim
12:09:25FromGitter<zacharycarter> you can do that with a stream
12:09:29*dadada is now known as Guest8592
12:09:40FromGitter<zacharycarter> https://nim-lang.org/docs/streams.html#setPosition%2CStream%2Cint
12:11:03Amun_RaI can't operate on absolute values
12:12:14Amun_Raperhaps I'll just add file size to function prototypes
12:22:58*Hideki_ quit (Remote host closed the connection)
12:23:31*Hideki_ joined #nim
12:27:16FromGitter<sealmove> @Yardanico any idea why it doesn't work for high(int64) == 9223372036854775807?
12:28:05*Hideki_ quit (Ping timeout: 258 seconds)
12:34:03*Hideki_ joined #nim
12:44:23FromGitter<sealmove> seems like a bug
12:44:42FromGitter<sealmove> or at least undocumented implementation limitation
12:44:44Yardanicodo you really need an enum value of int64 though? :P
12:45:29FromGitter<sealmove> yes, I need to make it work in the general case, because I am making parsers and this value could exist in some file
12:46:03Araqthis is not much of an "enumeration"
12:46:03FromGitter<sealmove> so I have tests in place for testing even these edge cases, and my tests fail right now :3
12:46:11Araqit's a distinct int.
12:46:41FromGitter<sealmove> Araq I know, initially I modeled it as distinct int, but I want these nice Nim enum features like exhausting coverage :3
12:46:55FromGitter<sealmove> exhaustive*
12:50:40FromGitter<sealmove> except enums, does any other construct offer exhaustive coverage? how about sets?
12:51:35Araqwell you can overload the 'case' statement these days but yeah, only enums really offer it
12:53:21FromGitter<sealmove> Araq, if I overload `case` for my distinct int, this will work?
12:53:56Araqhopefully
12:54:25FromGitter<sealmove> And could I have an insight on why int(64) doesn't work with enums? Just curious.
12:54:49FromGitter<sealmove> `high(int64)` I mean
12:54:56Araqcompiler bug, fix it
12:55:04FromGitter<sealmove> okay, got it
12:55:40Araqmany of these bugs are actually more conscious than many think.
12:56:10FromGitter<sealmove> I can imagine it can be an implementation decision
12:56:31AraqI'm aware of overflows but keep thinking "nobody will ever stumble upon this"
12:56:59AraqI'm usually wrong :-)
12:57:06FromGitter<sealmove> haha
12:58:50Araqhttps://github.com/nim-lang/Nim/pull/14008#issuecomment-615879473 anyhow vote please
12:58:52disbotβž₯ enummaps: library based generalized typesafe enum with holes ; snippet at 12https://play.nim-lang.org/#ix=2iER
13:01:34*Hideki_ quit (Remote host closed the connection)
13:02:10*Hideki_ joined #nim
13:04:32federico3Araq: +1 on stability. Perhaps a issue label to track ideas for Nim 2.0?
13:05:32FromGitter<sealmove> I agree with federico3
13:06:02Araqyeah good idea. as I said before, the current plan is to grow/fix Nim and then in a couple of years focus on the cleanups in a 2.0 release
13:06:48*Hideki_ quit (Ping timeout: 258 seconds)
13:14:41FromGitter<sealmove> btw is there a pragma to disable exhaustive coverage?
13:15:03Yardanicoelse: discard
13:15:22Yardanicoassuming you have a case statement :)
13:15:52FromGitter<sealmove> yeah I know about this, but when generating code and you don't know whether you have covered all cases or not, you can either get error like "not all case covered" or "all cases covered but found `else: discard`"
13:16:29FromGitter<sealmove> well, if there isn't, I can use `if` instead of `case` of course.
13:16:47Yardanicodo a macro or a template?
13:17:06Yardanicoalso there's compiles() in system
13:17:18*xcm quit (Read error: Connection reset by peer)
13:18:25FromGitter<sealmove> Sadly I am not generating code with Nim X_X. Anyway I will use an `if`
13:19:21Yardanicoeven if you're not generating it with nim you can still insert a compiles() call
13:19:54*xcm joined #nim
13:20:52FromGitter<sealmove> Is this nice though? I prefer to have an if instead of case than inserting a compiles() call
13:21:30FromGitter<sealmove> but really, we could have a pragma for example called {.dirtyCase.} if it's not hard to add
13:24:01*Hideki_ joined #nim
13:25:36federico3was there an httpserver in Nim at some point?
13:26:28Yardanicoyou mean a stdlib module? idk
13:26:32ftsfnimhttpd ?
13:27:10ftsf@dom96, yeah there's nothing pending, is there a way for poll to do nothing without error if there's no jobs?
13:27:15federico3nimhttpd serves only files from disk (pretty useless!)
13:27:33ftsffederico3, what do you want it to serve?
13:27:42supakeenI mean there's the asynchttpserver module which you can use to build one, or did you mean a built in one to server... what exactly? :)
13:28:00dom96ftsf, there is a function that tells you this, hasPendingOperations or something, take a look in asyncdispatch
13:28:08federico3the same as asynchttpserver from the stdlib but without the async
13:28:09ftsffederico3, i'm using jester to serve stuff via nim
13:28:23dom96federico3, yeah, there was httpserver
13:28:24ftsf@dom96, thanks
13:29:36*filcuc joined #nim
13:30:38*jjido joined #nim
13:32:15*xcm quit (Remote host closed the connection)
13:34:26*xcm joined #nim
13:44:58FromGitter<sealmove> Guys what do you think? https://github.com/nim-lang/Nim/issues/14019
13:44:58disbotβž₯ Add pragma for disabling enforced exhaustive case coverage
13:50:10*dddddd_ joined #nim
13:51:37FromDiscord<Chiqqum_Ngbata> The exhaustive coverage hasn't been an big issue for me so far. I'd lean toward not adding things but maybe this is a bigger pain in your kaitai stuff?
13:52:09FromDiscord<Chiqqum_Ngbata> Now I forgot what I came here to ask...
13:53:01*dddddd quit (Ping timeout: 264 seconds)
13:55:56FromGitter<sealmove> sorry for that :3
13:59:44FromGitter<sealmove> Yes, it would help me a with my implementation. Of course this is an edge case so it's not an important feature. I don't know what's the policy regarding pragmas. Maybe we don't introduce pragmas that are subject to abuse? If this is not a concern though, and if it's easy to add, then I don't see any other problems with introducing it.
14:04:04*Hideki_ quit (Remote host closed the connection)
14:04:39*Hideki_ joined #nim
14:15:29*Hideki_ quit (Ping timeout: 265 seconds)
14:17:30*dddddd_ is now known as dddddd
14:22:12FromDiscord<Chiqqum_Ngbata> Is it possible to configure nimble post-install task?
14:25:32*couven92 quit (Read error: Connection reset by peer)
14:25:58*couven92 joined #nim
14:30:54*Hideki_ joined #nim
14:32:00*couven92 quit (Read error: Connection reset by peer)
14:32:09*Hideki_ quit (Remote host closed the connection)
14:32:25*couven92 joined #nim
14:35:00*couven92 quit (Read error: Connection reset by peer)
14:35:27*couven92 joined #nim
14:38:30*couven92 quit (Read error: Connection reset by peer)
14:38:57*couven92 joined #nim
14:39:51*Hideki_ joined #nim
14:39:54*Hideki_ quit (Remote host closed the connection)
14:40:28*Hideki_ joined #nim
14:41:52*bra-ket quit (Remote host closed the connection)
14:42:09*bra-ket joined #nim
14:44:47*Hideki_ quit (Ping timeout: 256 seconds)
14:51:12disruptekmake the pragma, show its use, create an RFC to add it to stdlib.
14:51:22disrupteksimple.
14:54:50*theelous3 quit (Read error: Connection reset by peer)
14:55:30*couven92 quit (Read error: Connection reset by peer)
14:55:58*couven92 joined #nim
14:59:30*couven92 quit (Read error: Connection reset by peer)
14:59:53*couven92 joined #nim
15:00:00disruptek~stream
15:00:01disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:00:08disruptekpersistent storage macro.
15:12:32*couven92 quit (Read error: Connection reset by peer)
15:12:57*couven92 joined #nim
15:14:50*lritter quit (Ping timeout: 258 seconds)
15:15:30*couven92 quit (Read error: Connection reset by peer)
15:15:53*couven92 joined #nim
15:23:00leorizePrestige: to be fair we should fix nimsuggest so that it can work with nimscript :P
15:28:00*couven92 quit (Read error: Connection reset by peer)
15:28:23*couven92 joined #nim
15:29:30*couven92 quit (Read error: Connection reset by peer)
15:29:53*couven92 joined #nim
15:30:13*ftsf quit (Ping timeout: 264 seconds)
15:32:58*nsf joined #nim
15:35:13*axion quit (Quit: WeeChat 2.8)
15:35:51*Guest8592 is now known as dadada
15:36:55*liblq-dev quit (Ping timeout: 256 seconds)
15:40:54*zacharycarter quit (Ping timeout: 258 seconds)
15:46:09*waleee-cl joined #nim
15:46:49*Hideki_ joined #nim
15:56:31*Hexeratops joined #nim
16:02:24*axion_ joined #nim
16:03:43*axion_ quit (Client Quit)
16:11:11*Hideki_ quit (Ping timeout: 250 seconds)
16:11:49*xcm quit (Remote host closed the connection)
16:14:05*xcm joined #nim
16:19:29*liblq-dev joined #nim
16:23:03*couven92 quit (Read error: Connection reset by peer)
16:23:28*couven92 joined #nim
16:23:45livcdi am also watching
16:28:35federico3most nim packages age like fish
16:29:51*natrys quit (Ping timeout: 265 seconds)
16:30:31*zacharycarter joined #nim
16:33:28*Vladar quit (Quit: Leaving)
16:35:28*natrys joined #nim
16:36:11livcdthey rot away?
16:36:19federico3yep
16:36:37federico3how can expose a variable defined in a template to another template nested inside its body?
16:37:53*Trustable joined #nim
16:39:17*inv2004 joined #nim
16:39:29inv2004Good Sunday of quarantine!
16:40:21inv2004Few days ago I asked about problem with UncheckedArray, I spent some time trying to reproduce and found that for simple structure it works perfect, but for more complicate structure with unions it does not work
16:41:14inv2004I created an example (I removed all bycopy because I am not if it is necessary or not here, but it does not change behavior): https://github.com/inv2004/test_nim_c
16:41:50inv2004.. I am not sure if the is ...
16:45:30*couven92 quit (Read error: Connection reset by peer)
16:45:54*couven92 joined #nim
16:53:34*sigmapie8 joined #nim
16:54:09leorizeinv2004: you should always add `bycopy` when interfacing with C
16:54:25shashlickhttp://ix.io/2iGU/nim is the output from nimterop
16:55:19inv2004leorize, I had it - problem was the same. Let me convert it to the link from shashlick
16:55:55leorizeyea, but a tip is that you should always have it when building C wrappers
16:56:18leorizethe pragma is to prevent Nim from doing optimizations (ie. pass by reference)
16:59:40zacharycarterare custom allocators supported in --gc:arc?
17:00:22livcdfederico3: that's one of the biggest issues i think. That packages break too often as Nim develops further. Winim is broken with every release :D
17:01:04*abm joined #nim
17:01:41leorizezacharycarter: IIRC it was removed
17:02:35federico3livcd: that and the general quality and debuggability
17:03:02*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:03:47zacharycarterleorize: gotcha
17:05:30*couven92 quit (Read error: Connection reset by peer)
17:05:55*couven92 joined #nim
17:06:02*Lord_Nightmare joined #nim
17:13:41FromDiscord<EdgyNerd> https://play.nim-lang.org/#ix=2iH5 how can I speed up this Pi program, it's currently taking around double the time of a similar crystal program (5000 digits takes 3.2s
17:13:49FromDiscord<EdgyNerd> https://play.nim-lang.org/#ix=2iH5 how can I speed up this Pi program, it's currently taking around double the time of a similar crystal program (5000 digits takes 3.2s in Nim, 1.7 in crystal)
17:14:05Araqzacharycarter, it got removed because the destructors feature is about how you can implement your own seqs and containers
17:14:16Yardanico@EdgyNerd how are you compiling it and can you show the crystal source? also please don't edit messages on discord
17:14:17Araqand when you do, you get to choose the allocator
17:15:16YardanicoI just tested and with -d:danger it took me 300ms on 5000 digits
17:15:33FromDiscord<EdgyNerd> what does `-d:danger` do?
17:15:48AraqEdgyNerd: also put the code inside a 'main' proc
17:16:09Yardanico@EdgyNerd -d:release is the release mode, and -d:danger implies -d:release but disables various runtime checks
17:16:26YardanicoIt's 600ms for me with -d:release
17:17:05FromDiscord<EdgyNerd> ah ok
17:17:35Yardanicoif you compile like "nim c file.nim" you're compiling in debug mode with every possible check enabled
17:18:35FromDiscord<EdgyNerd> oh ok
17:18:55Yardanicoalso check if you're compilng crystal code in release mode :)
17:19:11FromDiscord<EdgyNerd> yeah I was, I just didn't find the flag in Nim
17:19:46FromDiscord<EdgyNerd> it's still taking 2.5 seconds even in danger mode, how long does it take for you to run the 'debug' mode?
17:19:58FromDiscord<EdgyNerd> it's still taking 2.5 seconds even in danger mode, how long does it take for you to run the debug mode?
17:20:01FromDiscord<Yardanico> What's your Nim version by the way?
17:20:18FromDiscord<EdgyNerd> latest I think
17:20:37FromDiscord<Yardanico> What's the time if you try with -d:release ?
17:20:48leorizenim --version for the version number
17:20:51FromDiscord<EdgyNerd> oh my version is 1.2.0
17:20:53FromDiscord<EdgyNerd> is that latest?
17:20:56leorizeyep
17:20:57FromDiscord<Yardanico> Yeah
17:21:13FromDiscord<Yardanico> "nim c -d:release file.nim"
17:22:06FromDiscord<EdgyNerd> 2.6 seconds with -d:release
17:22:09leorizehow are you measuring the time?
17:22:16Prestigeleorize: good point, didn't know if it was an appropriate issue to open on your repo. I still think nimlsp would have to know about different filetypes, no?
17:22:17leorizeit ran in less than one second here
17:22:37livcdTotalMilliseconds : 58.0343
17:22:37livcdhere
17:22:54FromDiscord<EdgyNerd> the unix time thing (time ./pi)
17:22:59leorizePrestige: my repo is not a nimsuggest bug tracker :P
17:23:05*sigmapie8 quit (Quit: Leaving)
17:23:11leorize❯ bash -c 'time ./test'
17:23:13leorize3141592653
17:23:15leorizereal 0m0.001s
17:23:17leorizeuser 0m0.001s
17:23:19leorizesys 0m0.001s
17:23:23FromDiscord<EdgyNerd> set the digits to 5000
17:23:27FromDiscord<Yardanico> Leorize - change DIGITS to 5000
17:23:28PrestigeYeah I meant as setting a different file type for .nims leorize
17:24:22FromDiscord<EdgyNerd> (also if digits is set to 5000 you might wanna comment out the stdout line since it has a lot of output)
17:24:57Yardanicowell it just takes 600ms with -d:release and 300ms with -d:danger for me
17:25:07YardanicoI'm checking with fish's "time" built-in command
17:25:07leorize2s here :P
17:25:17leorizeoh fish have `time` now
17:25:31Yardanicowell I have 3700X but single-core it's not the best CPU
17:25:42livcd2.3s here
17:26:33FromDiscord<EdgyNerd> actually my time is basically exactly 2s
17:26:49leorizecan we have the crystal version too?
17:26:54Yardanicoin debug mode I get 2.22 seconds
17:26:58FromDiscord<EdgyNerd> oh yeah
17:27:00FromDiscord<EdgyNerd> https://pastebin.com/9uLPq1Xu
17:27:31FromDiscord<EdgyNerd> (ignore the part at the end, it's a special case I was too lazy to implement in Nim, and only affects about 1/30 digits)
17:28:01Yardanicothe code seems different though?
17:28:02leorizeah int vs int32
17:28:45Yardanicoleorize: that doesn't make any difference for me really
17:28:46FromDiscord<EdgyNerd> the code is basically the same except I used until loops instead of for loops
17:29:19FromDiscord<EdgyNerd> yeah changing the int size doesn't really do anything
17:29:24FromDiscord<EdgyNerd> (to the time)
17:30:55*inv2004 quit (Ping timeout: 258 seconds)
17:31:20leorizethe crystal code is a bit better structured
17:31:25Yardanico@EdgyNerd but really I wouldn't suggest you to compare on microbenchmarks :)
17:31:27YardanicoI
17:31:31leorizeI'm gonna clean up the nim one and see what can I improve
17:31:32YardanicoI'll try with crystal 0.34 on my PC
17:31:39Yardanicothat seems to be the latest
17:32:36Yardanicowell Crystal version takes 640ms for me too lol
17:32:59livcdint32 brings it down to 1.5s for me
17:33:19Yardanico(nim with -d:release is around the same and nim with -d:danger is ~300ms)
17:33:38leorizeYardanico: big cpu perks :P
17:33:55leorizeI'm doing this on a weak intel
17:34:18Yardanicomaybe LLVM does a better job at optimizing stuff than GCC? can you try with clang?
17:34:23Yardanicoon your CPUs I mean
17:35:55leorizelol the nim code is not the same as the crystal one
17:36:04leorizewe miss an iteration for our for loops
17:36:13Yardanicoactually it's the other way :P
17:36:20Yardanicowith crystal I get "741326047" at the end
17:36:28Yardanicowith nim "7413260472"
17:36:37Yardanicobut it's only 1 digit difference
17:36:43*jjido quit (Quit: Vision[0.10.3]: i've been blurred!)
17:36:43leorizeI'm talking about the code :P
17:37:53FromDiscord<EdgyNerd> what's different about it?
17:37:56*someunknownuser joined #nim
17:38:04leorizeyou used `..<`
17:38:27zacharycarteris there any alternative of codegenDecl for types?
17:38:29Yardanico@EdgyNerd basically can you try compiling the nim program with clang (I hope it's installed on your machine)
17:38:30leorizewhich is `..` but stop before the end point
17:38:39zacharycarterI want to specify the aligned attribute for a type I'm defining in Nim
17:38:39Yardaniconim c --cc:clang -d:release file.nim
17:39:52FromDiscord<EdgyNerd> clang doesn't speed it up at all
17:40:23FromDiscord<EdgyNerd> also: the reason I used `..<` is because I based the crystal and Nim programs off of this python program
17:40:24FromDiscord<EdgyNerd> https://pastebin.com/NqYE796H
17:40:36FromDiscord<EdgyNerd> (python ranges work the same as `..<`)
17:40:40Yardanicowell then I don't really know, it might depend on your CPU or something, as I said I get same speeds - 600ms - with crystal ("crystal build tt.cr --release") and "nim c -d:release file.nim" and I get 300ms with -d:danger instead of -d:release
17:41:12Yardanico@EdgyNerd they don't though
17:41:27Yardanicoah they do sorry I misunderstood
17:41:50FromDiscord<EdgyNerd> it's weird that for you Nim is double as fast, whereas for me Nim is 2 seconds and crystal is 1.7s
17:42:20FromDiscord<EdgyNerd> I guess it could be based on the CPU (my laptop has a pretty awful CPU)
17:43:25*tane joined #nim
17:44:52FromDiscord<Yardanico> Also just for fun info the Nim compiled binary (after strip -s) is 80kb, while it's 320kb for Crystal :P
17:45:34FromDiscord<EdgyNerd> haha
17:46:28FromDiscord<EdgyNerd> I wasn't really trying to compare them, I was just confused why Crystal was so much faster than Nim (because I didn't realise about -d:release and -d:danger)
17:46:52leorizehmm, does crystal array start at 1 lol
17:47:51FromDiscord<EdgyNerd> nope they start at 0
17:48:04leorizeI read the loop in correctly :P
17:48:09leorizeincorrectly*
17:49:33FromDiscord<EdgyNerd> I've tried Nim and Crystal and I'm probably gonna stick with Nim (mainly because it's syntax is more similar to python, and it looks like it has a more active community)
17:50:34FromDiscord<Recruit_main707> yeah, this comunnity is small, but they are very helpful and active
17:51:35FromDiscord<Yardanico> Also by the way if you want some number crunching (and matrix and more) stuff - https://github.com/mratsim/Arraymancer and https://github.com/mratsim/weave
17:53:45FromDiscord<EdgyNerd> "Compile with -d:release -d:danger to get the same performance as in 0.19.x" why both?
17:54:07*inv2004 joined #nim
17:54:07leorizeyou don't need both
17:54:34*dddddd quit (Ping timeout: 240 seconds)
17:54:55leorize@EdgyNerd: http://ix.io/2iHC/nim
17:55:00leorizecomplete port from python
17:55:03leorize1.72 secs
17:55:09FromDiscord<Yardanico> @EdgyNerd that was fixed in 1.2
17:55:27FromDiscord<Yardanico> -d:danger is supposed to imply -d:release but it didn't got some time
17:55:32FromDiscord<Yardanico> *for
17:58:57*couven92 quit (Read error: Connection reset by peer)
17:58:58leorize-d:danger on my port and it's 1.57s :P
17:59:23*couven92 joined #nim
17:59:35leorize-d:release --gc:arc and it's 1.58s
17:59:45leorizeso as fast as -d:danger without being dangerous
18:01:28*couven92 quit (Client Quit)
18:10:24FromDiscord<EdgyNerd> what does --gc:arc do?
18:10:33Yardanicoswitched to ARC memory management model
18:10:42skrylar[m]i have never used crystal and i am more a rubyist than a pythonist, but nim works
18:10:52Yardanicohttps://forum.nim-lang.org/t/5734 some info about arc
18:11:15skrylar[m]now if only the reset password button on the forum worked :headbandage:
18:11:33Yardanicoskrylar[m]: ask dom96 :P
18:11:45leorizewe really need more reliable forum software :P
18:12:02Yardanicoas 4raq would say: go fix nimforum
18:12:02Yardanico:D
18:12:53FromDiscord<KingDarBoja> Hi guys
18:17:25FromDiscord<such father that father not> Hey!
18:19:46FromDiscord<KingDarBoja> Welcome!
18:30:49*zacharycarter quit (Ping timeout: 264 seconds)
18:33:26FromGitter<sealmove> guys, since we have a working Kaitai Struct back-end now, I started work here: https://github.com/sealmove/kaitai_struct_forensics
18:40:52*hax-scramper quit (Ping timeout: 256 seconds)
18:43:01FromDiscord<__ibrahim__> hello, can someone explain to me why my silly code gives SIGSEV?
18:43:01FromDiscord<__ibrahim__> https://pastebin.com/fN25W3wD
18:43:13Yardanicoyou forgot to initialize Test in newTest
18:43:20*uvegbot joined #nim
18:43:47FromDiscord<__ibrahim__> wow that was fast, thanks Yardanico
18:44:24Yardanicohttps://play.nim-lang.org/#ix=2iI3
18:44:31Yardanicoboth newTest and newTest2 will work
18:45:21*bra-ket quit (Ping timeout: 265 seconds)
18:45:43FromDiscord<__ibrahim__> i guess this also works
18:45:43FromDiscord<__ibrahim__> https://play.nim-lang.org/#ix=2iI4
18:46:16FromDiscord<__ibrahim__> thanks Yardanico
18:46:59Yardanicoyeah in your case newTest works because Nim assumes that that the last expression (not statement) in a proc is a return value
18:47:42FromDiscord<__ibrahim__> true, nice feature
18:48:48FromDiscord<__ibrahim__> how would you implement template specialisation on a type? using enums?
18:48:55Yardanicowdym?
18:49:18FromDiscord<__ibrahim__> say i have a component that can be a transform component or a render component or a physics component
18:52:40Araqmaybe via 'typedesc[T]' overloading, not sure tho
18:59:09FromDiscord<__ibrahim__> Thanks Araq! i will check that out for sure!
18:59:09FromDiscord<__ibrahim__> Here is a sample C++ code:
18:59:09FromDiscord<__ibrahim__> https://pastebin.com/x1fWkTCh
18:59:41FromDiscord<__ibrahim__> kinda lost between programming paradigms, should i go oop? or meta-programming?
19:00:24FromDiscord<__ibrahim__> kinda lost between programming paradigms, should i go oop? or meta-programming dsl?
19:00:34disruptekoop is dead.
19:00:58FromDiscord<Recruit_main707> tell that to python stats :P
19:01:19*nsf quit (Quit: WeeChat 2.8)
19:01:39FromDiscord<__ibrahim__> i really like Nim's metaprogramming into declarative dsl
19:02:47FromDiscord<__ibrahim__> trying to learn how to do things i usually do in cpp
19:06:28FromDiscord<__ibrahim__> okay i guess this needs macros
19:07:58skrylar[m]Yardanico: i've been bothering him to fix it about once a month now
19:08:48disrupteksealmove: how did you make kaitai work?
19:09:22skrylar[m]i dont have the same resentment to objects and still do object-based stuff in nim, i just think people might have missed what oop was about while they were badly copying it out of clos/st-80
19:11:10*NimBot joined #nim
19:11:45FromDiscord<__ibrahim__> dod seems to be the new rage in game dev
19:11:47FromDiscord<KingDarBoja> _oop is dead._ wut
19:12:34FromDiscord<KingDarBoja> I have never heard of DOD to be honest
19:12:44FromDiscord<__ibrahim__> data oriented design
19:13:17FromDiscord<__ibrahim__> something about optimising the way data is loaded to the L1 cache of the CPU to minimise cache misses that you would otherwise have in OOP
19:14:05FromDiscord<__ibrahim__> unity's new data oriented tech stack/ entity component system is based on
19:14:27FromDiscord<__ibrahim__> structs of arrays vs arrays of structs
19:14:47FromDiscord<__ibrahim__> that's about as much as i can explain it :p
19:19:44*Tyresc joined #nim
19:28:26FromDiscord<KingDarBoja> I see
19:28:59FromDiscord<KingDarBoja> Not an expert on the topic but must be a good approach as a quick google search shows several applications on game dev
19:31:43FromDiscord<__ibrahim__> Mike Acton's talk about dod from a c++ perspective is interesting
19:34:21AraqDoD is nice but in practice cumbersome to work with
19:34:51disruptekshould be easier to make it ergonomic in nim.
19:35:02*Irregulator joined #nim
19:35:12Araqindeed, we should have a DSL for it
19:35:45AraqI designed one once but my employer wasn't willing to pay for it
19:36:10Araqand I have no need for it since I don't write games :-)
19:36:16*Irregulator quit (Client Quit)
19:36:36FromDiscord<__ibrahim__> too bad for him xD
19:37:07disruptekwhat bugs me is that so much of these problems feel like things we had solutions for decades ago. we're already too old or too young; doomed to repeat history.
19:37:20*Intensity quit (Read error: Connection reset by peer)
19:37:56liblq-devEh. new weird patterns that in reality are just unnecessary microoptimizations. at least for (relatively) simple 2D games like the ones I make
19:38:57disrupteki'm thinking more of optimizations that shouldn't need to exist if the design wasn't perpetrated by a novice in the first place.
19:38:57FromDiscord<__ibrahim__> If you have alot of 3d rendered entities, they make a great difference. else, no need.
19:39:23disruptekcomputers are fast. we made them slow.
19:40:06*Intensity joined #nim
19:40:06*kungtotte quit (Read error: Connection reset by peer)
19:40:19FromDiscord<__ibrahim__> well, dod is the answer to oop's "slowness" i guess
19:40:32FromDiscord<__ibrahim__> since entity/component is oop style
19:40:45liblq-devbut oop isn't *that* slow if you know how to use it
19:40:57*kungtotte joined #nim
19:40:58liblq-devie. not have millions of subclasses each contributing to bloat
19:41:14disruptekthey are designing for the lowest common denominator.
19:42:31FromDiscord<__ibrahim__> https://www.youtube.com/watch?v=0_Byw9UMn9g
19:42:31FromDiscord<__ibrahim__> interesting talk about oop vs dod, talks about "millions of subclasses" issue
19:43:59FromDiscord<__ibrahim__> nim dod dsl would be something amazing :D declarative game programming
19:44:36leorizeliblq-dev: the "mainstream" languages shepherd people into subclassing like hell :P
19:44:49FromDiscord<KingDarBoja> My brain hurts while trying to differentiate all those paradigms
19:44:59liblq-devleorize: true
19:45:14FromDiscord<KingDarBoja> OOP vs Functional, Composition vs Inheritance, etc
19:45:21leorizeI don't really care about paradigms anymore
19:45:27leorizeI write whatever that fits
19:45:29FromDiscord<KingDarBoja> leorize is right
19:45:29disrupteki have a bug in nimph that i'm not how to handle.
19:45:36disrupteknot sure, rather.
19:45:36liblq-devleorize: same here
19:46:04FromDiscord<KingDarBoja> Mainstream languagesare pretty focused into OOP (and few functional examples)
19:46:12nerdrat[m]dom96: Let me do some tests with 0.4.0 because I didn't install the nim-1.2.0 toolchain with choosenim 0.4.0. I updated choosenim first and then I installed Nim.
19:46:15FromDiscord<__ibrahim__> i think nim has the most interesting paradigm i have ever seen, making a dsl using metaprogramming to program at a higher level
19:46:39leorize[m]nim is multi-paradigm
19:46:42leorize[m]why focus on one when you can do all?
19:46:58FromDiscord<__ibrahim__> https://www.youtube.com/watch?v=JO0iqGDgFqA
19:47:11FromDiscord<__ibrahim__> really cool demo by krux02
19:47:16FromDiscord<KingDarBoja> That explains why OOP is minimal here
19:47:37FromDiscord<KingDarBoja> But glad to see how it can be used in multiple paradigms
19:47:44leorize[m]we take what works, then get rid of the rest
19:48:07leorize[m]that's how programming should work imo
19:48:43FromDiscord<__ibrahim__> it's cool that it is multi-paradigm , which led me to some confusion to pick which paradigm to go with, after some research i learned about many paradigms and im still thinking how i should approach building a simple 2d engine in nim.
19:49:07leorize[m]don't build an engine, build a game
19:49:15leorize[m]then you will know how to build an engine
19:49:34disruptekthis.
19:49:37FromDiscord<KingDarBoja> Shouldn't it be the other way?
19:49:39*abm quit (Read error: Connection reset by peer)
19:49:39FromDiscord<__ibrahim__> it's cool that it is multi-paradigm , which led me to some confusion to pick which paradigm to go with, after some research i learned about many paradigms and im still thinking how i should approach building a simple 2d engine in nim.
19:50:00FromDiscord<__ibrahim__> whoops i deleted my comment and repasted it, didn't mean t spam sorry
19:50:01leorize[m]imo the problem with toy engine is that a lot of people don't even know how a game work and/or what it needs
19:50:06FromDiscord<KingDarBoja> RIP IRC people
19:50:47AraqDOD is also mostly a workaround for badly implemented prefetcher that doesn't understand memory strides
19:50:56FromDiscord<KingDarBoja> https://miro.medium.com/max/3632/1*wS8DsmEejvsswkQjNA-BoQ.png
19:50:56leorize[m]so if you wanna build something generalized, you gotta know the specifics first
19:51:02FromDiscord<KingDarBoja> Oh god, why I googled it
19:51:16Araqnot sure why they don't just fix the hardware but apparently it's hard
19:51:45FromDiscord<__ibrahim__> i dont care to build something generalised at all, i just want to build a simple game.
19:52:10leorize[m]then build the game
19:52:24leorize[m]an engine is the game without the game part in it :P
19:53:29FromDiscord<__ibrahim__> lol epic advice, but i come from an oop background, and i want to write idiomatic nim ( at least as best i can )
19:53:53FromDiscord<__ibrahim__> i guess idiomatic nim is procedural metaprogramming
19:54:30leorize[m]idiomatic nim is "whatever that works"
19:54:40FromDiscord<KingDarBoja> lol really?
19:54:46disrupteknah.
19:54:58leorize[m]I'm outta words :P
19:55:10leorize[m]well we try to use as little advanced features as possible
19:55:15FromDiscord<EdgyNerd> how would I manually compile the C source files that Nim produces? (is there just a simple gcc command I can use)
19:55:23leorize[m]only use them when it's needed
19:55:34disruptekgcc works.
19:55:35leorize[m]@EdgyNerd: pass --genScript to the compiler
19:55:57leorize[m]it'll generate a script with the commands needed to build your project
19:56:11leorize[m]the script will be in your nimcache though, so you might want to move it elsewhere with `--nimcache`
19:56:30FromDiscord<__ibrahim__> thank you leorize
19:59:01FromDiscord<EdgyNerd> "it'll generate a script with the commands needed to build your project" where are the commands?
19:59:20leorize[m]check your nimcache
19:59:29leorize[m]there will be a script inside it
19:59:43FromDiscord<EdgyNerd> oh yeah I missed 'compile_pi.sh'
20:00:07dom96nerdrat[m], thank you :)
20:03:23leorizeanyone knows how to use `{.multisync.}`?
20:04:27dom96sure
20:05:03leorizeso how do I use it? :P
20:05:07leorizewhat should my return type be?
20:08:32*Hideki_ joined #nim
20:09:24FromDiscord<KingDarBoja> OMG just finished another test round and now a previous tests is failing lol
20:09:47FromDiscord<KingDarBoja> I hate when that happens x.x
20:13:25*Hideki_ quit (Ping timeout: 264 seconds)
20:18:30dom96leorize: take a look at the stdlib for examples
20:25:51FromDiscord<mratsim> What is DOD?
20:29:25inv2004shashlick, I just copied all bycopy from your link and commited, but nothing really changed. structure was ~ the same before
20:29:43inv2004https://github.com/inv2004/test_nim_c/blob/master/c.nim#L9
20:30:00inv2004and it is the same "Illegal storage access."
20:30:34inv2004ah, except that I replaced your array[1, cuchar] with arr*: UncheckedArray[S]
20:30:51inv2004UncheckedArray[SS]
20:31:17*azed joined #nim
20:31:20inv2004I did the same for S-struct and it worked fine
20:39:38leorizeinv2004: the sizes of the arrays where different
20:39:46leorizein the C code they are `unsigned char`
20:40:01leorizebut you use a `pointer` here for nim code
20:40:36inv2004leorize, I have the same for S-struct, which works fine. the arr is just offset for allocated array of pointers
20:41:18inv2004that is why I suppose it is not important for C is it is char array of something else
20:44:17inv2004I compile the code with nim only (not nimble) - where can I find generated .c file? I see it in nimcache for nimble projects only - strange
20:44:35disruptekset your --nimcache:/some/where
20:45:33*rockcavera quit (Remote host closed the connection)
20:45:55inv2004thx
20:45:57*rockcavera joined #nim
20:46:07Yardanicoinv2004: ~/.cache/nim
20:47:55leorizeinv2004: yea the char is the problem
20:48:21inv2004hm, hm, should I cast it then? why it works for S ?
20:48:36leorizehttp://ix.io/2iJ5
20:48:46leorizethis is probably due to the C compiler attempting to align the struct
20:50:28inv2004It works! thank you!
20:51:44inv2004another question - how bycopy works? If I have 1000Gb of data in one array - will it copy it every access? or will it make deep copy (not, because it is byte right now I think)
20:53:27leorize`{.bycopy.}` means pass to parameters like C does
20:54:42leorizein Nim, if an object has a size > 3 * sizeof(float), it will be passed to functions as reference (ie. proc(o: BigObj) -> void(BigObj* o)) as an optimization
20:55:05leorizesince we're dealing with C, that pragma forces Nim to not do this kind of optimization
20:55:29inv2004interesting, thank you
20:55:59*krux02 quit (Remote host closed the connection)
20:56:25inv2004another question: if I have the ptr object - does it mean that GC do not care about it?
20:56:31leorizeyea
20:56:52PrestigeIs there a way to get a string representation of a const's name (at compile time)? I don't think there is but I'm trying to avoid potentially "extra" work
20:57:06leorizeastToStr()
20:57:28leorizeit can convert any ast into a string
20:57:30inv2004what can I do with it? in my lib which defines the S and SS structure - I have some kind of reference-counter to clear the structure - can I link it somehow with nim?
20:57:42inv2004... with nim's GC
20:57:42Prestigeleorize: thanks
20:58:11leorizeinv2004: you can't, however we do have a destructors system that you can exploit to link it to Nim
20:58:25leorizeinv2004: https://nim-lang.org/docs/destructors.html
20:59:24leorizewrap your pointer in an object with one field (there won't be any overhead), then define `=`, `=destroy` and `=sink` for it
20:59:43leorize`=` should be mappable to `inc_ref()`
20:59:50leorize`=destroy` to `dec_ref()`
20:59:58leorizeand `=sink` should just copy the pointer over
21:00:08inv2004Perfect, thank you!
21:03:07leorizeso from this: https://stackoverflow.com/questions/5435841/memory-alignment-in-c-structs
21:03:26leorizeit appears that you should always wrap structs as-is
21:04:29leorizeas C compilers are allowed to add paddings however they like
21:06:14*someunknownuser quit (Quit: someunknownuser)
21:07:13inv2004ok, so the two structs does not match, got it
21:08:09inv2004I have an idea, probably (original idea for the chat) to rewrite everything in nim, and just to pass .addr to C sometimes - I should not cafe about GC or anything else
21:08:34inv2004cafe = care . Looks like I need better keyboard :(
21:08:47*tane quit (Quit: Leaving)
21:08:55leorizeit does work
21:09:16leorizeyou can expose Nim's reference tracking to C also
21:10:57leorizethen you should make the struct opaque and use getter/setter procs to access it from C
21:13:09inv2004Yep, have to think about it
21:14:49FromDiscord<exelotl> How do I publish docs for my library? Do I run `nim doc` and then manually copy the result into a gh-pages branch?
21:15:13leorizeyea
21:15:19disrupteknim doc --project --outdir=docs some.nim
21:15:21leorizethere's `nim doc --project`
21:15:30leorizeoh that works too
21:16:24Prestigeis there a way to have `when defined` statements in a table declaration to selectively initialize it with certain entries?
21:16:31disrupteksure.
21:18:38FromDiscord<exelotl> what does --project do?
21:18:54Prestigethis is what I'm trying to do: https://0x0.st/i112.png
21:18:56FromDiscord<exelotl> I don't see the difference compared to just running nim doc
21:19:25leorizeit recursively generates documentation for all modules in the project iirc
21:19:55FromDiscord<exelotl> oh wow, so it does!
21:20:12FromDiscord<exelotl> that's epic, I can delete my script to do that now. πŸ˜…
21:28:04FromGitter<lolgab> Hi everyone :) ⏎ Do you know a way to attach a pipe to an external process started with `startProcess` to a file descriptor different from `stdin`, `stdout` or `stderr`? I want to read what the process writes to fd `3`
21:28:28leorizesorry, that's not here yet
21:28:58leorizefor now you gotta do plain old fork()-setup-exec()
21:29:31FromGitter<lolgab> No workarounds like attaching to the underlying process or something available?
21:29:41FromGitter<lolgab> I tried but didn't achieve anything
21:29:42FromDiscord<Recruit_main707> lolgab: that sounds to dll injection ;)
21:30:22leorizelolgab: setup a pipe then forward it as fd 3 to the target process?
21:30:24*arecaceae quit (Remote host closed the connection)
21:30:32*solitudesf quit (Ping timeout: 256 seconds)
21:30:50*arecaceae joined #nim
21:31:07FromDiscord<Recruit_main707> the file descriptors in other processes
21:31:38FromGitter<lolgab> I want to implement a proxy of a protocol similar to this one: https://github.com/apache/openwhisk/blob/master/docs/actions-actionloop.md#implementing-the-actionloop-protocol
21:32:23FromGitter<lolgab> > setup a pipe then forward it as fd 3 to the target process? ⏎ ⏎ Yes, something like that.. I have to try deeper
21:32:54leorizeposix_spawn should simplify the process
21:34:15FromGitter<lolgab> Thank you, I'll try with `posix_spawn`
21:41:50*natrys quit (Quit: natrys)
21:43:01PrestigeIs there a way I could do this at compile time with an immutable map, or is this the best I'll get? https://play.nim-lang.org/#ix=2iJv
21:43:34disruptekyou can use a ct const table.
21:44:11leorizePrestige: you can just... import all of them
21:45:15Prestigeyou mean just not bothering with `when defined` and having them all exist?
21:45:21leorizeyea
21:45:32Prestigehm I suppose so
21:47:05disrupteka .compileTime. var is immutable, fwiw.
21:47:16disrupteksad but true.
21:47:30Prestigedisruptek: what is a ct const table?
21:47:40disruptektables can be consts.
21:48:06Prestigeif I do that here using when defined, I thought I'd get an error for adding more elements
21:48:45disruptekconst someTab = when foo: {...} else: {...}
21:50:42Prestigeahh perfect, thanks
21:51:31Prestigeactually maybe not if multiple things could be defined and added to the map
21:51:43disruptek.compileTime. then.
21:52:27disruptekor just define the contents as consts and then add them all at once.
21:53:58*azed quit (Quit: WeeChat 2.7.1)
21:55:18FromDiscord<Elegant Beef> prestige what is that for?
21:55:48Prestigereading a user config file and getting the keysyms from the names
21:56:23FromDiscord<Elegant Beef> Xlib can convert string to keysym, which then can convert to keycode
21:57:03PrestigeYeah, I'm wanting to have some custom names though
21:57:16Prestigelike just using "c" instead of "XK_c"
21:58:08FromDiscord<Elegant Beef> I mean
21:58:08FromDiscord<Elegant Beef> https://hatebin.com/jiydsehajg
21:58:14FromDiscord<Elegant Beef> That's from my config loader
21:58:16FromDiscord<EdgyNerd> is there a way to get arbituary precision floats in Nim?
21:58:31FromDiscord<Elegant Beef> It's hardcoded right now, but it will support loading chars
21:58:40leorize!repo decimal
21:58:41disbothttps://github.com/Sud0nim/Decimal -- 9Decimal: 11A big/arbitrary precision Decimal class in pure Nim 15 23⭐ 0🍴 7& 1 more...
21:58:49leorize!repo nim-decimal
21:58:50disbothttps://github.com/Sud0nim/Decimal -- 9Decimal: 11A big/arbitrary precision Decimal class in pure Nim 15 23⭐ 0🍴 7& 1 more...
21:58:51PrestigeElegant Beef: You can just pass in "d" and it will auto convert to XK_d?
21:59:11leorize!repo status-im/nim-decimal
21:59:11disbothttps://github.com/status-im/nim-decimal -- 9nim-decimal: 11A correctly-rounded arbitrary precision decimal floating point arithmetic library 15 12⭐ 3🍴
21:59:12FromDiscord<Elegant Beef> I mean that works so when i hit mod4 + d it opens rofi
21:59:20Prestigeinteresting
21:59:23Prestigethanks
21:59:36*dddddd joined #nim
21:59:54FromDiscord<Elegant Beef> My WM is actually mostly functional
21:59:58leorize@EdgyNerd: ^ use nim-decimal
22:00:12FromDiscord<KingDarBoja> How can I convert a parent type to a child type?
22:00:21FromDiscord<KingDarBoja> Just curious, seems like I can do the opposite
22:00:41FromDiscord<Elegant Beef> `Child(parent)` is i think the standard, or `cast[Child](parent)`
22:00:47FromDiscord<Elegant Beef> But im a numpty in nim so πŸ˜„
22:00:55FromDiscord<KingDarBoja> The child(parent) didn't worked
22:00:58FromDiscord<KingDarBoja> Let me try the cast
22:01:15FromDiscord<KingDarBoja> As the first one yields `Invalid object conversion [ObjectConversionError]`
22:01:16leorizeChild(parent) work if it's a ref object
22:01:25FromDiscord<KingDarBoja> Both are ref objects πŸ€”
22:01:32leorizeinherited?
22:01:38FromDiscord<EdgyNerd> actually how do I download/use libraries in Nim?
22:01:42FromDiscord<KingDarBoja> Ye
22:01:45FromDiscord<Elegant Beef> Nimble
22:01:52leorizeyou either use nimble or nimph
22:01:53FromDiscord<Elegant Beef> then import module/name
22:02:26leorize@KingDarBoja: make sure you check it with `if obj of Child` before doing the `cast` then
22:02:36FromDiscord<Elegant Beef> so currently prestige im stuck at drawing status bars for monitors, and having workspaces
22:03:10FromDiscord<KingDarBoja> Hold on, sharing a screenshot
22:03:23FromDiscord<KingDarBoja> I am doing it at the newMyType proc of the child type
22:03:33FromDiscord<Elegant Beef> I've tried multiple things to unmap and remap but it seems unmapping causes the window to bork
22:03:57leorize@KingDarBoja: I can see why it didn't work now :P
22:04:44FromDiscord<KingDarBoja> :'v
22:05:32FromDiscord<KingDarBoja> https://imgur.com/gE4jB2w
22:05:38FromDiscord<KingDarBoja> Left child, right parent
22:06:08leorizeyea you can't do that
22:06:52leorizebut... couldn't a variant object work here?
22:07:34leorizewell but I guess exceptions are built on inheritance
22:07:36FromDiscord<Elegant Beef> Is there an OOP environment where that'd be allowed? Cause im fairly certain C# wouldnt allow that either
22:07:52leorizepython would allow it
22:08:11FromDiscord<Elegant Beef> Yea but python also allows you to cry while coding
22:08:13FromDiscord<Elegant Beef> So that's a low bar πŸ˜„
22:08:30FromDiscord<KingDarBoja> Python
22:08:35shashlick@leorize - question from last night - does importc work on static inline functions with {.header.}
22:09:06shashlickI'd think so since the header is being pulled in with the nim code during compile so it should work
22:09:07FromDiscord<KingDarBoja> https://imgur.com/JXlbRPl
22:09:13FromDiscord<KingDarBoja> Sauce from Python
22:09:17leorizeKingDarBoja: anyhow, create an `init` proc for GraphQLError
22:09:33FromDiscord<KingDarBoja> It has one already, it is new
22:09:45shashlickIt won't work with dynlib, depends if compiler stripped it out
22:09:45FromDiscord<KingDarBoja> Cuz it must be a ref or I will not be allowed to raise it
22:09:52leorizeKingDarBoja: no, an init that take a GraphQLError
22:10:05leorizeshashlick: `static` functions are limited to the file that contains it
22:10:12leorizeyou can't link against them
22:10:33leorizefor standalone headers: translate them to Nim
22:10:43leorizefor non-standalone, use `{.header.}` and it should work
22:10:56*FromDiscord <KingDarBoja> Scratching my head
22:11:13shashlickBut that's why I'm saying if Nim importc has header pragma, the header gets included during compile time
22:11:16FromDiscord<KingDarBoja> But why a init if I have a new already, (GraphQLError is a ref)
22:11:26FromDiscord<KingDarBoja> Or maybe I don't get the idea?
22:11:28shashlickOther cases its no go
22:12:04leorizeyep, that's why I said you gotta translate that function to Nim in non-{.header.} case
22:12:47leorize@KingDarBoja: well we don't usually use exceptions for this kind of errors
22:13:02FromDiscord<KingDarBoja> πŸ€” so?
22:13:03*inv2004 quit (Quit: Leaving)
22:13:13PrestigeElegant Beef: Thanks for sharing that, going to make my life a lot easier lol
22:13:49leorizebut here's how this can be done: make an `init(g: GraphQLError) = g.field = "foo" <- basically a helper setup proc like this`
22:14:35leorizethen in your inherited object, do this `new result; init(result); <do your child object setup here>`
22:14:56FromDiscord<Elegant Beef> Check out my loadconfig in config.nim and goodwm.nim's setup procs to see more how im handling
22:15:40FromDiscord<Elegant Beef> I have a system for hardcoded events and user defined commands
22:16:18Prestigeonly thing I need to do it add modifiers and I should be good
22:18:19leorize@KingDarBoja: ping just in case you didn't see the above
22:18:30FromDiscord<KingDarBoja> Looking at it
22:18:46shashlickso that's the thing - why would anyone expect to share static inline procs as an API if the header isn't supposed to be available
22:19:11FromDiscord<KingDarBoja> So the init "helper" proc should just return the GraphQLError type so I can use it on my inherited obj, rigth?
22:19:54shashlickas a C lib writer, if I am using static inline and expect my user to use those procs, I will be giving them the header
22:19:56leorizethe helper proc take a GraphQLError, then set the needed fields
22:20:03FromDiscord<KingDarBoja> Right
22:20:05shashlickso I don't see the point in converting them into pure Nim
22:20:41leorizestatic inline procs are like macros, but with better syntax and semantics
22:21:25PrestigeElegant Beef - how would you add/load a modifier key from a string (like shift)?
22:21:40FromDiscord<Elegant Beef> I mean i'd have a map for modifiers
22:21:47FromDiscord<Elegant Beef> there's only like 8 of them afterall
22:22:07leorizeshashlick: you can try to convert them, but if you can't just bail and tell the user to either enable `{.header.}` or override it with their own hand written version
22:22:36shashlickso my logic is that nimterop is all about wrapping headers at build time, which means the header is right there
22:23:05leorizeyea but there are users that want to use nimterop to generate standalone headers, no?
22:23:19shashlickcreating wrappers that don't need the header anymore might be a legitimate use case no doubt
22:23:38shashlickbut I don't think it is realistic for large wrappers
22:24:02leorizeworst case, just import the proc verbatim to the wrapper with `{.emit.}`
22:24:08shashlickcause people do all sorts of platform, compiler and package detection at build time
22:24:22shashlickI tried to explain my rationale in the latest nimterop readme in the why nimterop section
22:24:34shashlickI know 4raq doesn't agree with it but that's my experience so far
22:25:00leorize4raq wants a tool that can generate platform-agnostic wrapper
22:25:04leorizeyour tool is not that :P
22:25:27leorizeso just ignore him, focus on the use case that your tool targets
22:25:40shashlickI don't believe that's possible without reimplementing everything configure/cmake and preprocessor does in Nim
22:25:43leorizeto be fair I think nimterop is not something anyone should use to generate generic wrappers
22:26:03shashlickthat's not going to be my goal - I've explained that in the readme now
22:26:19shashlickplease take a read and let me know your feedback
22:26:21leorizefor simple stuff, like sdl2 or kmod this can be done
22:26:27leorizesince they're not a maze of configurations
22:27:06leorizebut for more "configurable" ones like openssl, yea it's impossible
22:27:28*Tyresc quit (Quit: WeeChat 2.9-dev)
22:28:05shashlickbasically stuff like this issue - https://github.com/nim-lang/zip/issues/39
22:28:08disbotβž₯ ZlibStreamError due to size mismatch of data types (Linux) ; snippet at 12https://play.nim-lang.org/#ix=2iJQ
22:29:04shashlickcall me lazy but I don't want to reimplement all that #ifdef in Nim because then it is my responsibility for the user to pass all the #defines for that specific platform/compiler/package combo to the nim wrapper so that it renders the right thing at compile time
22:29:44shashlickso I'm willing to toss this `static inline` stuff also into the same bucket, even though we could wrap it into pure Nim
22:30:01shashlickanother - call me lazy - classification
22:30:12shashlickjust want to make sure I'm not missing something, hence the questions and explanations
22:30:32shashlickI'll consider the {.emit.} thing later for non {.header.} cases
22:32:26FromDiscord<KingDarBoja> leorize: got it, thanks
22:32:34FromDiscord<KingDarBoja> It seemed messy but that works lol
22:36:24FromDiscord<KingDarBoja> https://imgur.com/b8pXb5l
22:37:19leorizethat's not how I meant it to be...
22:37:25*chemist69 quit (Ping timeout: 272 seconds)
22:37:49*chemist69 joined #nim
22:38:53FromDiscord<KingDarBoja> Uhhh?
22:41:55leorizehttps://play.nim-lang.org/#ix=2iJT
22:42:30leorizeit's a pattern in Nim for exceptions to be object type and not ref object
22:42:48*couven92 joined #nim
22:47:22dom96it's a historical defect ;)
22:49:38leorizethe lack of documentation for asyncdispatch is annoying...
22:53:39*inv2004 joined #nim
22:55:17dom96leorize: I agree, can you help us improve it? :)
22:55:30FromDiscord<KingDarBoja> Impressive, never expected such approach
22:55:43leorizedom96: I'm still trying to make sense of how to do things lol
22:56:05FromDiscord<KingDarBoja> Darn leo, you are pretty good at this ❀️
22:56:19dom96leorize: feel free to ask questions
22:57:24leorizeI'm still unsure whether to use FutureVar or FutureStream
22:57:43leorizethe use case is to read data from a pipe
22:57:50inv2004leorize, my previous example works, but I moved everything to real lib and found that struct in totally misaligned, but on another fields. Do it mean than my definition of nim-struct is not correct (but looks it is ok) . Or are there any way to align my nim-struct to match C ?
22:59:01leorizeyea your definition might not be correct
22:59:13leorizeif you can share the C and Nim definition I might be able to figure out why
22:59:15inv2004ok, let me recheck
22:59:17dom96leorize: what's the pipe implemented as?
22:59:21dom96is it an async pipe?
22:59:33leorizeboth
22:59:39leorizebut yea for this it's an asyncpipe
23:00:06inv2004@leorize, How do you check it? I just printed all offsetof in C and nim
23:00:22leorizeinv2004: manual inspection and experience :P
23:00:22dom96leorize: not sure why you'd need either then
23:00:34inv2004@leorize, ah, I do not have it, ok :)
23:01:06dom96You're presumably reading from the pipe and then writing it somewhere else? let data = await pipe.read(1024); await foo.send(data)
23:02:11leorizethat's an use case
23:02:24inv2004heh, looks like I have a bit :) probably found a bug in c2nim
23:03:11inv2004typedef char*S,C - S is char*, but C is char. looks like how it is in C, but c2nim set cstring for C
23:03:32leorizedom96: the other one could be that you wanna parse something and you start trickle data in from the pipe
23:04:03leorizehmm actually I can implement both lol
23:04:22dom96You only need FutureStream if you're offering an API for someone else to consume streaming data
23:04:46dom96It seems you already have a streaming API with the pipe
23:04:50leorizeI got kinda confused when I saw asyncfile.readToStream :P
23:08:49inv2004should I try to send PR to c2nim or it is outdated already? I remember previous struct was generated by something else
23:09:59leorizesure, make a PR to c2nim
23:10:06shashlickPlease fix it if you can
23:10:41inv2004shashlick, but you generated it by something else
23:10:55leorizethe other tool is not a c2nim replacement :)
23:11:56shashlickNimterop
23:12:43inv2004thx, too late to ask the difference :)
23:15:51FromDiscord<KingDarBoja> Hey leo, looking at the example
23:16:02*inv2004 quit (Quit: Leaving)
23:16:10FromDiscord<KingDarBoja> Does that means that all my setup stuff for the base error shoul be on init call instead of new, right?
23:16:27leorizeyea
23:16:43FromDiscord<KingDarBoja> Okie Dokie
23:16:48FromDiscord<KingDarBoja> Makes sense
23:16:54leorizeon another note, EINTR is horrifying in so many levels
23:18:29FromDiscord<KingDarBoja> Ok moved all setup of base error into init with it's parameters
23:18:53FromDiscord<KingDarBoja> But now the `newError` proc is asking for those
23:19:32leorizeuhmmm, just forward all the parameters to init?
23:20:07FromDiscord<KingDarBoja> .-.
23:20:56FromDiscord<KingDarBoja> wdym
23:21:07leorizenow i'm not sure what you mean
23:21:45FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2iK7
23:21:50FromDiscord<KingDarBoja> Check init of `Error`
23:22:02FromDiscord<KingDarBoja> -> missing parameter: param1
23:22:08FromDiscord<KingDarBoja> this is what I mean
23:23:56leorizehttps://play.nim-lang.org/#ix=2iK8 <- like that?
23:24:56FromDiscord<KingDarBoja> πŸ€”
23:26:17FromDiscord<KingDarBoja> That looks like a mess with more params IMO
23:27:56leorizewell it's not like you'll need it for every param
23:28:21leorizeyour newGraphQLSyntaxError already got less param than newGraphQLError
23:30:52*Faulander_ joined #nim
23:32:16FromDiscord<KingDarBoja> πŸ€”
23:32:30*Faulander quit (Read error: Connection reset by peer)
23:33:06*liblq-dev quit (Quit: WeeChat 2.7.1)
23:43:26FromDiscord<KingDarBoja> Ok, now it works
23:45:48FromDiscord<KingDarBoja> The only thing that bother me is having the same proc arguments for the parent error
23:45:55FromDiscord<KingDarBoja> On the init and newError call
23:50:44*Trustable quit (Remote host closed the connection)
23:52:11leorizethen maybe instead of so many arguments you should try to see if it can be derived from some state object?
23:55:43*konvertex quit (Ping timeout: 250 seconds)
23:56:12FromDiscord<KingDarBoja> Nah
23:56:32FromDiscord<KingDarBoja> Or wait, not sure what you mean
23:57:56leorizeit's a parser, right? then you can probably derive most of the data in the parsing error from the parser state?
23:58:14leorizebut then I'm not sure how your parser even work :P
23:59:06FromDiscord<KingDarBoja> I do prefer it like it is right now, I don't have issue with the duplicated arguments on both init and new call
23:59:41FromDiscord<KingDarBoja> Still nice idea
23:59:59FromDiscord<KingDarBoja> Didn't know about the Exception being handled like that