00:04:08 | FromDiscord | <bedwardly-down> @Never Listen To Beef , well of course, you’re a dog beef hybrid afterall |
00:22:23 | * | krux02_ quit (Remote host closed the connection) |
00:24:32 | * | zacharyc1rter quit (Ping timeout: 256 seconds) |
00:24:32 | * | zacharycarter quit (Ping timeout: 256 seconds) |
00:33:14 | * | monokrom quit (Remote host closed the connection) |
00:48:02 | * | arecaceae quit (Remote host closed the connection) |
00:48:41 | * | arecaceae joined #nim |
00:52:18 | * | Earlh21 joined #nim |
00:54:57 | * | Earlh21 left #nim (#nim) |
00:58:18 | * | idrialite joined #nim |
00:58:34 | * | ryan__ joined #nim |
01:01:25 | * | ryan_ quit (Ping timeout: 264 seconds) |
01:01:57 | idrialite | Can someone help me with a compile error? I'm getting invalid indentation: https://pastebin.com/1Qxh2cVg (line 23) |
01:03:37 | leorize | it's `not` in Nim, not `!` |
01:04:06 | leorize | also `and`, not `&&` |
01:05:24 | idrialite | Changed them and still getting the error |
01:07:36 | leorize | also `.inc`, not `++` |
01:08:21 | idrialite | That fixed it, thank you |
01:08:28 | leorize | you can also use `+=`, though the `inc` proc is more popular |
01:08:45 | FromDiscord | <Yardanico> Yeah I like using inc |
01:12:17 | * | ryan__ is now known as tanger_moon |
01:13:14 | FromDiscord | <KingDarBoja> Do you come from Python? |
01:14:50 | idrialite | Me? No, I usually use C#/C++/Java |
01:14:58 | FromDiscord | <Never Listen To Beef> Ah fellow C# dev 😄 |
01:15:05 | idrialite | Love C# <3 |
01:15:25 | FromDiscord | <Never Listen To Beef> I love that in nim we dont need to write extension methods ever |
01:15:30 | FromDiscord | <Never Listen To Beef> Cause normal methods function the same |
01:16:12 | FromDiscord | <Yardanico> UFCS is the best, yeah |
01:16:24 | FromDiscord | <Never Listen To Beef> For us that dont speak in abbreviations? |
01:16:51 | FromDiscord | <Yardanico> universal function call syntax, in nim it's called MCS (method call syntax) |
01:17:08 | FromDiscord | <KingDarBoja> Welcome 😄 |
01:17:11 | FromDiscord | <Yardanico> Ah sorry *uniform |
01:17:19 | FromDiscord | <Never Listen To Beef> Ah the techincal term for why i can do a.b() or b(a) |
01:17:21 | FromDiscord | <Never Listen To Beef> ? |
01:17:28 | FromDiscord | <Yardanico> Yes |
01:17:30 | FromDiscord | <KingDarBoja> So you heavy OOP guy? |
01:17:30 | FromDiscord | <Yardanico> UFCS |
01:17:49 | FromDiscord | <Never Listen To Beef> I mean i am considering i use unity engine mostly, and that's all C# |
01:17:58 | FromDiscord | <Never Listen To Beef> I prefer data oriented design though |
01:18:18 | FromDiscord | <Yardanico> https://en.m.wikipedia.org/wiki/Uniform_Function_Call_Syntax check the first two languages as an examples xd |
01:18:31 | FromDiscord | <KingDarBoja> I am being converted into OV |
01:18:38 | * | FromDiscord <KingDarBoja> I am being casted awaaayyy |
01:19:07 | FromDiscord | <Yardanico> Ah seems like D and Nim are the only ones who have real UFCS |
01:19:20 | FromDiscord | <Yardanico> Out of the "bigger" languages |
01:19:32 | FromDiscord | <Never Listen To Beef> I really love it, it's so frigging nice to just have procs be procs and not specific use case procs |
01:19:37 | idrialite | It confused me at first cuz I was looking for a way to put methods into the objects lol |
01:19:47 | FromDiscord | <Never Listen To Beef> Ah i did the same |
01:20:01 | FromDiscord | <Never Listen To Beef> You can have objects with named procs for an event system |
01:20:20 | FromDiscord | <Kurinoku> may i ask something, im trying to use a single-header c library with nim, i cant make the .h file a dynamic library so what do i do |
01:20:21 | FromDiscord | <Never Listen To Beef> No clue if there is a proper alternative for delgates outside of a `seq[proc]` |
01:20:50 | FromDiscord | <Yardanico> @Kurinoku {.compile: "file.h".} should work |
01:21:00 | FromDiscord | <Kurinoku> ok thank you |
01:21:05 | FromDiscord | <Never Listen To Beef> Is there a type you can add procs to and have them all call in at once? |
01:21:09 | FromDiscord | <Yardanico> Put it at top level |
01:21:31 | FromDiscord | <Yardanico> At the start of the file (you can do it after imports if you want) |
01:21:48 | FromDiscord | <Kurinoku> @Yardanico okeh-okeh |
01:21:54 | FromDiscord | <Kurinoku> imma try now |
01:21:56 | FromDiscord | <Yardanico> Well actually it doesn't matter where you put it in the file, at the start or in the end, but the former is nicer |
01:35:48 | FromDiscord | <Kurinoku> c2nim translates const wchar_t* to ptr wchar_t should i use mangle to make wchar_t*, WideCString as provided by widestrs |
01:39:53 | idrialite | Can I have multiline while statements |
01:46:52 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:48:18 | FromDiscord | <Never Listen To Beef> No clue why'd you want to but yes |
01:48:18 | FromDiscord | <Never Listen To Beef> https://play.nim-lang.org/#ix=2kPD |
01:48:49 | * | chemist69 joined #nim |
01:50:25 | FromDiscord | <bedwardly-down> Is inc(1) an incremental operator? |
01:50:51 | FromDiscord | <Never Listen To Beef> you can do `inc i` or `inc(i)` and yes it just increments by 1 |
01:51:17 | FromDiscord | <Never Listen To Beef> *and i guess `i.inc`* |
01:51:21 | FromDiscord | <Yardanico> Not only by 1 |
01:51:25 | FromDiscord | <bedwardly-down> That looks kind of convenient |
01:51:30 | FromDiscord | <Yardanico> inc(i, 2) |
01:51:34 | FromDiscord | <Never Listen To Beef> oh |
01:51:36 | FromDiscord | <Yardanico> 1 is the default second argument |
01:51:36 | FromDiscord | <Never Listen To Beef> nice |
01:52:04 | FromDiscord | <Never Listen To Beef> Is in cthe idiomatic method of `+=` then? |
01:52:10 | FromDiscord | <Never Listen To Beef> inc the* |
01:53:00 | FromDiscord | <Yardanico> Both are fine I guess |
01:53:03 | FromDiscord | <bedwardly-down> Looks kind of like for(i = 0; i++; i < 10) in haxe |
01:53:23 | FromDiscord | <Yardanico> For that we have for i in 0 ..< 10: stuff |
01:53:23 | FromDiscord | <Never Listen To Beef> the nim of that would be `for i in 0..9` |
01:53:27 | FromDiscord | <bedwardly-down> Or the new for(i in 0..10) |
01:53:58 | FromDiscord | <bedwardly-down> That’s very similar to the Haxe 4 new incremental stuff. Nice |
01:55:43 | FromDiscord | <Yardanico> and by the way the first example you did is the default in most C-like languages |
01:55:54 | FromDiscord | <Yardanico> It's been around for tens of years :P |
01:55:57 | FromDiscord | <bedwardly-down> Mine? |
01:56:18 | FromDiscord | <Yardanico> The for(i= 0; ....) one |
01:56:36 | FromDiscord | <Never Listen To Beef> I've never seen the middle be the conditional though |
01:56:41 | FromDiscord | <Yardanico> Ah right |
01:56:45 | FromDiscord | <Never Listen To Beef> not be i mean* |
01:57:04 | FromDiscord | <bedwardly-down> It’s the default in Java, Haxe, c# and even a variant of it exists in bash and other shell scripting languages |
01:57:21 | FromDiscord | <Never Listen To Beef> Well C# it's val, conditional, increment |
01:57:34 | FromDiscord | <Yardanico> It's *also* the default in C, C++, JS |
01:57:56 | FromDiscord | <bedwardly-down> Now but about 10 years ago at least, it was how i showed. |
01:59:21 | FromDiscord | <Never Listen To Beef> Ah i've never seen it in anywhere |
02:00:06 | leorize | @Never Listen To Beef: `inc` is not the same as `+=`, though the effect is the same |
02:00:06 | FromDiscord | <Never Listen To Beef> Can nim abuse the for loop into a while loop |
02:00:23 | FromDiscord | <Never Listen To Beef> In what way is it different? |
02:00:24 | FromDiscord | <Yardanico> @bedwardly-down is it really that way? The increment being in the middle |
02:00:34 | FromDiscord | <Yardanico> It's really the first time seeing the for me |
02:00:50 | leorize | inc() is "increase by this amount (default 1)", and `+=` is "add this amount into the var" |
02:01:08 | FromDiscord | <bedwardly-down> It was. It’s just not as used in tutorials anymore but still valid |
02:01:13 | FromDiscord | <Never Listen To Beef> C# doesnt even compile with that |
02:01:33 | leorize | the "technical" difference would be that `inc` works with enum and `+=` doesn't :p |
02:02:07 | FromDiscord | <Never Listen To Beef> Well the difference is minimal |
02:02:22 | leorize | yea, it's only for the reading flow |
02:02:30 | leorize | like how people use `++` instead of `+= 1` |
02:02:35 | FromDiscord | <Never Listen To Beef> Inc still takes a negative secondary parameter so i'd argue it's illdesigned 😛 |
02:02:57 | disruptek | see also succ() |
02:02:57 | leorize | lol |
02:03:16 | FromDiscord | <Yardanico> Btw funny thing that https://haxe.org/manual/lf-iterators.html can be implemented in Nim just fine without any classes |
02:03:18 | disruptek | leorize: how well do you understand versioned symbols? |
02:03:26 | leorize | enough to curse them |
02:03:55 | FromDiscord | <bedwardly-down> @Never Listen To Beef last time i used c# XNA just was created for Xbox Live Indie program |
02:03:55 | leorize | you having trouble with them? |
02:04:00 | FromDiscord | <Yardanico> You just create your own object and define items for it (and pairs if you want two values like key: value) |
02:04:16 | FromDiscord | <Never Listen To Beef> Yea i just had to see if it was possible since it seemed unlikely |
02:04:26 | FromDiscord | <Never Listen To Beef> in C# the second param has to be a bool or else it complains |
02:05:03 | disruptek | leorize: we should scheme about if there's a "best" way to exploit them going forward. |
02:05:55 | leorize | I have always considered them a bad design |
02:06:09 | leorize | it existed for the sole idea of "using multiple version of the same library" |
02:06:14 | FromDiscord | <bedwardly-down> They changed that then, beef |
02:06:23 | FromDiscord | <Yardanico> Uhh no |
02:06:35 | leorize | and then it never worked out |
02:06:59 | FromDiscord | <bedwardly-down> I’m talking about c#. Sorry |
02:07:01 | FromDiscord | <Yardanico> C# always had C style for loops (they added the foreach and friends though) |
02:07:23 | disruptek | i'm wondering if we couldn't support multiple architectures or something. there's something there but i'm not sure what. |
02:07:38 | FromDiscord | <Yardanico> C# never had for loops with increment in the middle |
02:08:13 | FromDiscord | <Yardanico> Maybe you're confusing it with something else |
02:08:17 | leorize | disruptek: wdym? |
02:08:32 | FromDiscord | <Yardanico> it's for(variable, condition, operation) |
02:09:13 | FromDiscord | <bedwardly-down> You’re probably right. Xna wasn’t pure c# but a subset |
02:09:18 | disruptek | i dunno. just looking for ideas on how to exploit the feature in the backend. |
02:09:21 | FromDiscord | <Never Listen To Beef> or if you're abusing it for(;;) |
02:09:23 | FromDiscord | <Never Listen To Beef> Cause why not! |
02:09:31 | FromDiscord | <Never Listen To Beef> *Can i abuse nim for loops?* |
02:09:43 | FromDiscord | <Yardanico> just use while true |
02:09:46 | leorize | go did the for(;;) thing then call it "a clever design" |
02:09:55 | leorize | I say that's a retarded one |
02:09:57 | FromDiscord | <Never Listen To Beef> No that's too smart |
02:10:02 | FromDiscord | <Never Listen To Beef> While is intended for that |
02:10:09 | FromDiscord | <Never Listen To Beef> for;; is a silly while loop |
02:10:31 | FromDiscord | <Never Listen To Beef> You dont understand, one is for purposely making your code silly, the other is for serious work |
02:10:59 | FromDiscord | <Never Listen To Beef> Also im sorta offended you actually suggested while true, like i didnt know about it |
02:11:00 | FromDiscord | <Never Listen To Beef> 😦 |
02:11:14 | disruptek | i'm more of a while false: guy, myself. |
02:11:24 | disruptek | faster. |
02:11:39 | FromDiscord | <Never Listen To Beef> Im more of a `quit 1` on line 1 of my main file |
02:11:52 | FromDiscord | <Never Listen To Beef> It's the quickest program i can make |
02:11:53 | shashlick | @leorize I think I have a fix for https://github.com/nim-lang/nimble/pull/768 |
02:11:54 | disruptek | amateur. |
02:11:55 | leorize | disruptek: well we can exploit symbol versioning to walkaround our static library situation, but I don't see any good way to use it |
02:12:08 | leorize | shashlick: what's your idea? |
02:12:39 | disruptek | #12480 |
02:12:41 | FromDiscord | <bedwardly-down> Haxe and Java seem to iterate weirdly then or I’ve been using it the wrong way and it still compiled and worked |
02:13:14 | disruptek | i forgot i killed the bot. |
02:13:16 | disruptek | #12480 |
02:13:19 | disbot | https://github.com/nim-lang/Nim/issues/12480 -- 5an admittedly silly compiler crash one-liner ; snippet at 12https://play.nim-lang.org/#ix=2kPM |
02:13:25 | shashlick | It's the same as my fix for disruptek's nimph issue with nimterop |
02:13:36 | leorize | do you have a link? |
02:14:47 | shashlick | https://github.com/nim-lang/nimble/pull/768 |
02:14:49 | disbot | ➥ nimscript{wrapper,api}: don't copy generated script to package directory |
02:14:50 | shashlick | Ugh |
02:15:00 | shashlick | https://github.com/nimterop/nimterop/commit/33d77f82e878c86c0edf3bd21d359e5f40492ad2 |
02:15:15 | shashlick | I added nimconf.nim which does most of the work |
02:15:44 | shashlick | Basically we can run Nim dump in the target folder and create a cfg for the nims script |
02:16:19 | disruptek | but can we get a tag? |
02:16:31 | disruptek | why so stingy with the version tags? |
02:16:55 | disruptek | shashlick, take care of yourself. looks like texas is getting bad. |
02:19:14 | leorize | shashlick: but this would make nimble requires nim >= 1.2 |
02:23:02 | * | dddddd_ quit (Ping timeout: 260 seconds) |
02:23:02 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:25:09 | * | muffindrake joined #nim |
02:27:08 | shashlick | Yes unless we can get 4raq to backport the nim dump stuff to 1.0 |
02:27:27 | shashlick | @disruptek almost there, last few tests remain |
02:27:50 | shashlick | https://github.com/nimterop/nimterop/blob/master/CHANGES.md |
02:28:19 | leorize | I'm quite certain that it won't be backported |
02:36:41 | FromDiscord | <KingDarBoja> Hi guys |
02:41:02 | FromDiscord | <bedwardly-down> @Never Listen To Beef make any progress on that window manager? I’m debating on learning more nim when i get home or crashing. |
02:41:25 | FromDiscord | <bedwardly-down> Sup, @KingDarBoja ? |
02:41:33 | FromDiscord | <Never Listen To Beef> nope i've been polishing my last game jam game a bit |
02:41:42 | FromDiscord | <Never Listen To Beef> The atoms are annoying to deal with so i've been putting it off |
02:41:43 | FromDiscord | <KingDarBoja> Doing some TS stuff before continuing my journey |
02:42:47 | FromDiscord | <bedwardly-down> I need to figure out how to decouple some haxe code i worked on earlier that i had a fridge epiphany with. Ha |
02:43:04 | FromDiscord | <bedwardly-down> Atoms, @Never Listen To Beef ? |
02:43:18 | FromDiscord | <Never Listen To Beef> X uses atoms to mark features and states |
02:43:22 | FromDiscord | <Never Listen To Beef> They're annoying as hell |
02:45:18 | FromDiscord | <Never Listen To Beef> They're basicaly just strings and data, but again are annoying as hell |
02:46:10 | FromDiscord | <bedwardly-down> Ewww. Gotya |
02:46:33 | FromDiscord | <Never Listen To Beef> And for some reason i dont get fullscreen propert changes like awesomewm or any other wm |
02:46:35 | FromDiscord | <Never Listen To Beef> so idk |
02:46:43 | FromDiscord | <Never Listen To Beef> Could always just torch it and restart it |
02:47:19 | FromDiscord | <bedwardly-down> If it’s anything like other Linux software, you’re most likely forgetting some obscure flag that makes no sense |
02:47:48 | FromDiscord | <bedwardly-down> That’s not all software but there are a few out there |
02:48:11 | FromDiscord | <Never Listen To Beef> Yea i've added the property changed flags, and also added the supported atoms though so i know it's trying just not working 😄 |
02:49:01 | * | cgfuh quit (Quit: WeeChat 2.7.1) |
02:49:51 | FromDiscord | <bedwardly-down> What was your git repo again? |
02:51:28 | shashlick | @leorize lmk if you think this can work |
02:52:11 | FromDiscord | <Never Listen To Beef> @bedwardly-down https://github.com/beef331/goodwm |
02:52:11 | FromDiscord | <Never Listen To Beef> Probably should rename it "Disaster WM" |
02:53:14 | FromDiscord | <bedwardly-down> Super sexy nim nim time is more like it. 🤪 |
02:55:24 | FromDiscord | <bedwardly-down> I’m going to be honest, you could probably cut down the goodwm.nim file in size, but most of the atoms are in there, right? |
02:59:15 | FromDiscord | <bedwardly-down> @Never Listen To Beef , is this shell dependent? ‘execShellCmd("notify-send FullScreen it")’ |
02:59:29 | FromDiscord | <Never Listen To Beef> Well that's for debugging |
02:59:39 | FromDiscord | <Never Listen To Beef> Some things dont send inside Xephyr |
02:59:44 | FromDiscord | <Never Listen To Beef> Such as mouse movement |
03:00:03 | FromDiscord | <Never Listen To Beef> I do have to replace the Xrandr call with the xrandr lib since it is inside the nim x11 |
03:00:48 | FromDiscord | <bedwardly-down> Does that print to shell or log or what? That might have issues for non-bash shells |
03:00:49 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
03:01:00 | FromDiscord | <bedwardly-down> I’d have to test it out |
03:02:08 | FromDiscord | <Never Listen To Beef> I mean it sends a nitfication |
03:02:12 | FromDiscord | <Never Listen To Beef> notification |
03:02:16 | FromDiscord | <Never Listen To Beef> It's again for debugging |
03:02:29 | FromDiscord | <Never Listen To Beef> So it doesnt matter for non bashshells |
03:02:39 | FromDiscord | <bedwardly-down> Ah, gotya. |
03:03:52 | FromDiscord | <bedwardly-down> The proc name confused me since that sounds like you’re actually passing a command to be ran by the shell and not more of a console trace |
03:04:13 | FromDiscord | <bedwardly-down> Is that your own name or what your api uses? |
03:04:26 | FromDiscord | <Never Listen To Beef> That is sending a message for debugging |
03:04:32 | FromDiscord | <Never Listen To Beef> It's not proper debugging |
03:04:36 | FromDiscord | <Never Listen To Beef> It's print log debugging |
03:04:40 | FromDiscord | <Never Listen To Beef> Since im a fuckwit |
03:04:50 | FromDiscord | <bedwardly-down> 🤮🤪 |
03:06:23 | FromDiscord | <bedwardly-down> I’m almost home. I’m gonna eat. Then I’ll see what i can read more. I’m not good at nim right now but could check into it more |
03:06:54 | FromDiscord | <Never Listen To Beef> Im not good at nim either |
03:07:33 | FromDiscord | <bedwardly-down> We’re idiots, so let’s try to be smart together! Lmao |
03:07:47 | FromDiscord | <Never Listen To Beef> Nah i think that just increases the idiot density |
03:09:46 | FromDiscord | <bedwardly-down> And dead work nights cause me to get grumpy, so maybe doing something not related to me might be a good distraction. Ha |
03:13:03 | FromGitter | <kayabaNerve> PMunch: You around? |
03:13:27 | FromGitter | <kayabaNerve> Have something to discuss with you |
03:13:49 | leorize | he 's not online |
03:13:57 | FromGitter | <kayabaNerve> Oof. Damn Gitter side of things. |
03:14:08 | * | silvernode joined #nim |
03:14:35 | FromDiscord | <KingDarBoja> Hi leo 😄 |
03:14:45 | leorize | o/ |
03:14:56 | voltist | Is there a way to specify a single proc that accepts either an int or a float, without having to specify the type every time in [square brackets]? |
03:15:21 | leorize | proc foo(val: int | float) |
03:15:55 | voltist | Ooo thats nice and simple, thanks |
03:17:26 | FromDiscord | <bedwardly-down> Leo, is that applicable to more than two options? |
03:17:34 | leorize | yes |
03:17:38 | FromDiscord | <Yardanico> If you want to accept *any* number type you might why to use SomeNumber |
03:17:41 | FromDiscord | <bedwardly-down> Nice. |
03:17:50 | leorize | it's a shorthand for proc foo[T: int | float](i: T) |
03:17:56 | FromDiscord | <Yardanico> @bedwardly-down it's implicit generics basically |
03:18:03 | FromDiscord | <bedwardly-down> Does nim have a dynamic type? |
03:18:09 | leorize | `int | float` here is a typeclass, and not a sum type |
03:18:10 | FromDiscord | <Yardanico> No |
03:18:17 | voltist | Features like that sit in a strange place where guides don't cover them, and they dont have a dedicated documentation (that one might, but just in general) |
03:18:35 | FromDiscord | <Yardanico> Nim manual covers that though |
03:19:12 | leorize | usually people don't know the terms, that why they can't find them |
03:19:20 | leorize | the manual covers like 95% of the features |
03:19:27 | FromDiscord | <Never Listen To Beef> Reading is too hard, just get a brain siphon and give me the knowledge |
03:19:40 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#generics-type-classes |
03:19:46 | voltist | "usually people don't know the terms" yeah that's a better way of putting it |
03:20:25 | voltist | It's not signposted like you might get with more fundimental features |
03:22:01 | FromDiscord | <KingDarBoja> But to use that, one must use generics |
03:22:04 | FromDiscord | <KingDarBoja> I am right? |
03:22:14 | FromDiscord | <KingDarBoja> Ofc union types aren't allowed |
03:22:19 | leorize | that is generics |
03:22:21 | FromDiscord | <Never Listen To Beef> That's a shorthand of a generic |
03:23:21 | * | idrialite quit (Remote host closed the connection) |
03:24:10 | FromDiscord | <bedwardly-down> In haxe, this is a common way to take anything for a value: https://haxe.org/manual/types-dynamic.html |
03:24:25 | FromDiscord | <KingDarBoja> Dart uses that too |
03:24:33 | FromDiscord | <Yardanico> In Nim you can have a raw pointer too |
03:24:39 | FromDiscord | <Yardanico> With no type attached to it |
03:24:46 | FromDiscord | <bedwardly-down> https://haxe.org/manual/type-system-generic.html |
03:24:55 | FromDiscord | <Never Listen To Beef> Generic variables are always weird to me in static languages |
03:24:58 | FromDiscord | <bedwardly-down> And generic is a weird thing |
03:25:18 | leorize | dynamics reminds me of pascal's Variant type |
03:25:31 | leorize | in here we have it too, called JsonNode :) |
03:25:34 | FromDiscord | <KingDarBoja> I always confuse its purpose with being able to return union types on proc calls |
03:25:34 | * | Lord_Nightmare2 joined #nim |
03:25:40 | FromDiscord | <KingDarBoja> But ofc that is a big NO |
03:25:54 | * | FromDiscord <KingDarBoja> don't hit me Yardanicco |
03:25:57 | FromDiscord | <Yardanico> Not really you l |
03:25:59 | FromDiscord | <Never Listen To Beef> Idk in my years of C# i've never needed a generic variable |
03:26:17 | FromDiscord | <Yardanico> *you can have "a | b" as the return type |
03:26:26 | FromDiscord | <Yardanico> If the proc itself is generic |
03:26:41 | * | Lord_Nightmare quit (Ping timeout: 258 seconds) |
03:26:44 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
03:26:45 | FromDiscord | <KingDarBoja> That's a whole different situation 🧠 |
03:26:55 | FromDiscord | <KingDarBoja> My brain is gonna get OVERLOADED |
03:27:01 | voltist | It's very annoying that ``*`(v: A, r: B)` doesn't support `someB * someA`. Is there a helper for this? |
03:27:33 | leorize | write a template :P |
03:28:17 | voltist | So just define ``*`(v: B, r: A)`? |
03:28:23 | leorize | we need a macro for this in sugar then |
03:28:41 | leorize | `{.permutate.}` |
03:28:43 | FromDiscord | <KingDarBoja> https://dart.dev/guides/language/sound-dart#type-inference |
03:28:49 | leorize | shouldn't be too hard |
03:29:26 | voltist | I'll leave that to someone who knows how to write macros well :) |
03:29:40 | leorize | I can actually write you one rn :P |
03:29:59 | FromDiscord | <Never Listen To Beef> I still think the tables module needs a macro/template to automatically hash objects so objects can always be used as keys |
03:30:12 | leorize | nah, it's a stupid idea |
03:30:20 | FromDiscord | <KingDarBoja> wtf? |
03:30:25 | FromDiscord | <KingDarBoja> I don't get the idea... |
03:30:38 | FromDiscord | <KingDarBoja> objects as keys... what? |
03:31:01 | FromDiscord | <Never Listen To Beef> Mine? All hashable fields of an object gets hashed so you can use objects as keys if you so wish without having to manually hash their fields |
03:31:31 | Prestige | What do other languages do to automatically hash objects? |
03:32:24 | voltist | leorize: That would be wonderful, thanks! I should really get to know macros better, because it seems that people make contributions because of needs I have more than I do :/ |
03:32:39 | FromDiscord | <Never Listen To Beef> Idk prestige i just suggest illadvised ideas i have |
03:32:49 | * | silvernode quit (Ping timeout: 256 seconds) |
03:33:21 | Prestige | Lol beef |
03:33:46 | FromDiscord | <Never Listen To Beef> I could be wrong but could be similar to what i said |
03:33:49 | Prestige | It sounds like a good idea for the end users but I have no idea of the drawbacks |
03:34:45 | FromDiscord | <KingDarBoja> We need a beef emoji, just saying |
03:34:50 | FromDiscord | <Never Listen To Beef> Why? |
03:35:02 | FromDiscord | <KingDarBoja> Because I am getting hungry |
03:35:06 | Prestige | 🥩 |
03:35:10 | FromDiscord | <KingDarBoja> 🥩 |
03:35:10 | FromDiscord | <Yardanico> 🥩 |
03:35:12 | FromDiscord | <KingDarBoja> that works |
03:35:22 | FromDiscord | <Never Listen To Beef> |
03:35:22 | FromDiscord | <Never Listen To Beef> https://cdn.discordapp.com/attachments/371759389889003532/707072914683330601/Beef256.png |
03:35:26 | FromDiscord | <KingDarBoja> RIP IRC |
03:35:31 | FromDiscord | <Yardanico> ? |
03:35:33 | FromDiscord | <Never Listen To Beef> They get a url |
03:35:40 | FromDiscord | <Never Listen To Beef> to that discord upload |
03:35:46 | FromDiscord | <KingDarBoja> Is that true? |
03:35:52 | FromDiscord | <Never Listen To Beef> That's what i've been told |
03:35:52 | * | Romanson joined #nim |
03:35:56 | FromDiscord | <Yardanico> Of course lol |
03:36:01 | Prestige | Beef: I was looking into it and I think xrandr is probably the best choice for multihead btw, found a nim wrapper as well |
03:36:04 | FromDiscord | <Yardanico> and emojis work fine since it's just utf8 |
03:36:08 | Prestige | so you don't have to execute a shell command iirc |
03:36:11 | FromDiscord | <Never Listen To Beef> Yea the nim wrapper is with x11 |
03:36:22 | FromDiscord | <Never Listen To Beef> I've already mentioned this multiple times and said it's dumb that i did |
03:36:41 | Prestige | Just trying to be helpful :P |
03:37:01 | FromDiscord | <Never Listen To Beef> Yea sorry i guess, if it came off aggressive 😄 |
03:37:11 | Prestige | Hehe np |
03:38:20 | voltist | Doesn't the Discord have an unrelated discussion channel you can use for beef related discussion? IRC users like myself don't really have anywhere to go to escape to when beef emojis start flowing :) |
03:39:39 | FromDiscord | <Never Listen To Beef> I mean if you want me to shutup just tell me to, ill call you rude, but i'll understand |
03:39:52 | FromDiscord | <KingDarBoja> Yes, it is offtopic |
03:40:07 | FromDiscord | <KingDarBoja> We went offtopic for a brief moment, sorry pal |
03:41:54 | shashlick | there's a #nim-offtopic for that |
03:42:05 | Prestige | is that bridged to irc as well? |
03:42:13 | FromDiscord | <Never Listen To Beef> Yea |
03:42:24 | voltist | Nah I don't have a problem with off topic stuff, but just spam is kinda... spammy |
03:42:45 | FromDiscord | <Never Listen To Beef> I feel like i need to say "that's the joke" but i dont want to be considered a total asshole 😄 |
03:42:59 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-pragma-pragma pragma pragma pragma pragma pragma! |
03:43:25 | Prestige | That's a great url |
03:44:34 | FromDiscord | <KingDarBoja> pragmatic... |
03:45:06 | FromDiscord | <Yardanico> Pragmagic :P https://github.com/pragmagic |
03:46:39 | FromDiscord | <Never Listen To Beef> Interesting a lot of nim stuff, and they're an abathur main in Heroes of the Storm |
03:46:49 | voltist | Does the Nim compiler tolerate special characters like Δ? |
03:46:56 | shashlick | ya |
03:46:58 | FromDiscord | <Never Listen To Beef> it's utf8 |
03:47:11 | Prestige | Beef do you have a roadmap for your wm? |
03:47:17 | voltist | Neat |
03:47:30 | FromDiscord | <Never Listen To Beef> Yea, im going to drive it to a ocean dock and drop it in there with cement tied to it's legs |
03:47:42 | FromDiscord | <Never Listen To Beef> No i dont have a sincere map |
03:47:48 | FromDiscord | <Never Listen To Beef> I dont plan i just do |
03:47:48 | Prestige | lmao, ok |
03:47:55 | FromDiscord | <KingDarBoja> Wtf has to do abathur with Nim? |
03:48:05 | FromDiscord | <Never Listen To Beef> <https://github.com/pragmagic/abathur> |
03:48:19 | FromDiscord | <KingDarBoja> Clever name |
03:48:28 | FromDiscord | <Never Listen To Beef> Clearly a cool person 😛 |
03:48:35 | FromDiscord | <KingDarBoja> genetics related == abathur |
03:48:36 | FromDiscord | <KingDarBoja> Noise! |
03:50:09 | voltist | How is that repo genetics related other than through the name? |
03:50:22 | FromDiscord | <Never Listen To Beef> > A genetically modified database |
03:50:30 | FromDiscord | <Never Listen To Beef> Dont ask what that means |
03:50:33 | FromDiscord | <Never Listen To Beef> Just accept it |
03:50:37 | FromDiscord | <bedwardly-down> Was the WM stuff off topic or what came from it? My roommate needed my help a bit |
03:51:27 | FromDiscord | <Never Listen To Beef> The WM is between me and prestige who are both making WMs in nim |
03:51:35 | FromDiscord | <Never Listen To Beef> His is clearly going to be better since he actually reads docs |
03:52:07 | Prestige | Lol we'll see, you're making much more progress |
03:52:51 | FromDiscord | <bedwardly-down> It’s not a race to make Nim a common household name in the WM space, is it? |
03:53:47 | Prestige | First one to do it wins 1,000 internet points |
03:53:48 | FromDiscord | <Never Listen To Beef> I mean my intial idea was to use nim for the base and nimscript for the widget programming but that seems like a pipedream, but we'll see |
03:53:50 | voltist | I don't think WM development is the kind of space where people would use a language because someone else did |
03:54:03 | FromDiscord | <Never Listen To Beef> Yea WM is the most use whatever language you want |
03:54:17 | FromDiscord | <KingDarBoja> Never stop dreaming, you can do it 🙂 |
03:54:19 | FromDiscord | <Never Listen To Beef> Looks at awesome WM having a ton of lua |
03:54:34 | FromDiscord | <Never Listen To Beef> It's not an issue of doing it, it's more of doing it right 😄 |
03:54:52 | FromDiscord | <Never Listen To Beef> Embedded nimscript would let me pass primitives but that's clearly not enough for me |
03:56:12 | FromDiscord | <Never Listen To Beef> Well like it'd work but it'd be a pain to setup |
03:56:26 | FromDiscord | <KingDarBoja> Well, what disruptek told me once time ago: make it work, then improve |
03:56:41 | FromDiscord | <KingDarBoja> Any doubt, feel free to ask |
03:56:44 | FromDiscord | <Never Listen To Beef> Might as well just use json instead of that |
03:57:01 | FromDiscord | <Never Listen To Beef> Well my biggest issue is xlib atm, and i doubt many people here are well accustomed in that 😄 |
03:57:35 | FromDiscord | <bedwardly-down> Fix the x11 Wayland issue by building a full rendering stack in nim |
03:57:43 | FromDiscord | <Never Listen To Beef> lol |
03:58:01 | FromDiscord | <Never Listen To Beef> Yea im way less qualified then the xorg devs working on wayland, and less of a man |
03:58:22 | FromDiscord | <Never Listen To Beef> *They've got how many people contributing?* |
03:59:09 | FromDiscord | <bedwardly-down> And how much money coming in to support development? |
04:00:02 | FromDiscord | <Never Listen To Beef> Not a clue, anywho prestige you've got some time to play catchup since im polishing up a gamejam game i did, so do it quick, so we can both assist eachother later 😛 |
04:00:49 | Prestige | Sounds good :) |
04:02:40 | FromDiscord | <bedwardly-down> So, I'm at my laptop. Basic way to get started is figuring out hwo the xlibs interact with each other, right? |
04:02:58 | FromDiscord | <KingDarBoja> ok enough TS stuff for today |
04:03:51 | * | silvernode joined #nim |
04:04:17 | FromDiscord | <Never Listen To Beef> Yea bedwardly this is basically the best thing i've found to get a quick grasp of xlib |
04:04:17 | FromDiscord | <Never Listen To Beef> https://tronche.com/gui/x/xlib/ |
04:04:19 | * | zacharycarter joined #nim |
04:04:20 | * | zacharyc1rter joined #nim |
04:05:16 | FromDiscord | <bedwardly-down> Thanks. |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:40 | * | supakeen joined #nim |
04:08:22 | FromDiscord | <bedwardly-down> @Never Listen To Beef and prestige, did you guys see this: https://github.com/jichu4n/basic_wm |
04:08:31 | FromDiscord | <Never Listen To Beef> I've |
04:08:58 | voltist | Does anybody know to get in contact with SSPkrolik? One of their packages is slowly deteriorating because they aren't responding to issues/PRs |
04:09:06 | Prestige | Yep |
04:09:36 | FromDiscord | <Never Listen To Beef> If they arent maintaing it you always could fork it and maintain it 😄 |
04:10:06 | FromDiscord | <bedwardly-down> He also has a paper that was part of Google Summer of Docs linked on how Xorg and Window Management work. Did you read that link? |
04:10:14 | FromDiscord | <bedwardly-down> https://jichu4n.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i/ |
04:10:24 | FromDiscord | <Never Listen To Beef> That is where i found basic_wm |
04:11:27 | FromDiscord | <bedwardly-down> Gotya |
04:12:04 | voltist | Thing is, they have the nimble listing for the neat, recognizable name `nimongo`, so it might confuse people if it doesn't work and they actually have to go for some other library |
04:12:20 | FromDiscord | <Never Listen To Beef> Ah |
04:12:46 | FromDiscord | <Never Listen To Beef> The annoying thing there bedwardly is they stop that wm before they implement anything that is actually needed in a TWM |
04:12:58 | FromDiscord | <Never Listen To Beef> > In our next installment, we will improve the user-facing functionality of our window manager by adding ways to move, resize and close windows. |
04:13:46 | FromDiscord | <bedwardly-down> Voltist, is this the same guy? https://twitter.com/SSPkrolik |
04:14:03 | * | opal quit (Ping timeout: 240 seconds) |
04:14:17 | voltist | I'd say so yeah |
04:14:23 | FromDiscord | <Never Listen To Beef> Seems so with his big ol' nim image there |
04:15:11 | voltist | They have made contributions on GitHub recently |
04:15:32 | voltist | But obviously not seeing/acknowledging issues |
04:16:44 | FromDiscord | <bedwardly-down> I got no idea |
04:17:26 | * | opal joined #nim |
04:20:29 | FromDiscord | <Avatarfighter> just curious is there any reason why a variable wouldn't change its value when you "-=" from it? |
04:21:32 | FromDiscord | <Avatarfighter> I know this may sound weird but I'm getting weird behavior where a mutable variable isn't modifying |
04:21:40 | leorize | voltist: https://play.nim-lang.org/#ix=2kQ2 |
04:21:42 | leorize | that's a rough version |
04:21:50 | leorize | I'll have to copy it to my machine and clean it up |
04:21:58 | leorize | the playground is not a nice editor |
04:22:08 | FromDiscord | <Avatarfighter> playground best IDE 😛 |
04:22:30 | FromDiscord | <Never Listen To Beef> *intergrated* doesnt mean into the web browser |
04:22:57 | FromDiscord | <Avatarfighter> hahah |
04:23:01 | * | narimiran joined #nim |
04:23:08 | voltist | leorize: Neat, thanks! Are you going to make a pull request once you have it cleaned up a bit? |
04:24:11 | leorize | I'll once I figured out this permutations iterator :P |
04:24:22 | leorize | I copied it from wikipedia :P |
04:24:30 | voltist | Ah right :) |
04:25:08 | FromDiscord | <Avatarfighter> oh nvm ik why im getting my weird behavior, I did change the value of the variable lmao |
04:27:09 | leorize | voltist: does it work well? :P |
04:27:54 | leorize | I designed it to work with arbitrary amount of params, so it might be a bit overkill |
04:27:55 | voltist | leorize: Yes it does |
04:28:50 | voltist | leorize: It took me a minute to remember my Ohms law from highschool science and figure out what procs should actually be permutable |
04:29:05 | FromDiscord | <bedwardly-down> Do any of you guys actually use playground to pigure out production level code for your projects? |
04:29:13 | FromDiscord | <bedwardly-down> Do any of you guys actually use playground to figure out production level code for your projects? |
04:29:22 | leorize | nah |
04:29:32 | leorize | I just use it when I wanna draft something out for the chat |
04:29:44 | FromDiscord | <Avatarfighter> I use it when I'm on my phone tbh |
04:29:44 | leorize | my trusty neovim setup trumps all |
04:30:15 | FromDiscord | <bedwardly-down> When I'm bored at work, I might need to do just that, @Avatarfighter |
04:30:28 | leorize | voltist: currently it doesn't copy the doc comments, but if you want I can add it |
04:31:16 | FromDiscord | <Avatarfighter> @bedwardly-down I really like doing that since I get to try new things AND ask here for that realtime spoonfeeding lmao |
04:31:22 | * | thomasross quit (Ping timeout: 260 seconds) |
04:31:57 | FromDiscord | <Never Listen To Beef> I tend to use it as an alternative to makeing a nim file on my pc for quick things |
04:32:26 | FromDiscord | <bedwardly-down> That actually seems fairly useful, especially for ED users like me |
04:33:07 | FromDiscord | <Never Listen To Beef> I've gotta be honest i doubt users needs to be puralized there |
04:33:37 | FromDiscord | <bedwardly-down> You would be surprised at how many ED users are out there in my online circles |
04:33:49 | FromDiscord | <Avatarfighter> welp I just realized I messed up the implementation of salsa20poly1305 800 lines in :L |
04:34:07 | FromDiscord | <bedwardly-down> What is that, @Avatarfighter? |
04:34:32 | leorize | it's a crypto algo |
04:34:37 | FromDiscord | <Avatarfighter> ^ |
04:34:39 | FromDiscord | <bedwardly-down> Gotya |
04:35:08 | FromDiscord | <Avatarfighter> salsa20 is a symmetric stream cipher while poly1305 is a message authentication code |
04:35:44 | FromDiscord | <Avatarfighter> I forgot that passing stuff in as a variable makes it mutable out of the scope of the proc its in and it broke everything lmfao |
04:36:17 | FromDiscord | <Never Listen To Beef> Photsynthetical quantum mechanical engineering. I too can say random big words together 😛 |
04:36:53 | FromDiscord | <Avatarfighter> lmao |
04:37:18 | FromDiscord | <Avatarfighter> basically salsa20 takes in bytes in sequence and as long as you also have salsa20 you can read my bytes in the correct sequence while poly1305 makes sure the bytes were by me |
04:37:44 | FromDiscord | <bedwardly-down> Gotya |
04:39:45 | FromGitter | <kayabaNerve> Can I attach a macro to an object field without a macro surrounding the object definition? |
04:39:59 | leorize | yes |
04:40:09 | leorize | I think |
04:40:12 | FromGitter | <kayabaNerve> So dumpTree shows the pragma, but getTypeInst doesn't |
04:41:02 | leorize | how are your custom pragmas defined |
04:41:23 | FromGitter | <kayabaNerve> I was checking it wasn't check applying the pragma; removing the pragma def causes a compilation error |
04:41:27 | FromGitter | <kayabaNerve> template {.pragma.} |
04:42:25 | FromGitter | <kayabaNerve> Tried checking if I had to write a body and manually re-attach the pragma; I do not. {.pragma.} aren't allowed bodies. |
04:43:18 | FromGitter | <kayabaNerve> Huh. I may not want the pragma pragma |
04:45:11 | FromGitter | <kayabaNerve> So, the pragma pragma is for your custom pragma to be macro-detectable. That said, the macro calling getType and getTypeImpl strip them. |
04:45:48 | FromGitter | <kayabaNerve> Removing the pragma pragma causes this to error; so does removing commenting the pragma out (I thought maybe if it couldn't resolve, it'd be kept as a label) |
04:46:22 | FromDiscord | <Avatarfighter> I'm going to be so proud when I'm done with this library lmao it looks like spaghetti, but its my spaghetti 😉 |
04:46:26 | FromGitter | <kayabaNerve> Yep. Think I need a wrapping macro. |
04:46:47 | leorize | maybe a new issue then? |
04:47:43 | FromDiscord | <Never Listen To Beef> When ever i write code avatar im always happy because of the phrase "A face only a mother could love" and that defends my terrible code! |
04:49:06 | FromDiscord | <Avatarfighter> @Never Listen To Beef that is what I think every time I write something 😛 I also wonder why my stuff is always defective tho 😛 |
04:49:16 | FromGitter | <kayabaNerve> Oh. Never mind. Found a way |
04:50:23 | FromGitter | <kayabaNerve> nim-stew has a shim for it. No idea how it works, just that it does. |
04:50:39 | FromDiscord | <Never Listen To Beef> All my code works, just dont pick at it or it may explode |
04:51:03 | * | SweetSense joined #nim |
04:53:27 | * | SweetSense quit (Client Quit) |
04:53:33 | * | rockcavera quit (Remote host closed the connection) |
05:10:22 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
05:13:48 | FromDiscord | <KingDarBoja> Good night! |
05:16:15 | FromDiscord | <Avatarfighter> gn |
05:16:21 | FromDiscord | <Never Listen To Beef> Buh bye |
05:17:48 | FromDiscord | <Avatarfighter> what is the best way of converting a seq[char] to seq[uint8?] |
05:18:25 | leorize | @seq[char].toOpenArrayByte() |
05:18:33 | leorize | lemme try first |
05:19:03 | FromDiscord | <Avatarfighter> I've never seen "@" prefixed before something what does that mean? |
05:19:11 | leorize | !eval echo `@`(@['a', 'b', 'c'].toOpenArrayByte) |
05:19:13 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: type mismatch: got <seq[char]> |
05:20:07 | leorize | !eval echo `@`(@['a', 'b', 'c'].toOpenArrayByte(0, 3)) |
05:20:10 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: index out of bounds [IndexError] |
05:20:19 | leorize | !eval echo `@`(@['a', 'b', 'c'].toOpenArrayByte(0, 2)) |
05:20:19 | FromDiscord | <Avatarfighter> 0,2 should work? |
05:20:21 | NimBot | @[97, 98, 99] |
05:20:26 | FromDiscord | <Avatarfighter> lit |
05:20:49 | FromGitter | <kayabaNerve> Cam I overload a generic so one has T, U, and one only has T? D |
05:20:57 | leorize | so `@` is the array -> seq operator |
05:21:10 | FromGitter | <kayabaNerve> Doesn't look like it, just double checking because I can't supply a default type with T, U |
05:21:28 | leorize | you can overload like that |
05:21:32 | leorize | it's done all the time with types |
05:22:00 | leorize | Avatarfighter: .toOpenArray is our zero-copy slicing operator |
05:22:04 | leorize | pretty useful |
05:22:16 | leorize | there's also a shorter way to do the same thing |
05:22:27 | leorize | `cast[seq[byte]](seq[char])` |
05:22:31 | FromGitter | <kayabaNerve> leorize: Nim says it's a redef |
05:22:32 | leorize | but it's dangerous so :P |
05:22:41 | leorize | kayabaNerve: how are you doing it? |
05:22:43 | FromDiscord | <Avatarfighter> yeah i try to avoid casting when i can |
05:23:02 | Prestige | leorize: does toOpenArray just point to that location in memory? |
05:23:13 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb0f8415cd4fe50a3ed9c5a] |
05:23:26 | leorize | Prestige: pretty much |
05:23:45 | leorize | an openArray is a pointer to the data + the length |
05:23:47 | FromGitter | <kayabaNerve> inline doesn't make a difference to be clear |
05:23:52 | Prestige | Hmm but I guess assigning a var to it would copy |
05:24:06 | FromGitter | <kayabaNerve> And sorry for causing two people to be asking for help at the same time; happy to come back in 10 :P |
05:24:29 | FromDiscord | <Avatarfighter> Prestige: thats actually what I'm trying to do and it complains about openArray being unassignable to vars lol |
05:24:57 | Prestige | openArray isnt really a type though |
05:25:04 | leorize | not a first class yet |
05:25:17 | leorize | toOpenArray is our stop gap solution |
05:25:42 | FromDiscord | <Avatarfighter> Stupid question once again(i've had many of these today), but byte = uint8 right? |
05:25:49 | leorize | yea |
05:25:59 | FromDiscord | <Avatarfighter> so why does uint8 != byte lmao |
05:26:04 | leorize | ? |
05:26:18 | leorize | !eval uint8 is byte |
05:26:20 | NimBot | Compile failed: ???(0, 0) Error: expression 'true' is of type 'bool' and has to be discarded |
05:26:25 | leorize | ^ it's true |
05:27:04 | FromDiscord | <Avatarfighter> i parameterized my procs only parameter with "openarray[uint8]" but when i pass a "openarray[byte]" I'm getting an error that says... |
05:27:14 | Prestige | !eval uint8(1) == byte(1) |
05:27:16 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: expression 'true' is of type 'bool' and has to be discarded |
05:27:22 | Prestige | Hmm yeah |
05:27:40 | FromDiscord | <Avatarfighter> "type mismatch: got<openArray[byte],openArray[byte],openArray[byte]>" is the official error |
05:27:46 | FromDiscord | <Avatarfighter> I hope that was one line |
05:27:59 | leorize | I need some sample code |
05:28:03 | FromDiscord | <Avatarfighter> uhh |
05:28:04 | FromDiscord | <Avatarfighter> its like |
05:28:04 | * | Hideki joined #nim |
05:28:08 | FromDiscord | <Avatarfighter> 800+ lines atm |
05:28:16 | Prestige | Is that the whole error? |
05:28:29 | FromDiscord | <Avatarfighter> yeah that is the whole error from what I can tell |
05:28:29 | * | Hideki is now known as Guest66655 |
05:28:40 | FromDiscord | <Avatarfighter> let me get a paste of a snippet of my code |
05:28:42 | leorize | just copy the function prototypes |
05:28:46 | leorize | and how you called it |
05:28:49 | leorize | use discard as impl |
05:30:14 | FromDiscord | <Avatarfighter> oh wait I got it |
05:31:14 | FromDiscord | <Avatarfighter> the error was not descriptive at all, its because my proc takes "var openarray[uint8]" but I'm feeding it "openarray[uint8]" |
05:31:32 | leorize | :P |
05:31:57 | leorize | 4raq would disagree with you but I can agree that the compiler bites you a lot with the error messages |
05:32:15 | FromDiscord | <Avatarfighter> honestly I blame myself for not reading more carefully |
05:32:39 | FromDiscord | <Avatarfighter> I'm just used to python which outputs the entire stack and a story to figure out what went wrong lol |
05:32:40 | leorize | the compiler could always put up some highlights so you can spot the errors easier |
05:33:13 | leorize | we should learn from some of the more mature compilers out there, though that's pretty low on my list for now |
05:33:49 | FromDiscord | <Avatarfighter> I mean the compiler does provoke your critical thinking as to what might've gone wrong lmao |
05:34:01 | * | Guest66655 quit (Remote host closed the connection) |
05:35:32 | FromDiscord | <Avatarfighter> how do you reference something? |
05:35:35 | FromDiscord | <Avatarfighter> is it []? |
05:35:41 | FromDiscord | <Avatarfighter> dereference* |
05:39:29 | leorize | yea |
05:40:00 | FromDiscord | <Avatarfighter> dang I think I need to make everything I just wrote referenced :L |
05:44:13 | FromDiscord | <Avatarfighter> nope I just need to use vars correctly haha |
05:46:00 | FromDiscord | <Avatarfighter> leorize: if you're still here, going back to "toOpenArrayByte" what would be the correct way of storing the openarray in a var? |
05:46:11 | leorize | you can't store an openarray :) |
05:46:16 | leorize | turn it into a seq if you may |
05:46:43 | leorize | the `@` operator can be used for that |
05:46:51 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:46:52 | FromDiscord | <Avatarfighter> for once I was doing this correctly and concisely haha |
05:50:53 | FromDiscord | <Avatarfighter> Ok well I think I'm going to head out and finish this tomorrow and then hopefully I'll get a willing soul to do a codereview |
05:51:03 | FromDiscord | <Avatarfighter> thank you very much for the help as always leorize 🙂 |
05:51:05 | FromDiscord | <Avatarfighter> gn everyone |
05:57:27 | * | chemist69 quit (Ping timeout: 240 seconds) |
05:57:57 | * | chemist69 joined #nim |
06:07:11 | * | solitudesf joined #nim |
06:26:50 | * | pbb quit (Ping timeout: 246 seconds) |
06:34:54 | * | pbb joined #nim |
06:40:49 | * | Hideki joined #nim |
06:41:12 | * | Hideki is now known as Guest33548 |
06:45:49 | * | Guest33548 quit (Remote host closed the connection) |
06:53:03 | * | PMunch joined #nim |
06:56:46 | * | avatarfighter joined #nim |
07:09:17 | * | avatarfighter quit (Quit: Leaving) |
07:09:46 | * | narimiran quit (*.net *.split) |
07:09:47 | * | qbradley quit (*.net *.split) |
07:09:47 | * | njoseph quit (*.net *.split) |
07:09:55 | * | Condor quit (*.net *.split) |
07:10:02 | * | zacharyc1rter quit (Ping timeout: 260 seconds) |
07:11:14 | * | zacharycarter quit (Ping timeout: 272 seconds) |
07:15:57 | * | narimiran joined #nim |
07:15:57 | * | qbradley joined #nim |
07:15:57 | * | Condor joined #nim |
07:15:57 | * | njoseph joined #nim |
07:19:05 | FromGitter | <sealmove> Do we have in-place sort? |
07:20:01 | FromGitter | <Vindaar> sure: https://nim-lang.github.io/Nim/algorithm.html#sort%2CopenArray%5BT%5D |
07:20:06 | * | Hideki joined #nim |
07:20:29 | * | Hideki is now known as Guest99123 |
07:21:32 | FromGitter | <sealmove> Rephrasing: do we have `sortByIt` similarly to `sortedByIt`? |
07:22:00 | FromGitter | <sealmove> Instead of passing an anonymous function to `sort`... |
07:22:39 | FromGitter | <Vindaar> ah, no I don't think so |
07:31:58 | * | wowi42 quit (Excess Flood) |
07:32:38 | * | wowi42 joined #nim |
07:35:10 | FromDiscord | <Benumbed> I don't know who mantains c2-nim, but the link on the github page to the docs (http://nim-lang.org/docs/c2nim.html) is broken, and 404s |
07:39:02 | * | Guest99123 quit (Remote host closed the connection) |
07:40:45 | * | zacharyc1rter joined #nim |
07:40:45 | * | zacharycarter joined #nim |
07:46:39 | * | Vladar joined #nim |
07:49:53 | Araq | Benumbed: that is the wrong URL, where did you get it from? |
07:50:30 | * | zacharyc1rter quit (Ping timeout: 272 seconds) |
07:50:30 | * | zacharycarter quit (Ping timeout: 272 seconds) |
07:53:32 | FromDiscord | <Benumbed> Github page: https://github.com/nim-lang/c2nim |
07:53:51 | FromDiscord | <Benumbed> Project description up at the top |
08:01:52 | Araq | thanks, fixed |
08:02:33 | FromDiscord | <Benumbed> :thumbsup: |
08:03:51 | FromDiscord | <Benumbed> Has anyone tried the `importcpp` pragma stuff? Up until this point I've only used C, but I'm messing around with C++ dynamic libraries and it's not going so well for me :/ |
08:04:44 | leorize | it's not an easy pragma to use |
08:04:53 | FromDiscord | <Benumbed> so I've discovered lol |
08:06:38 | PMunch | I used it a bit for Arduino stuff, it's not that hard to use |
08:07:25 | FromGitter | <kayabaNerve> PMunch: There you are. |
08:07:31 | FromGitter | <kayabaNerve> I need to talk to you about something. |
08:07:40 | PMunch | Oh, sounds ominous |
08:07:52 | FromGitter | <kayabaNerve> Yeah, shall I hop on IRC or do you want to PM me on Gitter? |
08:08:09 | PMunch | And I'm almost always here :P But I guess you don't see my IRC status on Gitter |
08:08:22 | FromGitter | <kayabaNerve> I reached out earlier; leorize said you weren't here :P |
08:08:28 | FromDiscord | <Benumbed> PMunch: Was your Arduino stuff open (aka is there asomething I can look at?) |
08:08:29 | PMunch | Whatever is easiest |
08:08:53 | PMunch | Benumbed, ah unfortunately not. But it's just not open because the code quality isn't quite there |
08:09:04 | FromGitter | <kayabaNerve> I would prefer you get on Gitter, personally. Been a while since I used IRC :P |
08:09:14 | FromDiscord | <Benumbed> damn, k |
08:10:19 | PMunch | kayabaNerve, just a sec |
08:11:09 | FromGitter | <kayabaNerve> All good |
08:17:40 | FromDiscord | <mratsim> @Araq, after thinking more on how to use both asyncdispatch and Weave, hear you go: https://github.com/mratsim/weave/issues/123 |
08:17:43 | disbot | ➥ Handling blocking tasks and long-running tasks ; snippet at 12https://play.nim-lang.org/#ix=2kQT |
08:17:50 | FromDiscord | <mratsim> here* |
08:22:19 | * | fredrikhr joined #nim |
08:26:08 | * | zacharyc1rter joined #nim |
08:26:08 | * | zacharycarter joined #nim |
08:27:14 | Araq | Benumbed: we used it in production for the Urho3D wrapper fwiw |
08:27:30 | * | anti[m] joined #nim |
08:28:54 | Araq | mratsim: will read it later |
08:30:07 | Araq | so ... if (and that's a big if) my idea works out the potential speedup is from 4.3s down to 0.5s for bootstrapping |
08:30:49 | * | zacharyc1rter quit (Ping timeout: 264 seconds) |
08:30:49 | * | zacharycarter quit (Ping timeout: 264 seconds) |
08:34:18 | * | stefan[m]2 joined #nim |
08:34:42 | leorize | https://play.nim-lang.org/#ix=2kQW |
08:34:44 | leorize | I think I did it |
08:34:51 | leorize | the ultimate permutable macro |
08:35:01 | leorize | generates only meaningful permutations |
08:35:08 | * | stefan[m]2 left #nim ("User left") |
08:35:29 | leorize | and completely support any weird kind of proc you can throw at it |
08:35:35 | leorize | voltist: ^ |
08:35:46 | leorize | don't use it though, even I'm scared of it |
08:35:51 | leorize | now I gotta sleep :P |
08:39:05 | FromGitter | <Hammer2900> hey, how about dependency text file like in python requirements.txt ? any advice to read about this ? |
08:40:03 | FromDiscord | <Benumbed> Hammer2900: If you're using nimble as your pkg manager, it provides a 'requires' directive you can use in your <project name>.nimble file |
08:40:27 | * | pbb quit (Ping timeout: 260 seconds) |
08:40:53 | FromGitter | <alehander92> Araq huh |
08:40:57 | FromGitter | <alehander92> whats your idea |
08:42:03 | * | pbb joined #nim |
08:42:12 | FromGitter | <Hammer2900> > *<FromDiscord>* <Benumbed> Hammer2900: If you're using nimble as your pkg manager, it provides a 'requires' directive you can use in your <project name>.nimble file ⏎ ⏎ ooo, ok thank you, now i check this information )) beater if this information store in first doc pages |
08:42:37 | FromGitter | <sealmove> Are 32bit integers more effecient than 16bit? |
08:42:46 | FromGitter | <sealmove> (speed-wise) |
08:43:04 | FromDiscord | <Benumbed> That would depend on the hardware you're running on |
08:44:00 | FromGitter | <sealmove> I have a type with 4+8 bits, how to align it? |
08:44:10 | FromDiscord | <Never Listen To Beef> Vertically |
08:44:17 | FromGitter | <sealmove> :D |
08:44:31 | FromDiscord | <Benumbed> That depends on the surrounding data IIRC |
08:44:56 | FromGitter | <sealmove> Well, I use only this type repetedly in an array |
08:45:10 | PMunch | @kayabaNerve, you wanted to talk? |
08:46:04 | FromGitter | <sealmove> So I am considering either padding the first field (4+8 -> 8+8) or padding both to make 32bit integer (4+8 -> 16+16). Which one do you recommend? |
08:46:45 | PMunch | If you don't have any other data and memory isn't an issue I'd say go 32bit |
08:46:51 | PMunch | Should be faster on "normal" CPUs |
08:47:19 | FromDiscord | <Benumbed> Well my padding stuff is rusty, but padding to the highest bitcount within the structure is 'recommended' but there's some other alignment gotchas that for the life of me I can't bring to mind |
08:47:24 | PMunch | (I believe 32 bit reading is still faster than 16 bit reading on 64 bit machines, correct me if I'm wrong..) |
08:47:35 | FromGitter | <sealmove> Thanks! I though so, but wanted a confirmation from an expert :) |
08:47:47 | FromDiscord | <Benumbed> I think you're right PMunch, but I'm too tired to remember why 😄 |
08:49:14 | PMunch | The CPU instructions to read/write bytes are still the same for 32bit, it has been extended for 64bit. So it's just a matter of using the 32bit instructions instead. There are 16bit instructions as well, but I'm not entirely sure how they perform |
08:49:17 | FromDiscord | <Never Listen To Beef> Being a dumb dumb i would've thought that since most machines cache line is 64 bit having 4 being on 1 line instead of 2 would've been faster. But i know nothing about actual cpus and just aimlessly guess |
08:49:28 | * | Trustable joined #nim |
08:49:30 | PMunch | Disclaimer, been a looong while since I've done this kind of stuff :P |
08:49:48 | FromDiscord | <Benumbed> There's a good article on this but I can't find it for the life of me |
08:49:49 | FromGitter | <sealmove> Oh makes sense, I see |
08:50:32 | FromDiscord | <Never Listen To Beef> i guess i meant byte size and larger multiples 😄 |
08:50:52 | PMunch | If it's a 16bit one then a write could potentially be "read 32 bit, copy high/low 16 bits, mask out the area we want to write to, mask in our data, write back 32 bit" |
08:51:28 | PMunch | I guess the real answer is "try both, benchmark" |
08:51:42 | PMunch | If speed is really important |
08:54:16 | FromGitter | <sealmove> It's a decompression routine so quite important... |
08:57:11 | PMunch | Then I guess it's benchmarking time! |
08:58:24 | PMunch | I mean all of this could be made null and void if your application hits the cache a certain way |
08:58:47 | PMunch | Modern CPUs are getting so complex it's not always trivial to give "always do X" advice |
09:00:09 | * | dddddd joined #nim |
09:02:41 | FromGitter | <sealmove> I always try to avoid benchmark. It's a lot of work x_x |
09:03:21 | * | zacharyc1rter joined #nim |
09:03:21 | * | zacharycarter joined #nim |
09:06:41 | * | abm joined #nim |
09:07:51 | * | zacharycarter quit (Ping timeout: 258 seconds) |
09:08:14 | * | zacharyc1rter quit (Ping timeout: 258 seconds) |
09:09:29 | * | liblq-dev joined #nim |
09:12:51 | * | kayabaNerve joined #nim |
09:17:30 | * | ryan_ joined #nim |
09:20:07 | * | tanger_moon quit (Ping timeout: 260 seconds) |
09:20:26 | Araq | alehander92: it's an old idea from Zahary, re-interpreted for IC |
09:20:43 | Araq | but it's too early to talk about it :P |
09:22:16 | liblq-dev | shashlick: why does nimterop not generate .importc pragmas for bound objects? |
09:22:30 | liblq-dev | it breaks the ABI and causes segfaults with soundio |
09:23:04 | FromGitter | <alehander92> Araq i am *just* reading another interesting IC idea |
09:23:36 | * | Romanson quit (Quit: Connection closed for inactivity) |
09:23:43 | FromGitter | <alehander92> but it seems a bit radical |
09:23:46 | Araq | link? |
09:23:49 | FromGitter | <alehander92> https://github.com/ziglang/zig/pull/5158#issue-408356035 |
09:23:52 | disbot | ➥ beginnings of (non-LLVM) self-hosted machine code generation and linking ; snippet at 12https://play.nim-lang.org/#ix=2kR9 |
09:23:59 | FromDiscord | <mratsim> @PMunch, @Never Listen To Beef , 16 bytes instructions are the worse on 64-bit CPU: They take more space to encode, They take somewhat more time due to more expensive zero-extension |
09:24:03 | liblq-dev | does Nim reorder object fields somehow? |
09:24:13 | FromGitter | <alehander92> basically it requires writing a special incremental linker etc from zero |
09:24:32 | PMunch | @mratsim, so my memory didn't fail me this time, wohoo :) |
09:25:59 | FromDiscord | <mratsim> but that is valid only if everything you need is CPU-bound |
09:26:16 | FromDiscord | <mratsim> usually workload are either bottlenecked by IO or memory |
09:26:34 | FromDiscord | <mratsim> if bottlenecked by memory, as @Never Listen To Beef said, it's more important to pack more data in a single cache line |
09:28:20 | Araq | alehander92: ok, well "figure out how comptime code will work" means it's rather unfinished ;-) |
09:29:08 | FromDiscord | <Yardanico> Well Zig itself has much less "advanced" stuff |
09:31:10 | * | lritter joined #nim |
09:34:45 | dom96 | Yardanico, keep in mind that Zig is much much younger |
09:36:39 | FromDiscord | <Yardanico> Well yeah, but also the ecosystem for stuff like LLVM is much better than when Nim was started ;) |
09:38:18 | FromGitter | <alehander92> Araq oh i agree |
09:38:21 | * | idf joined #nim |
09:38:23 | FromGitter | <alehander92> i just was wondering for my own |
09:38:33 | FromGitter | <alehander92> side project idea and IC |
09:38:48 | FromGitter | <alehander92> and comparing stuff i saw randomly |
09:40:21 | FromGitter | <alehander92> but aren't those a bit separated? e.g. caching in a smart way compile time code is one problem, optimizing the backend work for regenerating the final binary another one |
09:41:16 | FromGitter | <eagledot> Is it possible to get different code behaviour based on the garbarge collector used?? |
09:41:40 | Araq | yes |
09:42:12 | Araq | that's usually kinda the point of using a different algorithm, to get different runtime behaviour ;-) |
09:42:32 | FromGitter | <alehander92> probably the linking/binary thing isn't such a bottleneck tho, after all redoing 1 of 50 objects is a big win anyway |
09:42:51 | Araq | but it also affects edge cases wrt GC_ref etc |
09:43:12 | FromGitter | <eagledot> I have trying to make this code work but it is getting compiled properly ..but it works only when "arc" is used not with default garbage collector... ⏎ https://play.nim-lang.org/#ix=2kRf |
09:44:02 | Araq | so use arc, it's the future |
09:44:47 | FromGitter | <eagledot> I have been wanting to ask that using different garbage collector should not influence the result of programmes? |
09:45:30 | FromGitter | <eagledot> shouldn't the programme's results be same independent of GC used? |
09:46:07 | Araq | ideally yes, but your program is full of low level stuff, run it with -d:useMalloc --gc:arc under valgrind already |
09:47:44 | * | Hideki joined #nim |
09:47:51 | FromGitter | <eagledot> So nim doesnot take care of this if i am writing code in nim??If this is so when should i change gc. ⏎ Code works prefectly everytime when i use no GC...so i think logic is correct!! |
09:48:08 | * | Hideki is now known as Guest5252 |
09:49:18 | Yardanico | if code works "perfectly" when you don't use a gc it doesn't mean that the code is correct :P |
09:49:30 | Yardanico | when you use "gc:none" all GC'd memory is simply being leaked |
09:50:06 | Araq | you might as well claim "my C++ code works perfect in debug mode" |
09:50:13 | Yardanico | you should really try using nim c -d:useMalloc --gc:arc --debugger:native file.nim |
09:50:21 | Yardanico | valgrind --leak-check=full ./file |
09:50:31 | Yardanico | debugger:native for source code lines :P |
09:50:45 | Araq | "and it fails in release, so the C++ compiler isn't working!" |
09:51:13 | FromGitter | <eagledot> I understand that GC main function is release memory automatically. But why some code works with one GC and not with other. |
09:52:53 | FromGitter | <alehander92> it's a good question in general |
09:53:21 | FromGitter | <alehander92> a lot of code never really accounts for what gc mode is used |
09:53:43 | Araq | as I said, if you have bugs the program might appear to work under various conditions for a long time |
09:54:15 | FromGitter | <eagledot> low level C code i am calling does not allocate in memory..i do it in nim.But it is behaving weirdly even if add an extra line `echo(variable)` it start working. |
09:54:40 | Araq | does the C code run it in a different thread? |
09:54:51 | FromGitter | <eagledot> No |
09:55:03 | Yardanico | hmm NiGui seems to be crashing with arc (uses methods for GUI controls and stuff), wonder why, crashes even with sink inference off |
09:55:15 | FromGitter | <eagledot> I CAN post even the C code..if u want. |
09:55:25 | FromGitter | <eagledot> nim code is here. ⏎ https://play.nim-lang.org/#ix=2kRf |
09:56:07 | FromGitter | <eagledot> Can u tell me if i am doing something gravely wrong??I have been upto this for 2 days. |
09:56:36 | * | Guest5252 quit (Remote host closed the connection) |
09:56:41 | Yardanico | well we can't try without the webrtcvad_nim |
09:57:16 | * | ryan_ quit (Ping timeout: 246 seconds) |
09:57:47 | * | Tlongir joined #nim |
09:58:12 | FromGitter | <eagledot> https://gitlab.com/eagledot/webrtcvad-nim/ |
09:59:00 | FromGitter | <eagledot> i was trying to writ nim-bindings for google's opensource webrtcvad (voice activity detector). |
10:00:16 | liblq-dev | shashlick: I reported this as a bug in nimterop: https://github.com/nimterop/nimterop/issues/202 |
10:00:19 | disbot | ➥ ABI break due to the lack of .importc in struct definitions ; snippet at 12https://play.nim-lang.org/#ix=2kRm |
10:01:13 | Yardanico | @eagledot it works with the default GC for me just as fine |
10:02:18 | Yardanico | "total heap usage: 3 allocs, 3 frees, 5,608 bytes allocated" with default GC and no -d:useMalloc |
10:02:26 | Yardanico | "All heap blocks were freed -- no leaks are possible" |
10:04:13 | FromGitter | <eagledot> you tested with different wave files?? |
10:04:26 | Yardanico | tested with 60seconds one, with 10 seconds one, with 3 seconds one |
10:04:30 | Yardanico | although the program seems to SIGSEGV with valgrind if compiled with arc and -d:useMalloc |
10:04:36 | Yardanico | doesn't sigsegv without valgrind at all though |
10:04:51 | Yardanico | and yes valgrind itself crashed |
10:04:53 | Yardanico | not the program |
10:04:54 | Yardanico | XD |
10:05:17 | Yardanico | "valgrind: the 'impossible' happened: Killed by fatal signal" |
10:05:46 | FromGitter | <eagledot> For me i used that nim code with corresponding python code ..even though the nim code works but results donot match with the equivalent python code. ⏎ https://github.com/wiseman/py-webrtcvad/blob/master/example.py |
10:06:34 | FromGitter | <eagledot> For me by now it has been a hit and miss. |
10:09:42 | Yardanico | oh also found a simple compiler crash with kinda invalid code |
10:11:16 | FromGitter | <eagledot> So is it a problem with my code or some nim internal bug ... just confirming..i am a newbie?? |
10:11:33 | Yardanico | I honestly don't really know, I'm doing a different thing right now, so sorry :) |
10:12:37 | * | krux02 joined #nim |
10:13:40 | FromGitter | <eagledot> OK. Thanks. |
10:14:05 | FromGitter | <eagledot> If you have any advice to avoid such cases ..please let me know. |
10:15:18 | FromGitter | <sealmove> Is `newSeq[int](512)` slower than `array[512, int]`? |
10:17:06 | krux02 | sealmove: can't say completely out of context. |
10:17:35 | krux02 | array is always stack allocated, where newSeq is always heap allocated. |
10:18:29 | FromGitter | <sealmove> Hmm, I always have 512 elements but then I want to drop some (with the `keepItIf` proc) |
10:18:45 | krux02 | yea that doesn't work with array. |
10:18:55 | FromGitter | <sealmove> Also I want to order them (either before or after dropping some elements) |
10:19:07 | krux02 | sorting is no problem with arrays. |
10:19:31 | FromGitter | <sealmove> Should I first make an array, use `sort` and then allocate a seq and use `keepItIf` on it? Or make a seq from the beginning and not use array? |
10:19:51 | krux02 | dropping isn't possible, but you can reorder then in a way that all "dropped" items are at the end and then you only iterate until you reach those "dropped" elements. |
10:20:00 | krux02 | no |
10:20:33 | krux02 | I can't even tell you if "keepItIf" is the right thing to do. |
10:20:42 | narimiran | just use seq |
10:21:01 | FromGitter | <Bennyelg> Hi, Anyway I can echo all the procs names inside customType ? |
10:21:17 | krux02 | what procs names? |
10:21:19 | FromGitter | <sealmove> Oh actually sort does take care of it as you suggested, I don't really need to drop anything! |
10:21:38 | FromGitter | <Bennyelg> yes procs names |
10:21:47 | FromGitter | <Bennyelg> which assosicated to him |
10:21:50 | FromGitter | <Bennyelg> it* |
10:22:23 | krux02 | I don't think that there is an api to get all procs that take "CustomType" as first argument. |
10:22:46 | krux02 | But it would certainly be valuable. |
10:23:05 | * | tane joined #nim |
10:23:11 | FromGitter | <Bennyelg> yea well, need to write macro for it right ? |
10:23:39 | krux02 | I don't think there is a macro api so that you could implement it. |
10:24:15 | krux02 | it is only possible the other way around. "give me all the overloads with the name "myCustomProc" |
10:24:17 | FromDiscord | <Recruit_main707> getting all your code into the macro and checking for all procs and their args maybe? |
10:24:56 | krux02 | Recruit_main707: That could work, but solution like that can seriously hurt compile time. |
10:26:36 | Yardanico | how do I output an address of a procedure with --gc:arc ? |
10:30:59 | * | NimBot joined #nim |
10:31:18 | Yardanico | you wouldn't believe it but echo cast[array[2, int]](control.fOnClick)[0] worked because in C it was defined like "static NIM_CONST tyProc__Jv1U9bAA9aOQah3FXJraBXHg TM__v6sMqsqcQidqukQ1qgYXEQ_58 = {NIM_NIL,NIM_NIL};" |
10:31:40 | Yardanico | i just need this for debugging why nigui doesn't work with arc |
10:31:56 | Yardanico | seems like that arc doesn't like when you try to access nil procs in an object |
10:32:18 | Yardanico | nigui has a lot of stuff like "let callback = checkbox.onToggle" "if callback != nil: stuff" |
10:32:33 | * | CcxCZ joined #nim |
10:32:36 | FromGitter | <alehander92> krux02 |
10:32:50 | * | so joined #nim |
10:32:56 | FromGitter | <alehander92> i need to fix printing case objects in gdb too |
10:32:56 | krux02 | yes? |
10:33:05 | FromGitter | <alehander92> can you remember what blocked you |
10:33:13 | FromGitter | <alehander92> afaik this code was disabled in nim-gdb |
10:33:46 | krux02 | well, gdb needs some form of runtime type information. |
10:33:50 | * | Hideki joined #nim |
10:34:14 | * | Hideki is now known as Guest73501 |
10:34:22 | * | junland joined #nim |
10:34:24 | FromGitter | <alehander92> yeah, but does the nti contain enough info for case objects? |
10:34:35 | krux02 | if things are mapped to something that exists in the backend directly, then the debug information that is generated by the C/C++ compiler is enough. |
10:34:48 | FromGitter | <alehander92> iirc one mostly needs to know which branch corresponds to which enum range |
10:35:09 | krux02 | but if the construct is crafted then you need to generate other forms of runtime type information. |
10:35:30 | FromGitter | <alehander92> ok |
10:35:37 | krux02 | and last time I based something on NDI it was broken, because NDI is a singking ship. |
10:35:41 | krux02 | sinking ship |
10:35:47 | FromGitter | <alehander92> yeah, that seems to be bad |
10:36:13 | FromGitter | <Bennyelg> Newbie question: When I should also export my module ? |
10:36:42 | krux02 | Bennyelg: when you feel like doing so. |
10:36:55 | FromGitter | <alehander92> krux02 it would be good to standartize this |
10:36:57 | krux02 | no honestly I don't know what you are talking about. |
10:37:10 | krux02 | what do you want to export. |
10:37:41 | FromGitter | <alehander92> i also used some of that info for making better async stepping actions |
10:38:32 | FromGitter | <Bennyelg> when I do export it will pass the import along to the other module without explicitly import it again right? |
10:39:14 | FromGitter | <alehander92> and are the ndi and nti info-s in some kind of sync? |
10:39:16 | * | xcm quit (Ping timeout: 246 seconds) |
10:39:20 | * | dadada joined #nim |
10:39:26 | dadada | hey |
10:39:28 | krux02 | Bennyelg: if you export a module all symbol of that module will be avaiable through another module. |
10:39:46 | FromGitter | <Bennyelg> exactly thanks |
10:39:53 | krux02 | if you have a.foo and in b you export a you can access a.foo as b.foo |
10:40:42 | dadada | I want multiline strings that includes triple quotes strings themselves... so triple quotes bite triple quotes |
10:40:48 | dadada | what can I do about it? |
10:41:02 | dadada | s/includes/include |
10:41:13 | krux02 | dadada: nothing |
10:41:40 | Yardanico | dadada: have text files in your project and read them at compiletime :P |
10:41:40 | krux02 | you can use something else that is not """ and then replace it with tripple quotes as a post process. |
10:43:36 | * | natrys joined #nim |
10:57:29 | * | Guest73501 quit (Ping timeout: 258 seconds) |
11:10:00 | * | dadada quit (Ping timeout: 272 seconds) |
11:11:17 | * | dadada joined #nim |
11:11:40 | * | dadada is now known as Guest23312 |
11:34:20 | * | narimiran quit (Ping timeout: 256 seconds) |
11:36:28 | * | Romanson joined #nim |
11:54:12 | FromGitter | <alehander92> ok |
11:54:31 | FromGitter | <alehander92> how can a void async procedur yield nil |
11:55:22 | FromDiscord | <Rika> it shouldnt |
12:00:10 | * | rockcavera joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:43 | * | supakeen joined #nim |
12:08:14 | * | Hideki joined #nim |
12:08:38 | * | Hideki is now known as Guest23088 |
12:09:32 | FromGitter | <nothratal> just out of curiosity, can someone help me transform this here: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb1577b7a24ff01b001c9d6] |
12:10:22 | FromGitter | <Yardanico> pairs is an iterator, so you can't use UFCS for it |
12:10:41 | FromGitter | <Yardanico> instead do it like toSeq(tParam.pairs).stuff |
12:10:47 | FromDiscord | <Recruit_main707> you are also in gitter? |
12:11:10 | Yardanico | i am |
12:11:10 | FromDiscord | <Yardanico> every |
12:11:12 | FromGitter | <Yardanico> where |
12:11:42 | FromDiscord | <Recruit_main707> i think you got a bit confused |
12:12:14 | FromGitter | <nothratal> ahh! UCFS again :P ⏎ I already tried: ⏎ pairs(tParam).toSeq.map(proc(x,y:string):string= x & "=" & y).join("&") ⏎ but not toSeq(...) [https://gitter.im/nim-lang/Nim?at=5eb1581ed898fe7a37685713] |
12:12:22 | * | Guest23088 quit (Ping timeout: 246 seconds) |
12:12:47 | FromGitter | <Yardanico> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
12:13:12 | FromGitter | <Yardanico> there's an example with an iterator here, and why it's not possible |
12:15:03 | FromGitter | <Yardanico> you can do something like proc toKv(data: Table[string, string]): string = toSeq(data.pairs).mapIt(it[0] & "=" & it[1]).join("&") |
12:15:13 | FromGitter | <Yardanico> but I don't like this kinda-functional style ;) |
12:15:58 | FromDiscord | <Rika> so this can be another reason why nim doesnt default to fully qualifying functions from imports |
12:16:06 | FromGitter | <Yardanico> yep |
12:16:10 | FromGitter | <Yardanico> there's also https://nim-lang.org/docs/uri.html#encodeQuery%2CopenArray%5B%5D |
12:16:30 | FromGitter | <Yardanico> if you don't actually need tables you can just use it as encodeQuery({"a": "b", "c": "d"}) |
12:16:55 | FromGitter | <Yardanico> {} syntax is sugar openArray[tuple[val1: keytype, val2: valtype]] in Nim |
12:16:58 | FromGitter | <Yardanico> for* |
12:17:28 | FromGitter | <Yardanico> also encodeQuery automatically escapes strings so it'll be a valid part of URL |
12:18:00 | Yardanico | A cool thing is https://github.com/zero-functional/zero-functional by the way |
12:18:07 | Yardanico | "A library providing (almost) zero-cost chaining for functional abstractions in Nim." |
12:18:52 | FromDiscord | <Rika> is it better than pure sequtils |
12:19:05 | * | monokrom joined #nim |
12:19:09 | FromDiscord | <Rika> maybe itll become yet-another-dependency of circa xd |
12:19:40 | Yardanico | well it should be more performant since it doesn't create temporary sequences |
12:19:52 | * | natrys quit (Quit: natrys) |
12:19:56 | Yardanico | it's a really cool example of what can be done with nim macros |
12:20:25 | Yardanico | https://github.com/zero-functional/zero-functional/tree/master/benchmarks XDDD |
12:22:12 | FromGitter | <nothratal> @Yardanico , thx the encodeQuery is new to me. It does the same thing. |
12:22:24 | Yardanico | yes, just don't forget that you don't need tables for the {} syntax |
12:23:08 | Yardanico | [("hello", "world"), ("yes", "no")] is the same as {"hello": "world", "yes": "no"} |
12:23:35 | FromDiscord | <Rika> {} even saves order if thats important |
12:23:43 | Yardanico | uhh wat |
12:24:00 | Yardanico | it's the same for both [] and {} since {} is sugar over [] |
12:24:12 | Yardanico | and arrays/seqs are ordered |
12:24:19 | Yardanico | tables are not unless you use OrderedTable |
12:24:56 | * | Hideki joined #nim |
12:25:20 | * | Hideki is now known as Guest51372 |
12:26:11 | FromDiscord | <Rika> yeah i know |
12:26:13 | FromDiscord | <Rika> what do you mean lmao |
12:26:20 | Yardanico | ? |
12:26:23 | FromDiscord | <Rika> i was talking about {} and tables |
12:26:29 | Yardanico | you didn't say so |
12:26:32 | FromDiscord | <Rika> not your last message |
12:26:34 | Yardanico | "{} even saves order if thats important" |
12:26:41 | FromDiscord | <Rika> if you didnt send that message then it'd make sense xd |
12:26:46 | FromGitter | <alehander92> it was a fun benchmark to do but its old and probably was very inexact |
12:27:03 | FromGitter | <alehander92> overally we need first-class iterators, zero-functional is a huge hack |
12:27:17 | Yardanico | but will they be fast? :P |
12:27:30 | FromGitter | <alehander92> with amazing work on writing custom operations by @micheal72 |
12:27:36 | FromGitter | <alehander92> but still the approach is hacky |
12:28:11 | FromGitter | <alehander92> well it seems rust was basically the same speed in those very strange benchmarks so why not |
12:32:53 | Yardanico | ok time to continue debugging nigui with arc (it sigsegvs because it can't access the control object for some reason) |
12:33:22 | Yardanico | the problem is that it's not easy to create a small example when the lib is a lot of lines, I've managed to strip it to 2.5k loc single file but that's still a lot |
12:48:33 | Yardanico | ok down to 1.3k loc |
12:50:02 | * | zacharyc1rter joined #nim |
12:50:02 | * | zacharycarter joined #nim |
12:50:57 | FromGitter | <alehander92> how do you debug it |
12:51:04 | Yardanico | run with/without arc :DD |
12:51:21 | Yardanico | basically nigui does some casts and uses methods so maybe there's some bug here |
12:51:25 | Yardanico | or arc behaves differently |
12:51:32 | Yardanico | I also checked with --sinkInference:off and it doesn't help |
12:52:21 | * | thomasross joined #nim |
12:56:11 | Yardanico | oh so apparently the method event handler gets a null pointer of control |
12:56:12 | Yardanico | nice |
12:56:41 | Yardanico | without arc it has a proper pointer |
12:56:46 | Yardanico | not null one :P |
12:58:25 | Yardanico | I mean gdb is pretty nice even without nim-gdb |
12:58:46 | Yardanico | https://i.imgur.com/DTC11Gv.png |
12:59:39 | Yardanico | so apparently in that proc after evt.control = control control is zeroed out lol |
13:03:52 | FromDiscord | <clyybber> so its sinked |
13:04:10 | Yardanico | but it also doesn't work with --sinkInference:off |
13:04:13 | Yardanico | so I was a bit confused :P |
13:04:23 | FromDiscord | <clyybber> yeah, its still incorrectly sinked. I think |
13:04:34 | Yardanico | ah ok, I'll try to create a shorte example now |
13:04:47 | FromDiscord | <clyybber> can you look in the C code and see what that evt.control = control translates to? |
13:05:30 | Yardanico | to this if I correctly understand https://gist.github.com/Yardanico/9476cf354c39a7d04a95307ccf251a7b |
13:05:55 | Yardanico | the whole c function https://gist.github.com/Yardanico/aab2a8e0b42ce76601bfad71d6e9dd89 |
13:05:57 | Yardanico | -d:danger --gc:arc |
13:06:21 | Yardanico | and nim source for the proc https://gist.github.com/Yardanico/529540799c9455907852abf0e134006f |
13:06:23 | liblq-dev | @Bennyelg I know I'm late, but if it's your API you may be able to create a custom pragma that adds the procs to some `var procs {.compileTime.}: seq[NimNode]` |
13:07:36 | FromDiscord | <clyybber> Yardanico: Looks like somehow we sink even though its used later. |
13:07:58 | Yardanico | well yeah I'm still minimizing it, right now it's 1.2k loc and requires gtk :/ |
13:08:42 | dom96 | In case anyone wants to bike shed: https://github.com/TechEmpower/FrameworkBenchmarks/issues/5680 |
13:08:43 | disbot | ➥ New classification for implementation types |
13:11:18 | Yardanico | @clyybber I think I managed to repro it :) |
13:12:53 | PMunch | dom96, did you ever try to wrap picohttp in Nim and see how that compares to the V wrapper? |
13:13:11 | dom96 | nope |
13:14:07 | FromDiscord | <Rika> are we calling it pico.nim? lmao |
13:15:13 | PMunch | I was just curious how much overhead V has when wrapping stuff |
13:17:11 | Yardanico | phew, this one took a few hours to reproduce https://github.com/nim-lang/Nim/issues/14233 |
13:17:15 | disbot | ➥ [ARC] Incorrect sinking of an argument? ; snippet at 12https://play.nim-lang.org/#ix=2kSu |
13:17:51 | FromDiscord | <Yardanico> @clyybber ^ |
13:18:35 | FromDiscord | <clyybber> nice, thanks!! |
13:24:16 | FromDiscord | <clyybber> yeah, the dfa is not detecting the read/use of control in the last line correctly |
13:24:36 | Yardanico | yeah I also posted a bit smaller example |
13:25:01 | Yardanico | you guys can join arc bug hunting too, it's fun :P |
13:25:14 | Yardanico | https://i.imgur.com/fYvgymp.png |
13:26:16 | FromDiscord | <clyybber> actually, nevermind. The dfa has the last use of control.. |
13:26:34 | * | narimiran joined #nim |
13:31:18 | FromDiscord | <clyybber> huh. this is a wierd one.. |
13:31:25 | FromDiscord | <clyybber> I think its to do with type conversions |
13:31:51 | Yardanico | well my second repro doesn't really do type conversions and doesn't use pointers |
13:31:55 | Yardanico | or you mean type conversions in C? |
13:32:14 | FromDiscord | <clyybber> hmm nope, I'm probably wrong |
13:32:34 | Yardanico | btw if I remove the case statement it works |
13:32:39 | Yardanico | ah wait |
13:32:42 | FromDiscord | <clyybber> oh |
13:32:50 | Yardanico | yes |
13:32:55 | Yardanico | it works if I remove the case statement |
13:33:54 | FromDiscord | <clyybber> hmm, somehow isLastRead can't deal with these forks then.. |
13:34:15 | Yardanico | it also works if I replace "else: return" with "else: discard" :P |
13:35:11 | FromDiscord | <clyybber> thanks, thats actually really helpful |
13:35:21 | FromDiscord | <clyybber> so its the goto generated by the return |
13:35:31 | FromDiscord | <clyybber> but the fork happening before should reach L22.. |
13:37:14 | Yardanico | well it's nice that 1.4 (or next 1.2 release?) will have quite a lot of arc bugfixes :P |
13:37:20 | FromDiscord | <clyybber> yeah 😄 |
13:37:24 | disruptek | i smell a horse. |
13:37:46 | Yardanico | oh hi disruptek |
13:37:50 | Yardanico | are you motivated today? |
13:37:51 | FromDiscord | <clyybber> hyo |
13:37:55 | FromDiscord | <Rika> maybe you smell like a horse |
13:38:06 | disruptek | eh i haven't had a shower this month. |
13:38:12 | disruptek | wait, it's still april, right? |
13:38:20 | * | Vladar quit (Quit: Leaving) |
13:38:20 | Yardanico | ye |
13:38:22 | disruptek | oh shit. |
13:38:35 | FromDiscord | <Rika> time traveler |
13:38:47 | Yardanico | ntw NiGui seems to work fine with arc if I replace two instances of "else: return" with "else: discard" |
13:39:24 | Yardanico | hmm, had another crash, but we'll deal with it later I guess :D |
13:39:35 | FromDiscord | <clyybber> yeah ::D |
13:39:36 | disruptek | yardinco: the important list holds packages that /don't/ work. |
13:40:02 | Yardanico | ? |
13:40:22 | disruptek | we need a culture of assuming that things work. |
13:42:16 | * | chemist69 quit (Ping timeout: 244 seconds) |
13:42:18 | disruptek | #13912 |
13:42:20 | disbot | https://github.com/nim-lang/Nim/issues/13912 -- 3Regression: hintConf exclusion no longer prevents hints ; snippet at 12https://play.nim-lang.org/#ix=2kSE |
13:43:15 | * | chemist69 joined #nim |
13:48:09 | FromDiscord | <Yardanico> @clyybber can you mark this one as ARC just for the sake of reference? 😛 https://github.com/nim-lang/Nim/issues/14219 (I guess I should ask 4raq to make me a collaborator in the repo again so I could label issues lol) |
13:48:10 | disbot | ➥ ARC codegen bug with inline iterators ; snippet at 12https://play.nim-lang.org/#ix=2kLa |
13:48:29 | FromDiscord | <clyybber> done 🙂 |
13:50:52 | * | ftsf_ joined #nim |
13:53:53 | * | ftsf quit (Ping timeout: 256 seconds) |
13:55:50 | FromGitter | <alehander92> oh well i found a waitFor in my async function |
13:55:57 | Yardanico | xdd |
13:56:01 | FromGitter | <alehander92> but i wouldnt have found it anyway probably its indirect |
13:57:59 | disruptek | agenda: compiler or game programming? |
13:58:00 | FromDiscord | <Rika> `rg waitFor` ? |
13:58:20 | shashlick | @liblq-dev - you around? |
13:58:30 | liblq-dev | ye |
13:58:51 | shashlick | i replied to the issue you opened |
13:58:55 | shashlick | can you test with `-H`? |
13:59:22 | shashlick | also, can you post the type which is getting messed up? I am wondering if the type generated is wrong or if it is wholly importc related |
13:59:36 | FromGitter | <alehander92> disruptek compiler ? |
13:59:57 | disruptek | one vote for compiler. 😁 |
14:00:30 | FromDiscord | <clyybber> count me for compiler too |
14:00:34 | disruptek | damnit. |
14:00:44 | FromDiscord | <clyybber> you cannot escape |
14:01:42 | FromGitter | <Willyboar> if i had to choose one i want to watch web but from those 2 of course game programming |
14:01:55 | disruptek | YES |
14:02:09 | disruptek | you are my man. |
14:02:46 | zacharyc1rter | web dev bleh |
14:02:51 | zacharyc1rter | game programming all the way |
14:02:56 | * | fredrikhr joined #nim |
14:03:02 | zacharyc1rter | although you're not really programming games are you disruptek? |
14:03:06 | zacharyc1rter | you sneaky sneaky bastard |
14:03:07 | FromGitter | <Willyboar> alehanders dont count because of the question mark |
14:03:09 | liblq-dev | shashlick: http://ix.io/2kSM/nim, the C type is defined here: https://github.com/andrewrk/libsoundio/blob/master/soundio/soundio.h#L497 |
14:03:22 | liblq-dev | I checked and the order seems to be correct on the Nim side |
14:03:32 | * | abm quit (Ping timeout: 272 seconds) |
14:03:36 | disruptek | i don't program games anymore. |
14:03:42 | disruptek | i program to make games unfun. |
14:03:51 | zacharyc1rter | you're good at sucking the fun out of things |
14:04:06 | disruptek | i'm a champion sucker, that's for sure. |
14:04:11 | zacharyc1rter | :D |
14:04:31 | FromDiscord | <clyybber> Araq: ping |
14:04:46 | liblq-dev | shashlick: just tested with -H, seems to work fine |
14:04:47 | FromGitter | <Willyboar> zachary why not web dev |
14:04:49 | FromGitter | <Willyboar> ? |
14:04:55 | zacharyc1rter | no web dev is the worst |
14:05:03 | zacharyc1rter | let's light the web on fire and never look back at it again |
14:05:17 | liblq-dev | my man |
14:05:17 | zacharyc1rter | actually it's already on fire so let's just add gasoline |
14:05:27 | liblq-dev | lol |
14:05:48 | shashlick | liblq-dev - is SoundIoFormat defined as a `distinct cint` |
14:05:57 | liblq-dev | it's a defineEnum() |
14:06:28 | liblq-dev | not sure what the underlying type is |
14:07:50 | * | disruptek is now known as ad |
14:07:58 | shashlick | can you check types.nim - should be distinct int |
14:07:58 | * | ad is now known as asd |
14:08:39 | * | Guest51372 quit (Remote host closed the connection) |
14:09:08 | * | asd is now known as disruptek |
14:09:32 | FromGitter | <alehander92> disruptek just do whatever you want :D |
14:09:42 | zacharyc1rter | he's going to anyway, don't worry |
14:09:44 | FromGitter | <alehander92> democracy is optional! |
14:10:17 | FromDiscord | <Yardanico> @clyybber so there's a guy in telegram doing bindings for some C library, and basically he encountered a kind of memory leak with arc (or maybe it's just how it should work) |
14:10:33 | FromDiscord | <clyybber> I'm in the group I'll look there |
14:10:36 | FromDiscord | <Yardanico> ah ok |
14:10:59 | zacharyc1rter | we have wayyyyy too many communication channels |
14:11:04 | zacharyc1rter | let's just all use IRC k? |
14:11:28 | liblq-dev | shashlick: yup, it's distinct int |
14:11:41 | zacharyc1rter | it's like now we have a manual bridge to telegram lol |
14:12:02 | * | Hideki joined #nim |
14:12:21 | Yardanico | zacharyc1rter: well telegram is less active than irc/discord/gitter combined of course |
14:12:25 | * | Hideki is now known as Guest20956 |
14:12:51 | Yardanico | I mean for nim |
14:12:55 | shashlick | libliq-dev you need to pull latest head |
14:13:04 | shashlick | it should be distinct cint, sorry |
14:13:31 | zacharyc1rter | Yardanico: they should all just join IRC |
14:14:07 | Yardanico | zacharyc1rter: that's true but some people think that irc is bad/hard and dislike it :D |
14:14:25 | shashlick | liblq-dev - from the change log - Enums were originally being mapped to `distint int` - this has been changed to `distinct cint` since the sizes are incorrect on 64-bit and is especially noticeable when types or unions have enum fields. |
14:14:43 | krux02 | IRC is a bit crude. But that is what I like about it. |
14:14:47 | zacharyc1rter | yeah I know - but pretty soon some new chat app is going to come out |
14:14:48 | krux02 | No images, no animations. |
14:15:10 | zacharyc1rter | like soon we'll have a Nim facebook messenger group chat |
14:15:16 | FromDiscord | <clyybber> oh no |
14:15:17 | krux02 | I think there is an xkcd about this |
14:15:20 | zacharyc1rter | lol |
14:15:24 | Yardanico | we need an instagram account for nim as well |
14:15:31 | * | hpyc9 quit (Quit: FREENODE IS FUCKING GAY) |
14:15:31 | * | blackbeard420 quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:15:31 | zacharyc1rter | yeah and a twitter group DM |
14:15:36 | zacharyc1rter | bridge all the things |
14:15:45 | Yardanico | don't forget to bridge the forum too |
14:15:53 | zacharyc1rter | lol |
14:16:14 | Yardanico | but who uses forums in 2020 am i right :D |
14:16:28 | zacharyc1rter | we should have just gone the TempleOS route we were discussing yesterday |
14:16:30 | krux02 | https://xkcd.com/1782/ |
14:16:30 | shashlick | @liblq-dev - can you try with latest head and remove the `-H` and see what happens |
14:16:36 | zacharyc1rter | no community, we just get messages directly from God |
14:16:52 | liblq-dev | shashlick: installing it right now |
14:16:53 | * | natrys joined #nim |
14:16:58 | zacharyc1rter | could have saved ourselves a lot of bridge construction time |
14:17:01 | * | Guest20956 quit (Ping timeout: 264 seconds) |
14:17:07 | krux02 | zacharyc1rter, only works if we have a holy bible of Nim. |
14:17:13 | zacharyc1rter | haha |
14:17:36 | Yardanico | HolyNim |
14:17:38 | Yardanico | by krux02 |
14:17:40 | zacharyc1rter | oh no |
14:17:46 | zacharyc1rter | death to the heretics |
14:17:55 | liblq-dev | featuring: a functional REPL |
14:18:10 | disruptek | crude wins. nothing to complain about. |
14:18:11 | zacharyc1rter | actually that's probably possible now with arc |
14:18:13 | krux02 | I am talking about a book, not a Nim fork. |
14:18:34 | krux02 | or -derivative/implementation |
14:18:37 | Yardanico | zacharyc1rter: also see https://github.com/arnetheduck/nlvm/pull/18 https://github.com/nim-lang/Nim/issues/8927#issuecomment-580456200 |
14:18:39 | disbot | ➥ [Grant Proposal] Make Nim suitable for interactive programming (Implement hot code-reloading, a REPL and a Jupyter kernel) ; snippet at 12https://play.nim-lang.org/#ix=2kSQ |
14:18:53 | disruptek | arc of the covenimt. |
14:19:06 | liblq-dev | shashlick: works now. thanks for that |
14:19:40 | liblq-dev | I still believe that .header and .importc should be default though, it would save a lot of headaches if gcc suddenly decides to reorder fields for no reason |
14:19:46 | shashlick | okay, i need to release soon so i'm worried about this issue |
14:20:13 | shashlick | just to confirm, you tried without `-H` right |
14:20:52 | shashlick | i think making it opt out is safer for folks |
14:21:05 | anti[m] | #matrixforthewin |
14:22:00 | zacharyc1rter | Yardanico: I saw that a few weeks ago but I think it's possible even without NLVM now |
14:22:06 | Yardanico | how? |
14:22:06 | zacharyc1rter | using dlopen / dlclose |
14:22:15 | liblq-dev | shashlick: yes, that's without -H |
14:22:20 | Yardanico | isn't that what hcr does |
14:22:24 | shashlick | okay cool |
14:22:58 | * | blackbeard420 joined #nim |
14:24:22 | * | hpyc9 joined #nim |
14:24:42 | Yardanico | btw c2nim works with gc:arc just fine :P |
14:25:20 | * | leorize[m] quit (Quit: killed) |
14:25:20 | * | Northstrider[m] quit (Quit: killed) |
14:25:25 | zacharyc1rter | Yardanico: no not exactly HCR works with the default gc |
14:25:47 | Yardanico | well I still don't understand how gc:arc will allow repl to work |
14:25:51 | Yardanico | without any shared libs |
14:26:00 | zacharyc1rter | but it does used shared libraries and trampolines |
14:26:01 | * | leorize[m] joined #nim |
14:26:10 | * | Northstrider[m] joined #nim |
14:26:11 | Yardanico | then what is the difference from hcr? |
14:26:15 | zacharyc1rter | no you will still need shared libraries |
14:26:22 | Yardanico | can't you use hcr with arc |
14:26:37 | FromGitter | <alehander92> hmm |
14:26:39 | zacharyc1rter | I don't know - probably not |
14:26:52 | zacharyc1rter | but I'm using shared libraries for hot code reloading without hcr |
14:26:56 | zacharyc1rter | Nim's hcr rather |
14:27:05 | zacharyc1rter | so a repl should be doable |
14:27:59 | zacharyc1rter | but there are still complexities - like you need to use cstrings which are not Nim strings |
14:28:34 | zacharyc1rter | but that's relatively easy to overcome |
14:28:53 | zacharyc1rter | I'm using this library to do hot reloading - https://github.com/fungos/cr |
14:29:10 | FromDiscord | <clyybber> Yardanico: Any way to not deal with this telegram slowmode thing? |
14:29:34 | Yardanico | @clyybber the only way is to ask dom96 to disable it :P |
14:29:49 | narimiran | slowmode? what do you mean? |
14:29:57 | dom96 | huh? |
14:30:00 | narimiran | you mean that you cannot send multiple message one after the other? |
14:30:03 | FromDiscord | <clyybber> Once you write a message you have a 10 sec cooldown |
14:30:04 | FromDiscord | <clyybber> Yeah |
14:30:11 | FromDiscord | <Rika> that subtitle tho on the xkcd |
14:30:11 | narimiran | i added that because we had some spammy users |
14:30:53 | Yardanico | yeah it's sad there's no 3s or 5s slowmode |
14:31:11 | narimiran | you can edit your message (up arrow on computer) and then add stuff there |
14:31:17 | narimiran | shift+enter for multiline |
14:31:17 | FromDiscord | <clyybber> ah right |
14:32:09 | Yardanico | although with editing other people won't see that the chat has a new message, but I guess that's not an issue when a discussion is ongoing |
14:32:25 | narimiran | that way you can also avoid "* correction" messages - just correct the original one |
14:32:59 | narimiran | people will notice if a message posted < 10 seconds ago was edited ;) |
14:35:34 | zacharyc1rter | is there a good cross platform filewatcher yet for Nim? |
14:36:39 | Yardanico | not with a permissive license ;) |
14:36:54 | zacharyc1rter | I guess I get to write one |
14:37:07 | zacharyc1rter | and it will work on macOS first :P |
14:37:15 | zacharyc1rter | since that's the only OS my game engine works on atm |
14:37:27 | Yardanico | look into https://github.com/snowlt23/nimwatch and fsmonitor from stdlib for some inspiration :P |
14:37:49 | Yardanico | ah right its not in stdlib anymore |
14:37:58 | Yardanico | https://github.com/nim-lang/graveyard/tree/master/fsmonitor |
14:38:02 | Yardanico | such a depressing repo name |
14:38:55 | zacharyc1rter | where projects go to die |
14:39:11 | shashlick | does -d:checkAbi not work in `nim cpp` mode? |
14:39:21 | FromGitter | <Vindaar> zacharyc1rter: feel free to add support for osx here: https://github.com/Vindaar/fsmonitor2 ⏎ Been meaning to do it, but well .. :( |
14:39:47 | shashlick | `/nimbase.h:547:17: error: expected constructor, destructor, or type conversion before ‘(’ token |
14:39:48 | shashlick | _Static_assert(sizeof(typ) == sz, "Nim & C disagree on type size")` |
14:40:42 | zacharyc1rter | Vindaar oh cool - I will do that |
14:41:35 | FromGitter | <Vindaar> I haven't used in in almost a year though, so I hope it didn't break in the meantime. Was working fine for my use case on linux |
14:41:46 | PMunch | Hmm, any reason a non-nil cstring can segfault when converted to a Nim string? |
14:41:54 | PMunch | Not null terminated? |
14:41:55 | zacharyc1rter | I just need to run a sidecar with my game engine for recompiling game code |
14:42:01 | zacharyc1rter | when a game source file changes |
14:42:09 | zacharyc1rter | so I think as long as OSX support is added it should work perfectly file |
14:42:12 | zacharyc1rter | and I can update to work with Nim devel |
14:42:22 | FromGitter | <Vindaar> cool! :) |
14:42:23 | zacharyc1rter | fine not file |
14:48:02 | PMunch | The graveyard, where the cool kids go to smoke and listen to emo music |
14:51:19 | * | Hideki joined #nim |
14:51:43 | * | Hideki is now known as Guest87169 |
14:54:16 | PMunch | Hmm, something funky is up here.. The cstring I should've gotten isn't a pointer to anything I can access. I get a segfault as soon as I try to get the first character.. |
14:54:57 | PMunch | Problem is I can swear that this used to work.. |
14:55:15 | disruptek | ~stream |
14:55:16 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:57:27 | disruptek | rika: you awake? |
14:57:32 | disruptek | !last rika |
14:57:32 | disbot | Rika spoke in 12#nim 27 minutes ago |
14:57:49 | FromDiscord | <clyybber> @Rika forward ping |
14:58:05 | FromDiscord | <Rika> hello |
14:58:13 | FromDiscord | <Rika> am awake yes |
14:58:33 | disruptek | c'mon the stream and explain your gender. |
14:58:47 | FromDiscord | <Rika> why? |
14:58:59 | disruptek | we're talking about you and dunno which pronoun to use. |
14:59:18 | FromDiscord | <Rika> use whatever |
14:59:22 | PMunch | Haha |
14:59:23 | FromDiscord | <Rika> why are you talking about me |
14:59:36 | disruptek | trying to think of folks who are easterly. |
14:59:39 | PMunch | Isn't "they" the sorta accepted non-gendered pronoun? |
14:59:42 | disruptek | further east than yardanico. |
14:59:49 | FromDiscord | <Rika> i am asian |
14:59:56 | FromDiscord | <Rika> just use they or she or he |
15:00:04 | FromDiscord | <Rika> i guess i'm considered gender fluid |
15:00:09 | PMunch | Hmm, can confirm. It works with Nim 1.2.0.. |
15:00:12 | disruptek | "does it ping they?" |
15:00:17 | FromDiscord | <Rika> them |
15:00:18 | PMunch | "them" |
15:00:21 | disruptek | "does it ping they?" |
15:00:38 | FromDiscord | <clyybber> wtf is going on |
15:00:42 | FromDiscord | <Rika> dunno |
15:00:46 | disruptek | i took a shower. |
15:00:47 | FromDiscord | <Rika> installing mumble right now |
15:01:01 | PMunch | disruptek is low on gender fluid, needs to top up |
15:02:13 | FromDiscord | <Rika> hahaha |
15:07:20 | * | Guest87169 quit (Ping timeout: 256 seconds) |
15:08:29 | dom96 | everyone is on a spectrum when it comes to gender |
15:08:40 | FromDiscord | <Danny Fritz> Does Nim HCR work as expected right now? Was reading through the RFC and it seems unclear if it does. |
15:08:41 | * | ftsf_ quit (Ping timeout: 256 seconds) |
15:09:08 | FromDiscord | <Danny Fritz> I guess I should just try it out this evening. XD |
15:09:26 | * | chapl joined #nim |
15:11:29 | FromDiscord | <Rika> dom: i apologize if its annoying |
15:11:52 | dom96 | Rika: You've got nothing to apologise for |
15:12:29 | FromDiscord | <Rika> i know some people are annoyed at it though so eh |
15:14:37 | disruptek | let it be known: |
15:14:40 | disruptek | rika is the shit. |
15:19:01 | FromDiscord | <bedwardly-down> Disruptek, here’s some of my gender fluid in exchange for your nim compiler knowledge in full |
15:19:25 | solitudesf | that doesnt sound right |
15:19:25 | * | Guest23312 quit (Ping timeout: 264 seconds) |
15:19:41 | * | chapl quit (Remote host closed the connection) |
15:19:50 | disruptek | i thought i felt something damp. |
15:20:06 | * | chapl joined #nim |
15:20:08 | FromDiscord | <bedwardly-down> 👀 |
15:22:18 | * | fredrikhr quit (Quit: Client disconnecting) |
15:22:35 | * | couven92 is now known as fredrikhr |
15:24:27 | * | chapl quit (Remote host closed the connection) |
15:24:51 | * | chapl joined #nim |
15:30:09 | FromDiscord | <Rika> "range types need to be constructed with '..', '..<' is not supported" i'd like to know why ..< isnt supported with range |
15:37:06 | FromDiscord | <mratsim> lack of time |
15:37:14 | FromDiscord | <mratsim> (just a guess) |
15:37:51 | narimiran | because Ar4q doesn't like exclusive ranges :) |
15:38:01 | FromDiscord | <Rika> i see |
15:38:11 | FromDiscord | <Rika> thats fine was just wondering |
15:41:58 | * | waleee-cl joined #nim |
15:42:23 | * | dadada joined #nim |
15:42:48 | * | dadada is now known as Guest91059 |
15:54:22 | Araq | it's ...er... surprisingly difficult to do this in today's compiler :P |
15:54:28 | Araq | no personal feelings involved |
15:56:40 | FromDiscord | <bedwardly-down> Nim’s compiler or the others? |
15:56:53 | Yardanico | there's only one compiler for nim as of today ;) |
15:57:02 | Yardanico | you are free to implement another one if you want :D |
15:57:22 | FromDiscord | <bedwardly-down> 🤮 |
15:57:30 | FromDiscord | <bedwardly-down> Not anytime soon |
15:58:29 | FromDiscord | <bedwardly-down> When i said others, i meant c++ and whatnot. I’m still not 100% sure how transpiling works |
15:58:56 | FromDiscord | <Rika> those are backends |
15:58:59 | shashlick | seeking feedback - https://github.com/nimterop/nimterop/issues/202 |
15:59:01 | disbot | ➥ ABI break due to the lack of .importc in struct definitions ; snippet at 12https://play.nim-lang.org/#ix=2kRm |
16:04:01 | * | Senketsu joined #nim |
16:06:29 | * | brainproxy joined #nim |
16:06:30 | FromDiscord | <Dankrad> I've a question regarding to gintro. Does anyone know if one of the following gtk procs are called before my main proc: gtk_init, gtk_init_check, gtk_init_with_args and gtk_parse_args? I'm trying to set the language on windows and it seems that the language has been set (calling setlocale(LC_ALL, nil) retrieves me the currently language I've set previously). I'm also calling disableSetlocale before any of the language relating procs. But my |
16:15:59 | FromDiscord | <Dankrad> But my gui displayes everything in my system language. |
16:17:37 | * | ptdel joined #nim |
16:24:59 | * | Senketsu quit (Quit: WeeChat 2.8) |
16:29:16 | * | tiorock joined #nim |
16:29:16 | * | tiorock quit (Changing host) |
16:29:16 | * | tiorock joined #nim |
16:29:16 | * | rockcavera is now known as Guest57253 |
16:29:16 | * | tiorock is now known as rockcavera |
16:33:11 | * | Guest57253 quit (Ping timeout: 260 seconds) |
16:36:35 | * | tiorock joined #nim |
16:36:35 | * | tiorock quit (Changing host) |
16:36:35 | * | tiorock joined #nim |
16:36:35 | * | rockcavera quit (Killed (beckett.freenode.net (Nickname regained by services))) |
16:36:35 | * | tiorock is now known as rockcavera |
16:37:48 | * | rockcavera quit (Read error: Connection reset by peer) |
16:38:08 | * | rockcavera joined #nim |
16:38:54 | * | Hideki joined #nim |
16:39:16 | * | Dankrad joined #nim |
16:39:17 | * | Hideki is now known as Guest29636 |
16:40:42 | leorize | Dankrad: you should post on the forum, gintro author is more active there |
16:41:26 | shashlick | meh, checkAbi worked fine in my older devel snapshot, now fails on head |
16:42:00 | Dankrad | Thank you for your reply leorize, i'll if i dont get it by myself |
16:42:15 | shashlick | says **`typedef int A13(int, int, void (**func)(void));` != `*A13* = proc (a1: cint; a2: cint; 'func': proc () {.cdecl.}): cint {.cdecl.}` |
16:43:43 | shashlick | wish i had saved my devel hash before updating, now no idea what broke |
16:43:44 | * | Guest29636 quit (Ping timeout: 256 seconds) |
16:46:38 | leorize | shashlick: looks like that's a pointer to a pointer of a function? |
16:48:39 | shashlick | c2nim gives me **`A13** = proc (a1: cint; a2: cint; 'func': proc ()): cint`* |
16:48:46 | shashlick | pretty much the same except the cdecl |
16:49:04 | shashlick | added --cdecl flag and i get the cdecl as well |
16:49:48 | leorize | yea, that one is pointer to pointer for real |
16:51:01 | shashlick | okay bisecting, found a working commit |
16:55:13 | shashlick | yep - @timotheecour fix for checkAbi broke this - https://github.com/nim-lang/Nim/commit/66db9de714be7c2f4cf1f2fb0a0a99145baf6acb |
16:55:46 | * | Guest91059 is now known as dadada |
16:55:51 | leorize | shashlick: uhmmm but that's a wrong typedef for real |
16:55:56 | dadada | hey |
16:56:17 | dadada | oh man, I'm spending the whole day with debugging something that shouldn't be a problem in the first place ... wtf |
16:57:06 | dadada | I copied docopt.nim from its github repository into my own project, made only a few slight changes, that shouldn't hinder it from working like it used to |
16:57:07 | krux02 | dadada: what did you debug on? |
16:57:26 | krux02 | what broke? |
16:57:29 | dadada | and now with the exact same inputs, my version fails, while the original works, my testcases fail, their's work |
16:57:37 | shashlick | @leorize: looks like changing to `(*A13)` gets it working |
16:57:59 | dadada | I diffed the files, and the only changes I made are trivial... made some import changes, merged a util file into the main file |
16:58:13 | shashlick | what should the wrapper look like for **`typedef int A13(int, int, void (**func)(void))`* |
16:58:38 | dadada | and now I wanted to go full gdb debugger ... but sadly the vscode integration doesn't work ... |
16:58:40 | shashlick | gcc doesn't mind that |
16:58:54 | leorize | `type A13 = proc(cint, cint, func: ptr proc() {.cdecl.}) {.cdecl.}` |
16:58:57 | dadada | krux02: it throws an exception, that it shouldn't throw |
16:59:00 | leorize | don't trust gcc, it's C |
16:59:07 | leorize | to it pointers are pointers |
17:00:22 | krux02 | dadada: I really can't help you with vscode, I tried it, but vscode is one of those gdb integrations that want to be visual studio debugger instead. |
17:00:43 | krux02 | ignoring the fact that they are actually using gdb, but faking the behavior of visual studio |
17:01:25 | krux02 | and that does work to some extend, but it makes it incompatible to gdb extensions and other benefits of gdb that you simply can't use at all if you use vscode. |
17:01:49 | krux02 | The only gdb integration that I know about that works correct is as far as I know emacs. |
17:01:58 | krux02 | But it is a super slim gdb wrapper |
17:02:20 | krux02 | you basically have gdb, but with an emacs window displaying everything. |
17:02:27 | dadada | emacs is great, I just don't have the time to tinker with my editor all day :D |
17:02:41 | krux02 | dadada, I don.t do that either nor do I want to. |
17:03:06 | dadada | after 2 weeks of using emacs I started to write my own elisp scripts ... |
17:03:25 | krux02 | emacs is more of a lisp machine environment that runs on other operating systems. And also an editor. And all sorts of other things. |
17:03:28 | dadada | INSTEAD of working of on the code I should work on |
17:03:51 | krux02 | then don't do that. |
17:04:02 | krux02 | but it also isn't wrong to work on tools to help you do your job. |
17:04:15 | krux02 | But emacs is sophisticated in its base version. |
17:04:23 | krux02 | it is just very unconventional. |
17:04:34 | krux02 | And that is annoying. |
17:04:45 | krux02 | And not something that you can just get used to. |
17:04:46 | dadada | spacemacs fixes a lot, but adds alot of complexity too |
17:05:07 | krux02 | Every time you switch an application, you need to remember that your keys work differently. |
17:05:10 | krux02 | Not very pleasing. |
17:05:32 | krux02 | I don.t use spacemacs as I never really liked vim. |
17:05:41 | krux02 | or modal editing |
17:05:56 | krux02 | anyway, using emacs just as a debugger is possible. |
17:06:32 | dadada | okay, I'll think about it, let me see if emacs is still installed |
17:06:46 | dadada | yeah, it's there :D |
17:07:06 | krux02 | set gdb-many-windows to true |
17:07:21 | krux02 | no, customize it to "on" |
17:07:50 | krux02 | M-x gdb will ask you for how you would like to run gdb |
17:08:14 | krux02 | nim-gdb -i=mi --args myprogram arg1 arg2 arg3 ... |
17:08:21 | krux02 | that is what you should enter there |
17:08:27 | krux02 | and then you are good to go |
17:08:30 | dadada | nim-gdb? |
17:08:37 | krux02 | yes nim-gdb |
17:08:43 | dadada | why don't I have that? |
17:08:52 | krux02 | that is the starter script to start gdb |
17:09:15 | dadada | where is that script? |
17:09:24 | * | liblq-dev quit (Quit: WeeChat 2.8) |
17:09:39 | krux02 | I have it in the bin folder of my Nim installation |
17:09:45 | krux02 | (I install from source) |
17:09:55 | dadada | hmm, it's not in my PATH |
17:10:12 | krux02 | is nim in your path? |
17:11:12 | krux02 | it should be in the same directory? |
17:11:21 | dadada | yeah, nim is installed by choosenim |
17:11:27 | krux02 | fuck choosenim |
17:11:34 | disruptek | lol |
17:11:47 | dadada | nim is in .nimble/bin/ |
17:11:53 | dadada | but no nimgdb |
17:12:11 | krux02 | yea, then you should stop using choosenim |
17:12:32 | krux02 | well you can continue to use choosenim |
17:12:43 | krux02 | I don't know what it does, but I never liked it. |
17:12:46 | dadada | wasn't dom96 responsible for choosenim? |
17:12:54 | * | tane quit (Ping timeout: 272 seconds) |
17:13:02 | leorize | dom96 is not really active here nowadays |
17:13:04 | dadada | it was recommended in this channel |
17:13:19 | leorize | and shashlick have his hands filled with tons of projects |
17:13:24 | krux02 | do you gave a nim git repository clone? |
17:13:29 | krux02 | if you have that, it is in there. |
17:13:33 | krux02 | and then it should work |
17:14:30 | krux02 | and then you can file a bug in choosenim that it doesn't provide nim-gdb properly. |
17:15:14 | krux02 | I really dislike choosenim, and my disliking already starts with the name. |
17:15:19 | dadada | you're right, I will file a report |
17:16:25 | krux02 | nim-gdb after all is a bash script that starts gdb in a way, so that the python pretty printers are loaded. |
17:16:43 | krux02 | (python meaning they are implemented in python, not for python or something) |
17:16:52 | dadada | this may be the bug https://github.com/nim-lang/Nim/issues/13104 |
17:16:52 | disbot | ➥ nim-gdb is missing from all released packages |
17:17:58 | krux02 | well then comment that the bug isn't fixed. |
17:18:28 | shashlick | yes that's the bug |
17:20:20 | * | liblq-dev joined #nim |
17:26:49 | dadada | choosenim downloads over 45MB of c sources from github... (building from head with it) |
17:27:20 | dadada | seems excessive? or is that really the size of Nim when it's compiled to C? |
17:27:31 | shashlick | it gets deleted after build is complete |
17:27:33 | federico3 | yep :( |
17:27:53 | shashlick | @leorize: would you be able to test your kmod wrapper with `-f:ast2`? |
17:28:19 | dadada | shashlick: the issue is not disk space, but download time, and download speed, provider caps for some |
17:29:02 | shashlick | choosenim downloads the .xz file which is very small in comparison |
17:29:20 | leorize | dadada: csources is big because it contain c code for all supported os |
17:29:41 | shashlick | if you mean choosenim devel then ya, it downloads a tgz which is bigger |
17:30:02 | dadada | leorize: my hunch is that the real reason is that old versions of the files my be downloaded with the git index |
17:30:15 | dadada | may |
17:30:27 | leorize | nah, it fetches the release tarball from github |
17:30:41 | dadada | 61mb and counting |
17:30:50 | leorize | that thing is 2Gb btw |
17:30:54 | leorize | :) |
17:30:56 | FromDiscord | <mratsim> @dadada, 45MB is really small compared to other lang. Go is 300MB+ and Rust 1GB, Haskell is also a couple hundreds iirc |
17:31:19 | leorize | jk, just around 100+Mb |
17:31:29 | leorize | or is it 1 gig |
17:31:34 | leorize | not sure if I remember |
17:32:51 | leorize | shashlick: I will when I have time, if you want to test it, just verify that the examples compiles and run |
17:32:52 | FromDiscord | <mratsim> Rust is 200MB compressed on Arch actually |
17:34:47 | federico3 | my binary package is 3MB and uses 12MB on disk |
17:36:39 | FromDiscord | <NerdRat> Alo Alo! |
17:37:59 | dadada | httpclient.nim(271) httpError |
17:38:00 | dadada | Error: unhandled exception: Server terminated connection prematurely [ProtocolError] |
17:38:05 | FromDiscord | <NerdRat> Choosenim is nice, I love it. It has some obscure and esoteric errors, that's why I love it! |
17:38:11 | dadada | this is when you want to give up |
17:38:36 | dadada | choosenim should use something like aria2 to not be in trouble when that happens |
17:39:47 | shashlick | @leorize: it works ya |
17:44:08 | FromDiscord | <mratsim> I don't think choosenim reaches the level of nimble errors, especially the dreaded single dot ".". I'll even call that the singularity |
17:44:14 | PMunch | Huh, this is super weird |
17:44:22 | PMunch | So I have a procedure marked with nodecl |
17:44:43 | PMunch | It run just fine, and returns a pointer. But accessing the pointer fails. |
17:44:52 | PMunch | By removing nodecl it works just fine |
17:45:40 | zacharyc1rter | I SEE |
17:45:51 | zacharyc1rter | lol whoops |
17:47:42 | * | Vladar joined #nim |
17:50:07 | FromDiscord | <Recruit_main707> when having multiple threads accesing a variable, is there some kind of special thing you must do? |
17:50:22 | disruptek | nah, just wing it. |
17:51:21 | Yardanico | @Recruit_main707 pray to Nim Gods |
17:51:25 | Yardanico | but really you need to have locks |
17:51:34 | Yardanico | or atomic variables I guess |
17:51:42 | Yardanico | I'm not really into the threading stuff, I only know locks :P |
17:52:00 | * | companion_cube joined #nim |
17:52:03 | Araq | locks are fine, use them |
17:52:03 | FromDiscord | <Recruit_main707> can you briefly explain me locks then? |
17:52:33 | PMunch | Locks are a way to gain exclusive access |
17:53:21 | PMunch | A lock can only be "locked" once, any subsequent lock operation will wait until the lock is open again before getting past |
17:53:38 | liblq-dev | @Recruit_main707, they're available in the locks module |
17:54:18 | PMunch | So if you have two threads that both try to manipulate variable A, but they have lock/unlock around the so-called "critical section" you are guaranteed that only one thread at a time can execute the code in this section at the same time. |
17:54:43 | liblq-dev | Nim has extra support for them, there's the {.guard: someLock.} pragma you can apply to variables and then you use withLock(someLock): |
17:55:09 | liblq-dev | and the compiler will not allow you to modify (?) the variable outside of the withLock template call |
17:55:12 | FromDiscord | <Recruit_main707> makes sense |
17:55:14 | PMunch | Think of it as a way of saying "Hey I'm going to work on this right now, so don't touch anything I'm working on" |
17:55:26 | Yardanico | yeah, common usecase is to use locks for IO for example |
17:55:53 | FromDiscord | <Recruit_main707> that probably fucked up my async client :P |
17:56:01 | liblq-dev | this is actually implemented using the {.locks: [someLock].} pragma which can be used to implement custom locks |
17:56:06 | FromDiscord | <Recruit_main707> multithreaded* |
17:59:02 | PMunch | Hmm, so nodecl does something weird.. |
18:04:21 | dadada | I never really liked any debugger |
18:05:02 | FromDiscord | <12345> just add echo("here"); echo("here1") ... between lines |
18:05:08 | PMunch | Hmm, why would a call with nodecl give me something other than a call without it? |
18:05:28 | dadada | 12345: usually enough, but not always |
18:06:58 | FromDiscord | <12345> oh lel, im recruit let me change my name back, we were testing something |
18:09:32 | cyraxjoe | Hi o/ |
18:10:04 | FromDiscord | <Avatarfighter> Stupid question is there an easy way of converting seq[uint8] to seq[uint]? I'm casting atm but I just wanted to know if there was a better way |
18:11:07 | cyraxjoe | I have basically the same question as in https://www.reddit.com/r/nim/comments/g3kpuz/exportc_javascript_object_method/ not sure if a lot of people already saw that... |
18:11:53 | FromDiscord | <Recruit_main707> Avararfighter, it depends on what you are doing |
18:12:14 | FromDiscord | <Rika> theSeq.mapIt(it.uint) is what i would do lol |
18:13:04 | * | brainproxy quit (Ping timeout: 272 seconds) |
18:13:28 | Yardanico | cyraxjoe: output of JavaScript backend isn't really tailored to be used in other JS code |
18:13:41 | Yardanico | so you'll probably have to deal with JS prototypes and stuff |
18:14:15 | FromDiscord | <Avatarfighter> @Recruit_main707 I need to pass a seq of uint8s as uints from one proc to another |
18:14:40 | FromDiscord | <Recruit_main707> can you show us the code? |
18:14:55 | FromDiscord | <Avatarfighter> its a tiny bit long hence why I was asking :L |
18:15:08 | Yardanico | @Avatarfighter maybe you can just use implicit generics? |
18:15:30 | cyraxjoe | Yardanico: it seems that is good enough with {.exportc.} (at least for vars and procs), but the prototype integration is missing indeed |
18:15:33 | FromDiscord | <Avatarfighter> yeah I'll do that I've been dancing around that @Yardanico |
18:15:40 | FromDiscord | <Recruit_main707> or safely cast whenever you use the uint8 and need them as uints |
18:15:40 | Yardanico | cyraxjoe: well because nim has UFCS and doesn't need it ;) |
18:16:04 | Yardanico | I mean you probably can make it work |
18:16:14 | FromDiscord | <Recruit_main707> for instance: `theSeq[0].uint` |
18:16:14 | * | natrys_ joined #nim |
18:16:30 | * | companion_cube left #nim ("WeeChat 2.3") |
18:16:30 | FromDiscord | <Avatarfighter> yeah I can also do that |
18:16:54 | FromDiscord | <Avatarfighter> I have a few ways of doing what I need but wasn't sure which is best lol |
18:17:08 | Yardanico | implicit generics: https://play.nim-lang.org/#ix=2kUC |
18:17:09 | FromDiscord | <Recruit_main707> i dont know which in is the best either :P |
18:17:20 | Yardanico | i don't know either, nim doesn't have the "best" way always |
18:17:31 | Yardanico | there's the fastest way usually, the most elegant way, the straightforward way |
18:17:37 | Yardanico | sometimes these intersect |
18:17:41 | Yardanico | (which is good) |
18:18:35 | cyraxjoe | Yardanico: I was thinking in the use case of making the "core" in nim and exposing some _clean_ js object, it seems that currently that can be done, but you have to manually couple the type/procs into JsObject/bindMethod (from jsffi) |
18:18:44 | Yardanico | yeah |
18:18:49 | Yardanico | you can make a library to help others :P |
18:18:59 | FromDiscord | <Recruit_main707> i have some homework to do, but after that, i would apreciate some help for transpiling a function from either go/python/js and maybe more options |
18:19:25 | * | natrys quit (Ping timeout: 264 seconds) |
18:19:32 | PMunch | What does N_STDCALL do? |
18:20:01 | Yardanico | __stdcall |
18:20:29 | FromDiscord | <Technisha Circuit> How do i turn a JavaScript object (like a string or an int) into a Nim object? |
18:20:37 | Yardanico | JsObject |
18:20:58 | Yardanico | PMunch: for example https://github.com/nim-lang/nim/blob/master/lib/nimbase.h#L166 |
18:21:02 | Yardanico | search for it in the file |
18:21:16 | FromDiscord | <Technisha Circuit> If I'm using Nim with C? |
18:21:32 | PMunch | Right, but when I do nodecl the only change in my code is that that the call that declares it like that disappears. But it is still able to call the procedure and get a result, but it fails to read from the result. |
18:21:49 | PMunch | But with nodecl the only definition of it should be in the original header file, right? |
18:22:17 | Zevv | Technisha Circuit: ParseJson in the json module |
18:22:28 | PMunch | So why does Nim try to call it with something it was not declared with? Does it somehow force fastcall, even for procs imported from C? |
18:22:32 | Zevv | https://nim-lang.github.io/Nim/json.html#overview-parsing-json |
18:22:50 | FromDiscord | <Recruit_main707> he talks about javascript objects though |
18:22:59 | FromDiscord | <Technisha Circuit> > <Zevv> Technisha Circuit: ParseJson in the json module |
18:22:59 | FromDiscord | <Technisha Circuit> For JavaScript objects? |
18:23:19 | FromDiscord | <Rika> he means to go from JS objects to Nim |
18:23:30 | FromDiscord | <Technisha Circuit> Yeah |
18:23:30 | Zevv | oh right I wasn't reading properly, sorry |
18:23:35 | Zevv | let me shut up now |
18:23:45 | FromDiscord | <Recruit_main707> happens to the best of us :p |
18:23:46 | FromDiscord | <Technisha Circuit> Like a JS string to a Nim string |
18:23:56 | FromDiscord | <Technisha Circuit> Don't worry man/woman/person of no gender |
18:24:37 | Prestige | Hm what is wrong with this? https://play.nim-lang.org/#ix=2kUE |
18:24:47 | Prestige | do I just have to create an empty table then populate it? |
18:25:03 | Zevv | Pmunch: , -> : |
18:25:05 | Zevv | line 6 |
18:25:19 | FromDiscord | <Technisha Circuit> ^^ |
18:25:32 | PMunch | Zevv, what? |
18:25:37 | Zevv | No, Prestige I ment, wrong tab completion |
18:25:41 | PMunch | Haha :P |
18:25:45 | Zevv | P<tab> is usually you |
18:26:00 | Prestige | woops typo |
18:26:23 | Prestige | huh my example works, what's going on in my actual code.. |
18:26:33 | PMunch | I guess I'm flattered Zevv :) |
18:26:51 | PMunch | Well, I'm not sure how your tab complete works, but apparently it's not last message |
18:27:27 | FromDiscord | <Technisha Circuit> Maybe it's most common |
18:28:04 | FromDiscord | <Technisha Circuit> Or if the next char is closer to A |
18:28:37 | Yardanico | it's the next char of course |
18:28:45 | Yardanico | I get PMunch first for P too |
18:29:04 | FromDiscord | <Technisha Circuit> So how would i turn a JavaScript string, int, or float into the Nim equivalent? |
18:29:16 | FromDiscord | <Technisha Circuit> And how about for JavaScript functions too? |
18:29:22 | Prestige | PMunch: You're familiar with x11 Atoms yeah? |
18:29:27 | Yardanico | depends on what you mean @Technisha |
18:29:32 | FromDiscord | <Recruit_main707> from the c backend? |
18:29:34 | Yardanico | i don't understand the context |
18:29:35 | FromDiscord | <Technisha Circuit> Yes |
18:29:43 | Yardanico | json |
18:29:53 | Yardanico | JSON is literally a JS subset |
18:29:58 | Yardanico | for data |
18:30:07 | FromDiscord | <Rika> js functions? |
18:30:12 | FromDiscord | <Rika> you can only call them in nim no? |
18:30:18 | Yardanico | js fuinctions aren't exactly data |
18:30:37 | Yardanico | and you can't call JS functions from C backend unless you embed a JS runtime in your app |
18:30:39 | PMunch | Prestige, yup |
18:30:40 | Yardanico | like duktape |
18:30:56 | PMunch | Well, define "familiar" |
18:31:21 | Prestige | PMunch: Attempting to do this: https://play.nim-lang.org/#ix=2kUJ Getting a strange error on the toTable call |
18:31:23 | FromDiscord | <Technisha Circuit> I want to make a JavaScript module in Nim using the C backend using cffi, but I'd have to convert strings, ints and other data types into the Nim equivalents |
18:31:39 | Prestige | I was thinking it may have to do with the pragma on TAtom but am unsure |
18:31:49 | FromDiscord | <Recruit_main707> remember about the python interop? |
18:31:51 | Yardanico | well @Technisha there should be some kind of API |
18:31:59 | Yardanico | or the JS side manages things itself |
18:32:24 | Prestige | Oh I bet it has something to do with hasing, eh |
18:32:37 | Araq | use '.emit' to gain more control over the JS output |
18:32:48 | FromDiscord | <Technisha Circuit> Okay, thanks |
18:32:53 | Yardanico | Prestige: you have to define hash proc for object types yourself |
18:33:03 | Yardanico | the simplest way is to hash all fields ( |
18:33:07 | PMunch | Prestige, on runtime? |
18:33:27 | Yardanico | wait wat |
18:33:27 | Prestige | just from nimlsp, seemed I was able to compile the file though |
18:33:31 | Yardanico | @Prestige you don't need tables here |
18:33:45 | Yardanico | enums are just integers |
18:33:52 | PMunch | Oh, I have the same thing.. |
18:34:03 | Yardanico | you can just use an array |
18:34:06 | Yardanico | or a sequence |
18:34:20 | PMunch | That is a weird error indeed.. |
18:34:20 | Yardanico | and use enum members as indexes |
18:34:21 | Prestige | I'm going to be accessing the values by name later on |
18:34:29 | Prestige | hmm |
18:34:31 | Prestige | ok |
18:34:49 | Prestige | Good point, thanks Yardanico |
18:35:28 | Prestige | PMunch: when I saw a similar error before, the compilation failed and revealed a more verbose error about hasing |
18:35:34 | PMunch | Seems to be a bug in nimsuggest: http://ix.io/2kUM |
18:35:44 | Prestige | ah, rip |
18:36:40 | FromDiscord | <Technisha Circuit> Is there something like Nimpy but for NodeJS? |
18:36:45 | Yardanico | no |
18:36:57 | Yardanico | what about using https://github.com/node-ffi/node-ffi ? |
18:37:01 | Yardanico | idk |
18:37:02 | FromDiscord | <Rika> node.js is pretty badly supported in nim afaik |
18:37:07 | FromDiscord | <Technisha Circuit> Oof |
18:37:09 | Yardanico | that too |
18:37:13 | Yardanico | nodejs is mainly used for testsuite |
18:37:21 | * | brainproxy joined #nim |
18:37:23 | Prestige | Yardanico: I suppose the only slightly annoying part is, I need to keep the array declaration in the same order as the enums are defined |
18:37:23 | Yardanico | the primary target of nim JS backend is browsers |
18:37:37 | Yardanico | Prestige: I wouldn't call that annoying really :P |
18:37:37 | Zevv | narimiran: "change 'iff' to 'if' to stop "corrections" once and for all", haha |
18:38:29 | PMunch | More minimal example, doesn't seem to have anything to do with X |
18:38:30 | PMunch | http://ix.io/2kUN |
18:39:19 | FromDiscord | <Never Listen To Beef> @mratsim holy shit, my guesses arent always silly guesses?! That scares me that i was right |
18:39:44 | Yardanico | daily reminder: please test your libraries with arc and open issues if they don't work or add it there https://github.com/nim-lang/Nim/wiki/Status-of-gc:arc-and-gc:orc-(library-compatibility) :P |
18:39:51 | Yardanico | just so we can fix all the arc bugs |
18:40:49 | narimiran | Zevv: ;) |
18:40:51 | Prestige | PMunch: I think I have a knack for breaking things |
18:41:09 | PMunch | Prestige, please report this, you can use my minimal example if you want |
18:41:41 | PMunch | Yardanico, ooh, it's that stable now? |
18:41:47 | Prestige | Sure, I'm using your paste though :P |
18:42:03 | Yardanico | PMunch: well I mean a lot of libs work with it |
18:42:30 | Zevv | Yardanico: yay, npeg is at #1 \o/ |
18:42:37 | Yardanico | I reported 5 arc bugs in the last few days :D |
18:42:47 | Yardanico | just was testing stuff out of boredom |
18:42:57 | Zevv | I think Ar4q found 4 AR |
18:43:05 | Zevv | ARC bugs because npeg is in the default test suite |
18:43:11 | Yardanico | nice |
18:43:13 | Zevv | nothing I had to do to fix it :) |
18:44:37 | * | zacharyc1rter quit (Ping timeout: 264 seconds) |
18:45:15 | PMunch | Oh, some of my packages are already there :) |
18:45:20 | Yardanico | yeah I tried nimlsp |
18:45:30 | Yardanico | nimsuggest compiles with arc after adding nosinks but it doesn't actually work |
18:45:37 | Yardanico | shows random strange errors everywhere |
18:45:44 | PMunch | Although all of them in the "A bug or not yet sure" category.. |
18:45:49 | * | zacharycarter quit (Ping timeout: 264 seconds) |
18:45:56 | Yardanico | also parsetoml/persvec use deepCopy which is not available on arc (yet) |
18:46:09 | PMunch | Yardanico, as you can see above it does that even without gc:arc :P |
18:46:31 | PMunch | But wouldn't nimsuggest working pretty much mean that the compiler would be working with gc:arc? |
18:46:41 | Yardanico | well that's the ultimate goal |
18:46:43 | Yardanico | with orc thoughj |
18:46:59 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:48:06 | PMunch | Yeah, isn't orc the better choice? |
18:48:25 | Yardanico | they're different |
18:48:30 | Yardanico | orc is arc with a cycle collector |
18:48:42 | PMunch | Yeah I know |
18:48:46 | PMunch | So isn't it "better" |
18:48:57 | Yardanico | well with arc cycles will just leak I think |
18:49:03 | FromDiscord | <clyybber> it is probably better for nimsuggest 🙂 |
18:49:05 | PMunch | Yeah, which isn't good.. |
18:49:31 | PMunch | Is the penalty of using orc that big? |
18:49:31 | Araq | orc is for applications, arc is for libraries |
18:50:11 | PMunch | Huh, why does this error appear twice? http://ix.io/2kUS |
18:50:13 | FromDiscord | <Rika> so libraries shouldnt have cycles? |
18:50:21 | FromDiscord | <clyybber> Ideally no |
18:50:31 | PMunch | (That error message is from a library for what it's worth..) |
18:50:35 | FromDiscord | <clyybber> If they do, they should best take care of them themselves |
18:50:40 | Araq | Rika: never seen a library here cycles are good design |
18:50:40 | FromDiscord | <clyybber> (if possible of course) |
18:50:44 | Araq | *where |
18:51:01 | FromDiscord | <Rika> guess thats an extra todo for my library |
18:52:00 | FromDiscord | <clyybber> tbf compiler as a library will still have cycles :p |
18:52:03 | PMunch | What does "cursor" mean? |
18:52:39 | FromDiscord | <clyybber> its a reference which doesn't contribute to the refcount. |
18:52:43 | Araq | PMunch, "don't perform RC ops" |
18:52:49 | FromDiscord | <clyybber> Its essentially the same as lent IMO |
19:01:35 | leorize | cursor is unsafe btw :P |
19:03:20 | * | Vladar quit (Quit: Leaving) |
19:08:13 | Araq | leorize, well in debug mode we can add a second RC field to make it safe |
19:08:43 | * | chapl quit (Quit: Leaving) |
19:11:23 | * | lritter quit (Ping timeout: 260 seconds) |
19:20:53 | * | chapl joined #nim |
19:21:31 | chapl | disruptek: irssi ftw. :P |
19:21:51 | * | NimBot joined #nim |
19:31:21 | disruptek | say goodnight, gracie |
19:36:41 | * | natrys_ quit (Quit: natrys_) |
19:36:58 | * | natrys joined #nim |
19:37:52 | * | Hideki joined #nim |
19:38:15 | * | Hideki is now known as Guest5886 |
19:39:51 | * | idf quit (Ping timeout: 260 seconds) |
19:42:49 | * | Guest5886 quit (Ping timeout: 264 seconds) |
19:44:18 | * | letto quit (Read error: Connection reset by peer) |
19:45:19 | * | letto joined #nim |
20:04:48 | * | tane joined #nim |
20:06:33 | disruptek | Yardanico: same time every year. |
20:08:28 | FromDiscord | <Yardanico> That's a good answer |
20:11:23 | * | thomasross quit (Read error: Connection reset by peer) |
20:11:53 | * | thomasross joined #nim |
20:20:11 | * | PMunch quit (Quit: leaving) |
20:21:14 | dom96 | dadada, please do report choosenim problems you're having on github |
20:22:49 | dom96 | mratsim: I don't get the hate for the dots output by Nimble. |
20:24:44 | dadada | dom96: I did report it... |
20:25:44 | dom96 | I don't see any new choosenim bug reports |
20:34:46 | * | filcuc joined #nim |
20:35:13 | FromGitter | <Vindaar> @dom96 pretty sure mratsim is referring to these kind of errors: https://github.com/nim-lang/nimble/issues/756 |
20:35:16 | disbot | ➥ Very poor error messages when evaluating .nimble files ; snippet at 12https://play.nim-lang.org/#ix=2kVC |
20:37:43 | * | zacharycarter joined #nim |
20:37:46 | * | zacharyc1rter joined #nim |
20:38:43 | dom96 | oh, i think you're right |
20:39:10 | * | filcuc quit (Ping timeout: 246 seconds) |
20:39:25 | chapl | "/Users/dom/projects/nim/lib/pure/streams.nim(274, 9) Error: undeclared identifier: 'copyMem'" ?? |
20:39:43 | dom96 | That's a really silly thing to criticise to be honest :P |
20:40:17 | dom96 | I spent time to make a custom error message to explain that Nimble is attempting to read the .nimble file as an ini file and a nimscript file |
20:40:24 | dom96 | You cannot get clearer than that |
20:40:31 | FromDiscord | <exelotl> woww I found an ancient copy of Nim on my external hard drive |
20:40:31 | FromDiscord | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/707330912697843763/unknown.png |
20:40:44 | FromDiscord | <Yardanico> Wow |
20:41:08 | FromDiscord | <Rika> nice |
20:41:11 | FromDiscord | <Yardanico> Well tbf you can get the same |
20:41:12 | FromGitter | <awr1> doing this PR - is the next version of the lang supposed to be 1.4 or 1.3? |
20:41:21 | FromDiscord | <exelotl> this was back when I was making games in `ooc` which was another language that compiles to C |
20:41:22 | leorize | 1.4 |
20:41:29 | FromDiscord | <Yardanico> Nim repo has commits since 2008 |
20:41:38 | FromDiscord | <Yardanico> @awr1 you should use since 1.3.1 |
20:41:43 | dom96 | exelotl: hah, I've had friends that used ooc |
20:42:02 | FromGitter | <awr1> i'm writing up `since` annotations, should i use `.since: (1,4)`? |
20:42:11 | FromDiscord | <Yardanico> 1.3.1 I think |
20:42:21 | FromDiscord | <Yardanico> You should account for devel version |
20:42:23 | FromGitter | <awr1> oh okay |
20:42:29 | leorize | awr1: write `since: (1, 3)` |
20:42:54 | FromDiscord | <Yardanico> (1, 3, 1) will work |
20:43:27 | dom96 | exelotl: I even wrote up a gist a while ago outlining why I prefer Nim :P |
20:43:32 | dom96 | Cannot find it though |
20:43:58 | dom96 | I should have said "friends that used and contributed to ooc" |
20:44:06 | FromDiscord | <Yardanico> See https://github.com/nim-lang/Nim/pull/14197#discussion_r419789724 |
20:44:07 | disbot | ➥ Make the fields of `times.DateTime` private |
20:44:41 | dom96 | honestly, to me (1, 3) doesn't make sense |
20:44:53 | dom96 | it should be (1, 4) |
20:45:04 | FromDiscord | <clyybber> odd is #devel |
20:45:13 | narimiran | if you ask about `since`, use `(1, 3)` |
20:45:28 | FromDiscord | <clyybber> and you wouldn't want to exclude the users who use #devel from features being introduced in #devel :p |
20:46:22 | FromDiscord | <exelotl> at the time I totally bounced off Nimrod, it mainly cause of the docs and the way that so much stuff is named differently compared to C-like languages |
20:46:36 | dom96 | the only use that the since annotations have to me are to let me know which version procs have been introduced in |
20:46:43 | dom96 | in that sense odd versions make no sense |
20:46:46 | dom96 | since they are never released |
20:47:02 | FromDiscord | <Yardanico> Well they are still used between releases in devel |
20:47:59 | FromDiscord | <Yardanico> And since actually disables features if your version is lower than specified |
20:48:12 | dom96 | I find that use case silly |
20:51:57 | * | Jesin quit (Quit: Leaving) |
20:53:42 | * | narimiran quit (Ping timeout: 260 seconds) |
20:54:47 | FromGitter | <awr1> you know i'm looking at bitops again and i don't get it, there are all these masking operations but no one that maps directly to `and` which is really... "the masking op" |
20:55:02 | FromGitter | <awr1> `setMask` actually is just an `or` which is weird |
20:56:05 | FromGitter | <awr1> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/bitops.nim#L73 |
20:58:12 | FromGitter | <awr1> i will have to improve this API a bit |
20:59:20 | * | kayabaNerve quit (Remote host closed the connection) |
21:03:56 | * | Jesin joined #nim |
21:09:58 | liblq-dev | how should I name an "unsafe" leaked implementation detail procedure? |
21:10:09 | FromDiscord | <Rika> leaked? |
21:10:36 | FromGitter | <nothratal> can someone explain me how timezones in nim are working? ⏎ ⏎ ```2020-04-27T00:00:00+02:00==>1587938400 ⏎ 2020-04-28T02:00:00+02:00==>1588032000``` ⏎ ⏎ I expected that the first line contains the timezone but not the second one. Instead both have the timezone and the second line also has +2 hours [https://gitter.im/nim-lang/Nim?at=5eb1d64c7a24ff01b0031f44] |
21:10:39 | liblq-dev | yes, leaked. because it should be private but can't |
21:11:04 | liblq-dev | I was thinking about prefixing it with IMPL_ |
21:11:07 | FromDiscord | <Rika> you cant??? |
21:11:16 | liblq-dev | no, because it's used in another module |
21:11:20 | FromDiscord | <Rika> export except not working? |
21:11:40 | liblq-dev | I have one module which is an abstract interface and then modules that use the interface |
21:12:37 | FromDiscord | <Rika> then the exporter file cant except the interface? |
21:12:53 | FromDiscord | <Rika> i usually have a file that exports everything needed or so |
21:14:24 | liblq-dev | I don't have such an exporter file, it would hurt documentation |
21:15:50 | FromGitter | <kaushalmodi> @nothratal By default the time will always be converted to your local time zone |
21:16:02 | FromGitter | <kaushalmodi> looking at that output, your local time zone is probably +2:00 |
21:16:27 | * | sagax quit (Ping timeout: 260 seconds) |
21:16:48 | FromGitter | <kaushalmodi> You will need `inZone` to get the time from the perspective of a different zone |
21:17:28 | FromGitter | <kaushalmodi> Copying @GULPF as he's the expert in this field (I forget the difference between the "time zone" and "time offset") |
21:18:05 | FromGitter | <nothratal> I read that in the documentation, yes +2:00 is correct |
21:18:06 | FromGitter | <nothratal> but |
21:18:48 | FromGitter | <nothratal> why do I have a time difference? I changed "+02:00" to "+00:00" |
21:19:40 | FromGitter | <nothratal> this should only affect the time zone displayed but not the time itself |
21:19:44 | FromGitter | <kaushalmodi> someone can correct me here.. but what your code essentially did is "hey, here's this time in +00:00 time offset, what's the effective time in my local timezone" |
21:20:26 | FromGitter | <kaushalmodi> that code keeps the time absolute based on the time offset you provided |
21:20:43 | FromGitter | <kaushalmodi> it just printed the corresponding time in your time zone |
21:20:58 | FromGitter | <nothratal> ahhhh ok, that could make sense |
21:21:36 | FromDiscord | <Rika> wait |
21:21:42 | FromDiscord | <Rika> let me understand your code first |
21:22:31 | FromGitter | <Bennyelg> do we have builtin function in nim which convert camelCase to snake_case ? |
21:22:37 | FromDiscord | <Avatarfighter> dang I love js as a language but porting js -> nim is the biggest hassle I've ever had because I can't tell what size the ints are :L |
21:22:48 | FromDiscord | <Rika> https://nim-lang.org/docs/times.html#parse%2Cstring%2CTimeFormat%2CTimezone%2CDateTimeLocale @nothratal |
21:23:06 | FromDiscord | <Rika> default for `zone` is `local()` |
21:23:10 | FromDiscord | <Rika> you can assume what these mean |
21:23:42 | FromDiscord | <Rika> ah yes, js, the language where integers dont exist |
21:24:09 | FromDiscord | <Avatarfighter> its not that they don't exist its that they morph to different sizes lmao |
21:24:28 | leorize | Avatarfighter: if you want a constant size, use a sized int lol |
21:25:02 | FromDiscord | <Avatarfighter> leorize: lmao I wish it was that easy |
21:25:03 | FromDiscord | <Rika> @Avatarfighter but afaik most js implementations do not store numbers as ints at all, theyre all floats |
21:25:33 | leorize | Avatarfighter: what's the problem then? |
21:25:40 | FromDiscord | <Avatarfighter> I converted some bitwise operations from js to nim directly and the outputs aren't exciting lmao |
21:26:24 | leorize | well you probably did something wrong :P |
21:27:21 | FromGitter | <Bennyelg> Why del not working from request.params as its : Table[string, string] ⏎ requestParams.del["key1"] |
21:27:46 | leorize | because that's not the syntax :) |
21:28:02 | leorize | use `()`, not `[]` |
21:28:06 | FromGitter | <Bennyelg> tried |
21:28:06 | leorize | del is a procedure |
21:28:09 | FromGitter | <Bennyelg> not working |
21:28:27 | leorize | !eval import tables; var t: Table[string, string]; t.del "hi" |
21:28:30 | NimBot | <no output> |
21:28:37 | leorize | seems to work just fine here |
21:28:43 | FromGitter | <Bennyelg> (https://files.gitter.im/nim-lang/Nim/QMRp/image.png) |
21:28:58 | FromDiscord | <Avatarfighter> leorize: I always do something wrong its my style 😛 here is where I'm having fun https://hastebin.com/mowiwapoje.makefile I made a custom operator for "^=" xor assignment |
21:29:46 | FromDiscord | <Avatarfighter> I know what the issue is though its the same as last night, I gave one of the variables the wrong size |
21:29:58 | leorize | :P |
21:30:08 | leorize | make sure your constants are typed |
21:30:11 | leorize | ie. 0u8 or 0u32 |
21:30:36 | FromDiscord | <Avatarfighter> wym constants I don't think I have any 😛 |
21:30:43 | leorize | Bennyelg: try compiling it |
21:31:06 | leorize | sometimes the linter can be weird |
21:31:27 | leorize | Bennyelg: actually I think I know your problem |
21:31:30 | FromGitter | <Bennyelg> no no it didnt work maybe because something related to const |
21:31:34 | leorize | !eval import tables; let t: Table[string, string]; t.del "hi" |
21:31:37 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: 'let' symbol requires an initialization |
21:31:38 | FromGitter | <Bennyelg> I saved it in different variiable and it works |
21:31:50 | leorize | yea, Table is a value type |
21:32:18 | FromGitter | <Bennyelg> I mean : I got request.params and it probably can't modified |
21:32:36 | leorize | https://nim-lang.org/docs/manual.html#procedures-var-parameters |
21:32:45 | * | tane quit (Quit: Leaving) |
21:33:18 | FromGitter | <Bennyelg> do we have something which snake_case string? |
21:33:44 | leorize | ? |
21:33:50 | FromDiscord | <Rika> ? |
21:34:39 | FromGitter | <Bennyelg> Nvm I'll write a new proc |
21:34:57 | FromDiscord | <Avatarfighter> I'm actually so hyped for when I'm done with this lmao nim is about to get the sketchiest crypto it has ever seen 😛 |
21:35:14 | * | ehmry quit (Remote host closed the connection) |
21:36:32 | * | ehmry joined #nim |
21:37:07 | FromGitter | <kaushalmodi> @nothratal I am not sure if this helps or confuses more, but I quickly extracted this from a different project of mine: https://play.nim-lang.org/#ix=2kVW |
21:37:28 | dadada | staticExec isn't calling a shell to call commands, is it? |
21:37:42 | dadada | cause that would be very handy right now |
21:38:05 | leorize | dadada: it's calling a shell |
21:38:35 | dadada | ooh, nice, should be documented in https://nim-lang.org/docs/system.html#staticExec%2Cstring%2Cstring%2Cstring |
21:39:12 | leorize | I think it's kinda common knowledge that any call that takes only a string will use the shell |
21:40:19 | dadada | put yourself into a beginners mind, maybe it's common knowledge for you and your friends |
21:40:35 | dadada | I assumed it could use a shell, but wasn't 100% sure, so I asked |
21:41:05 | dadada | documentation needs to be written in a way that somebody new to programming can catch up to that common knowledfge |
21:41:08 | dadada | knowledge |
21:42:07 | * | solitudesf quit (Ping timeout: 260 seconds) |
21:42:09 | leorize | was just stating my opinion :P |
21:43:12 | FromDiscord | <Rika> does `object of` (note, no ref) only copy the fields from the base? |
21:43:20 | FromDiscord | <Rika> or does it do something else |
21:43:37 | leorize | it makes a new object type that's inherited from the base |
21:43:56 | leorize | this mean it carry with it some RTTI |
21:44:18 | FromDiscord | <Rika> is there a way to make 2 objects where one also takes the fields of the other and nothing else? |
21:44:28 | FromDiscord | <Rika> or must i make a pragma |
21:44:31 | leorize | wdym? |
21:44:44 | leorize | distinct object? |
21:44:47 | FromDiscord | <Rika> no |
21:44:57 | FromDiscord | <Rika> i want the other object to have its own unique fields too |
21:45:08 | leorize | then inheritance? |
21:45:11 | FromDiscord | <Rika> no |
21:45:14 | FromDiscord | <Rika> i dont need that |
21:45:29 | FromDiscord | <Rika> i legitimately only need it to copy the fields |
21:45:34 | leorize | then no you have to copy the fields |
21:45:47 | leorize | I can't imagine a situation where you would need to do this though |
21:46:21 | FromDiscord | <Rika> i want to make an object that i can use `json.to` with and another that's the main type |
21:46:45 | FromDiscord | <Rika> (very lazy, yes) |
21:47:19 | leorize | that is hacky as hell |
21:47:29 | leorize | treat your data structure with some respect :p |
21:47:34 | FromDiscord | <Rika> naw |
21:47:57 | leorize | why would there be two types with the same fields but one has a bit more? |
21:48:03 | FromDiscord | <Rika> maybe i can write a template w/ typeInstance.fields |
21:48:14 | FromDiscord | <Rika> because one of its fields cannot be serialized in json |
21:48:16 | FromDiscord | <Yardanico> Guess I'll try to run Nim on https://wiki.kolibrios.org/wiki/Main_Page tomorrow , it has GCC and it's own libc (that OS is mostly written in assembly) |
21:48:22 | FromDiscord | <Yardanico> Really cool small thing |
21:48:31 | FromDiscord | <Yardanico> --os:any ftw :D |
21:48:39 | leorize | Rika: then write your own `%` for it? |
21:49:03 | FromDiscord | <Rika> leorize: you think theres a sensible way to serialize a DbConn |
21:49:50 | leorize | write a `%` for the object type itself |
21:49:52 | FromDiscord | <Yardanico> Isn't there no runtime impact if you use inheritance with ordinary procs |
21:49:56 | leorize | then ignore the DbConn field |
21:49:59 | FromDiscord | <Yardanico> Without methods |
21:50:56 | leorize | Yardanico: he seems to want a way to partially serialize a data structure into json |
21:51:37 | FromDiscord | <Rika> no, deserialize actually |
21:52:12 | leorize | a custom overload for `.to`? |
21:52:40 | FromDiscord | <Yardanico> @leorize well I'm asking generally :) |
21:52:42 | leorize | signature should be: `proc to(json: JsonNode, yourType: typedesc[YourType]): YourType` |
21:53:05 | leorize | Yardanico: yea, afaik the rtti overhead only incur when you use methods |
21:53:18 | leorize | or when you use things that need it, like `of` |
21:53:44 | FromDiscord | <Rika> leorize: found what i must overload, `initFromJson` is what i must overload it seems |
21:54:10 | FromDiscord | <Rika> will overload them now |
21:54:14 | * | zacharyc1rter quit (Ping timeout: 240 seconds) |
21:54:44 | * | zacharycarter quit (Ping timeout: 272 seconds) |
21:56:49 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:59:58 | FromDiscord | <Recruit_main707> i am experimenting with threads, and i have this code here, but when it finishes, nothing its printed, why? https://play.nim-lang.org/#ix=2kW2 |
22:02:16 | FromDiscord | <clyybber> Recruit_main707: Because you commented out the print? |
22:02:39 | FromDiscord | <Recruit_main707> im not stupid, i mean at the end |
22:02:48 | FromDiscord | <clyybber> kk |
22:03:59 | FromDiscord | <clyybber> works for me |
22:04:26 | FromDiscord | <Recruit_main707> hmmm |
22:04:32 | FromDiscord | <clyybber> are you on windows? |
22:04:37 | FromDiscord | <Recruit_main707> ye |
22:04:45 | FromDiscord | <clyybber> where are you running it from? |
22:04:58 | FromDiscord | <Recruit_main707> terminal |
22:05:42 | FromDiscord | <clyybber> but you see the "done" being printed? |
22:05:53 | FromDiscord | <Recruit_main707> no, nothing at all |
22:06:15 | FromDiscord | <clyybber> thats weird |
22:06:44 | FromDiscord | <clyybber> try powershell maybe |
22:07:27 | FromDiscord | <Recruit_main707> neither... |
22:07:47 | FromDiscord | <clyybber> try nim r yourfile.nim |
22:15:43 | * | avatarfighter joined #nim |
22:15:45 | * | zacharyc1rter joined #nim |
22:15:45 | * | zacharycarter joined #nim |
22:24:08 | * | covidian joined #nim |
22:27:55 | FromDiscord | <Recruit_main707> i dont understand, why does counting up to x take longer with multiple threads |
22:29:04 | stefantalpalaru | I think getTotalMem() and getOccupiedMem() are lying to me. They claim a few MiB are used, while dumpHeapInstances() reports hundreds of MiB in the GC-managed heap. |
22:31:04 | leorize | Recruit_main707: because threads have a huge overhead |
22:31:19 | * | natrys quit (Quit: natrys) |
22:31:34 | dadada | oh, I hate it when I hit on something that may be a Nim bug :-( It's so much nicer when the fault is mine |
22:32:23 | leorize | stefantalpalaru: I think those numbers are the amount of GC owned memory that's used |
22:32:34 | FromDiscord | <Recruit_main707> leorize: then threads are only worth it (for performance reasons) when single thread cant keep up? |
22:33:16 | leorize | threads only worth their performance cost when you can max out all of them |
22:33:39 | leorize | this is because you aren't the only person spawning threads on your system |
22:33:40 | FromDiscord | <Recruit_main707> that sounds a bit abstract :p |
22:34:21 | leorize | if your threads don't take a large amount of computing power to function, then the OS will schedule other threads that need it first |
22:35:11 | FromDiscord | <Recruit_main707> So, threads are basically more useful the more you need them? |
22:35:14 | dadada | is there a way to tell the parser that code generated by a macro is valid? |
22:35:28 | dadada | Nim complains about something being wrong, that's clearly right |
22:35:42 | dadada | and I'd like to preemptively tell it that it needs to shut it |
22:35:45 | leorize | dadada: if the compiler complains that it's wrong, it's wrong |
22:35:59 | dadada | leorize: no, it's not always, Nim has bugs |
22:35:59 | leorize | don't use `repr` to print out your macro result |
22:36:04 | leorize | use `treeRepr` |
22:36:24 | leorize | the AST on the other hand is pretty solid |
22:36:40 | leorize | invalid AST will trip the compiler, but valid AST will always pass |
22:36:47 | FromDiscord | <Recruit_main707> macros are hard, it’s rather unlikely you found a compiler bug :) |
22:37:29 | dadada | leorize: it's complaining about code that definitely should work, in this case I'm certain |
22:37:38 | leorize | well can I see the code? |
22:37:38 | skrylar[m] | i think i've given up hope of ever using the nim forums. poked password reset again and it sends the email, says it changed the pw, then login says "invalid." and its been like this for like .. two years now, people just say ping dom, and then he never does anything. and it stays broken. *hops down pot of coffee in shrugs* |
22:38:14 | leorize | dom96: ^ |
22:38:22 | leorize | you really need to fix nimforum, dom |
22:39:13 | FromDiscord | <Recruit_main707> I’ll @ him on discord, he has been active over here recently @dom96 ^ |
22:39:34 | FromDiscord | <Rika> dadada: can we have code then, im interested in fixing it |
22:41:23 | dadada | leorize: https://pastebin.com/UaYvLHuz |
22:41:32 | dadada | I used treeRepr, because you forbade repr |
22:41:39 | dadada | with repr it was even clearer |
22:41:47 | dadada | basically I generate a simple test proc |
22:42:04 | leorize | yea it's wrong :) |
22:42:09 | dadada | (which in my actual code is just a transformation from a real proc that I take in with a macro in the stmtlist) |
22:42:17 | dadada | the proc returns bool |
22:42:33 | FromDiscord | <Recruit_main707> I didn’t specify that |
22:42:35 | dadada | so the infix a == b should be no problem |
22:42:41 | FromDiscord | <clyybber> > threads are basically more useful the more you need them? |
22:42:41 | FromDiscord | <clyybber> Goes for everything in life :p |
22:42:48 | leorize | I really hate nnkStmtList for this |
22:42:57 | leorize | sometimes it work as an expression, sometimes it doesn't :P |
22:43:33 | dadada | 1) written by hand it works |
22:43:37 | dadada | 2) written by macro it doesn't |
22:43:42 | dadada | 3) ??? wtf |
22:44:02 | FromDiscord | <clyybber> nnkStmtListExpr is what you want |
22:44:06 | leorize | I think you need nnkStmtExpr for this |
22:44:12 | leorize | ah yea nnkStmtListExpr |
22:44:24 | dadada | why are there two and not one that JUST WORKS |
22:44:29 | leorize | though shouldn't the compiler take care of this if the output is untyped? |
22:44:34 | FromDiscord | <clyybber> because legacy |
22:44:45 | leorize | I hate the compiler for that too |
22:44:55 | FromDiscord | <Recruit_main707> Bc one is an expression I guess :P |
22:45:23 | leorize | in the right context nnkStmtList can be an expression :) |
22:45:26 | leorize | how fun |
22:46:50 | FromDiscord | <Recruit_main707> Nevertheless, despite this being wonky, if you want it as an expression you should use the one for expression, if not, the other one, that avoids confusing the compiler |
22:46:58 | * | Amabella joined #nim |
22:47:19 | leorize | it's a PITA when you are transforming things though |
22:47:29 | leorize | lemme try to make a reproduction code |
22:47:35 | FromDiscord | <Recruit_main707> (But that should be fixed) and if you ask me, just don’t let nnkStmtList be an expression |
22:47:46 | leorize | usually an untyped output should have the compiler fix all of these issues |
22:47:53 | leorize | so I'm kinda surprised actually |
22:48:05 | dadada | https://github.com/oilshell/oil/issues/740#issuecomment-624259000 |
22:48:10 | dadada | help me dispell this guys myths |
22:48:42 | dadada | he would make the right choice by selecting Nim and believes in a few wrong "issues" that aren't really issues |
22:48:53 | dadada | I think he confuses Nim with a transpiler |
22:49:07 | dadada | and don't tell him about the Nim bugs :-) |
22:49:14 | * | Amabella quit (Client Quit) |
22:49:19 | skrylar[m] | nim is a transpiler |
22:49:35 | FromDiscord | <Rika> i dont see him mention it |
22:50:03 | dadada | no, but I think it's implicit, Vala doesn't hold a candle to Nim |
22:50:17 | leorize | dadada: ok now you got a problem |
22:50:22 | leorize | I can't reproduce it |
22:50:31 | skrylar[m] | vala does a fine job if you want a C# that is welded to GObject and you have no aspirations of ever supporting windows or mac |
22:50:32 | dadada | leorize: what did you do? |
22:51:09 | FromDiscord | <Never Listen To Beef> I dont even know what this guy's point is |
22:51:14 | FromDiscord | <Recruit_main707> skylar, I think it’s not, a transpire would grab nim code and spit it’s c clone, but nim optimizes it, that’s why I consider it compiler |
22:51:23 | leorize | dadada: generated that exact AST https://play.nim-lang.org/#ix=2kWh |
22:51:37 | skrylar[m] | people consider a transpiler anything that doesn't ultimately emit a binary |
22:51:43 | skrylar[m] | it outputs c, so its a transpiler |
22:51:46 | leorize | Recruit_main707: the idea of a transpiler is stupid anyway |
22:51:55 | skrylar[m] | haxe also (attempts to) optimize, but it ultimately doesn't make exe's |
22:52:02 | leorize | you can say gcc is a transpiler and you wouldn't be wrong |
22:52:08 | leorize | gcc don't make exe either |
22:52:13 | FromDiscord | <Recruit_main707> > <skrylar[m]> it outputs c, so its a transpiler |
22:52:13 | FromDiscord | <Recruit_main707> Ppl is sometimes dumb though :) |
22:52:18 | FromDiscord | <Rika> dadada: imo thats a minor detail, the vala thing |
22:52:25 | FromDiscord | <Rika> he's not against the idea |
22:52:27 | skrylar[m] | anyway i dunno why having readable C matters in this case, but eh |
22:52:44 | leorize | people be like: it outputs C, so it has to write C for me |
22:52:45 | skrylar[m] | eys not upset at outputting C, ey's upset that the output C looks godawful |
22:52:46 | FromDiscord | <Rika> tbh, i'd be against the idea of switching language after ive already translated part of it in the language i chose |
22:52:54 | leorize | we should stop advertising outputting C |
22:53:12 | FromDiscord | <Never Listen To Beef> I mean if im not writting asm am i even writting code? |
22:53:14 | dadada | skrylar[m]: transpilers to me are things like coffeescript, I'd like to have different terminology for different things, to me a transpiler makes a 1:1 translation, and a compiler uses the target simply as a means to an end, and not the end |
22:53:16 | skrylar[m] | V claims readable C output but it looks just as horrible |
22:53:46 | dadada | skrylar[m]: even if I were to agree with you, what different name for a coffeescript like thingy would you then choose? |
22:54:14 | skrylar[m] | ¯\_(ツ)_/¯ i dun really need you to agree with me. that's just what people call the things |
22:54:22 | FromDiscord | <Rika> i dont believe transpilation is a word at all |
22:54:32 | FromDiscord | <Never Listen To Beef> I dont think it really matters |
22:54:35 | FromDiscord | <Never Listen To Beef> 😛 |
22:54:51 | skrylar[m] | i would just call it a meta-language if its whole point is to let you write some other language easier |
22:55:01 | skrylar[m] | which is what coffeescript and icedcoffeescript are for |
22:55:10 | FromDiscord | <Rika> thats almost like calling translating a dialect into its "ancestor" not translation |
22:55:10 | FromDiscord | <Rika> imo |
22:55:13 | FromDiscord | <Never Listen To Beef> If you complain about something transpiling vs compiling, shouldnt you complain about writting C instead of asm? |
22:55:19 | FromDiscord | <Joshua S. Grant> The hype around V (even the amount of stars it has) blows my mind tbh |
22:55:34 | FromDiscord | <Rika> @Joshua S. Grant its just really good advertisment |
22:55:40 | FromDiscord | <Rika> which nim doesnt really do |
22:55:56 | skrylar[m] | well V is teeeensy and fast, like Go tried to be |
22:56:12 | FromDiscord | <Never Listen To Beef> Like to my uneducated brain compiling C results in the same issue of converting from C to asm, unless im dead wrong? |
22:56:36 | FromDiscord | <Recruit_main707> But it’s optimized Sam |
22:56:42 | skrylar[m] | it also sounds like they want nice stacktraces |
22:56:51 | FromDiscord | <Joshua S. Grant> Kinda sad that http://libcello.org/ never took off in this space :^P |
22:57:14 | FromDiscord | <Recruit_main707> > which nim doesnt really do |
22:57:15 | FromDiscord | <Recruit_main707> We are doing smart propaganda with memes though :p |
22:57:23 | skrylar[m] | beef is tempting but good god anything llvm based is a nightmare |
22:58:17 | * | Dankrad quit (Quit: WeeChat 1.9.1) |
22:58:30 | * | covidian is now known as ii |
22:58:31 | FromDiscord | <Rika> whats so bad about llvm |
22:58:31 | * | ii is now known as covidian |
22:58:45 | FromDiscord | <Joshua S. Grant> @Recruit_main707 Worked for Rust (or at least, made it more known) as-long as we don't get a reputation of "the annoying RIIR" crowd from other communities I'm fine with it / think it's overall a good-thing, yeah. |
23:00:18 | skrylar[m] | @Rika well in beefs case it got spotlit by a big youtube channel so people flooded in, but the sole dev is a windozer so none of the advertised nix stuff even works |
23:00:27 | FromDiscord | <Recruit_main707> I’m already the nim boi of the server, the memes are another way to torture them |
23:00:32 | skrylar[m] | so you have to build this monsterous llvm checkout which takes hours |
23:00:52 | FromDiscord | <Joshua S. Grant> What is the excitement for a llvm based Nim; That it's an already thriving ecosystem / near-standard at this point and there's no real maintance costs besides your own stack? |
23:00:54 | skrylar[m] | and then it uses an older version, so look forward to a long heave of an updateat some point |
23:01:47 | skrylar[m] | something amuses me about how fossil and v almost fit on a floppy but yet are almost an entire devstack |
23:02:46 | leorize | Joshua S. Grant: better debugger integration |
23:03:34 | FromDiscord | <Joshua S. Grant> I've guess I just haven't seen it -- but I assume it would be "as competent" as source-to-source compilation / transpiling? |
23:03:53 | FromDiscord | <Joshua S. Grant> Like you could still Nim -> LLVM -> C++ |
23:03:55 | FromDiscord | <Joshua S. Grant> ? |
23:04:03 | * | liblq-dev quit (Quit: WeeChat 2.8) |
23:04:10 | FromDiscord | <Recruit_main707> llvm is as promising as Vulkan in graphics, it’s definitely the way, but they still don’t offer something that big for people to massively use them and abandon what we have (imho) |
23:04:31 | skrylar[m] | eeh when you are tied in to the code generator you can get away with more silly low level stuff, whereas transpiling to c means it has t ofit in whatever c wants you to do |
23:04:51 | skrylar[m] | this problem came up with chicken scheme where a lot of engineering went in to conning C to let you do things Scheme allows but C doesn't, like their crazy continuation bullshit |
23:04:57 | FromDiscord | <Joshua S. Grant> @Recruit_main707 So the argument is the 'architecture is better' but it's not so-much-so that it's worth throwing everything away for it? |
23:05:19 | FromDiscord | <Recruit_main707> That’s more or less how I see it |
23:05:47 | FromDiscord | <Joshua S. Grant> "cons-ing C" * lol |
23:06:08 | FromDiscord | <Never Listen To Beef> @Recruit_main707 steam did branch mesa to include ACO over LLVM for vulkan to increase performance of game. I dont know the context of your comment though |
23:06:15 | skrylar[m] | i dont tend to use debuggers anyway so :f |
23:06:25 | FromDiscord | <Joshua S. Grant> Think that was already a pun anyways (scheme x conning) but still; Need to double up! |
23:06:46 | FromDiscord | <Recruit_main707> Anyway gn all |
23:06:52 | FromDiscord | <Joshua S. Grant> Oh, peace Recruit |
23:07:28 | skrylar[m] | i did spend a few moments thinking about how one could have abusive fun with a wasm backend |
23:07:35 | skrylar[m] | and looking at how one might HCR wasm |
23:08:13 | FromDiscord | <Rika> doesnt nim work well with gdb? |
23:08:24 | FromDiscord | <Rika> so the gdb part of the dude's comment isnt too accurate |
23:09:10 | FromDiscord | <Rika> why does he need to step through the *generated* code, and not the code that was *written*? |
23:09:14 | FromDiscord | <Joshua S. Grant> Can't wait for like 5-10 years from now when we start seeing Nim-x-Wasm games start popping up itch.io and 'just work' like a lot of these native-web-games that get embeded |
23:09:36 | skrylar[m] | eh. i'm just curious to try it for stuff really. |
23:10:07 | skrylar[m] | but i've seen a research group using wasm to do smart contracts and then the haxe nightmare where they transpile to js to run on charka to livecode 3d apps |
23:10:31 | skrylar[m] | or make those crazy time travelling debuggers like elm once had |
23:11:02 | FromDiscord | <Joshua S. Grant> I really need to look into HCR more; Have no clue what the actual limitations are -- and I'm imagining "nim, basically one-removed for a scripting-language" for Gamedev ... which I think is being way-too-optimistic at this point, probably lol |
23:11:17 | dadada | leorize: can you show me your code ... |
23:11:20 | * | fredrikhr quit (Ping timeout: 256 seconds) |
23:11:22 | dadada | please? |
23:11:35 | dadada | leorize: I can't get it to work, even when using StmtListExpr |
23:12:08 | skrylar[m] | @grant nim makes the process load itself like a dll so when you run a reload function it re-dlsym/getprocs everything and functions go through a jump table |
23:12:25 | skrylar[m] | downside is when i tried it on windows, the aftercodereload hook caused segfaults |
23:13:06 | leorize | dadada: I sent you the paste? |
23:13:17 | leorize | you probably missed it |
23:13:23 | skrylar[m] | but since you have to sit theough 5-30sec of build time to trip hcr, it's only worthwhile for stuff that has a lot of heavy persistent state like socket connections or textures and stuff |
23:13:25 | FromDiscord | <Joshua S. Grant> Hm. sounds interesting; Wonder how this compares to other compiled languages with similar features -- namely CL (no idea how that magic works lol) |
23:13:35 | leorize | dadada: https://play.nim-lang.org/#ix=2kWh |
23:13:37 | dadada | leorize: ah, thanks! yeah I was writing about how great Nim is |
23:13:39 | skrylar[m] | CL is amazing magic |
23:14:05 | FromDiscord | <Joshua S. Grant> Also, gonna change my nick to '@jsgrant' on discord so it's not as-crazy to type out lol |
23:14:06 | FromDiscord | <Never Listen To Beef> @Joshua S. Grant i imagine using the nim VM with an underlying nim code base would be a more worthwile method, but idk |
23:14:51 | FromDiscord | <Never Listen To Beef> Could just be my Unity brain talking |
23:14:54 | skrylar[m] | its basically an interpreter/compiler and when you define an object or a proc, CL runs a compile proc in the image and that outputs a new set of bytecode/assembly and sticks a reference in the image, kind of like how forth has the dictionary of words. so CL is literally a script that writes itself incrementally |
23:15:10 | skrylar[m] | the image is then the result of that self-writing |
23:15:28 | skrylar[m] | its also why a common lisper will never wait 30 minutes to test a build ^^; |
23:15:48 | dadada | leorize: I'm doing that in a subproc of a macro, there it's NimNode and not untyped, could that be a reason? |
23:16:15 | leorize | no idea |
23:16:18 | skrylar[m] | (on the off chance you look at smalltalk; don't. their magic is the same as CL.) |
23:16:37 | zacharycarter | I've used CL and I don't find it that amazing |
23:17:04 | skrylar[m] | (declaim (shunned 'zacharycarter)) |
23:17:06 | zacharycarter | yes lisps and schemes are cool |
23:17:07 | FromDiscord | <Joshua S. Grant> I've 'played' with Pharo a few times; And it was pretty fun, but I don't know how much of it was the language or the crazy "almost an operating-system 'ide'" |
23:17:25 | zacharycarter | but the ecosystems and portability is not great |
23:17:35 | zacharycarter | nor is using emacs |
23:18:11 | zacharycarter | the last time I tried using CL I couldn't even get SDL2 working on my mbp |
23:18:16 | skrylar[m] | pharo is kind of trying but they are constrained by being funded by research grants and not actual business users |
23:18:17 | FromDiscord | <JSGrant> Think the ecosystem, for being like 30 years old and being a LOT MORE niche than other similarly aged ecosystems is pretty-solid. It's just super-modular / tacked on |
23:18:20 | zacharycarter | and it wasn't due to user error it was due to an issue with SDL2 bindings for CL |
23:18:29 | * | covidian is now known as ii |
23:18:31 | * | ii is now known as covidian |
23:18:41 | skrylar[m] | i am using janet bolted on to nim |
23:18:49 | dadada | leorize: private message! |
23:19:06 | zacharycarter | The language should have a better ecosystem if it's been around for 30 years |
23:19:19 | FromDiscord | <JSGrant> If it was popular, maybe lol |
23:19:43 | FromDiscord | <JSGrant> Most advancements I've seen have been since it's niche growth over the past 10 or-so years |
23:19:46 | zacharycarter | I think CL is fine if you want to write everything yourself - lispers claim amazing productivity but they end up authoring everything themselves |
23:19:58 | zacharycarter | Nim might be more popular than CL at this point |
23:20:03 | FromDiscord | <JSGrant> Roswell itself is such a big boon, it's unbelievable to oversell it |
23:20:11 | FromDiscord | <JSGrant> Same with Quicklisp |
23:20:15 | FromDiscord | <JSGrant> and later qlot |
23:20:19 | skrylar[m] | you mean like.. we are doing. (<_< ) |
23:20:54 | zacharycarter | no we're not |
23:21:05 | zacharycarter | we have the advantage of being able to easily consume C/C++'s ecosystems |
23:21:22 | zacharycarter | as well as JavaScripts if that's your thing |
23:21:30 | FromDiscord | <JSGrant> Lol, tbh Skylar; Nim is compartiviely very new and CL does like re-implementing stuff over-and-over historically but I don't see that as a bad thing personally (and not what is holding CL back). |
23:22:06 | * | Trustable quit (Remote host closed the connection) |
23:22:37 | skrylar[m] | CL is held back by the part where all the free runtimes are convinced 70mb hello worlds are not a problem |
23:23:22 | FromDiscord | <JSGrant> Gotta be honest, unless on an embedded system -- which CL is not really aiming for ... I kina belong to that club |
23:23:26 | skrylar[m] | they are literally blind to ex. gamedevs needs and will attack you if you say hello i am from gamedev how do i do these things i absolutely cannot compromise on and their response is you are too stupid for lisp and should compromise on everything |
23:23:35 | leorize | CL is held back by the fact that you need their super custom setup just to write code :P |
23:24:29 | skrylar[m] | treeshakers are also bad because only corporate people use those and if you are a company you shuld just buy frans or lispworks and gtfo |
23:25:03 | skrylar[m] | i've seen more than a few developers say they were excited for lisp but the lack of being able to actually use it in a game engine killed the decision in minutes |
23:25:26 | FromDiscord | <JSGrant> I personally see a lot of testimonies about agressive 'smug lisp weenies' and the like, but being involved in that orbit more than any other language-family thusfar -- I haven't really seen it. |
23:25:33 | zacharycarter | I have |
23:25:39 | skrylar[m] | i did in sbcl |
23:25:51 | skrylar[m] | i was attacked for even mentioning the importance of c abis |
23:26:01 | zacharycarter | not mentioning any names but I think we just had one who said some pretty negative things about Nim |
23:26:33 | zacharycarter | regarding it as a language they wouldn't use even if it was the last one in existence |
23:26:36 | skrylar[m] | i have this https://git.sr.ht/~skrylar/janim but it needs some smoothing over |
23:27:11 | FromDiscord | <Rika> cough |
23:27:25 | FromDiscord | <Rika> jsg. should know who you're referring to |
23:27:46 | covidian | what is the optimum number of pgming languages to have ? like how many ought the universities teach ? |
23:27:50 | FromDiscord | <JSGrant> Who I'm refering to or who they are? |
23:28:09 | skrylar[m] | covidian: smalltalk =p |
23:28:27 | zacharycarter | I'd be more interested in diving further into Chicken / Guile / Racket or checking out scopes honestly |
23:28:34 | zacharycarter | than spending another minute using CL |
23:28:51 | FromDiscord | <Rika> who they are |
23:29:11 | skrylar[m] | racket seemed okay but.. not a schemer here. |
23:29:14 | FromDiscord | <Rika> covidian: that is an unfortunate name |
23:29:20 | skrylar[m] | naughty dog uses racket for their custom lispy stuff now |
23:29:28 | * | qbradley quit (Ping timeout: 256 seconds) |
23:29:58 | skrylar[m] | (they also suck now, for unrelated reasons) |
23:30:21 | zacharycarter | actually I really want to get more into forth |
23:30:43 | zacharycarter | I think the next language I spend a lot of time using will be forth |
23:30:50 | FromDiscord | <Rika> how about factor? |
23:30:58 | FromDiscord | <Rika> forth's child or something |
23:30:58 | * | qbradley joined #nim |
23:31:01 | skrylar[m] | factor is kill |
23:31:31 | skrylar[m] | dev was eaten by googlebucks |
23:31:53 | FromDiscord | <Rika> oof |
23:31:59 | FromDiscord | <JSGrant> Also, not trying to write anyone off here; And maybe arguing that they're not agressive is the wrong way to go about it -- I think I'm more-so saying most are not TRYING to be agro / rude. I've just interacted with a fair bit of them (and probably the person in-question (who has personally dm'd me borderline agro)), but I've more-so noticed that hardcore common-lisp people are often both really opinionated and really conservative (about th |
23:32:56 | FromDiscord | <JSGrant> skrylar, are they still using Racket? I've heard conflicting stuff; Like evidently they stopped after they were bought out by Sony but then have here-and-there afterwards for the dialogue / interaction system in some games |
23:33:10 | FromDiscord | <mratsim> That's true for many communities actually |
23:33:15 | FromDiscord | <mratsim> Arch is the same |
23:33:24 | skrylar[m] | they used franz lisp when sony bought them, made one game with c++ that sucked, then went to racket and started winning awards again |
23:33:27 | FromDiscord | <mratsim> Nim also somewhat |
23:33:41 | skrylar[m] | they only use racket to transpile tho |
23:34:00 | skrylar[m] | (obviously they can't use racket proper because it has funny licensing and they are console devs who can't make weird lgpl-ish compromises) |
23:34:31 | FromDiscord | <JSGrant> I know Jak & Daxter used GOAL pretty extensively, which was a scheme-like written in franz lisp to compile to assembly -- allowed them to dynamically load part of the map and get rid of most of the loading-screens |
23:34:54 | FromDiscord | <JSGrant> I thought Racket was dual-licensed Apache2 / MIT? |
23:35:10 | skrylar[m] | if its apache and mit thats new 'cause when i last checked it wasn't that liberal |
23:35:59 | FromDiscord | <JSGrant> Okay, now I have to re-read this because I'm confused more now; lol |
23:35:59 | skrylar[m] | i have an unfinished transpiler that turns sexps in to a shitty game-specific language that is suffering to code for lol. need to write another one for glsl |
23:36:00 | FromDiscord | <JSGrant> "Racket is primarily distributed under the Apache License, version 2.0 and the MIT License, at your option. Some components of the Racket distribution, including the compiled racket executable for the "Regular" variant of Racket and packages that distribute third-party libraries, are distributed under the GNU Lesser General Public License (LGPL) version 3.0." |
23:36:58 | skrylar[m] | well glsl is not bad. but does have some silliness |
23:38:34 | skrylar[m] | anyway. no funcoding today. logging and tracing ._. |
23:39:37 | zacharycarter | what are you working on? |
23:39:46 | skrylar[m] | game engine/game |
23:40:00 | zacharycarter | ooo |
23:40:02 | zacharycarter | in Nim? |
23:40:07 | skrylar[m] | it is |
23:40:09 | zacharycarter | nice |
23:40:15 | zacharycarter | any screenshots? |
23:40:34 | FromDiscord | <Rika> or a repo link ;; |
23:40:52 | FromDiscord | <JSGrant> @mratsim Also yeah, I think it's any community that is "moderately successful overtime" just to differeing degrees. And also, probably made worse by if the operating paradigm used is significantly different than what's popular; Because there's people who come in and go "why isn't there x,y,z?" and there very-well maybe be good reasons for it or 'you can do it this way, there's no reason for this' and there's an inherent friction there |
23:41:06 | skrylar[m] | zacharycarter: nothing fun https://media.discordapp.net/attachments/643402542000373761/706457747360841849/unknown.png |
23:41:49 | skrylar[m] | i read over corona sdk, love2d, libgdx, and less recently heaps.io, and sort of shrugged at how little all these "engines" actually "do" |
23:42:09 | zacharycarter | better than mine currently |
23:42:13 | skrylar[m] | well libgdx has a large pile of random stuff that kind of works |
23:42:22 | FromDiscord | <JSGrant> corona just got renamed, didn't it (because all of them unfournate association to covid)? |
23:42:27 | zacharycarter | https://imgur.com/dQThyOU |
23:42:40 | FromDiscord | <JSGrant> Solar2D now evidently |
23:42:41 | zacharycarter | well mine currently has hot reloading / plugins and a fiber based job system |
23:42:45 | skrylar[m] | i remember at one point their approach to skeletal animation was "buy a proprietary program with web activation" :| which i guess is fine because monogame's answer to shaders is "just use windows to compile them rofl" |
23:42:53 | zacharycarter | https://github.com/zacharycarter/frag |
23:43:06 | skrylar[m] | mine just has pretty linebreaks |
23:43:06 | zacharycarter | working now on draw call command buffers |
23:43:14 | * | krux02 quit (Remote host closed the connection) |
23:44:03 | skrylar[m] | debating on doing rich text inside of simpletext. it occured to me that since it already does vbox and hboxes for tex, that changing typefaces is just indexing a typeface array when calculating bounds |
23:44:21 | skrylar[m] | and coloring text is just changing a palette code that the GLES-izer reads |
23:44:27 | FromDiscord | <JSGrant> Forgot to ask; Is this version of frag mostly a reimplementation or what; Noticed the organization's version was archived still? |
23:44:41 | zacharycarter | it's a new version - I wrote the original |
23:44:45 | skrylar[m] | ey keeps rewriting it =p |
23:45:07 | zacharycarter | we made an organization because there were two of us involved, but the other guy only ended up writing about 10 lines of code |
23:45:16 | * | avatarfighter quit (Remote host closed the connection) |
23:45:17 | zacharycarter | it was also my first game project in Nim |
23:45:39 | FromDiscord | <JSGrant> News about Frag a few years-ago was my first introduction to Nim, actually. :^) |
23:45:40 | zacharycarter | this is also the final version :P |
23:45:56 | skrylar[m] | also need a tweener ._.; |
23:45:57 | zacharycarter | haha, well hopefully this will turn out a lot better |
23:46:17 | FromDiscord | <mratsim> coming soon, frag_final_final_v2 |
23:46:21 | zacharycarter | :D |
23:46:38 | skrylar[m] | i just write little modules for particular things and then shunt those on to sourcehut/github |
23:46:42 | FromDiscord | <JSGrant> Is the goal still ultimately 2D / 3D or just going with one or the other now? |
23:46:43 | skrylar[m] | the heaps stack is the way to go |
23:46:54 | * | avatarfighter joined #nim |
23:47:01 | zacharycarter | I'm developing a 3d game along side with th eengine |
23:47:12 | FromDiscord | <JSGrant> oh sweet |
23:47:45 | skrylar[m] | plus adding the font array makes it so emojis and stuff works xD |
23:47:53 | zacharycarter | most important feature ^ |
23:48:17 | skrylar[m] | i saw a game called Max Gentleman and they uh, have a lot of fun with text. Color changes, rainbows, sometimes words wiggle for emphasis. |
23:49:52 | skrylar[m] | haven't decided on an image format yet. eyeing avif or jpeg-xl |
23:50:18 | * | brainproxy quit (Ping timeout: 260 seconds) |
23:50:31 | zacharycarter | https://www.gridsagegames.com/blog/ - I love this devblog - really makes me appreciate what can be done with ascii |
23:50:59 | skrylar[m] | will have to give it a read. |
23:51:16 | zacharycarter | just scroll through and watch gifs |
23:51:22 | skrylar[m] | thought about an ascii display component ... they're not that hard maybe. |
23:51:22 | zacharycarter | amazing stuff he does |
23:51:54 | skrylar[m] | just a grid that indexes a texture atlas, accept a stack of change codes throughout the logic frame and then issue a pile of vbo updates for changed cells |
23:53:32 | skrylar[m] | i worry for the memory use all this vbox/hbox crap does though |
23:55:08 | skrylar[m] | i *really* appreciate that beef lets you do defer or destructors tho. `var blah = makesomething() ~ specifically_blow_it_up()` is a thing |
23:55:56 | skrylar[m] | when it goes out of scope, blows up, but you can pick which detonator it uses |
23:56:29 | FromDiscord | <Rika> hm, nim was supposed to have that at one point no? |
23:56:49 | FromDiscord | <mratsim> it does |
23:56:53 | FromDiscord | <mratsim> like right now |
23:57:02 | FromDiscord | <Rika> `=destroy`1? |
23:57:08 | FromDiscord | <Rika> disregard the 1 |
23:57:14 | * | ftsf joined #nim |
23:57:57 | FromDiscord | <KingDarBoja> That's pretty neat! |
23:58:14 | FromDiscord | <KingDarBoja> Awesome ASCII stuff |
23:59:41 | leorize | isn't `defer` also the solution? |
23:59:54 | FromDiscord | <Rika> yeah defer too |