<< 23-04-2021 >>

00:41:46*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:42:05*njoseph joined #nim
00:48:17*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:54:31*Tlangir joined #nim
00:56:41*Tanger quit (Ping timeout: 240 seconds)
01:04:57*krux02 quit (Remote host closed the connection)
01:36:45*dsrw joined #nim
02:12:21*NimBot joined #nim
02:22:02*Tlanger joined #nim
02:24:37*Tlangir quit (Ping timeout: 252 seconds)
02:57:43*thomasross quit (Ping timeout: 268 seconds)
02:59:12*Figworm quit (Quit: Figworm)
03:21:32*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:58:28*spiderstew_ joined #nim
03:59:35*spiderstew quit (Ping timeout: 260 seconds)
04:10:54FromDiscord<retkid> hey guys
04:11:09FromDiscord<retkid> i dont know a single.. not 35+ programmer who uses windows
04:11:22PrestigeI do
04:11:28Prestigebut only one
04:11:48FromDiscord<retkid> well, windows has like 87% of the industry
04:11:52FromDiscord<retkid> who theres a correlation ther
04:11:54FromDiscord<retkid> (edit) "ther" => "there"
04:11:58FromDiscord<retkid> (edit) "87%" => "97%"
04:12:05FromDiscord<retkid> (edit) "who" => "sos"
04:12:25FromDiscord<retkid> it might be because we like control over our computers
04:12:45FromDiscord<retkid> or linux is objectively better and if you know about computers theres no reason not to use
04:12:46FromDiscord<retkid> (edit) "or linux is objectively better and if you know about computers theres no reason not to use ... " added "it"
04:14:11*a_chou joined #nim
04:15:14*a_chou quit (Remote host closed the connection)
04:32:21ForumUpdaterBotNew thread by Nimrodman69: Sending raw packets with nim, see https://forum.nim-lang.org/t/7841
05:34:42FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2YMD
05:37:10FromDiscord<ElegantBeef> General type casting/inference "bugs", explicit conversion is prefer to implicit in many places
05:38:30FromDiscord<ElegantBeef> It's hard to reason about cause if you had a u16 in a third branch, what do you do
05:38:55FromDiscord<mattrb> Yeah I definitely wouldn't call it a bug, just an implementation detail. I wrote a little compiler in uni and remember actually handing this exact case, but it gets trickier with more complicated branching
05:39:01FromDiscord<mattrb> Yeah exactly
05:39:18FromDiscord<ElegantBeef> Well that's why i put quotes on it since it's completely reasonable and expected 😛
05:39:37FromDiscord<mattrb> Yeah totally, I was just curious if cases like this had been explicitly considered before 🙂
05:40:22FromDiscord<ElegantBeef> Still dont know what's valid does it become `int` or is it uint8 in the first branch now
05:41:15FromDiscord<mattrb> My expectation would that int literals without a specified type would conform to any type inferred for that expression
05:42:09FromDiscord<mattrb> So in _my_ ideal world, Nim would infer both expressions above to yield uint8s
05:42:25FromDiscord<mattrb> Although I'd imagine this could come down to personal preference too
05:42:33FromDiscord<mattrb> (edit) "My expectation would ... that" added "be"
05:45:23*narimiran joined #nim
05:45:24FromDiscord<ElegantBeef> No real "right" answer
05:46:20FromDiscord<mattrb> Agreed, just comes down to the discretion of the language designers
05:47:48FromDiscord<ElegantBeef> Though do say it's rather silly to not have a type listed in the first branch
05:48:01FromDiscord<ElegantBeef> Like `[10, 20, 30, 40u8]`
05:48:17FromDiscord<ElegantBeef> Have to look at the last value to see "oh it's a byte array"
05:49:30FromDiscord<mattrb> I agree, but it seems like it's in a bit of a middle-ground right now. If the compiler can infer the type of the `if` branch, it already converts the int literal in the `else` branch to that type
05:49:37FromDiscord<mattrb> I think it's weird that it works one way but not the other
05:50:00FromDiscord<ElegantBeef> ~~Looks at my array example~~
05:50:07FromDiscord<ElegantBeef> !eval let a = [10, 20, 30, 40u8]
05:50:09NimBotCompile failed: /usercode/in.nim(1, 22) Error: type mismatch: got <uint8> but expected 'int literal(10)'
05:50:19FromDiscord<mattrb> :eyesshaking:
05:50:22FromDiscord<ElegantBeef> !eval let a = [10u8, 20, 30, 40]
05:50:24NimBot<no output>
05:51:02FromDiscord<mattrb> So the same story there :halfharold:
05:51:26FromDiscord<ElegantBeef> indeed
05:54:07FromDiscord<ElegantBeef> Oh jeez you just made me realize that we can use casestatement macros for adding type inference to fields of an enum
05:54:16FromDiscord<ElegantBeef> (edit) removed "fields" | "an enum" => "branches"
05:54:45FromDiscord<mattrb> Wdym?
05:55:06FromDiscord<mattrb> Been awhile since I skimmed the docs for the casestatement macros :p
05:55:13FromDiscord<ElegantBeef> Say you have two enums with the same values, you have to explictly state `Enum.left`
05:55:44FromDiscord<ElegantBeef> But with a case statement macro you can check the type of the value and if the branches dont have them add it
05:56:06FromDiscord<ElegantBeef> Case statement macros are macros that let you rewriting the case statement
05:56:15FromDiscord<ElegantBeef> So same syntax but can do whatever you want
05:58:22FromDiscord<ElegantBeef> Or not
06:01:23FromDiscord<mattrb> Ooh, case-of macros seem interesting. I could maybe use them to build my arm look-up table at compile-time in a less ugly way 🙂
06:02:10FromDiscord<mattrb> Although it's still this monstrosity you helped me with that just compiles quickly :p https://github.com/mattrberry/gba/blob/master/src/gba/arm.nim#L263
06:02:57FromDiscord<ElegantBeef> That is some code alright
06:03:04FromDiscord<ElegantBeef> I helped you make this?!
06:03:13FromDiscord<mattrb> Haha I'm pretty sure it was you!
06:03:24FromDiscord<mattrb> 99% of the time you're the one helping me in this channel :p
06:04:06FromDiscord<mattrb> I had a few other options with templates and things, but compilation time was like 15-25 seconds. This way it's ❤️ seconds consistently
06:04:09FromDiscord<mattrb> < 3
06:04:10FromDiscord<ElegantBeef> Nah if i was the one that helped i'd have bitched about using `result.add` so many times and not just dropping the tree in there
06:05:14FromDiscord<mattrb> In reply to @mattrb "Brief summary: Templates (https://play.nim-lang.org": Ah, it was leorize. Nvm 🙂
06:06:42FromDiscord<mattrb> I'm definitely open to opinions if you see a nicer way that still compiles quickly, though 🙂
06:06:51FromDiscord<ElegantBeef> Well i'm just talking about cleaning it up 😄
06:08:23FromDiscord<mattrb> So much for me burying this code somewhere I'd never see again :halfharold:
06:10:30FromDiscord<ElegantBeef> I mean it's not much just slightly less redundant https://play.nim-lang.org/#ix=2YT0
06:10:49FromDiscord<ElegantBeef> forgot to do `newLit` inside the ct
06:11:27FromDiscord<ElegantBeef> Here we go https://play.nim-lang.org/#ix=2YTa
06:11:37FromDiscord<ElegantBeef> Not much of a change, just less redundant
06:13:02FromDiscord<ElegantBeef> Guess it should also return a `NimNode`, but alas i'm too daft
06:13:41FromDiscord<mattrb> Hey, less redundant is good. I guess I could also stick the creation of the tree and the bindSym in a prod too to clean it up a little further
06:14:10FromDiscord<mattrb> Out of curiosity, does the `inline` pragma do anything on bitTestCT? Does the nim vm respect that in some way?
06:14:23FromDiscord<ElegantBeef> No that's just a marker for the compiler
06:14:35FromDiscord<ElegantBeef> Just a remnant from me copying the procedure
06:14:43FromDiscord<mattrb> 👍
06:14:52FromDiscord<mattrb> Also, is `CT` a naming convention? What does that stand for?
06:15:10FromDiscord<ElegantBeef> CompileTime, not really just what i did cause i didnt look further below
06:15:26FromDiscord<ElegantBeef> You could name it bittest like the other if you dont use the other modules below it
06:15:26FromDiscord<mattrb> Ah gotcha
06:15:58FromDiscord<mattrb> Cool, thanks 👍
06:16:39FromDiscord<ElegantBeef> if you do you can qualify it `otherModule.bittest`
06:16:59FromDiscord<ElegantBeef> If you keep doing thumbs up you might lose those fingies
06:18:01FromDiscord<mattrb> I have a problem with the thumbs up emoji
06:18:14FromDiscord<ElegantBeef> I have a problem saying "i mean" so join the club
06:18:18FromDiscord<mattrb> sent a code paste, see https://paste.rs/whl
06:18:20FromDiscord<mattrb> Lmao
06:23:28FromDiscord<ElegantBeef> You might be able to use the casestmt macros there since it can be resolved
06:24:01FromDiscord<mattrb> Yeah I think we're talking about the same thing https://nim-lang.org/docs/manual.html#macros-caseminusof-macro
06:24:18FromDiscord<ElegantBeef> Oh we arent
06:24:21FromDiscord<ElegantBeef> I was talking about https://nim-lang.org/docs/manual_experimental.html
06:24:21FromDiscord<mattrb> Oh?
06:24:28FromDiscord<ElegantBeef> (edit) "https://nim-lang.org/docs/manual_experimental.html" => "https://nim-lang.org/docs/manual_experimental.html#case-statement-macros"
06:25:22FromDiscord<mattrb> On interesting
06:25:37FromDiscord<mattrb> I haven't actually seen a case-of macro in use, so maybe I'm misunderstanding where it's useful
06:25:53FromDiscord<mattrb> But the case statement macros definitely seem like they'd do what I'm looking for
06:25:58FromDiscord<ElegantBeef> Though this actually might help 😄
06:27:37FromDiscord<mattrb> In reply to @ElegantBeef "Here we go https://play.nim-lang.org/#ix=2YTa": Does this work? I just made the same change and I'm getting an indentation error :p
06:28:16FromDiscord<mattrb> I can just throw parens arount it
06:28:17FromDiscord<ElegantBeef> Return type should be Nimnode in the first proc, might want to do `add:`
06:28:18FromDiscord<mattrb> (edit) "arount" => "around"
06:28:31FromDiscord<ElegantBeef> Fuck that shit we're Nim we can block any procedure 😛
06:29:31FromDiscord<mattrb> In reply to @ElegantBeef "Return type should be": I didn't even know that was allowed <:big_brain:608305066301980713>
06:29:53FromDiscord<mattrb> I mean it makes sense
06:30:05FromDiscord<mattrb> I just didn't realize blocks could be used in that way
06:30:06FromDiscord<mattrb> Cool
06:30:14FromDiscord<ElegantBeef> It gets even cooler
06:30:45FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/hNQ
06:30:58*hyiltiz quit (Ping timeout: 240 seconds)
06:31:35FromDiscord<mattrb> Either I'm stupid or it's not obvious what that does lol
06:31:38FromDiscord<mattrb> Or both
06:31:50FromDiscord<ElegantBeef> it's `add(a, 300)` or `a.add(300)`
06:32:12FromDiscord<ElegantBeef> you can do block followed by do to pass all parameters in block forum
06:32:34FromDiscord<mattrb> What's an example of where that syntax could come in handy?
06:34:02*hyiltiz joined #nim
06:34:06FromDiscord<ElegantBeef> Damny playground isnt working well
06:34:13FromDiscord<ElegantBeef> But there you go
06:34:16FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/pCo
06:37:33FromDiscord<mattrb> Weird.. But that example makes sense. I wonder where I'd use that in a practical situation
06:37:49FromDiscord<mattrb> Are additional args just under further `do` blocks?
06:37:58FromDiscord<ElegantBeef> Afaik yes
06:38:23FromDiscord<ElegantBeef> It allows you to skip temporary variables and do the logic in a block there
06:39:07FromDiscord<ElegantBeef> It's very helpful for macros/templates
06:40:26FromDiscord<mattrb> Interesting, I could see that
06:49:31FromDiscord<ElegantBeef> But hey https://play.nim-lang.org/#ix=2YZT it works sorta, @treeform you might be interested 😄
06:50:29FromDiscord<ElegantBeef> Thanks matt, didnt know about those before surprisingly
06:52:40FromDiscord<mattrb> That is surprising. I think this is like the second time I've ever seen you not know something about nim haha
06:53:19FromDiscord<ElegantBeef> I'm not that knowledgeable
06:53:34FromDiscord<mattrb> Then maybe I just ask very basic questions :p
06:55:04FromDiscord<ElegantBeef> You ask questions i can answer so that means something, i dont know what, but something
07:00:16FromDiscord<mattrb> In reply to @ElegantBeef "But hey https://play.nim-lang.org/#ix=2YZT it": I think I understand everything you
07:01:00FromDiscord<mattrb> In reply to @ElegantBeef "But hey https://play.nim-lang.org/#ix=2YZT it": I think I understand everything you're doing here other than why you're dropping the last element of newBody when adding it to the result. What's going on there?
07:01:09FromDiscord<ElegantBeef> Stored in an arglist
07:01:17FromDiscord<ElegantBeef> So i guess i could do `copyChildren`
07:02:16FromDiscord<mattrb> I basically haven't looked into nim macros at all. What's the significance of it being in an arglist?
07:03:01FromDiscord<ElegantBeef> I want what it contains, not the root node
07:03:33FromDiscord<ElegantBeef> `arglist -> children` i just want `children` not the entire tree
07:04:47*PMunch joined #nim
07:08:07FromDiscord<mattrb> Ohhh I understand. Lol I was misunderstanding 2 things. That's super cool
07:08:21FromDiscord<mattrb> I think I'll definitely end up using that to make my lut generation look a little nicer
07:09:04FromDiscord<ElegantBeef> Yea the bodies dont need to be typed so it's wonderful
07:17:56FromDiscord<ElegantBeef> Which means you can do `1000..1001` and not do it in the string
07:25:29FromDiscord<mattrb> Well it needs to be valid nim, right?
07:25:40FromDiscord<mattrb> It's not a range
07:26:24FromDiscord<mattrb> E.g. it might be something like 10.011.010.. or something
07:26:29FromDiscord<mattrb> (edit) "10.011.010.." => "`10.011.010..`"
07:26:43FromDiscord<ElegantBeef> Well yea valid nim, but it doesnt have to be "Actual" nim
07:26:55FromDiscord<ElegantBeef> Aslong as you can massage the parser you're holden
07:27:00FromDiscord<ElegantBeef> (edit) "holden" => "golden"
07:27:29FromDiscord<mattrb> Don't think I can trick the parser into accepting "10.011.010.." unless it's in a string :p
07:27:39FromDiscord<mattrb> Unless you know of some fuckery haha
07:28:50PMunchProblem is that that isn't valid Nim
07:29:01FromDiscord<mattrb> Yeah exactly
07:29:04PMunchAnd you can't override .
07:29:12FromDiscord<mattrb> Which is why I was going to put it in a string
07:30:03PMunchThere's basically a distinction between syntactically correct Nim and semantically correct Nim
07:30:13PMunchBut that is neither :P
07:30:42PMunchAs long as it is syntactically correct you can do pretty much whatever you like
07:32:32FromDiscord<mattrb> Awesome, thanks for confirming 👍
07:32:49FromDiscord<mattrb> Oh no, I did another 👍 ElegantBeef is gonna break off a finger
07:33:00FromDiscord<ElegantBeef> lol
07:42:45FromDiscord<retkid> someone starting programming
07:42:50FromDiscord<retkid> they tried to learn c++
07:42:53FromDiscord<retkid> they're fucking stupid
07:42:57FromDiscord<retkid> I told them to learn Nim
07:43:02FromDiscord<retkid> set them on the right path
07:43:03FromDiscord<retkid> 😎
07:43:35PMunchWe started learning C at university. It's not too bad if you do it methodically
07:44:04FromDiscord<retkid> well, she doesn't know... anything
07:44:15FromDiscord<retkid> she says shses doing ok
07:44:21FromDiscord<retkid> don't really believe her
07:48:30PMunchI mean it isn't rocket science. Perfectly possible to pick up some C++ fairly quickly. Don't come crying when your program is leaking memory like a sieve though :P
07:49:04FromDiscord<ElegantBeef> Cmon it has all those modern smart ptrs or w/e
07:50:41PMunchHaha, C++ certainly tries to make it easier. But they have so many system for it that it can get confusing
07:55:03*Tlangir joined #nim
07:57:33*Tlanger quit (Ping timeout: 265 seconds)
08:33:55FromDiscord<jtiai> sent a code paste, see https://paste.rs/udd
08:34:25FromDiscord<Solitude> In reply to @jtiai "Can I turn enums": `$`
08:52:23*xet7 quit (Remote host closed the connection)
09:00:09*YovelKey-Cohen[m quit (Quit: Idle for 30+ days)
09:25:35*arecaceae quit (Remote host closed the connection)
09:25:54*arecaceae joined #nim
09:41:48*krux02 joined #nim
09:43:41*xet7 joined #nim
10:04:38*saem quit (Ping timeout: 258 seconds)
10:07:53*saem joined #nim
10:37:26ForumUpdaterBotNew question by Alex Craft: How to get reference to proc self inside multi-dispatch proc?, see https://stackoverflow.com/questions/67228425/how-to-get-reference-to-proc-self-inside-multi-dispatch-proc
11:06:18*natrys joined #nim
11:07:30*narimiran quit (Ping timeout: 265 seconds)
12:12:23*clyybber joined #nim
12:22:10*Kaivo joined #nim
12:30:18FromDiscord<jtiai> Are there relatively easy to use game/gui libraries for nim? Checked nimgl but it seems to miss keyboard input completely and sdl2 is pretty complex to use.
12:30:40*Vladar joined #nim
12:34:18*dsrw joined #nim
12:37:29PMunchPossibly rapid, although I haven't tried it myself
12:38:49Clonkk[m]Maybe SDL2 ?
12:39:18PMunchHe said he found it too complex
12:39:34Clonkk[m]Ah right, my bad, I read too fast
12:40:02PMunchIt might help to check out my SDL gamelib I used it once for a gamejam and it worked pretty well
12:40:31PMunchNico is also pretty cool, at least if you want to create retro looking games
12:42:56FromDiscord<jtiai> Mainly for my emulator.
12:44:21FromDiscord<jtiai> rapid looks promising.
12:49:19FromDiscord<ajusa> raylib is also an option
12:59:40ForumUpdaterBotNew thread by Alexeypetrushin: Let's Make Async Great Again!, see https://forum.nim-lang.org/t/7842
13:03:41FromDiscord<Rika> Async is too low level? So are we also going deprecate casting now?
13:05:09PMunchCasting is low level.. If you use it without a reason to go low level you're doing it wrong
13:05:26FromDiscord<Rika> Read the forum post
13:06:33PMunchI have..
13:07:42FromDiscord<Rika> I don't know what you mean then
13:08:31PMunchYou asked if we should deprecate casting. I just said that it is sorta deprecated already
13:15:32FromDiscord<exelotl> lol imagine an update that removes the cast keyword
13:15:43FromDiscord<exelotl> I'd be screwed :P
13:19:02*clyybber quit (Quit: WeeChat 3.1)
13:19:54PMunchHaha, ditto. Would be impossible to work with C code
13:20:40PMunchBut I agree that we could do more with the async system
13:21:49PMunchIt's a hard system to use, but that mostly goes for async in general. But I still run into more issues than I would expect
13:23:59*tiorock joined #nim
13:23:59*tiorock quit (Changing host)
13:23:59*tiorock joined #nim
13:23:59*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
13:23:59*tiorock is now known as rockcavera
13:24:00giaco__can a pure nim compiled lib be called from C code?
13:24:49PMunchSure, if you design it right
13:27:17giaco__PMunch: do you know if there's a page about it? I only find FFI (call C from nim) and not the other way around
13:28:54PMunchhttps://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c
13:29:29PMunchThere's certainly a bit more to it than that though
13:29:53PMunchAlthough less so with --gc:arc
13:30:28giaco__sure, I just need to have a look at how it could work, not yet ready to even try to grok it
13:30:53PMunchIt's not that hard
13:31:33PMunchI've written some DLLs in Nim that was called from a C program I had no control over
13:32:44giaco__PMunch: cool! reverse engineering something?
13:33:15PMunchNah, extending a DNS server
13:34:17PMunchFirst I had to write a PR to the DNS server to allow it to load DLLs :P So the DNS server you use might have my code on it
13:35:26PMunchIt had support for Python modules, but the performance we where getting was just too bad
13:36:02PMunchSo I could either A write some unreadable, optimised C code, or port the whole thing to Nim :D
13:36:08giaco__couldn't you call C from python, ot cython, or numba, or something like that?
13:36:12giaco__nuitka maybe
13:36:43PMunchProbably could, but why?
13:37:10giaco__(ex python dev here that wants to get back to static typed world)
13:37:38PMunchEasier to let a C program load a DLL and then be able to use the C data types and such directly without any translation
13:38:03PMunchConverting every DNS query to Python and back is already a bottleneck
13:38:25giaco__sure it is, but not really the easiest way to implement a plugin if python is available
13:38:47FromDiscord<jtiai> Hmm, most gui/game libs seems to be kind of half done for some reason. Or then they are plain wrappers over C/C++...
13:39:07giaco__yeah, performance wise there's not a chance for python
13:39:26PMunchWell I had already implemented the Python plugin, but it wasn't performing well enough
13:39:45PMunchIt worked and did the same thing, but performance wasn't good enough
13:49:04giaco__may I ask why there's both a C and a C++ backend, when C is compatible with C++? And why C seems currently preferred over C++?
13:50:10FromDiscord<Zachary Carter> why does anyone use C instead of C++?
13:50:32FromDiscord<Zachary Carter> if you know the answer that question you'll understand why Nim has C and C++ backends
13:50:40FromDiscord<Zachary Carter> (edit) "if you know the answer that question you'll understand why Nim has ... C" added "separate"
13:52:37PMunchIt's mostly for interop reasons
14:00:25*narimiran joined #nim
14:18:49*arecaceae quit (Remote host closed the connection)
14:19:08*arecaceae joined #nim
14:44:16*blackpawn quit (Ping timeout: 260 seconds)
15:02:33FromGitter<bung87> how you guys traverse NimNode? I want do some transform thing
15:03:18narimiranNim Dev Meet is starting! Join us at: https://meet.jit.si/NimDevMeet
15:06:29*krux02 quit (Remote host closed the connection)
15:20:35*vicfred joined #nim
16:00:56*vicfred quit (Remote host closed the connection)
16:01:14*vicfred joined #nim
16:02:32PMunch@bung87, manually or by using macroutils
16:03:12*blackpawn joined #nim
16:26:15FromGitter<bung87> @PMunch Thanks for sharing.
16:35:31PMunchDid the package naming discussion have an RFC already?
16:38:46Clonkk[m]I remember seeing a discussion on this topic on the rfc
16:38:55PMunchOn which RFC?
16:39:15Clonkk[m]Don't remember the name atm
16:39:29PMunchI want to leave my thoughts in a more permanent place than the Jitsi chat, especially since my microphone didn't seem to get picked up by Jitsi..
16:42:15Clonkk[m]https://github.com/nim-lang/RFCs/issues/310 was the one I had in mind but it was about fusion VS stdlib
17:07:07reversem3So do we say "Nim is compiled to C and then Compiled to binary or exec" or Nim is translated to C then compiled to binary / exec"
17:07:33federico3compiled
17:08:18reversem3Ok I thought so but in the book its says "translated to C"
17:08:25reversem3semantics ?
17:08:48leorize[m]you can also just say that nim compiles to executable
17:09:12leorize[m]I never understood why we even have to explicitly put C in the middle
17:10:12reversem3well its compiled to C right , if you look at the disassembly of nim executable to C it is different especially the header
17:11:02federico3leorize[m]: because it's more portable and debuggable than some alternatives
17:11:15reversem3Also if you can compile a runtime using nim into an exec do you have to install the runtime on another device in order to exec that nim program ?
17:11:33PMunchCompiled to C explains really quickly a lot of things about what the language probably can do
17:11:42reversem3say for instance Qt or GTK
17:12:11federico3reversem3: there's no runtime, it's not a VM. The executable is enough.
17:12:44reversem3I know nim's not a runtime I mean the qt runtime or gtk or something else
17:13:13leorize[m]I'm not a fan of associating Nim with C tbh
17:13:42reversem3I know I tried to compile SDL and run it on another machine and the machine needed SDL to run
17:14:07leorize[m]we call those libraries
17:14:28leorize[m]and yes you would need those on the machine that you want the application to run
17:15:18PMunchUnless you statically linked them
17:15:19leorize[m]this applies to all dynamically linked libraries (mostly a C/C++ thing)
17:16:12*PMunch quit (Quit: leaving)
17:16:17reversem3so you could statically link dlls compile them and then run them on another machine without the dlls on the other machine?
17:37:31FromDiscord<haxscramper> Made PR for compiler explorer for nim 1.4.6, should be available soon
17:48:25FromDiscord<haxscramper> https://wandbox.org/permlink/2wKU0Bns27zphiTQ macro argument captured as into closure becomes `NilLit` - is that an expected behavior? This can be avoided using `deepCopy()`, but this is a very ugly solution
17:49:12FromDiscord<haxscramper> https://github.com/nim-lang/Nim/issues/17199 might be close to what I'm getting here, though in my case it happens even on default GC
17:50:29FromDiscord<haxscramper> Though this works the same even on nim from `0.20` to `devel` so I guess this is most likely unrelated
17:52:40FromDiscord<haxscramper> Sorry, not a `deepCopy` but just `copyNimNode`
17:54:52FromDiscord<haxscramper> Adding `let arg1 = copyNimNode(arg1)` at the top
20:03:08*shmorgle quit (Quit: [TalkSoup] via NEXTSPACE)
20:06:32*narimiran quit (Ping timeout: 240 seconds)
20:07:51*arecaceae quit (Remote host closed the connection)
20:08:10*arecaceae joined #nim
20:40:32*tane joined #nim
21:13:23*thomasross joined #nim
21:13:35FromDiscord<Sabena Sema> nimterop is generally the best wrapper generator right?
21:13:54FromDiscord<mlokis> sent a code paste, see https://paste.rs/gES
21:14:19FromDiscord<mlokis> (edit) "https://play.nim-lang.org/#ix=31nR" => "https://paste.rs/OLM"
21:14:32FromDiscord<ElegantBeef> Yes
21:15:17FromDiscord<mlokis> nice this can make things lot easier, i can generate methods that convert tipy to id and vice versa
21:15:21FromDiscord<ElegantBeef> `type` or `typedesc` is actually compile time only
21:16:37FromDiscord<mlokis> In reply to @mlokis "nice this can make": not really
21:16:46FromDiscord<Sabena Sema> what do I need to do to tell a nimterop package to be a "pure" wrapper (not use {.emit.} or {.importcpp.} etc)>
21:16:46FromDiscord<mlokis> not vice versa
21:16:48FromDiscord<Sabena Sema> (edit) "etc)>" => "etc)?"
21:16:57FromDiscord<Sabena Sema> or {.header.}
21:26:24FromDiscord<Sabena Sema> ugh I missed the meetup _again_
21:26:43FromDiscord<Sabena Sema> it was posted at 4AM for an 8AM event ....
21:33:40FromDiscord<creonico> Hey, I just found Nim and want to know the difference in performance with plain C
21:34:18FromDiscord<ElegantBeef> Can be on par or better
21:35:12*abm joined #nim
21:36:10FromDiscord<ElegantBeef> Highly depends on the code 😄
21:39:42FromDiscord<Sabena Sema> yeah, it's around the same, there's no general overhead over c except for stuff like string handling which C is really slow at anyways
21:40:13FromDiscord<Sabena Sema> and like, refs which C doesn't have, but are about the same as using any of the reference counted C APIs out there
21:40:21FromDiscord<Sabena Sema> COM, gobject, etc
21:40:34FromDiscord<ElegantBeef> It can also generate more compiler friendly code, atleast as i understand 😄
21:41:07FromDiscord<Sabena Sema> a lot of that is for compile speeds, not runtime speeds (nim can perfectly forward declare everything)
21:42:17FromDiscord<ElegantBeef> But anywho if you want a better type system, fewer unmanaged pointers, generics, and proper macro system you've found your place 😄
21:50:26FromDiscord<Sabena Sema> The type system _does_ have more .... dusty corners .... than most others
22:00:09FromDiscord<JSONBash> I might be ignorant here, but whats good about CPS? and why is it not just callbacks?
22:01:03FromDiscord<Sabena Sema> There's no way to remove/hide a package (that I "maintain" (BIG quotes on that one)) from the nimble packages list
22:01:14FromDiscord<Sabena Sema> it is kinda just a callback, but is created automatically
22:02:01FromDiscord<Sabena Sema> what does async do today? Is it based on state machines?
22:04:13*natrys quit (Quit: natrys)
22:04:30*rockcavera is now known as Guest66901
22:04:30*tiorock joined #nim
22:04:31*Guest66901 quit (Killed (rothfuss.freenode.net (Nickname regained by services)))
22:04:31*tiorock is now known as rockcavera
22:05:44FromDiscord<JSONBash> i might not be answering what you are asking but i think it is a futures based event loop using an equivalent of epoll
22:06:19FromDiscord<Sabena Sema> yeah that's not quite what I'm asking
22:09:44*tane quit (Quit: Leaving)
22:09:48FromDiscord<Sabena Sema> oh closure iterators
22:09:50FromDiscord<Sabena Sema> OK that makes sense
22:31:41*hyiltiz quit (Ping timeout: 260 seconds)
22:32:08FromDiscord<mattrb> Pretty happy with this and wanted to share 🙂 https://play.nim-lang.org/#ix=31B3
22:32:22FromDiscord<mattrb> Still want to make further abstractions, but I liked using the case-of macro 🙂
22:34:26*Gustavo6046 quit (Ping timeout: 240 seconds)
22:34:29*hyiltiz joined #nim
22:35:52FromDiscord<exelotl> wowww
22:39:10FromDiscord<mattrb> First time using macros in Nim so it probably lacks some polish, but it sure makes the lut builder look cleaner
22:39:56*Figworm joined #nim
22:40:09FromDiscord<ElegantBeef> Wow look what i've made you do, spend time refactoring code you were going to hide and never touch
22:43:35FromDiscord<Sabena Sema> I'm not seeing the code in that link
22:43:54FromDiscord<ElegantBeef> Playground is a bit buggy recently so refresh might fix it
22:44:05FromDiscord<Sabena Sema> there it is!
22:44:29*NimBot joined #nim
22:44:58*Gustavo6046 joined #nim
22:45:23FromDiscord<mattrb> Macro trickery is more fun than hiding it in some other file ;p
22:46:29FromDiscord<clyybber> In reply to @ElegantBeef "Playground is a bit": it's ix.io that's the culprit I think; I've been having those issues there too
22:46:34FromDiscord<clyybber> and the playground uses ix.io
22:47:26FromDiscord<Sabena Sema> how do closures store their state? Is it heap allocated someplace?
22:48:00FromDiscord<Sabena Sema> I guess their state is going to be their position and local variables, since parameters can be changed between suspensions
22:50:49FromDiscord<treeform> In reply to @ElegantBeef "But hey https://play.nim-lang.org/#ix=2YZT it": I am sorta interesting, I just wish the langauge did this!
22:57:42*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
22:58:06*Gustavo6046 joined #nim
23:15:34FromDiscord<ElegantBeef> @Sabena Sema https://nim-lang.github.io/Nim/intern.html#code-generation-for-closures
23:18:10*Vladar quit (Quit: Leaving)
23:33:17*siinamon joined #nim