00:01:18 | FromDiscord | <Yardanico> And C backend is still the default |
00:17:58 | FromDiscord | <gogolxdong (liuxiaodong)> @stefanbacon you can deploy contracts using https://github.com/status-im/nim-web3 |
00:18:01 | nrds | <R2D299> itHub: 7"<No Description>" |
00:18:17 | FromDiscord | <gogolxdong (liuxiaodong)> and interact with contract |
00:22:17 | FromDiscord | <sheldon> https://media.discordapp.net/attachments/371759389889003532/898002740221988884/message.txt |
02:14:14 | FromDiscord | <satyrn> what would be the nim equivalent of python `var[:num]` |
02:16:12 | FromDiscord | <satyrn> actually nvm ill probably just write a proc to do that |
02:16:34 | FromDiscord | <Rika> var[var.low..<num] |
02:17:17 | FromDiscord | <satyrn> oh ok thanks |
02:39:04 | FromDiscord | <satyrn> how would i do something like kwargs in nim |
02:39:49 | FromDiscord | <impbox [ftsf]> you can pass keyword arguments in nim |
02:40:30 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3BGp |
02:41:19 | FromDiscord | <satyrn> alright thanks |
02:41:50 | FromDiscord | <Rika> Variable keyword arguments not possible though, I believe |
02:42:22 | FromDiscord | <impbox [ftsf]> as in passing in a table of keyword arguments? |
02:42:45 | FromDiscord | <Rika> As in keyword arguments not existing on the explicit function signature |
02:42:50 | FromDiscord | <Rika> kwargs |
02:43:08 | FromDiscord | <Rika> Possible but with much pain |
02:43:19 | FromDiscord | <Rika> Make a macro if you really want it, and even then it’s a lot of work |
02:44:32 | FromDiscord | <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:22 | FromDiscord | <Rika> you can do that with overloading |
02:54:15 | FromDiscord | <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:38 | FromDiscord | <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:41 | FromDiscord | <codic> just found that interesting |
06:17:32 | FromDiscord | <impbox [ftsf]> oh wow |
06:18:22 | FromDiscord | <Elegantbeef> Yep it really feels/looks like a modern wirth language |
06:20:10 | FromDiscord | <impbox [ftsf]> i did a tiny bit of pascal in school i think, the only bit i remember was `:=` |
06:29:43 | NimEventer | New thread by Miran: Nim 1.6.0 RC3, see https://forum.nim-lang.org/t/8500 |
06:36:57 | FromDiscord | <Kiloneie> When is type casting a good idea, or any good example of when type casting is useful ? |
06:37:14 | FromDiscord | <impbox [ftsf]> when you want to pretend one type is another |
06:38:01 | FromDiscord | <impbox [ftsf]> eg. I want to write some bytes to a file, but I have an object |
06:38:13 | FromDiscord | <impbox [ftsf]> I can cast it to an array of bytes |
06:39:10 | FromDiscord | <Kiloneie> so instead of extracting the fields, just cast it in there and the data is there right ? |
06:39:47 | FromDiscord | <Kiloneie> type casting it back would work right ? |
06:40:55 | FromDiscord | <Elegantbeef> Are we talking about `cast` or type conversions? |
06:42:18 | FromDiscord | <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:19 | FromDiscord | <impbox [ftsf]> think of cast as a "view" more so than a conversion |
06:42:41 | FromDiscord | <impbox [ftsf]> it's still pointing at the same memory, but treating it differently |
06:43:21 | FromDiscord | <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:57 | FromDiscord | <Kiloneie> Any actual reasons where it is neccessary to use them though ? like with C or smthing ? |
06:44:35 | FromDiscord | <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:50 | FromDiscord | <impbox [ftsf]> interacting with C is a common case |
06:45:53 | FromDiscord | <Kiloneie> they are faster im assuming, especially your example of casting an object to a file into an array ? |
06:46:00 | FromDiscord | <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:20 | FromDiscord | <Kiloneie> okay thank you both |
06:46:34 | FromDiscord | <impbox [ftsf]> https://play.nim-lang.org/#ix=3BH0 |
06:48:13 | FromDiscord | <Elegantbeef> A lovely contrived example here https://play.nim-lang.org/#ix=3BH1 |
06:49:44 | FromDiscord | <Kiloneie> i think imma put this into a pointer video or after it |
06:49:58 | FromDiscord | <Kiloneie> haven't covered ptr besides in the SDL video |
06:50:02 | FromDiscord | <Kiloneie> a brief one |
06:50:15 | FromDiscord | <Elegantbeef> You had a video about references and didnt cover pointers? |
06:50:39 | FromDiscord | <Kiloneie> yep :P, i tried to cut it down to be as simple as possible |
06:50:46 | FromDiscord | <Kiloneie> i did talk about pointers as well |
06:50:47 | FromDiscord | <Kiloneie> some |
06:50:54 | FromDiscord | <Elegantbeef> But references are more complicated imo |
06:50:59 | FromDiscord | <Kiloneie> but the main topic was on references |
06:51:16 | FromDiscord | <Kiloneie> well references are safe though, pointers are not |
06:51:37 | FromDiscord | <Kiloneie> so if i teach someone to use references, they can't really memory leak etc |
06:51:42 | FromDiscord | <Kiloneie> but with pointers they can |
06:51:55 | FromDiscord | <impbox [ftsf]> much more dangerous things than leaking memory =) |
06:52:34 | FromDiscord | <Elegantbeef> Like using any of my code |
06:52:49 | FromDiscord | <Kiloneie> xD |
06:55:11 | NimEventer | New Nimble package! easy_sqlite3 - Yet another SQLite wrapper for Nim., see https://github.com/codehz/easy_sqlite3 |
06:55:20 | FromDiscord | <Elegantbeef> Speaking of my code guess i should look at nicoscripter again \:P |
06:57:28 | FromDiscord | <impbox [ftsf]> mmm any ideas on what do next or at a loss? |
06:57:43 | FromDiscord | <Elegantbeef> Probably fix this |
06:57:44 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/898102255973179422/image.png |
07:04:10 | FromDiscord | <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:48 | NimEventer | New 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:56 | FromDiscord | <enthus1ast> ah true, i mistake this for split which has this feature |
07:53:09 | FromDiscord | <enthus1ast> would be a nice addition to replace imho |
08:06:55 | PMunch | @Yardanico, did you ever get any further with your sciter wrapping? |
08:07:18 | FromDiscord | <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:27 | FromDiscord | <Yardanico> the "main" thing - bridging native functions to sciter side - works |
08:07:36 | FromDiscord | <Yardanico> also I updated it to the Sciter.JS yesterday |
08:07:44 | PMunch | You where trying to wrap it using Futhark, no? |
08:07:50 | PMunch | But ran into some issues |
08:08:00 | FromDiscord | <Yardanico> yeah, but I didn't go far sadly, it still doesn't like the headers |
08:08:11 | FromDiscord | <Yardanico> the problem with Sciter headers is that they have C++ code under cplusplus defines |
08:08:13 | FromDiscord | <Yardanico> or CPP11 |
08:08:19 | PMunch | Do you have a sample? |
08:08:30 | PMunch | Those should be fine |
08:08:49 | PMunch | Futhark should handle those without any trouble |
08:09:46 | FromDiscord | <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:53 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3BHo |
08:10:22 | FromDiscord | <Yardanico> i mean if you want to check that it compiles |
08:10:31 | FromDiscord | <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:38 | FromDiscord | <Yardanico> without makefiles, the hard way, just for quick testing |
08:11:57 | FromDiscord | <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:12 | FromDiscord | <Yardanico> with |
08:12:20 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3BHq |
08:13:01 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/898121199379415050/unknown.png |
08:13:04 | FromDiscord | <Yardanico> the error is indeed pretty weird |
08:17:59 | FromDiscord | <Yardanico> also the json output from opir is 8.3 million chars long, so it's indeed pretty big :) |
08:18:43 | FromDiscord | <Yardanico> ok, I found where it errors in futhark code - line 543 `for name in state.used` |
08:18:56 | FromDiscord | <Yardanico> ahh right you're adding to the hashset while iterating over it |
08:20:21 | FromDiscord | <Yardanico> i'll try to use a temp hashset instead, will see how far that goes |
08:20:58 | FromDiscord | <Yardanico> now it's `error: Unknown kind in findAlias: {"kind":"invalid","value":"func_noproto?"}` |
08:21:48 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/N0A |
08:22:09 | FromDiscord | <Yardanico> ill make a small pr |
08:23:16 | PMunch | Huh, curious that I've never run into that hashset error before |
08:23:30 | PMunch | And the func_noproto is simply something I haven't seen before |
08:23:36 | FromDiscord | <Yardanico> heh |
08:23:38 | PMunch | Very interesting |
08:23:44 | PMunch | I'll try to see if I can get it to work |
08:23:50 | FromDiscord | <Yardanico> there are 3 of those apparently https://media.discordapp.net/attachments/371759389889003532/898123925375025182/unknown.png |
08:24:00 | PMunch | And 8.3 million lines of Opir output, yikes |
08:24:18 | PMunch | Do you have a file and location for those objects? |
08:24:29 | FromDiscord | <Kiloneie> the default iterator is called items right ? foggy memory |
08:24:34 | FromDiscord | <Yardanico> not lines, but characters, yeah @PMunch |
08:24:42 | FromDiscord | <Yardanico> @Kiloneie if you mean the default iterator that's called when using `for`, yes |
08:24:49 | FromDiscord | <Yardanico> @PMunch yeah, opir has that info |
08:24:52 | FromDiscord | <Kiloneie> yes, thanks |
08:24:56 | PMunch | items is the default one, yes |
08:25:12 | PMunch | Oh characters, that's slightly better at least :P |
08:25:33 | FromDiscord | <Kiloneie> some of my videos i improvized more so i don't know what's in the video xD... |
08:25:42 | PMunch | Yeah 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:16 | FromDiscord | <Yardanico> i think it shows that invalid thing for `typedef struct _ISciterAPI { a lot of stuff} ISciterAPI;` |
08:26:21 | FromDiscord | <Yardanico> one of func_noproto at least |
08:26:32 | FromDiscord | <Yardanico> sciter-x-api.h line 300 |
08:26:53 | FromDiscord | <Yardanico> wait sorry that's the wrong one |
08:26:56 | PMunch | Hmm, that should be handled just fine |
08:26:58 | FromDiscord | <Yardanico> it's confused for `typedef ISciterAPI (SCAPI SciterAPI_ptr)();` |
08:27:01 | FromDiscord | <Yardanico> line 302 |
08:27:10 | FromDiscord | <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:05 | FromDiscord | <Yardanico> SCAPI is defined just as `#define SCAPI` on linux and `#define SCAPI stdcall` on windows |
08:28:32 | PMunch | Man, the libclang documentation is so bad.. |
08:29:40 | PMunch | https://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:12 | FromDiscord | <Yardanico> i'll try to patch opir to do that |
08:30:35 | FromDiscord | <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:09 | PMunch | Hmm, I'm unable to compile the C snippet you sent me |
08:34:10 | * | max22- joined #nim |
08:34:16 | PMunch | Complains that SAPI is undefined |
08:35:36 | FromDiscord | <Yardanico> are you compiling with that gcc command? hmm |
08:35:44 | PMunch | Yup |
08:35:53 | * | xet7 quit (Remote host closed the connection) |
08:36:04 | PMunch | Oh wait.. |
08:36:54 | FromDiscord | <Yardanico> oh yeah I fixed it before, lemme remember how I did that |
08:37:02 | * | xet7 joined #nim |
08:37:25 | PMunch | Yardanico, you seem to have an include for /home/dian/Projects/nsciter/sdk/include, which I obviously don't have on my machine |
08:37:41 | FromDiscord | <Yardanico> oh, well, I assumed you downloaded that sciter archive |
08:37:49 | FromDiscord | <Yardanico> that's the path to the include folder inside of it |
08:38:26 | PMunch | No it's not |
08:38:34 | PMunch | That's a path to nsciter |
08:38:40 | FromDiscord | <Yardanico> nsciter doesn't matter |
08:38:49 | FromDiscord | <Yardanico> I just unpacked the sciter sdk to sdk folder inside of nsciter folder :) |
08:39:08 | PMunch | Ah right |
08:39:30 | FromDiscord | <Yardanico> ahh right @PMunch I remember what I did to fix it, it seems a bug in sciter headers themselves |
08:39:47 | PMunch | Fixed it so it points to my include folder, still same issue |
08:39:48 | PMunch | Aha |
08:39:57 | FromDiscord | <Yardanico> on line 454 and 507 add `extern` before the `inline` |
08:40:04 | FromDiscord | <Yardanico> sciter-x-api.h |
08:40:05 | PMunch | Which file? |
08:40:08 | PMunch | Okay |
08:40:10 | FromDiscord | <Yardanico> need to PR that probably |
08:41:10 | PMunch | Right, managed to compile it now |
08:41:45 | FromDiscord | <Yardanico> yeah, all good, you don't need to run it to confirm that it works |
08:42:30 | PMunch | There'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:46 | PMunch | ref.: https://play.nim-lang.org/#ix=3BHo |
08:42:58 | PMunch | Okay, so now to check if Futhark can do this |
08:43:33 | FromDiscord | <Yardanico> @PMunch that should be reported to me, not him :) |
08:44:09 | FromDiscord | <Yardanico> hmm, actually I'm not sure why it is doing that |
08:44:11 | PMunch | Oh really? |
08:44:21 | FromDiscord | <Yardanico> yeah, ircord is the bridge bot |
08:44:28 | PMunch | Ah right, you're maintaining that! |
08:44:58 | PMunch | I 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:07 | PMunch | Like when you paste code into their GUI |
08:49:15 | PMunch | Hmm, I didn't get the hashSet issue |
08:49:54 | FromDiscord | <Yardanico> weird, are you on devel? |
08:50:29 | PMunch | Nope 1.4.8 |
08:50:40 | FromDiscord | <Yardanico> oh yeah, that change was added in devel |
08:50:45 | PMunch | Right |
08:50:50 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/15767 |
08:50:53 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/16959 |
08:52:41 | FromDiscord | <Yardanico> ok got further, now futhark fails with `Error: unhandled exception: key not found: LPCWSTR` |
08:53:08 | PMunch | Yeah I got the same issue |
08:53:59 | FromDiscord | <Yardanico> maybe it's because LPCWSTR is defined as an alias to WCHAR ? |
08:54:21 | PMunch | Nope, that shouldn't be an issue |
08:55:00 | PMunch | It's probably because LPCWSTR wasn't marked as being used, so it's not included in the list of identifiers Futhark knows |
08:55:57 | PMunch | Ah |
08:56:30 | PMunch | Looking at the stack-trace you can see that LPCWSTR occurred as the return value of a procedure defined within a struct |
09:02:53 | PMunch | Hmm, if I re-raise an exception I seem to lose the original stack-trace.. |
09:08:33 | PMunch | I 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:21 | PMunch | The 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:26 | FromDiscord | <Yardanico> yeah, no worries, it's not a big deal :) |
09:45:55 | FromDiscord | <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:33 | FromDiscord | <dom96> I mean... why do you disagree? Nim is the closest to a compiled Python there is |
10:00:56 | FromDiscord | <Yardanico> the closest to compiled python is Cython :) |
10:01:10 | FromDiscord | <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:14 | FromDiscord | <Yardanico> exactly |
10:03:42 | FromDiscord | <dom96> In reply to @Yardanico "the closest to compiled": Meh, Cython doesn't count 🙂 |
10:03:47 | FromDiscord | <xflywind> Now cython supports type annotation, really nice to use |
10:05:10 | FromDiscord | <xflywind> it is |
10:05:20 | FromDiscord | <Rika> In reply to @dom96 "Meh, Cython doesn't count": Why would Nim count then |
10:05:21 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3BHO |
10:06:28 | FromDiscord | <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:47 | FromDiscord | <dom96> When I started using Nim I literally searched for a "compiled Python" |
10:08:54 | FromDiscord | <Rika> It is only coincidentally a “compiled Python” |
10:09:39 | FromDiscord | <dom96> no it isn't, the motto was something like "fast as C, expressive as Python, extensible as Lisp" |
10:09:50 | FromDiscord | <dom96> so the Python influence was very much intentional |
10:12:55 | FromDiscord | <Rika> Was the offside rule developed after the motto or before? |
10:14:12 | FromDiscord | <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:38 | FromDiscord | <xflywind> https://github.com/peregrine-lang/Peregrine/tree/main |
10:21:41 | FromDiscord | <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:50 | FromDiscord | <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:04 | FromDiscord | <dom96> `const str`? that's not Pythonic at all |
10:22:28 | * | andinus joined #nim |
10:22:52 | FromDiscord | <dom96> in any case, anything associated with V makes me suspicious. |
10:23:02 | FromDiscord | <Yardanico> In reply to @dom96 "`const str`? that's not": this language is not really working anyway, so nothing to compare with |
10:23:15 | FromDiscord | <Yardanico> i mean at this point in time |
10:23:23 | FromDiscord | <Yardanico> i think it was botted or something |
10:23:33 | FromDiscord | <Yardanico> 1.3k stars with literally _no_ actual working language |
10:23:42 | FromDiscord | <dom96> that's the V way |
10:23:47 | FromDiscord | <Yardanico> yess |
10:23:54 | FromDiscord | <xflywind> I'm curious why they can always get so many stars |
10:24:30 | FromDiscord | <xflywind> (edit) "I'm curious why they can always get so many stars ... " added "and attentions" |
10:24:36 | FromDiscord | <dom96> it's easy, just say you're doing something that most people want |
10:24:44 | FromDiscord | <dom96> people will star even if the repo is empty |
10:25:16 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/898154480657375252/unknown.png |
10:25:25 | FromDiscord | <xflywind> But people need to know the project first |
10:25:26 | FromDiscord | <dom96> sometimes you might even get millions of VC funding |
10:25:28 | FromDiscord | <dom96> see Theranos |
10:26:13 | FromDiscord | <Yardanico> XDD these comparisons https://media.discordapp.net/attachments/371759389889003532/898154719254556732/unknown.png |
10:26:27 | FromDiscord | <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:33 | FromDiscord | <Yardanico> but yeah, this is more for #offtopic |
10:27:09 | FromDiscord | <xflywind> They wrote an advertising article and attracted many people to read and review it. |
10:28:07 | FromDiscord | <xflywind> Maybe Nim team can publish article for blogs/ to dev.to too. |
10:52:55 | PMunch | It's on-topic enough for this channel when no one is trying to get help :P |
10:53:08 | FromDiscord | <Yardanico> https://www.youtube.com/watch?v=d2VRuZo2pdA |
10:53:12 | FromDiscord | <Yardanico> reposted from offtopic as well |
10:53:20 | FromDiscord | <Yardanico> seems like no one posted it before |
10:53:32 | PMunch | Haven't seen that at all |
10:53:39 | PMunch | Or anyone mentioning it |
10:54:18 | FromDiscord | <Yardanico> it's by deech who's active in this discord server sometimes |
10:54:34 | PMunch | Yeah I was surprised I hadn't seen before |
10:54:58 | FromDiscord | <Rika> Oh nice |
10:55:08 | FromDiscord | <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:12 | FromDiscord | <Yardanico> (manually of course, no bots) |
10:55:21 | FromDiscord | <Rika> How do you guys even write or make a presentation on these thing |
10:55:23 | FromDiscord | <Yardanico> well, not all, but the more serious ones like talk |
10:55:23 | FromDiscord | <Rika> Things |
10:55:37 | PMunch | What do you mean Rika? |
10:56:01 | FromDiscord | <Rika> I have difficulty writing about my projects, as in, what is there to write about exactly |
10:56:11 | FromDiscord | <xflywind> In reply to @Yardanico "maybe it's time to": forum thread cannot attract new users 😜 |
10:56:21 | FromDiscord | <Yardanico> that's not about new users, it's about existing users :) |
10:56:24 | FromDiscord | <Rika> In reply to @flywind "forum thread cannot attract": Repost on HN |
10:56:49 | PMunch | @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:01 | PMunch | Once you've done it a couple of times its almost automatic :P |
10:57:07 | FromDiscord | <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:10 | FromDiscord | <Yardanico> idk if it's a good idea to do |
10:57:37 | PMunch | Oops, gotta run to a meeting.. |
10:57:56 | FromDiscord | <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:36 | FromDiscord | <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:39 | FromDiscord | <Yardanico> only talks and similar stuff |
11:14:32 | FromDiscord | <Yardanico> but sometimes it's hard to differentiate between a talk and a tutorial :) |
11:15:20 | FromDiscord | <xflywind> https://piped.kavin.rocks/watch?v=WdL-doqxXyo |
11:15:49 | FromDiscord | <xflywind> I encounter this video yesterday |
11:15:51 | FromDiscord | <Yardanico> https://www.youtube.com/watch?v=WdL-doqxXyo |
11:16:01 | FromDiscord | <Yardanico> ah it's a invidio.us instance |
11:16:06 | FromDiscord | <Yardanico> I thought it was peertube or something |
11:16:15 | FromDiscord | <Yardanico> thanks for the link |
11:21:44 | FromDiscord | <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:32 | PMunch | @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:51 | FromDiscord | <Yardanico> interesting, thanks for fixing it! you don't have to rush though :) |
12:43:06 | PMunch | I'm not rushing :P |
12:43:34 | PMunch | These 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:38 | FromDiscord | <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:06 | FromDiscord | <konsumlamm> we can go even bigger and say that Nim has a zero-cost (WIP) garbage collector |
13:20:15 | FromDiscord | <konsumlamm> and no (WIP) bugs |
13:20:43 | FromDiscord | <konsumlamm> the sad thing is, it would probably work |
13:20:57 | * | max22- joined #nim |
13:24:37 | FromDiscord | <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:21 | FromDiscord | <konsumlamm> that sounds pretty funny |
13:26:02 | FromDiscord | <haxscramper> Best-in-class metaprogramming, effortless zero-cost abstractions |
13:26:06 | FromDiscord | <haxscramper> Well, we don't really need to even add WIP things |
13:26:38 | FromDiscord | <haxscramper> Of course, average joe schmoe "case insensetivity is bad" is going to be offended at everything anyway |
13:27:18 | FromDiscord | <haxscramper> what else |
13:28:16 | FromDiscord | <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:33 | FromDiscord | <haxscramper> We can probably play around this somehow as well |
13:28:55 | FromDiscord | <everyon> In reply to @haxscramper "Best-in-class metaprogramming, effortless zero-cost": The richest collection of libraries |
13:29:03 | FromDiscord | <everyon> (you can use C libraries) |
13:29:14 | FromDiscord | <haxscramper> also C++ and JS |
13:29:16 | FromDiscord | <haxscramper> yeah |
13:30:54 | FromDiscord | <Rika> `reliance of language users on compiler developers to implement very basic stuff` ??? |
13:30:58 | FromDiscord | <Rika> what? |
13:32:59 | FromDiscord | <haxscramper> You need random feature X |
13:33:13 | FromDiscord | <haxscramper> that nobody else needs, but you think it is super important |
13:33:16 | FromDiscord | <Rika> .... i still dont get it |
13:33:19 | FromDiscord | <haxscramper> some random-ass syntax sugar |
13:33:36 | FromDiscord | <haxscramper> The only option in 99% of the languages is to wait for compiler devs to implement it |
13:33:39 | FromDiscord | <Rika> oh this isnt a criticism of nim |
13:33:54 | FromDiscord | <haxscramper> they don't have a macro system good enough anyway |
13:34:05 | FromDiscord | <haxscramper> in nim you can do this by writing a macro, most of the time |
13:34:26 | FromDiscord | <haxscramper> of course we have unspecified typed AST and other things, but overall this is still better compared to the other languages |
13:36:52 | FromDiscord | <konsumlamm> "best-in-class metaprogramming" is gonna provoke some lispers |
13:37:18 | FromDiscord | <haxscramper> flamebait is good |
13:37:24 | FromDiscord | <haxscramper> flamebaits create attention, discussion |
13:37:38 | FromDiscord | <haxscramper> and to be honest I think we can prove this |
13:37:58 | FromDiscord | <haxscramper> well, except someone brings reader macros, but those are kind of useless |
13:38:04 | FromDiscord | <konsumlamm> (most?) lisps don't have typed macros though, tbf |
13:38:27 | FromDiscord | <Rika> reader macros would be cool though |
13:38:30 | FromDiscord | <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:43 | FromDiscord | <Rika> though yeah it would be useless technically |
13:40:25 | FromDiscord | <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:46 | FromDiscord | <haxscramper> nanim project is just so good |
14:20:48 | FromDiscord | <haxscramper> things just work |
14:21:45 | FromDiscord | <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:49 | FromDiscord | <haxscramper> I'm talking about https://forum.nim-lang.org/t/8499 |
14:22:10 | FromDiscord | <haxscramper> fuck facebook though |
14:22:39 | FromDiscord | <haxscramper> facebook/instagram shit. Can't even scroll to the end to see all animations |
14:25:22 | FromDiscord | <dom96> maybe we should try submitting that thread to HN |
14:27:24 | FromDiscord | <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:59 | FromDiscord | <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:21 | FromDiscord | <reilly> The command being run is: https://hastebin.com/oveyafativ.apache |
14:30:53 | FromDiscord | <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:00 | FromDiscord | <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:11 | FromDiscord | <haxscramper> Well, that much you have figured out yourself probably |
14:38:43 | FromDiscord | <haxscramper> But it sounds like some absolutely cursed Cxx trick that was used just in this library |
14:40:27 | FromDiscord | <reilly> In reply to @haxscramper "But it sounds like": Well, it's just ImGui... |
14:42:27 | FromDiscord | <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:55 | FromDiscord | <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:05 | FromDiscord | <haxscramper> Can you show generated cxx code around this part maybe? |
14:46:37 | FromDiscord | <haxscramper> Or if this is easy to reproduce I might try to look at it now |
14:51:06 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3BJl |
14:51:23 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3BJl" => "https://play.nim-lang.org/#ix=3BJm" |
15:02:52 | FromDiscord | <haxscramper> well https://github.com/status-im/nimbus-eth1/issues/2 |
15:04:14 | FromDiscord | <haxscramper> and https://github.com/nimgl/nimgl/issues/38 |
15:04:56 | FromDiscord | <haxscramper> tldri `#define SEQ_DECL_SIZE` in nimbase.h leads to `ImGuiTable Data[];` which is not allowed due to `ImGuiTable` destructor |
15:05:39 | FromDiscord | <haxscramper> Why nim sequence uses flexible array instead of actual pointer is something I don't really know |
15:05:51 | FromDiscord | <haxscramper> I mean, `size + capacity + pointer-to-start` |
15:05:52 | FromDiscord | <haxscramper> done |
15:06:02 | FromDiscord | <haxscramper> and no, it seems like this is not fixable |
15:06:36 | FromDiscord | <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:05 | FromDiscord | <reilly> Could I just... Edit nimbase.h, or is that a bad idea? |
15:09:39 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3BJH |
15:09:44 | FromDiscord | <haxscramper> No, you would have to edit codegen for sequence type |
15:10:12 | FromDiscord | <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:50 | FromDiscord | <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:08 | FromDiscord | <demotomohiro> stdio.h and string.h are standard C library headers. |
15:16:58 | FromDiscord | <demotomohiro> I don't know much about clang but these files should be installed when you install C compiler. |
15:20:18 | FromDiscord | <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:38 | FromDiscord | <reilly> Cause, I have to make this work. I am not doing this just for fun. |
15:22:05 | FromDiscord | <reilly> This may be the last hurdle I need to solve to get it working. |
15:23:42 | FromDiscord | <haxscramper> you need to have a `seq[T]` of things, correct? |
15:23:51 | FromDiscord | <haxscramper> or this is something other than that |
15:24:04 | FromDiscord | <haxscramper> you can, technically just write definition manually |
15:24:19 | FromDiscord | <haxscramper> and then `importcpp`, I think |
15:24:38 | FromDiscord | <haxscramper> not enough italic, it this does not really show how uncertain I am |
15:24:53 | FromDiscord | <haxscramper> like, what is the end goal |
15:28:15 | FromDiscord | <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:18 | FromDiscord | <haxscramper> also need minized example |
15:28:31 | FromDiscord | <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:40 | FromDiscord | <Ricky Spanish> thanks @haxscramper |
15:30:18 | FromDiscord | <reilly> I'm not really sure I can give you a minimal example, since it's kind of a convoluted setup... |
15:33:56 | FromDiscord | <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:09 | FromDiscord | <haxscramper> no, this does not work |
15:34:23 | FromDiscord | <haxscramper> fuck, why does cxx backend inherit from generic seq |
15:34:29 | FromDiscord | <haxscramper> And C puts all fields inside |
15:34:36 | FromDiscord | <haxscramper> I wanted to make like |
15:34:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJM |
15:34:51 | FromDiscord | <haxscramper> This is a valid nim |
15:34:54 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJN |
15:35:27 | FromDiscord | <haxscramper> but this is not valid cxx because I can't add to sequence size |
15:35:56 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJO |
15:37:04 | FromDiscord | <haxscramper> @reilly) |
15:37:17 | FromDiscord | <haxscramper> SEQ\_DECL\_SIZE itself is not preventing anything from compiling |
15:37:33 | FromDiscord | <haxscramper> I it is a `ImGuiTable Data[]` being used instead of `ImGuiTable Data` |
15:37:51 | FromDiscord | <reilly> You're right, poor phrasing. |
15:38:02 | FromDiscord | <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:56 | FromDiscord | <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:25 | FromDiscord | <haxscramper> That would've worked |
15:41:37 | FromDiscord | <haxscramper> ` ImSeq {.importcpp, header: "flexible_array.hpp".} = seq[ImGuiTable]` is basically all you need to define your own sequence |
15:41:43 | FromDiscord | <haxscramper> on C backed |
15:41:49 | FromDiscord | <haxscramper> cxx backend works differently |
15:41:59 | FromDiscord | <haxscramper> well, let me try to be completely sure |
15:53:24 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BJU |
15:53:56 | FromDiscord | <haxscramper> Well, it fully compiles, but still crashes because `newSeqRC1` does not create a valid sequence (does not polulate `.data` with anything |
15:54:33 | FromDiscord | <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:31 | FromDiscord | <reilly> This definitely seems to me like something for #internals, because we're really getting down to the nitty-gritty now. |
15:55:48 | FromDiscord | <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:43 | FromDiscord | <haxscramper> @reilly |
16:53:58 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BKi |
16:54:03 | FromDiscord | <haxscramper> `@[(field: 0), (field: 0), (field: 0), (field: 12)]` |
16:54:05 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BKj |
16:54:20 | FromDiscord | <haxscramper> I still don't know how to replicate nontrivial destructor |
16:54:38 | FromDiscord | <haxscramper> but this POS works at least |
16:55:09 | FromDiscord | <haxscramper> so you can substitute nim sequence with this contraption and still trick nim into thinking it is a valid `seq[T]` |
16:55:31 | FromDiscord | <haxscramper> I would be very careful around generics though |
17:02:19 | FromDiscord | <reilly> I've just set the array size to 1, and unbelievably, it fucking works. |
17:02:49 | FromDiscord | <reilly> By "set," I mean I'm `.replace()`ing on the generated C++ code. And it works. |
17:03:22 | FromDiscord | <haxscramper> you can try and subtitute `nimbase.h` with your own then |
17:03:38 | FromDiscord | <haxscramper> where `SEQ_DECL_SIZE` is defined to be `1` |
17:05:16 | FromDiscord | <reilly> I'd honestly rather leave nimbase.h alone. I just need a workaround for this one thing. |
17:08:06 | FromDiscord | <Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3BKq |
17:09:33 | FromDiscord | <Hamid Bluri> it's just a macro that converts `route(...) as <NAME>: <PROC>` to `Table[<NAME>, <PROC>]` |
17:11:06 | FromDiscord | <Hamid Bluri> 😄 i just forgot to add `async` to type def in `Table[string, proc()]` |
17:12:12 | FromDiscord | <Hamid Bluri> but it should gave me a reasonable error |
17:21:50 | FromDiscord | <reilly> In reply to @hamidb80 "but it should gave": 🥲 |
17:22:24 | FromDiscord | <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:25 | NimEventer | New 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:48 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BKK |
18:24:47 | FromDiscord | <exelotl> weird, mine looks just like that and doesn't have any problem 🤔 |
18:25:16 | FromDiscord | <exelotl> https://github.com/exelotl/natu/blob/devel/tools/templates/backgrounds.c.template |
18:26:58 | NimEventer | New 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:23 | FromDiscord | <haxscramper> I swear if I see nim and python in one sentence one more time today |
18:29:56 | FromDiscord | <konradmb> nim python nim python nim python nim python nim python nim python 😁 |
18:30:58 | FromDiscord | <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:44 | FromDiscord | <konradmb> no ; or {} - neuron activation - "Hey, that's Python!" |
18:32:54 | FromDiscord | <haxscramper> I know this particular one does not complain about it |
18:35:12 | FromDiscord | <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:21 | FromDiscord | <konradmb> Well, from what I see it's the only popular one with this kind of syntax |
18:36:04 | FromDiscord | <haxscramper> indentation + `:` for block delimiting is not really common, so similarity does really force people to jump to conclusions sometimes |
18:37:08 | FromDiscord | <konradmb> yeah, that's what I mean + Pascal or Lua has those begin/end, so they're not similar to Python |
18:38:43 | FromDiscord | <haxscramper> I think we should put mention of the C++ somewhere as well, considering it had certain degree of influence |
18:38:52 | FromDiscord | <haxscramper> But this would most likely just scare people away |
18:39:16 | FromDiscord | <haxscramper> Just like LISP thing I guess |
18:41:49 | FromDiscord | <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:44 | FromDiscord | <haxscramper> Nim generic system is very C++-like |
18:43:58 | FromDiscord | <haxscramper> But of course there is much more C in nim than `++` part |
18:44:15 | FromDiscord | <geekrelief> In reply to @exelotl "https://github.com/exelotl/natu/blob/devel/tools/te": maybe because I'm trying this from nimble? |
18:45:44 | FromDiscord | <konradmb> C# has <T>, so similar 🙃 you are doing the same thing that you frowned upon lately 😀 |
18:46:58 | FromDiscord | <haxscramper> I also mean parametrization of generic types/procedures with value-as-a-type |
18:47:07 | FromDiscord | <haxscramper> `static[int]` as a generic parameter |
18:47:47 | FromDiscord | <haxscramper> `<T>` is not really hard to find, but static parametrization is less frequent |
18:48:03 | FromDiscord | <konradmb> you mean like System.Collections.Generic.List<T>? |
18:48:05 | FromDiscord | <haxscramper> for example rust only got it this year and it was "the big thing" IIRC |
18:49:48 | FromDiscord | <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:38 | FromDiscord | <konradmb> hmm, then I don't know if that's possible in C# |
18:51:54 | FromDiscord | <konradmb> but you are doing the same thing that you hate |
18:51:54 | FromDiscord | <haxscramper> Thankfully nim does not adopt ALL C++ features, like SFINAE |
18:52:18 | FromDiscord | <konradmb> "I swear if I see nim and C++ in one sentence one more time today" 😀 |
18:53:05 | FromDiscord | <haxscramper> I don't hate the thing, I hate thundering crowds repeating the same basic nonsense |
18:53:18 | FromDiscord | <konradmb> but it's not nonsense |
18:53:47 | FromDiscord | <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:51 | FromDiscord | <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:04 | FromDiscord | <haxscramper> yes, and usually very first thing this comparison leads to discussions about how to make nim more python-like |
18:55:28 | FromDiscord | <haxscramper> Like style insensetivity being bad for people coming from python, or lack of list comprehensions |
18:55:34 | FromDiscord | <haxscramper> this is not a singular case |
18:56:14 | FromDiscord | <haxscramper> They are similar enough so people not only consider moving from one another, but also want to turn one into another |
18:56:40 | FromDiscord | <haxscramper> This is bound to happen to any newcomer from any language, but python has very large community |
18:56:48 | FromDiscord | <haxscramper> And very high syntactic similarity |
18:57:06 | FromDiscord | <haxscramper> So it amplifies the annoyance |
18:57:11 | FromDiscord | <konradmb> hmmm theres something in it |
18:57:31 | FromDiscord | <konradmb> but then you can send them to https://github.com/juancarlospaco/cpython XD |
18:58:20 | FromDiscord | <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:56 | FromDiscord | <ErikW> In reply to @haxscramper "facebook/instagram shit. Can't even": Yeah it's pretty shitty xD |
19:00:26 | FromDiscord | <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:53 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/245 because everyone else has pattern matching |
19:01:48 | FromDiscord | <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:11 | FromDiscord | <konradmb> the same for case insensitivity and module imports |
19:04:11 | FromDiscord | <haxscramper> Also, we need to remember that syntactic nitpicks cause largest discussions, period |
19:04:28 | FromDiscord | <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:45 | FromDiscord | <haxscramper> 252 is not implementable with macros |
19:04:55 | FromDiscord | <haxscramper> 245 is implemented in macos, by me |
19:05:28 | FromDiscord | <haxscramper> 362 is partially impelementable using std/typetraits and tuple unpacking, but this solution is extremely ugly |
19:05:37 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/898285257319665664): 245 is implemented in macros, by me |
19:07:37 | FromDiscord | <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:45 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3BKY |
19:11:17 | FromDiscord | <haxscramper> Sometimes `nimZeroMem` might really mess up the default state of the imported class |
19:11:44 | FromDiscord | <haxscramper> I can already deal with non-defaultable types via `{.requiresinit.}`, but that is just an intermediate step |
19:12:01 | FromDiscord | <konradmb> ok, I see |
19:17:15 | FromDiscord | <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:11 | FromDiscord | <exelotl> In reply to @geekrelief "maybe because I'm trying": so it's attempting to use the filter in a nimscript environment? |
19:25:15 | FromDiscord | <geekrelief> Yeah, I ended creating a separate generator file instead of trying to do it from nimble/nimscript. |
19:25:23 | FromDiscord | <geekrelief> (edit) "Yeah, I ended ... creating" added "up" |
19:25:50 | FromDiscord | <exelotl> ah, yeah I've been there before x) |
19:25:51 | FromDiscord | <geekrelief> But I just avoid the emit and returned a string to write out |
19:25:58 | FromDiscord | <geekrelief> (edit) "avoid" => "avoided" |
19:29:56 | FromDiscord | <tandy> is anyone here familiar with xml? how can i parse a list as a seq? |
19:49:51 | * | nrds joined #nim |
19:51:17 | FromDiscord | <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:03 | nrds | <Prestige99> tandy: https://nim-lang.org/docs/parsexml.html |
19:52:06 | FromDiscord | <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:07 | FromDiscord | <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:31 | FromDiscord | <geekrelief> I thought opening files was prevented because it's an importc thing |
19:54:05 | FromDiscord | <exelotl> you can `import os` - not all the functions are available (most annoyingly there's no time functions) but writeFile does work |
19:55:36 | FromDiscord | <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:23 | FromDiscord | <geekrelief> I'll try fiddling with it a little more. |
20:04:06 | FromDiscord | <tandy> hmm↵(<@709044657232936960_nrds=5b=49=52=43=5d>) |
20:04:08 | FromDiscord | <geekrelief> @exelotl huh 😄 that worked! So `writeFile` works but `open(path, fmWrite)` doesn't |
20:04:11 | FromDiscord | <tandy> how does this work? |
20:04:24 | FromDiscord | <tandy> the code im using atm uses this but also xmltree |
20:04:34 | FromDiscord | <tandy> and xmltree doesnt output seqs |
20:07:21 | FromDiscord | <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:50 | Mister_Magister | tfw you see project name nimble and files with name nimble and nim and turns out its not nim-lang |
20:17:03 | Mister_Magister | Apache 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:08 | FromDiscord | <tandy> can you have repeated keys in json? |
20:41:20 | FromDiscord | <exelotl> no, or at least it's undefined how that would behave depending on the JSON parser you're using |
20:41:42 | FromDiscord | <DMisener> sent a code paste, see https://play.nim-lang.org/#ix=3BLk |
20:44:24 | FromDiscord | <tandy> hm↵(@exelotl) |
20:44:38 | FromDiscord | <tandy> do you think it would be possible to describe JSPF as a nim type? |
20:44:38 | FromDiscord | <tandy> https://xspf.org/jspf/ |
20:45:43 | FromDiscord | <tandy> im trying at the moment but xml is quite different to json |
20:46:31 | FromDiscord | <exelotl> yeah, seems pretty easy |
20:46:42 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BLn |
20:46:42 | FromDiscord | <tandy> things like these are the hard parts |
20:47:12 | FromDiscord | <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:37 | FromDiscord | <tandy> i guess that could be link\: seq[seq[(string, string)]] |
20:51:50 | FromDiscord | <tandy> i guess that could be `link: seq[seq[(string, string)]]` |
20:52:21 | FromDiscord | <exelotl> probably don't need the nested seqs right? |
20:52:41 | FromDiscord | <exelotl> like `link: seq[(string, string)]` should be fine too |
20:53:13 | FromDiscord | <tandy> oh true |
20:54:13 | FromDiscord | <exelotl> I just checked, if the JSON has duplicate keys the 2nd occurrence will overwrite the 1st occurrence |
20:54:17 | FromDiscord | <exelotl> in Nim at least |
20:54:57 | FromDiscord | <exelotl> so probably better to stick to the XML format if that's something you think is likely to happen |
20:59:35 | FromDiscord | <tandy> yeah, im going to try describing the xspf type, but jspf should work as json↵(@exelotl) |
20:59:53 | FromDiscord | <tandy> really they should write a new spec for JSPF because it isnt exactly the same as xspf... |
21:06:11 | NimEventer | New thread by Deech: Nim Nuggets: Talk About Nim At The Strange Loop Conference, see https://forum.nim-lang.org/t/8503 |
21:07:46 | FromDiscord | <tandy> actually i need to use a table for this |
21:16:36 | FromDiscord | <exelotl> oh yeah that works too - tables in Nim _do_ support duplicate keys but it seems to be a controversial feature 😅 |
21:17:08 | FromDiscord | <tandy> how do u index tables tho |
21:17:27 | FromDiscord | <exelotl> myTable[key] |
21:17:28 | FromDiscord | <tandy> oh its not too bad |
21:17:34 | FromDiscord | <tandy> similiar to json |
21:17:41 | FromDiscord | <tandy> so its ideal i gues |
21:56:07 | Mister_Magister | is there some timeout for waitFor? |
22:01:22 | * | max22- quit (Quit: Leaving) |
22:02:18 | Mister_Magister | even better question |
22:02:25 | Mister_Magister | why AsyncSocket doesn't disconnect when i disconnect client |
22:04:04 | Mister_Magister | because i'm doing waitFor client.recvLine() but if i disconnect the client it never finishes and entire code is hang up |
22:09:03 | nrds | <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:42 | nrds | <Prestige99> Short of creating a global mapping of ids or something to my objects, I'm out of ideas |
22:10:49 | nrds | <Prestige99> The part of my code: https://play.nim-lang.org/#ix=3BLM |
22:11:38 | FromDiscord | <impbox [ftsf]> Use the body to get a reference to the object |
22:11:49 | FromDiscord | <impbox [ftsf]> You can store userdata on the body right? |
22:13:49 | nrds | <Prestige99> not sure, can't find the real definition of cpBody. Just `typedef struct cpBody cpBody` |
22:14:53 | FromDiscord | <impbox [ftsf]> This is chipmunk yeah? |
22:14:58 | nrds | <Prestige99> Yeah |
22:19:06 | FromDiscord | <impbox [ftsf]> setUserData and getUserData |
22:19:51 | FromDiscord | <impbox [ftsf]> https://media.discordapp.net/attachments/371759389889003532/898334308626989106/Screenshot_20211015-091939.jpg |
22:20:15 | nrds | <Prestige99> oh interesting, didn't know about that; thanks |
22:20:55 | nrds | <Prestige99> I suppose this.unsafeAddr would do the trick.. |
22:21:13 | FromDiscord | <impbox [ftsf]> Generally you'd bind your game object to your rigidbodies via userdata |
22:23:51 | nrds | <Prestige99> thank you! |
22:24:16 | FromDiscord | <impbox [ftsf]> For what you're doing though, you may as well just iterate though all your objects after stepping |
22:24:34 | FromDiscord | <impbox [ftsf]> Rather than adding callbacks to the physics code for every update |
22:25:04 | nrds | <Prestige99> oh this is just assigning a callback for the velocityUpdateFunc |
22:25:25 | nrds | <Prestige99> for a particular body |
22:26:38 | nrds | <Prestige99> calling cpBodySetVelocityUpdateFunc |
22:27:46 | FromDiscord | <impbox [ftsf]> Hmmmm ok, i don't really understand your use case. But I'm not sure why you'd use velocityupdatefunc |
22:28:51 | nrds | <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:14 | nrds | <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:39 | FromDiscord | <impbox [ftsf]> Ok that may be the case, but you probably only want to assign it once |
22:31:43 | nrds | <Prestige99> Yeah that's what this function does, it's just for assignment |
22:32:01 | nrds | <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:59 | FromDiscord | <impbox [ftsf]> Ok |
22:33:23 | FromDiscord | <impbox [ftsf]> Does the userdata thing do what you want? |
22:34:26 | nrds | <Prestige99> Yep! Just what I needed, thanks |
22:35:39 | FromDiscord | <impbox [ftsf]> Awesome |
22:42:11 | * | Vladar quit (Remote host closed the connection) |
22:48:47 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BLP |
22:52:07 | Mister_Magister | yeah my client sockets aren't being disconnected when i kill them |
22:52:17 | Mister_Magister | recvLine never ends |
22:52:47 | Mister_Magister | and nowhere i can find how to check if client is still connected |
22:54:49 | Mister_Magister | i tihnk the idea is to set timeout in recvLine and then set up some kind of heatbeat |