<< 14-10-2021 >>

00:01:18FromDiscord<Yardanico> And C backend is still the default
00:17:58FromDiscord<gogolxdong (liuxiaodong)> @stefanbacon you can deploy contracts using https://github.com/status-im/nim-web3
00:18:01nrds<R2D299> itHub: 7"<No Description>"
00:18:17FromDiscord<gogolxdong (liuxiaodong)> and interact with contract
00:22:17FromDiscord<sheldon> https://media.discordapp.net/attachments/371759389889003532/898002740221988884/message.txt
02:14:14FromDiscord<satyrn> what would be the nim equivalent of python `var[:num]`
02:16:12FromDiscord<satyrn> actually nvm ill probably just write a proc to do that
02:16:34FromDiscord<Rika> var[var.low..<num]
02:17:17FromDiscord<satyrn> oh ok thanks
02:39:04FromDiscord<satyrn> how would i do something like kwargs in nim
02:39:49FromDiscord<impbox [ftsf]> you can pass keyword arguments in nim
02:40:30FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3BGp
02:41:19FromDiscord<satyrn> alright thanks
02:41:50FromDiscord<Rika> Variable keyword arguments not possible though, I believe
02:42:22FromDiscord<impbox [ftsf]> as in passing in a table of keyword arguments?
02:42:45FromDiscord<Rika> As in keyword arguments not existing on the explicit function signature
02:42:50FromDiscord<Rika> kwargs
02:43:08FromDiscord<Rika> Possible but with much pain
02:43:19FromDiscord<Rika> Make a macro if you really want it, and even then it’s a lot of work
02:44:32FromDiscord<satyrn> i just need to make it so i can have 3 mandatory args and 1 optional arg, and do different stuff in the proc if the optional arg isnt set
02:46:22FromDiscord<Rika> you can do that with overloading
02:54:15FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3BGs
03:06:01*arkurious quit (Quit: Leaving)
03:08:51*asd quit (Ping timeout: 245 seconds)
03:10:43*asd joined #nim
03:39:52*rockcavera quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
06:11:21*andinus quit (Remote host closed the connection)
06:13:38FromDiscord<codic> If you look at the original pascal sources of the compiler (<https://github.com/nim-lang/Nim/tree/ea1f1ec6d4d6c776eb0f81c2bebdd4cb4c817ebe/nim>) you can really see just how much nim is like kinda a successor in the Pascal family, a lot of that stuff has rubbed off on modern Nim, I'm pretty sure most of that pascal should be readable to any nim programmer
06:13:41FromDiscord<codic> just found that interesting
06:17:32FromDiscord<impbox [ftsf]> oh wow
06:18:22FromDiscord<Elegantbeef> Yep it really feels/looks like a modern wirth language
06:20:10FromDiscord<impbox [ftsf]> i did a tiny bit of pascal in school i think, the only bit i remember was `:=`
06:29:43NimEventerNew thread by Miran: Nim 1.6.0 RC3, see https://forum.nim-lang.org/t/8500
06:36:57FromDiscord<Kiloneie> When is type casting a good idea, or any good example of when type casting is useful ?
06:37:14FromDiscord<impbox [ftsf]> when you want to pretend one type is another
06:38:01FromDiscord<impbox [ftsf]> eg. I want to write some bytes to a file, but I have an object
06:38:13FromDiscord<impbox [ftsf]> I can cast it to an array of bytes
06:39:10FromDiscord<Kiloneie> so instead of extracting the fields, just cast it in there and the data is there right ?
06:39:47FromDiscord<Kiloneie> type casting it back would work right ?
06:40:55FromDiscord<Elegantbeef> Are we talking about `cast` or type conversions?
06:42:18FromDiscord<Kiloneie> cast, i haven't used it yet, and i gotta bundle it with a video since it's probably too short of a topic to just make a video on it's own on it(of course i wanna know first what their use cases with concrete examples)
06:42:19FromDiscord<impbox [ftsf]> think of cast as a "view" more so than a conversion
06:42:41FromDiscord<impbox [ftsf]> it's still pointing at the same memory, but treating it differently
06:43:21FromDiscord<Kiloneie> basically it's still the same data, bit pattern preserved, but you use it differently after the cast... yeh i okay i get it
06:43:57FromDiscord<Kiloneie> Any actual reasons where it is neccessary to use them though ? like with C or smthing ?
06:44:35FromDiscord<Elegantbeef> Well cast is typically reserved for low level operations, so if you're making a stream library you'd probably want to cast
06:44:50FromDiscord<impbox [ftsf]> interacting with C is a common case
06:45:53FromDiscord<Kiloneie> they are faster im assuming, especially your example of casting an object to a file into an array ?
06:46:00FromDiscord<Elegantbeef> The reason to use cast is you have data in a type that you know the layout/size and want it as a different type, it's purely a type system and is free
06:46:20FromDiscord<Kiloneie> okay thank you both
06:46:34FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3BH0
06:48:13FromDiscord<Elegantbeef> A lovely contrived example here https://play.nim-lang.org/#ix=3BH1
06:49:44FromDiscord<Kiloneie> i think imma put this into a pointer video or after it
06:49:58FromDiscord<Kiloneie> haven't covered ptr besides in the SDL video
06:50:02FromDiscord<Kiloneie> a brief one
06:50:15FromDiscord<Elegantbeef> You had a video about references and didnt cover pointers?
06:50:39FromDiscord<Kiloneie> yep :P, i tried to cut it down to be as simple as possible
06:50:46FromDiscord<Kiloneie> i did talk about pointers as well
06:50:47FromDiscord<Kiloneie> some
06:50:54FromDiscord<Elegantbeef> But references are more complicated imo
06:50:59FromDiscord<Kiloneie> but the main topic was on references
06:51:16FromDiscord<Kiloneie> well references are safe though, pointers are not
06:51:37FromDiscord<Kiloneie> so if i teach someone to use references, they can't really memory leak etc
06:51:42FromDiscord<Kiloneie> but with pointers they can
06:51:55FromDiscord<impbox [ftsf]> much more dangerous things than leaking memory =)
06:52:34FromDiscord<Elegantbeef> Like using any of my code
06:52:49FromDiscord<Kiloneie> xD
06:55:11NimEventerNew Nimble package! easy_sqlite3 - Yet another SQLite wrapper for Nim., see https://github.com/codehz/easy_sqlite3
06:55:20FromDiscord<Elegantbeef> Speaking of my code guess i should look at nicoscripter again \:P
06:57:28FromDiscord<impbox [ftsf]> mmm any ideas on what do next or at a loss?
06:57:43FromDiscord<Elegantbeef> Probably fix this
06:57:44FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/898102255973179422/image.png
07:04:10FromDiscord<Elegantbeef> Dont know exactly what needs fixed, since fixing the os module doesnt make it work, so fun game of follow compiler logic until something make sense
07:07:48NimEventerNew thread by Lachu: Ref.sizeof error?, see https://forum.nim-lang.org/t/8501
07:08:44*max22- joined #nim
07:11:21*asd quit (Ping timeout: 245 seconds)
07:12:14*asd joined #nim
07:12:32*Vladar joined #nim
07:20:31*Gustavo6046 quit (Ping timeout: 245 seconds)
07:20:53*Gustavo6046 joined #nim
07:29:15*PMunch joined #nim
07:51:56FromDiscord<enthus1ast> ah true, i mistake this for split which has this feature
07:53:09FromDiscord<enthus1ast> would be a nice addition to replace imho
08:06:55PMunch@Yardanico, did you ever get any further with your sciter wrapping?
08:07:18FromDiscord<Yardanico> not sure what you mean, it's pretty low-level but as far as I can tell most stuff will already work
08:07:27FromDiscord<Yardanico> the "main" thing - bridging native functions to sciter side - works
08:07:36FromDiscord<Yardanico> also I updated it to the Sciter.JS yesterday
08:07:44PMunchYou where trying to wrap it using Futhark, no?
08:07:50PMunchBut ran into some issues
08:08:00FromDiscord<Yardanico> yeah, but I didn't go far sadly, it still doesn't like the headers
08:08:11FromDiscord<Yardanico> the problem with Sciter headers is that they have C++ code under cplusplus defines
08:08:13FromDiscord<Yardanico> or CPP11
08:08:19PMunchDo you have a sample?
08:08:30PMunchThose should be fine
08:08:49PMunchFuthark should handle those without any trouble
08:09:46FromDiscord<Yardanico> you can try to download https://github.com/c-smile/sciter-js-sdk/archive/refs/heads/main.zip (quite a big download), then go to `include` folder, and try to compile this sample:
08:09:53FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3BHo
08:10:22FromDiscord<Yardanico> i mean if you want to check that it compiles
08:10:31FromDiscord<Yardanico> I compiled with `gcc -I/usr/include/gtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -Dchar16_t=uint16_t -lgtk-3 -lglib-2.0 -I/home/dian/Projects/nsciter/sdk/include -ldl sciter-gtk-main.c`
08:10:38FromDiscord<Yardanico> without makefiles, the hard way, just for quick testing
08:11:57FromDiscord<Yardanico> and yeah, by default now futhark errors out about 1mil VM iterations, after changing to 10mil it takes quite a while but then crashes with an assertion about length of hashset being changed while iterating over it
08:12:12FromDiscord<Yardanico> with
08:12:20FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3BHq
08:13:01FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/898121199379415050/unknown.png
08:13:04FromDiscord<Yardanico> the error is indeed pretty weird
08:17:59FromDiscord<Yardanico> also the json output from opir is 8.3 million chars long, so it's indeed pretty big :)
08:18:43FromDiscord<Yardanico> ok, I found where it errors in futhark code - line 543 `for name in state.used`
08:18:56FromDiscord<Yardanico> ahh right you're adding to the hashset while iterating over it
08:20:21FromDiscord<Yardanico> i'll try to use a temp hashset instead, will see how far that goes
08:20:58FromDiscord<Yardanico> now it's `error: Unknown kind in findAlias: {"kind":"invalid","value":"func_noproto?"}`
08:21:48FromDiscord<Yardanico> sent a code paste, see https://paste.rs/N0A
08:22:09FromDiscord<Yardanico> ill make a small pr
08:23:16PMunchHuh, curious that I've never run into that hashset error before
08:23:30PMunchAnd the func_noproto is simply something I haven't seen before
08:23:36FromDiscord<Yardanico> heh
08:23:38PMunchVery interesting
08:23:44PMunchI'll try to see if I can get it to work
08:23:50FromDiscord<Yardanico> there are 3 of those apparently https://media.discordapp.net/attachments/371759389889003532/898123925375025182/unknown.png
08:24:00PMunchAnd 8.3 million lines of Opir output, yikes
08:24:18PMunchDo you have a file and location for those objects?
08:24:29FromDiscord<Kiloneie> the default iterator is called items right ? foggy memory
08:24:34FromDiscord<Yardanico> not lines, but characters, yeah @PMunch
08:24:42FromDiscord<Yardanico> @Kiloneie if you mean the default iterator that's called when using `for`, yes
08:24:49FromDiscord<Yardanico> @PMunch yeah, opir has that info
08:24:52FromDiscord<Kiloneie> yes, thanks
08:24:56PMunchitems is the default one, yes
08:25:12PMunchOh characters, that's slightly better at least :P
08:25:33FromDiscord<Kiloneie> some of my videos i improvized more so i don't know what's in the video xD...
08:25:42PMunchYeah I know Opir has that info, I was wondering if you could share them so I could have a look at the C that generated it
08:26:16FromDiscord<Yardanico> i think it shows that invalid thing for `typedef struct _ISciterAPI { a lot of stuff} ISciterAPI;`
08:26:21FromDiscord<Yardanico> one of func_noproto at least
08:26:32FromDiscord<Yardanico> sciter-x-api.h line 300
08:26:53FromDiscord<Yardanico> wait sorry that's the wrong one
08:26:56PMunchHmm, that should be handled just fine
08:26:58FromDiscord<Yardanico> it's confused for `typedef ISciterAPI (SCAPI SciterAPI_ptr)();`
08:27:01FromDiscord<Yardanico> line 302
08:27:10FromDiscord<Yardanico> `{"kind":"typedef","file":"/home/dian/Projects/nsciter/sdk/include/sciter-x-api.h","position":{"column":29,"line":302},"name":"SciterAPI_ptr","type":{"kind":"invalid","value":"func_noproto?"}`
08:28:05FromDiscord<Yardanico> SCAPI is defined just as `#define SCAPI` on linux and `#define SCAPI stdcall` on windows
08:28:32PMunchMan, the libclang documentation is so bad..
08:29:40PMunchhttps://kdevelop-devel.kde.narkive.com/pCHZr4QN/review-request-127027-add-support-for-cxtype-functionnoproto <- Seems like NoProto could possibly be handled the same way as Proto
08:30:12FromDiscord<Yardanico> i'll try to patch opir to do that
08:30:35FromDiscord<Yardanico> i mean it's a single line patch, but "I'll check if it works"
08:33:23*max22- quit (Remote host closed the connection)
08:34:09PMunchHmm, I'm unable to compile the C snippet you sent me
08:34:10*max22- joined #nim
08:34:16PMunchComplains that SAPI is undefined
08:35:36FromDiscord<Yardanico> are you compiling with that gcc command? hmm
08:35:53*xet7 quit (Remote host closed the connection)
08:36:04PMunchOh wait..
08:36:54FromDiscord<Yardanico> oh yeah I fixed it before, lemme remember how I did that
08:37:02*xet7 joined #nim
08:37:25PMunchYardanico, you seem to have an include for /home/dian/Projects/nsciter/sdk/include, which I obviously don't have on my machine
08:37:41FromDiscord<Yardanico> oh, well, I assumed you downloaded that sciter archive
08:37:49FromDiscord<Yardanico> that's the path to the include folder inside of it
08:38:26PMunchNo it's not
08:38:34PMunchThat's a path to nsciter
08:38:40FromDiscord<Yardanico> nsciter doesn't matter
08:38:49FromDiscord<Yardanico> I just unpacked the sciter sdk to sdk folder inside of nsciter folder :)
08:39:08PMunchAh right
08:39:30FromDiscord<Yardanico> ahh right @PMunch I remember what I did to fix it, it seems a bug in sciter headers themselves
08:39:47PMunchFixed it so it points to my include folder, still same issue
08:39:57FromDiscord<Yardanico> on line 454 and 507 add `extern` before the `inline`
08:40:04FromDiscord<Yardanico> sciter-x-api.h
08:40:05PMunchWhich file?
08:40:10FromDiscord<Yardanico> need to PR that probably
08:41:10PMunchRight, managed to compile it now
08:41:45FromDiscord<Yardanico> yeah, all good, you don't need to run it to confirm that it works
08:42:30PMunchThere's an annoying bug in the Discord bot by the way @dom96, whenever something gets turned into a paste the * character gets turned into a
08:42:46PMunchref.: https://play.nim-lang.org/#ix=3BHo
08:42:58PMunchOkay, so now to check if Futhark can do this
08:43:33FromDiscord<Yardanico> @PMunch that should be reported to me, not him :)
08:44:09FromDiscord<Yardanico> hmm, actually I'm not sure why it is doing that
08:44:11PMunchOh really?
08:44:21FromDiscord<Yardanico> yeah, ircord is the bridge bot
08:44:28PMunchAh right, you're maintaining that!
08:44:58PMunchI have no idea why it does that either, I'm guessing it's Discord turning it into that before it gets sent at all
08:45:07PMunchLike when you paste code into their GUI
08:49:15PMunchHmm, I didn't get the hashSet issue
08:49:54FromDiscord<Yardanico> weird, are you on devel?
08:50:29PMunchNope 1.4.8
08:50:40FromDiscord<Yardanico> oh yeah, that change was added in devel
08:50:50FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/15767
08:50:53FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/16959
08:52:41FromDiscord<Yardanico> ok got further, now futhark fails with `Error: unhandled exception: key not found: LPCWSTR`
08:53:08PMunchYeah I got the same issue
08:53:59FromDiscord<Yardanico> maybe it's because LPCWSTR is defined as an alias to WCHAR ?
08:54:21PMunchNope, that shouldn't be an issue
08:55:00PMunchIt's probably because LPCWSTR wasn't marked as being used, so it's not included in the list of identifiers Futhark knows
08:56:30PMunchLooking at the stack-trace you can see that LPCWSTR occurred as the return value of a procedure defined within a struct
09:02:53PMunchHmm, if I re-raise an exception I seem to lose the original stack-trace..
09:08:33PMunchI just wanted to add some more context to an already existing exception..
09:10:53*[R] quit (Ping timeout: 264 seconds)
09:12:10*[R] joined #nim
09:14:21PMunchThe actual error should be easy enough to fix though Yardanico. I'll ping you when I'm done, but first I need to get some lunch
09:16:26FromDiscord<Yardanico> yeah, no worries, it's not a big deal :)
09:45:55FromDiscord<Yardanico> seems like the creator of the https://forum.nim-lang.org/t/8497 thread now basically replies "why you disagree that nim is python?" to everyone
09:58:33FromDiscord<dom96> I mean... why do you disagree? Nim is the closest to a compiled Python there is
10:00:56FromDiscord<Yardanico> the closest to compiled python is Cython :)
10:01:10FromDiscord<Rika> Nim is not Python, in the sense that Nim should not bend to what Python people want unless it’s a good design idea and it fits what Nim is supposed to be as decided by the designers
10:01:14FromDiscord<Yardanico> exactly
10:03:42FromDiscord<dom96> In reply to @Yardanico "the closest to compiled": Meh, Cython doesn't count 🙂
10:03:47FromDiscord<xflywind> Now cython supports type annotation, really nice to use
10:05:10FromDiscord<xflywind> it is
10:05:20FromDiscord<Rika> In reply to @dom96 "Meh, Cython doesn't count": Why would Nim count then
10:05:21FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3BHO
10:06:28FromDiscord<dom96> Maybe you're right, but then why aren't I using Cython? It seems like a hack on top of Python not its own language
10:06:47FromDiscord<dom96> When I started using Nim I literally searched for a "compiled Python"
10:08:54FromDiscord<Rika> It is only coincidentally a “compiled Python”
10:09:39FromDiscord<dom96> no it isn't, the motto was something like "fast as C, expressive as Python, extensible as Lisp"
10:09:50FromDiscord<dom96> so the Python influence was very much intentional
10:12:55FromDiscord<Rika> Was the offside rule developed after the motto or before?
10:14:12FromDiscord<xflywind> In reply to @dom96 "I mean... why do": now a new language written in V (generate V codes) claiming they are more close(compatible) to Python.
10:15:38FromDiscord<xflywind> https://github.com/peregrine-lang/Peregrine/tree/main
10:21:41FromDiscord<xflywind> > Peregines syntax is very similar to Python's, and it gets trans-compiled to C, thus making it as fast as C.
10:21:50FromDiscord<dom96> In reply to @flywind "https://github.com/peregrine-lang/Peregrine/tree/ma": bleh https://github.com/peregrine-lang/Peregrine/blob/main/Peregrine/builtin.pe
10:22:04FromDiscord<dom96> `const str`? that's not Pythonic at all
10:22:28*andinus joined #nim
10:22:52FromDiscord<dom96> in any case, anything associated with V makes me suspicious.
10:23:02FromDiscord<Yardanico> In reply to @dom96 "`const str`? that's not": this language is not really working anyway, so nothing to compare with
10:23:15FromDiscord<Yardanico> i mean at this point in time
10:23:23FromDiscord<Yardanico> i think it was botted or something
10:23:33FromDiscord<Yardanico> 1.3k stars with literally _no_ actual working language
10:23:42FromDiscord<dom96> that's the V way
10:23:47FromDiscord<Yardanico> yess
10:23:54FromDiscord<xflywind> I'm curious why they can always get so many stars
10:24:30FromDiscord<xflywind> (edit) "I'm curious why they can always get so many stars ... " added "and attentions"
10:24:36FromDiscord<dom96> it's easy, just say you're doing something that most people want
10:24:44FromDiscord<dom96> people will star even if the repo is empty
10:25:16FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/898154480657375252/unknown.png
10:25:25FromDiscord<xflywind> But people need to know the project first
10:25:26FromDiscord<dom96> sometimes you might even get millions of VC funding
10:25:28FromDiscord<dom96> see Theranos
10:26:13FromDiscord<Yardanico> XDD these comparisons https://media.discordapp.net/attachments/371759389889003532/898154719254556732/unknown.png
10:26:27FromDiscord<Yardanico> https://dev.to/saptakbhoumik/swallow-a-new-programming-language-with-python-like-syntax-but-as-fast-as-c-currently-under-devolopment-2of4
10:26:33FromDiscord<Yardanico> but yeah, this is more for #offtopic
10:27:09FromDiscord<xflywind> They wrote an advertising article and attracted many people to read and review it.
10:28:07FromDiscord<xflywind> Maybe Nim team can publish article for blogs/ to dev.to too.
10:52:55PMunchIt's on-topic enough for this channel when no one is trying to get help :P
10:53:08FromDiscord<Yardanico> https://www.youtube.com/watch?v=d2VRuZo2pdA
10:53:12FromDiscord<Yardanico> reposted from offtopic as well
10:53:20FromDiscord<Yardanico> seems like no one posted it before
10:53:32PMunchHaven't seen that at all
10:53:39PMunchOr anyone mentioning it
10:54:18FromDiscord<Yardanico> it's by deech who's active in this discord server sometimes
10:54:34PMunchYeah I was surprised I hadn't seen before
10:54:58FromDiscord<Rika> Oh nice
10:55:08FromDiscord<Yardanico> maybe it's time to create a fork of that nim youtube playlist and make a forum thread to publish all new nim videos :D
10:55:12FromDiscord<Yardanico> (manually of course, no bots)
10:55:21FromDiscord<Rika> How do you guys even write or make a presentation on these thing
10:55:23FromDiscord<Yardanico> well, not all, but the more serious ones like talk
10:55:23FromDiscord<Rika> Things
10:55:37PMunchWhat do you mean Rika?
10:56:01FromDiscord<Rika> I have difficulty writing about my projects, as in, what is there to write about exactly
10:56:11FromDiscord<xflywind> In reply to @Yardanico "maybe it's time to": forum thread cannot attract new users 😜
10:56:21FromDiscord<Yardanico> that's not about new users, it's about existing users :)
10:56:24FromDiscord<Rika> In reply to @flywind "forum thread cannot attract": Repost on HN
10:56:49PMunch@Rika, I just imagine myself explaining the project to someone. Formulating why it's a good idea, what it achieves, and how it compares to other things
10:57:01PMunchOnce you've done it a couple of times its almost automatic :P
10:57:07FromDiscord<Yardanico> @dom96 what do you think about making a new forum thread for posting new nim videos/talks/etc from youtube or other websites?
10:57:10FromDiscord<Yardanico> idk if it's a good idea to do
10:57:37PMunchOops, gotta run to a meeting..
10:57:56FromDiscord<Yardanico> hmm, yeah, on the forum it'll be a bit uncomfortable since we don't have threads that only the creator or moderator can write in
11:10:36FromDiscord<Yardanico> started adding some vids to https://www.youtube.com/playlist?list=PLnthTbhS8ZO9_X9XQOX9-zhg3AIOsmfpU , i think I won't be adding nim tutorial videos
11:10:39FromDiscord<Yardanico> only talks and similar stuff
11:14:32FromDiscord<Yardanico> but sometimes it's hard to differentiate between a talk and a tutorial :)
11:15:20FromDiscord<xflywind> https://piped.kavin.rocks/watch?v=WdL-doqxXyo
11:15:49FromDiscord<xflywind> I encounter this video yesterday
11:15:51FromDiscord<Yardanico> https://www.youtube.com/watch?v=WdL-doqxXyo
11:16:01FromDiscord<Yardanico> ah it's a invidio.us instance
11:16:06FromDiscord<Yardanico> I thought it was peertube or something
11:16:15FromDiscord<Yardanico> thanks for the link
11:21:44FromDiscord<Yardanico> already 52 videos (around half are nimconf)
11:45:25*max22- quit (Ping timeout: 260 seconds)
11:56:37*Gustavo6046 quit (Read error: Connection reset by peer)
11:59:45*Gustavo6046 joined #nim
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:41:32PMunch@Yardanico, I was right about the Futhark issue. Got that fixed, but now I've gotten another bug which will need some tweaking.. They have defined an alias for "void" which breaks a couple things in interesting ways
12:42:51FromDiscord<Yardanico> interesting, thanks for fixing it! you don't have to rush though :)
12:43:06PMunchI'm not rushing :P
12:43:34PMunchThese are fairly simple fixes, I just hadn't come across the usecases before :P
12:44:27*rockcavera joined #nim
12:44:27*rockcavera quit (Changing host)
12:44:27*rockcavera joined #nim
12:46:09*jfinkhaeuser left #nim (#nim)
13:01:59*arkurious joined #nim
13:18:38FromDiscord<dom96> In reply to @Yardanico "<@!132595483838251008> what do you": Think bigger: a section on the nim-lang.org front page showcasing the videos would be awesome 🙂
13:20:06FromDiscord<konsumlamm> we can go even bigger and say that Nim has a zero-cost (WIP) garbage collector
13:20:15FromDiscord<konsumlamm> and no (WIP) bugs
13:20:43FromDiscord<konsumlamm> the sad thing is, it would probably work
13:20:57*max22- joined #nim
13:24:37FromDiscord<dom96> What I think would work is to create an alternate persona for Nim. Set up a fancy marketing page for a programming language that is fast, expressive, etc etc. Then at the end redirect people to the Nim repo 😛
13:25:21FromDiscord<konsumlamm> that sounds pretty funny
13:26:02FromDiscord<haxscramper> Best-in-class metaprogramming, effortless zero-cost abstractions
13:26:06FromDiscord<haxscramper> Well, we don't really need to even add WIP things
13:26:38FromDiscord<haxscramper> Of course, average joe schmoe "case insensetivity is bad" is going to be offended at everything anyway
13:27:18FromDiscord<haxscramper> what else
13:28:16FromDiscord<haxscramper> There was an article on HN where some person complained about ... nothing specific I guess, but one of the things they mentioned was reliance of language users on compiler developers to implement very basic stuff
13:28:33FromDiscord<haxscramper> We can probably play around this somehow as well
13:28:55FromDiscord<everyon> In reply to @haxscramper "Best-in-class metaprogramming, effortless zero-cost": The richest collection of libraries
13:29:03FromDiscord<everyon> (you can use C libraries)
13:29:14FromDiscord<haxscramper> also C++ and JS
13:29:16FromDiscord<haxscramper> yeah
13:30:54FromDiscord<Rika> `reliance of language users on compiler developers to implement very basic stuff` ???
13:30:58FromDiscord<Rika> what?
13:32:59FromDiscord<haxscramper> You need random feature X
13:33:13FromDiscord<haxscramper> that nobody else needs, but you think it is super important
13:33:16FromDiscord<Rika> .... i still dont get it
13:33:19FromDiscord<haxscramper> some random-ass syntax sugar
13:33:36FromDiscord<haxscramper> The only option in 99% of the languages is to wait for compiler devs to implement it
13:33:39FromDiscord<Rika> oh this isnt a criticism of nim
13:33:54FromDiscord<haxscramper> they don't have a macro system good enough anyway
13:34:05FromDiscord<haxscramper> in nim you can do this by writing a macro, most of the time
13:34:26FromDiscord<haxscramper> of course we have unspecified typed AST and other things, but overall this is still better compared to the other languages
13:36:52FromDiscord<konsumlamm> "best-in-class metaprogramming" is gonna provoke some lispers
13:37:18FromDiscord<haxscramper> flamebait is good
13:37:24FromDiscord<haxscramper> flamebaits create attention, discussion
13:37:38FromDiscord<haxscramper> and to be honest I think we can prove this
13:37:58FromDiscord<haxscramper> well, except someone brings reader macros, but those are kind of useless
13:38:04FromDiscord<konsumlamm> (most?) lisps don't have typed macros though, tbf
13:38:27FromDiscord<Rika> reader macros would be cool though
13:38:30FromDiscord<Kiloneie> I need a NON video series video on Nim, with a catchy title, my current ones just get traffic from people already using Nim mostly.
13:38:43FromDiscord<Rika> though yeah it would be useless technically
13:40:25FromDiscord<Kiloneie> im trying to get a udemy course up, though their bulk uploader is buggy, last i tried it got stuck at 99%, now my internet is 40 mbit, was 100 mbit for upload so this will take a while.
14:14:28*PMunch quit (Quit: Leaving)
14:20:46FromDiscord<haxscramper> nanim project is just so good
14:20:48FromDiscord<haxscramper> things just work
14:21:45FromDiscord<haxscramper> Maybe it does not have a thousand man-hours put in the development of some obscure arrangement algorithms, but not a lot of people would end up using them anyway
14:21:49FromDiscord<haxscramper> I'm talking about https://forum.nim-lang.org/t/8499
14:22:10FromDiscord<haxscramper> fuck facebook though
14:22:39FromDiscord<haxscramper> facebook/instagram shit. Can't even scroll to the end to see all animations
14:25:22FromDiscord<dom96> maybe we should try submitting that thread to HN
14:27:24FromDiscord<reilly> Getting this g++ compiler error with Nim-generated C++ code: `/Users/reillymoore/Documents/Repos/nanolab-gui/gui/.nimcache/@mgui.nim.cpp:241:12: error: flexible array member 'Data' of type 'ImGuiTable []' with non-trivial destruction`↵I have no idea how to make this go away.
14:27:59FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3BJb
14:28:13*rockcavera quit (Remote host closed the connection)
14:28:21FromDiscord<reilly> The command being run is: https://hastebin.com/oveyafativ.apache
14:30:53FromDiscord<reilly> I don't even know where to begin with this one...
14:34:05*rockcavera joined #nim
14:34:05*rockcavera quit (Changing host)
14:34:05*rockcavera joined #nim
14:38:00FromDiscord<haxscramper> You might need to look into what non-trivial destructor is, to begin with. But my guess is that nim generated code that C++ does not allow
14:38:11FromDiscord<haxscramper> Well, that much you have figured out yourself probably
14:38:43FromDiscord<haxscramper> But it sounds like some absolutely cursed Cxx trick that was used just in this library
14:40:27FromDiscord<reilly> In reply to @haxscramper "But it sounds like": Well, it's just ImGui...
14:42:27FromDiscord<Kiloneie> I can't get more than a single video onto Udemy, using their bulk uploader picking 1 or more files it will upload, say it uploaded successfully, but there isn't any video anywhere, switching between settings... nothing... -.- Shiete site
14:43:55FromDiscord<haxscramper> Last person who honestly believed that he is working with "just " now works only if fire extinguisher is present, in fear or computer spontaneously catching fire
14:46:05FromDiscord<haxscramper> Can you show generated cxx code around this part maybe?
14:46:37FromDiscord<haxscramper> Or if this is easy to reproduce I might try to look at it now
14:51:06FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3BJl
14:51:23FromDiscord<reilly> (edit) "https://play.nim-lang.org/#ix=3BJl" => "https://play.nim-lang.org/#ix=3BJm"
15:02:52FromDiscord<haxscramper> well https://github.com/status-im/nimbus-eth1/issues/2
15:04:14FromDiscord<haxscramper> and https://github.com/nimgl/nimgl/issues/38
15:04:56FromDiscord<haxscramper> tldri `#define SEQ_DECL_SIZE` in nimbase.h leads to `ImGuiTable Data[];` which is not allowed due to `ImGuiTable` destructor
15:05:39FromDiscord<haxscramper> Why nim sequence uses flexible array instead of actual pointer is something I don't really know
15:05:51FromDiscord<haxscramper> I mean, `size + capacity + pointer-to-start`
15:05:52FromDiscord<haxscramper> done
15:06:02FromDiscord<haxscramper> and no, it seems like this is not fixable
15:06:36FromDiscord<reilly> Well, yay, at least it's not just a me problem. I'm compiling and linking everything manually, so it's definitely a relief knowing that it's not a problem with that.
15:09:05FromDiscord<reilly> Could I just... Edit nimbase.h, or is that a bad idea?
15:09:39FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3BJH
15:09:44FromDiscord<haxscramper> No, you would have to edit codegen for sequence type
15:10:12FromDiscord<haxscramper> Because it still generates code using seq decl size https://github.com/nim-lang/Nim/search?q=SEQ_DECL_SIZE
15:11:11*robertmeta_ quit ()
15:11:27*robertmeta_ joined #nim
15:11:50FromDiscord<haxscramper> Try running code with `{.passc:"-v".}` to see include paths passed to the C compiler↵(@Ricky Spanish)
15:12:15*robertmeta_ is now known as robertmeta
15:13:40*robertmeta quit (Changing host)
15:13:40*robertmeta joined #nim
15:15:08FromDiscord<demotomohiro> stdio.h and string.h are standard C library headers.
15:16:58FromDiscord<demotomohiro> I don't know much about clang but these files should be installed when you install C compiler.
15:20:18FromDiscord<reilly> In reply to @haxscramper "and no, it seems": Could I just replace the type definitions in the generated C++ with constants instead of SEQ_DECL_SIZE?
15:21:38FromDiscord<reilly> Cause, I have to make this work. I am not doing this just for fun.
15:22:05FromDiscord<reilly> This may be the last hurdle I need to solve to get it working.
15:23:42FromDiscord<haxscramper> you need to have a `seq[T]` of things, correct?
15:23:51FromDiscord<haxscramper> or this is something other than that
15:24:04FromDiscord<haxscramper> you can, technically just write definition manually
15:24:19FromDiscord<haxscramper> and then `importcpp`, I think
15:24:38FromDiscord<haxscramper> not enough italic, it this does not really show how uncertain I am
15:24:53FromDiscord<haxscramper> like, what is the end goal
15:28:15FromDiscord<reilly> The end goal is to use ImGui extensions with NimGL's ImGui.↵- I can't use the C backend because the extensions are written in C++.↵- I have to compile and link everything manually (nakefile) because the Nim compiler on its own erroneously uses the `-std:g++14` flag when compiling Objective-C, which ObjC does not support and causes compilation to fail.↵- It's trying to compile ObjC because I'm on MacOS, and it needs the Cocoa librarie
15:28:18FromDiscord<haxscramper> also need minized example
15:28:31FromDiscord<Ricky Spanish> ok its mac being a nightmare, i suddenly dont have /usr/local/include which is where the compiler is looking for string.h, but when i use clang i can actually import string.h from another directory -.-
15:28:40FromDiscord<Ricky Spanish> thanks @haxscramper
15:30:18FromDiscord<reilly> I'm not really sure I can give you a minimal example, since it's kind of a convoluted setup...
15:33:56FromDiscord<reilly> I don't know what ImGuiTable or any of those other types are. I don't know what the objects they're being nested in are. All I know is that SEQ_DECL_SIZE is preventing it from compiling, and I want the problem to go away.
15:34:09FromDiscord<haxscramper> no, this does not work
15:34:23FromDiscord<haxscramper> fuck, why does cxx backend inherit from generic seq
15:34:29FromDiscord<haxscramper> And C puts all fields inside
15:34:36FromDiscord<haxscramper> I wanted to make like
15:34:47FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJM
15:34:51FromDiscord<haxscramper> This is a valid nim
15:34:54FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJN
15:35:27FromDiscord<haxscramper> but this is not valid cxx because I can't add to sequence size
15:35:56FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJO
15:37:04FromDiscord<haxscramper> @reilly)
15:37:17FromDiscord<haxscramper> SEQ\_DECL\_SIZE itself is not preventing anything from compiling
15:37:33FromDiscord<haxscramper> I it is a `ImGuiTable Data[]` being used instead of `ImGuiTable Data`
15:37:51FromDiscord<reilly> You're right, poor phrasing.
15:38:02FromDiscord<haxscramper> and that one I don't think can be fixed in a sane manner, or you need someone from #internals to look at this
15:40:56FromDiscord<reilly> In reply to @haxscramper "I it is a": Surely it can't be as simple as rewriting `ImGuiTable Data[SEQ_DECL_SIZE]` as `ImGuiTable Data`, right?
15:41:25FromDiscord<haxscramper> That would've worked
15:41:37FromDiscord<haxscramper> ` ImSeq {.importcpp, header: "flexible_array.hpp".} = seq[ImGuiTable]` is basically all you need to define your own sequence
15:41:43FromDiscord<haxscramper> on C backed
15:41:49FromDiscord<haxscramper> cxx backend works differently
15:41:59FromDiscord<haxscramper> well, let me try to be completely sure
15:53:24FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJU
15:53:56FromDiscord<haxscramper> Well, it fully compiles, but still crashes because `newSeqRC1` does not create a valid sequence (does not polulate `.data` with anything
15:54:33FromDiscord<haxscramper> I don't know how `N_LIB_PRIVATE N_NIMCALL(void, newSeqRC1)(TNimType typ, NI len) {` is supposed to function nor what `TNimType` really is
15:55:31FromDiscord<reilly> This definitely seems to me like something for #internals, because we're really getting down to the nitty-gritty now.
15:55:48FromDiscord<reilly> Man, I just wish I could `.replace()` something and have it work...
16:08:51*nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM)
16:08:52*happycorsair[m] quit (Quit: Bridge terminating on SIGTERM)
16:08:55*Theodore[m] quit (Quit: Bridge terminating on SIGTERM)
16:12:34*nixfreak_nim[m] joined #nim
16:23:58*happycorsair[m] joined #nim
16:24:10*Theodore[m] joined #nim
16:53:43FromDiscord<haxscramper> @reilly
16:53:58FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BKi
16:54:03FromDiscord<haxscramper> `@[(field: 0), (field: 0), (field: 0), (field: 12)]`
16:54:05FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BKj
16:54:20FromDiscord<haxscramper> I still don't know how to replicate nontrivial destructor
16:54:38FromDiscord<haxscramper> but this POS works at least
16:55:09FromDiscord<haxscramper> so you can substitute nim sequence with this contraption and still trick nim into thinking it is a valid `seq[T]`
16:55:31FromDiscord<haxscramper> I would be very careful around generics though
17:02:19FromDiscord<reilly> I've just set the array size to 1, and unbelievably, it fucking works.
17:02:49FromDiscord<reilly> By "set," I mean I'm `.replace()`ing on the generated C++ code. And it works.
17:03:22FromDiscord<haxscramper> you can try and subtitute `nimbase.h` with your own then
17:03:38FromDiscord<haxscramper> where `SEQ_DECL_SIZE` is defined to be `1`
17:05:16FromDiscord<reilly> I'd honestly rather leave nimbase.h alone. I just need a workaround for this one thing.
17:08:06FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3BKq
17:09:33FromDiscord<Hamid Bluri> it's just a macro that converts `route(...) as <NAME>: <PROC>` to `Table[<NAME>, <PROC>]`
17:11:06FromDiscord<Hamid Bluri> 😄 i just forgot to add `async` to type def in `Table[string, proc()]`
17:12:12FromDiscord<Hamid Bluri> but it should gave me a reasonable error
17:21:50FromDiscord<reilly> In reply to @hamidb80 "but it should gave": 🥲
17:22:24FromDiscord<reilly> Giving reasonably errors is not something that Nim likes to do, just in general.
17:56:58*Guest98 joined #nim
17:57:54*nrds quit (Ping timeout: 265 seconds)
18:01:25NimEventerNew thread by Orlean: Is there more simple way to solve this task?, see https://forum.nim-lang.org/t/8502
18:02:21*Guest98 quit (Quit: Client closed)
18:20:48FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BKK
18:24:47FromDiscord<exelotl> weird, mine looks just like that and doesn't have any problem 🤔
18:25:16FromDiscord<exelotl> https://github.com/exelotl/natu/blob/devel/tools/templates/backgrounds.c.template
18:26:58NimEventerNew post on r/nim by Pcarbonn: Nim to write Python modules ? What about memory management ?, see https://reddit.com/r/nim/comments/q85mih/nim_to_write_python_modules_what_about_memory/
18:29:23FromDiscord<haxscramper> I swear if I see nim and python in one sentence one more time today
18:29:56FromDiscord<konradmb> nim python nim python nim python nim python nim python nim python 😁
18:30:58FromDiscord<haxscramper> Well, not like we can change the public perception of this anyway, so most likely it would be an eternal curse of nim - random people would come in numbers to complain about nim not actually being a python
18:32:44FromDiscord<konradmb> no ; or {} - neuron activation - "Hey, that's Python!"
18:32:54FromDiscord<haxscramper> I know this particular one does not complain about it
18:35:12FromDiscord<haxscramper> I think there is a number of python RFCs like https://www.python.org/dev/peps/pep-0636/ https://www.python.org/dev/peps/pep-0638/ and features (like type annotations) that would allow us to argue that it is actually python is trying to be closer to nim
18:35:21FromDiscord<konradmb> Well, from what I see it's the only popular one with this kind of syntax
18:36:04FromDiscord<haxscramper> indentation + `:` for block delimiting is not really common, so similarity does really force people to jump to conclusions sometimes
18:37:08FromDiscord<konradmb> yeah, that's what I mean + Pascal or Lua has those begin/end, so they're not similar to Python
18:38:43FromDiscord<haxscramper> I think we should put mention of the C++ somewhere as well, considering it had certain degree of influence
18:38:52FromDiscord<haxscramper> But this would most likely just scare people away
18:39:16FromDiscord<haxscramper> Just like LISP thing I guess
18:41:49FromDiscord<konradmb> I see more of C than C++, but it's like saying that Nim is influenced by assembler, because it has multiplication
18:42:44FromDiscord<haxscramper> Nim generic system is very C++-like
18:43:58FromDiscord<haxscramper> But of course there is much more C in nim than `++` part
18:44:15FromDiscord<geekrelief> In reply to @exelotl "https://github.com/exelotl/natu/blob/devel/tools/te": maybe because I'm trying this from nimble?
18:45:44FromDiscord<konradmb> C# has <T>, so similar 🙃 you are doing the same thing that you frowned upon lately 😀
18:46:58FromDiscord<haxscramper> I also mean parametrization of generic types/procedures with value-as-a-type
18:47:07FromDiscord<haxscramper> `static[int]` as a generic parameter
18:47:47FromDiscord<haxscramper> `<T>` is not really hard to find, but static parametrization is less frequent
18:48:03FromDiscord<konradmb> you mean like System.Collections.Generic.List<T>?
18:48:05FromDiscord<haxscramper> for example rust only got it this year and it was "the big thing" IIRC
18:49:48FromDiscord<haxscramper> No, I mean `type Image[W, H: static[int]]` to move part of the image type properties at compile-time with zero overhead
18:51:38FromDiscord<konradmb> hmm, then I don't know if that's possible in C#
18:51:54FromDiscord<konradmb> but you are doing the same thing that you hate
18:51:54FromDiscord<haxscramper> Thankfully nim does not adopt ALL C++ features, like SFINAE
18:52:18FromDiscord<konradmb> "I swear if I see nim and C++ in one sentence one more time today" 😀
18:53:05FromDiscord<haxscramper> I don't hate the thing, I hate thundering crowds repeating the same basic nonsense
18:53:18FromDiscord<konradmb> but it's not nonsense
18:53:47FromDiscord<konradmb> because Python has the same syntax as Nim and it is the most popular languages some months - the comparison is bound to happen
18:54:51FromDiscord<konradmb> and it is right because you see many languages with ; and {} but only one with : and <space> during your typical IT career
18:55:04FromDiscord<haxscramper> yes, and usually very first thing this comparison leads to discussions about how to make nim more python-like
18:55:28FromDiscord<haxscramper> Like style insensetivity being bad for people coming from python, or lack of list comprehensions
18:55:34FromDiscord<haxscramper> this is not a singular case
18:56:14FromDiscord<haxscramper> They are similar enough so people not only consider moving from one another, but also want to turn one into another
18:56:40FromDiscord<haxscramper> This is bound to happen to any newcomer from any language, but python has very large community
18:56:48FromDiscord<haxscramper> And very high syntactic similarity
18:57:06FromDiscord<haxscramper> So it amplifies the annoyance
18:57:11FromDiscord<konradmb> hmmm theres something in it
18:57:31FromDiscord<konradmb> but then you can send them to https://github.com/juancarlospaco/cpython XD
18:58:20FromDiscord<ErikW> In reply to @haxscramper "nanim project is just": Hey thanks 🙂 I've spent a lot of time in both linux on debian, Windows 10 nad my Mac to make sure it works everywhere
18:58:56FromDiscord<ErikW> In reply to @haxscramper "facebook/instagram shit. Can't even": Yeah it's pretty shitty xD
19:00:26FromDiscord<haxscramper> But generally speaking, yes, you are partially correct and could say I'm doing the same thing I hate, but just with smaller footrpint. There are seveal RFCs that could be attributed to the same line of thought I mentioned - https://github.com/nim-lang/RFCs/issues/362, https://github.com/nim-lang/RFCs/issues/252 (because cxx allows inti)
19:00:53FromDiscord<haxscramper> https://github.com/nim-lang/RFCs/issues/245 because everyone else has pattern matching
19:01:48FromDiscord<konradmb> In reply to @haxscramper "Like style insensetivity being": list comprehensions are sooooo complicated that nim-way™ is just better, but it requires a change of thinking
19:02:11FromDiscord<konradmb> the same for case insensitivity and module imports
19:04:11FromDiscord<haxscramper> Also, we need to remember that syntactic nitpicks cause largest discussions, period
19:04:28FromDiscord<konradmb> but the advantage of nim in the case of RFCs you mentioned are that it could(?) be implemented with macro - something that would be impossible in other languages
19:04:45FromDiscord<haxscramper> 252 is not implementable with macros
19:04:55FromDiscord<haxscramper> 245 is implemented in macos, by me
19:05:28FromDiscord<haxscramper> 362 is partially impelementable using std/typetraits and tuple unpacking, but this solution is extremely ugly
19:05:37FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/898285257319665664): 245 is implemented in macros, by me
19:07:37FromDiscord<konradmb> I've only glanced, but wouldn't 252 be possible with macro creating fake proc accessor that inits it on first access?
19:10:45FromDiscord<haxscramper> sent a long message, see http://ix.io/3BKY
19:11:17FromDiscord<haxscramper> Sometimes `nimZeroMem` might really mess up the default state of the imported class
19:11:44FromDiscord<haxscramper> I can already deal with non-defaultable types via `{.requiresinit.}`, but that is just an intermediate step
19:12:01FromDiscord<konradmb> ok, I see
19:17:15FromDiscord<konradmb> hey, so it's not "other language has it, so I want it in nim", but it has a real use-case consistent with nim-way ™️
19:24:11FromDiscord<exelotl> In reply to @geekrelief "maybe because I'm trying": so it's attempting to use the filter in a nimscript environment?
19:25:15FromDiscord<geekrelief> Yeah, I ended creating a separate generator file instead of trying to do it from nimble/nimscript.
19:25:23FromDiscord<geekrelief> (edit) "Yeah, I ended ... creating" added "up"
19:25:50FromDiscord<exelotl> ah, yeah I've been there before x)
19:25:51FromDiscord<geekrelief> But I just avoid the emit and returned a string to write out
19:25:58FromDiscord<geekrelief> (edit) "avoid" => "avoided"
19:29:56FromDiscord<tandy> is anyone here familiar with xml? how can i parse a list as a seq?
19:49:51*nrds joined #nim
19:51:17FromDiscord<exelotl> In reply to @geekrelief "Yeah, I ended up": I really wanted to have config files written in nimscript for my game's assets. The config data needed to be read by a tool that converts images, generates C code etc. Running nimscript from the tool turned out bad because the startup time for `nim e` was too long (I think there were other issues too but don't remember). I ended up having nimscript write out TSV files before invoking the tool.
19:52:03nrds<Prestige99> tandy: https://nim-lang.org/docs/parsexml.html
19:52:06FromDiscord<exelotl> This turned out great because TSV is easy to generate and parse with no dependencies, and the whole process is super fast - if there are no new assets to convert, I don't even notice that the tool ran at all.
19:53:07FromDiscord<geekrelief> In reply to @exelotl "I really wanted to": How do you have nimscript write out files? I didn't see a proc for that in https://nim-lang.github.io/Nim/nimscript.html
19:53:31FromDiscord<geekrelief> I thought opening files was prevented because it's an importc thing
19:54:05FromDiscord<exelotl> you can `import os` - not all the functions are available (most annoyingly there's no time functions) but writeFile does work
19:55:36FromDiscord<geekrelief> ok thanks for the tip. hmm I think I still need to create a separate nim file to generate my plugin scaffolding because I can't seem to use `include` in nimscript with source code filters.
19:56:23FromDiscord<geekrelief> I'll try fiddling with it a little more.
20:04:06FromDiscord<tandy> hmm↵(<@709044657232936960_nrds=5b=49=52=43=5d>)
20:04:08FromDiscord<geekrelief> @exelotl huh 😄 that worked! So `writeFile` works but `open(path, fmWrite)` doesn't
20:04:11FromDiscord<tandy> how does this work?
20:04:24FromDiscord<tandy> the code im using atm uses this but also xmltree
20:04:34FromDiscord<tandy> and xmltree doesnt output seqs
20:07:21FromDiscord<tandy> oh i need to use findAll from xmltree
20:12:08*neurocyte0132889 joined #nim
20:12:08*neurocyte0132889 quit (Changing host)
20:12:08*neurocyte0132889 joined #nim
20:16:12*hexology quit (Quit: hex on you ...)
20:16:50Mister_Magistertfw you see project name nimble and files with name nimble and nim and turns out its not nim-lang
20:17:03Mister_MagisterApache NimBLE is an open-source Bluetooth 5.1 stack (both Host & Controller) that completely replaces the proprietary SoftDevice on Nordic chipsets. It is part of Apache Mynewt project.
20:34:30*neurocyte0132889 quit (Ping timeout: 265 seconds)
20:36:08FromDiscord<tandy> can you have repeated keys in json?
20:41:20FromDiscord<exelotl> no, or at least it's undefined how that would behave depending on the JSON parser you're using
20:41:42FromDiscord<DMisener> sent a code paste, see https://play.nim-lang.org/#ix=3BLk
20:44:24FromDiscord<tandy> hm↵(@exelotl)
20:44:38FromDiscord<tandy> do you think it would be possible to describe JSPF as a nim type?
20:44:38FromDiscord<tandy> https://xspf.org/jspf/
20:45:43FromDiscord<tandy> im trying at the moment but xml is quite different to json
20:46:31FromDiscord<exelotl> yeah, seems pretty easy
20:46:42FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BLn
20:46:42FromDiscord<tandy> things like these are the hard parts
20:47:12FromDiscord<tandy> like i could use a generic name like key and value? then make a jsony posthook to put in the real names
20:51:37FromDiscord<tandy> i guess that could be link\: seq[seq[(string, string)]]
20:51:50FromDiscord<tandy> i guess that could be `link: seq[seq[(string, string)]]`
20:52:21FromDiscord<exelotl> probably don't need the nested seqs right?
20:52:41FromDiscord<exelotl> like `link: seq[(string, string)]` should be fine too
20:53:13FromDiscord<tandy> oh true
20:54:13FromDiscord<exelotl> I just checked, if the JSON has duplicate keys the 2nd occurrence will overwrite the 1st occurrence
20:54:17FromDiscord<exelotl> in Nim at least
20:54:57FromDiscord<exelotl> so probably better to stick to the XML format if that's something you think is likely to happen
20:59:35FromDiscord<tandy> yeah, im going to try describing the xspf type, but jspf should work as json↵(@exelotl)
20:59:53FromDiscord<tandy> really they should write a new spec for JSPF because it isnt exactly the same as xspf...
21:06:11NimEventerNew thread by Deech: Nim Nuggets: Talk About Nim At The Strange Loop Conference, see https://forum.nim-lang.org/t/8503
21:07:46FromDiscord<tandy> actually i need to use a table for this
21:16:36FromDiscord<exelotl> oh yeah that works too - tables in Nim _do_ support duplicate keys but it seems to be a controversial feature 😅
21:17:08FromDiscord<tandy> how do u index tables tho
21:17:27FromDiscord<exelotl> myTable[key]
21:17:28FromDiscord<tandy> oh its not too bad
21:17:34FromDiscord<tandy> similiar to json
21:17:41FromDiscord<tandy> so its ideal i gues
21:56:07Mister_Magisteris there some timeout for waitFor?
22:01:22*max22- quit (Quit: Leaving)
22:02:18Mister_Magistereven better question
22:02:25Mister_Magisterwhy AsyncSocket doesn't disconnect when i disconnect client
22:04:04Mister_Magisterbecause i'm doing waitFor client.recvLine() but if i disconnect the client it never finishes and entire code is hang up
22:09:03nrds<Prestige99> I'm still trying to solve this issue where I have a {.cdecl.} callback, and I want to interact with one of my objects inside of that callback. Anyone have insight as to how I could handle this?
22:09:42nrds<Prestige99> Short of creating a global mapping of ids or something to my objects, I'm out of ideas
22:10:49nrds<Prestige99> The part of my code: https://play.nim-lang.org/#ix=3BLM
22:11:38FromDiscord<impbox [ftsf]> Use the body to get a reference to the object
22:11:49FromDiscord<impbox [ftsf]> You can store userdata on the body right?
22:13:49nrds<Prestige99> not sure, can't find the real definition of cpBody. Just `typedef struct cpBody cpBody`
22:14:53FromDiscord<impbox [ftsf]> This is chipmunk yeah?
22:14:58nrds<Prestige99> Yeah
22:19:06FromDiscord<impbox [ftsf]> setUserData and getUserData
22:19:51FromDiscord<impbox [ftsf]> https://media.discordapp.net/attachments/371759389889003532/898334308626989106/Screenshot_20211015-091939.jpg
22:20:15nrds<Prestige99> oh interesting, didn't know about that; thanks
22:20:55nrds<Prestige99> I suppose this.unsafeAddr would do the trick..
22:21:13FromDiscord<impbox [ftsf]> Generally you'd bind your game object to your rigidbodies via userdata
22:23:51nrds<Prestige99> thank you!
22:24:16FromDiscord<impbox [ftsf]> For what you're doing though, you may as well just iterate though all your objects after stepping
22:24:34FromDiscord<impbox [ftsf]> Rather than adding callbacks to the physics code for every update
22:25:04nrds<Prestige99> oh this is just assigning a callback for the velocityUpdateFunc
22:25:25nrds<Prestige99> for a particular body
22:26:38nrds<Prestige99> calling cpBodySetVelocityUpdateFunc
22:27:46FromDiscord<impbox [ftsf]> Hmmmm ok, i don't really understand your use case. But I'm not sure why you'd use velocityupdatefunc
22:28:51nrds<Prestige99> I was told that the velocityupdatefunc is called after the physics resolution instead of before, so e.g. if you wanted to cap the velocity, you should do it in the velocityupdatefunc
22:29:14nrds<Prestige99> I haven't verified it though, just what I was told by another chipmunk user. Maybe I should go read through the code
22:30:39FromDiscord<impbox [ftsf]> Ok that may be the case, but you probably only want to assign it once
22:31:43nrds<Prestige99> Yeah that's what this function does, it's just for assignment
22:32:01nrds<Prestige99> I don't think I'll care if the user calls it more than once though, it'd just replace the callback with a new one
22:32:59FromDiscord<impbox [ftsf]> Ok
22:33:23FromDiscord<impbox [ftsf]> Does the userdata thing do what you want?
22:34:26nrds<Prestige99> Yep! Just what I needed, thanks
22:35:39FromDiscord<impbox [ftsf]> Awesome
22:42:11*Vladar quit (Remote host closed the connection)
22:48:47FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BLP
22:52:07Mister_Magisteryeah my client sockets aren't being disconnected when i kill them
22:52:17Mister_MagisterrecvLine never ends
22:52:47Mister_Magisterand nowhere i can find how to check if client is still connected
22:54:49Mister_Magisteri tihnk the idea is to set timeout in recvLine and then set up some kind of heatbeat