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:54 | FromDiscord | <retkid> hey guys |
04:11:09 | FromDiscord | <retkid> i dont know a single.. not 35+ programmer who uses windows |
04:11:22 | Prestige | I do |
04:11:28 | Prestige | but only one |
04:11:48 | FromDiscord | <retkid> well, windows has like 87% of the industry |
04:11:52 | FromDiscord | <retkid> who theres a correlation ther |
04:11:54 | FromDiscord | <retkid> (edit) "ther" => "there" |
04:11:58 | FromDiscord | <retkid> (edit) "87%" => "97%" |
04:12:05 | FromDiscord | <retkid> (edit) "who" => "sos" |
04:12:25 | FromDiscord | <retkid> it might be because we like control over our computers |
04:12:45 | FromDiscord | <retkid> or linux is objectively better and if you know about computers theres no reason not to use |
04:12:46 | FromDiscord | <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:21 | ForumUpdaterBot | New thread by Nimrodman69: Sending raw packets with nim, see https://forum.nim-lang.org/t/7841 |
05:34:42 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2YMD |
05:37:10 | FromDiscord | <ElegantBeef> General type casting/inference "bugs", explicit conversion is prefer to implicit in many places |
05:38:30 | FromDiscord | <ElegantBeef> It's hard to reason about cause if you had a u16 in a third branch, what do you do |
05:38:55 | FromDiscord | <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:01 | FromDiscord | <mattrb> Yeah exactly |
05:39:18 | FromDiscord | <ElegantBeef> Well that's why i put quotes on it since it's completely reasonable and expected 😛 |
05:39:37 | FromDiscord | <mattrb> Yeah totally, I was just curious if cases like this had been explicitly considered before 🙂 |
05:40:22 | FromDiscord | <ElegantBeef> Still dont know what's valid does it become `int` or is it uint8 in the first branch now |
05:41:15 | FromDiscord | <mattrb> My expectation would that int literals without a specified type would conform to any type inferred for that expression |
05:42:09 | FromDiscord | <mattrb> So in _my_ ideal world, Nim would infer both expressions above to yield uint8s |
05:42:25 | FromDiscord | <mattrb> Although I'd imagine this could come down to personal preference too |
05:42:33 | FromDiscord | <mattrb> (edit) "My expectation would ... that" added "be" |
05:45:23 | * | narimiran joined #nim |
05:45:24 | FromDiscord | <ElegantBeef> No real "right" answer |
05:46:20 | FromDiscord | <mattrb> Agreed, just comes down to the discretion of the language designers |
05:47:48 | FromDiscord | <ElegantBeef> Though do say it's rather silly to not have a type listed in the first branch |
05:48:01 | FromDiscord | <ElegantBeef> Like `[10, 20, 30, 40u8]` |
05:48:17 | FromDiscord | <ElegantBeef> Have to look at the last value to see "oh it's a byte array" |
05:49:30 | FromDiscord | <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:37 | FromDiscord | <mattrb> I think it's weird that it works one way but not the other |
05:50:00 | FromDiscord | <ElegantBeef> ~~Looks at my array example~~ |
05:50:07 | FromDiscord | <ElegantBeef> !eval let a = [10, 20, 30, 40u8] |
05:50:09 | NimBot | Compile failed: /usercode/in.nim(1, 22) Error: type mismatch: got <uint8> but expected 'int literal(10)' |
05:50:19 | FromDiscord | <mattrb> :eyesshaking: |
05:50:22 | FromDiscord | <ElegantBeef> !eval let a = [10u8, 20, 30, 40] |
05:50:24 | NimBot | <no output> |
05:51:02 | FromDiscord | <mattrb> So the same story there :halfharold: |
05:51:26 | FromDiscord | <ElegantBeef> indeed |
05:54:07 | FromDiscord | <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:16 | FromDiscord | <ElegantBeef> (edit) removed "fields" | "an enum" => "branches" |
05:54:45 | FromDiscord | <mattrb> Wdym? |
05:55:06 | FromDiscord | <mattrb> Been awhile since I skimmed the docs for the casestatement macros :p |
05:55:13 | FromDiscord | <ElegantBeef> Say you have two enums with the same values, you have to explictly state `Enum.left` |
05:55:44 | FromDiscord | <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:06 | FromDiscord | <ElegantBeef> Case statement macros are macros that let you rewriting the case statement |
05:56:15 | FromDiscord | <ElegantBeef> So same syntax but can do whatever you want |
05:58:22 | FromDiscord | <ElegantBeef> Or not |
06:01:23 | FromDiscord | <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:10 | FromDiscord | <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:57 | FromDiscord | <ElegantBeef> That is some code alright |
06:03:04 | FromDiscord | <ElegantBeef> I helped you make this?! |
06:03:13 | FromDiscord | <mattrb> Haha I'm pretty sure it was you! |
06:03:24 | FromDiscord | <mattrb> 99% of the time you're the one helping me in this channel :p |
06:04:06 | FromDiscord | <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:09 | FromDiscord | <mattrb> < 3 |
06:04:10 | FromDiscord | <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:14 | FromDiscord | <mattrb> In reply to @mattrb "Brief summary: Templates (https://play.nim-lang.org": Ah, it was leorize. Nvm 🙂 |
06:06:42 | FromDiscord | <mattrb> I'm definitely open to opinions if you see a nicer way that still compiles quickly, though 🙂 |
06:06:51 | FromDiscord | <ElegantBeef> Well i'm just talking about cleaning it up 😄 |
06:08:23 | FromDiscord | <mattrb> So much for me burying this code somewhere I'd never see again :halfharold: |
06:10:30 | FromDiscord | <ElegantBeef> I mean it's not much just slightly less redundant https://play.nim-lang.org/#ix=2YT0 |
06:10:49 | FromDiscord | <ElegantBeef> forgot to do `newLit` inside the ct |
06:11:27 | FromDiscord | <ElegantBeef> Here we go https://play.nim-lang.org/#ix=2YTa |
06:11:37 | FromDiscord | <ElegantBeef> Not much of a change, just less redundant |
06:13:02 | FromDiscord | <ElegantBeef> Guess it should also return a `NimNode`, but alas i'm too daft |
06:13:41 | FromDiscord | <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:10 | FromDiscord | <mattrb> Out of curiosity, does the `inline` pragma do anything on bitTestCT? Does the nim vm respect that in some way? |
06:14:23 | FromDiscord | <ElegantBeef> No that's just a marker for the compiler |
06:14:35 | FromDiscord | <ElegantBeef> Just a remnant from me copying the procedure |
06:14:43 | FromDiscord | <mattrb> 👍 |
06:14:52 | FromDiscord | <mattrb> Also, is `CT` a naming convention? What does that stand for? |
06:15:10 | FromDiscord | <ElegantBeef> CompileTime, not really just what i did cause i didnt look further below |
06:15:26 | FromDiscord | <ElegantBeef> You could name it bittest like the other if you dont use the other modules below it |
06:15:26 | FromDiscord | <mattrb> Ah gotcha |
06:15:58 | FromDiscord | <mattrb> Cool, thanks 👍 |
06:16:39 | FromDiscord | <ElegantBeef> if you do you can qualify it `otherModule.bittest` |
06:16:59 | FromDiscord | <ElegantBeef> If you keep doing thumbs up you might lose those fingies |
06:18:01 | FromDiscord | <mattrb> I have a problem with the thumbs up emoji |
06:18:14 | FromDiscord | <ElegantBeef> I have a problem saying "i mean" so join the club |
06:18:18 | FromDiscord | <mattrb> sent a code paste, see https://paste.rs/whl |
06:18:20 | FromDiscord | <mattrb> Lmao |
06:23:28 | FromDiscord | <ElegantBeef> You might be able to use the casestmt macros there since it can be resolved |
06:24:01 | FromDiscord | <mattrb> Yeah I think we're talking about the same thing https://nim-lang.org/docs/manual.html#macros-caseminusof-macro |
06:24:18 | FromDiscord | <ElegantBeef> Oh we arent |
06:24:21 | FromDiscord | <ElegantBeef> I was talking about https://nim-lang.org/docs/manual_experimental.html |
06:24:21 | FromDiscord | <mattrb> Oh? |
06:24:28 | FromDiscord | <ElegantBeef> (edit) "https://nim-lang.org/docs/manual_experimental.html" => "https://nim-lang.org/docs/manual_experimental.html#case-statement-macros" |
06:25:22 | FromDiscord | <mattrb> On interesting |
06:25:37 | FromDiscord | <mattrb> I haven't actually seen a case-of macro in use, so maybe I'm misunderstanding where it's useful |
06:25:53 | FromDiscord | <mattrb> But the case statement macros definitely seem like they'd do what I'm looking for |
06:25:58 | FromDiscord | <ElegantBeef> Though this actually might help 😄 |
06:27:37 | FromDiscord | <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:16 | FromDiscord | <mattrb> I can just throw parens arount it |
06:28:17 | FromDiscord | <ElegantBeef> Return type should be Nimnode in the first proc, might want to do `add:` |
06:28:18 | FromDiscord | <mattrb> (edit) "arount" => "around" |
06:28:31 | FromDiscord | <ElegantBeef> Fuck that shit we're Nim we can block any procedure 😛 |
06:29:31 | FromDiscord | <mattrb> In reply to @ElegantBeef "Return type should be": I didn't even know that was allowed <:big_brain:608305066301980713> |
06:29:53 | FromDiscord | <mattrb> I mean it makes sense |
06:30:05 | FromDiscord | <mattrb> I just didn't realize blocks could be used in that way |
06:30:06 | FromDiscord | <mattrb> Cool |
06:30:14 | FromDiscord | <ElegantBeef> It gets even cooler |
06:30:45 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/hNQ |
06:30:58 | * | hyiltiz quit (Ping timeout: 240 seconds) |
06:31:35 | FromDiscord | <mattrb> Either I'm stupid or it's not obvious what that does lol |
06:31:38 | FromDiscord | <mattrb> Or both |
06:31:50 | FromDiscord | <ElegantBeef> it's `add(a, 300)` or `a.add(300)` |
06:32:12 | FromDiscord | <ElegantBeef> you can do block followed by do to pass all parameters in block forum |
06:32:34 | FromDiscord | <mattrb> What's an example of where that syntax could come in handy? |
06:34:02 | * | hyiltiz joined #nim |
06:34:06 | FromDiscord | <ElegantBeef> Damny playground isnt working well |
06:34:13 | FromDiscord | <ElegantBeef> But there you go |
06:34:16 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/pCo |
06:37:33 | FromDiscord | <mattrb> Weird.. But that example makes sense. I wonder where I'd use that in a practical situation |
06:37:49 | FromDiscord | <mattrb> Are additional args just under further `do` blocks? |
06:37:58 | FromDiscord | <ElegantBeef> Afaik yes |
06:38:23 | FromDiscord | <ElegantBeef> It allows you to skip temporary variables and do the logic in a block there |
06:39:07 | FromDiscord | <ElegantBeef> It's very helpful for macros/templates |
06:40:26 | FromDiscord | <mattrb> Interesting, I could see that |
06:49:31 | FromDiscord | <ElegantBeef> But hey https://play.nim-lang.org/#ix=2YZT it works sorta, @treeform you might be interested 😄 |
06:50:29 | FromDiscord | <ElegantBeef> Thanks matt, didnt know about those before surprisingly |
06:52:40 | FromDiscord | <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:19 | FromDiscord | <ElegantBeef> I'm not that knowledgeable |
06:53:34 | FromDiscord | <mattrb> Then maybe I just ask very basic questions :p |
06:55:04 | FromDiscord | <ElegantBeef> You ask questions i can answer so that means something, i dont know what, but something |
07:00:16 | FromDiscord | <mattrb> In reply to @ElegantBeef "But hey https://play.nim-lang.org/#ix=2YZT it": I think I understand everything you |
07:01:00 | FromDiscord | <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:09 | FromDiscord | <ElegantBeef> Stored in an arglist |
07:01:17 | FromDiscord | <ElegantBeef> So i guess i could do `copyChildren` |
07:02:16 | FromDiscord | <mattrb> I basically haven't looked into nim macros at all. What's the significance of it being in an arglist? |
07:03:01 | FromDiscord | <ElegantBeef> I want what it contains, not the root node |
07:03:33 | FromDiscord | <ElegantBeef> `arglist -> children` i just want `children` not the entire tree |
07:04:47 | * | PMunch joined #nim |
07:08:07 | FromDiscord | <mattrb> Ohhh I understand. Lol I was misunderstanding 2 things. That's super cool |
07:08:21 | FromDiscord | <mattrb> I think I'll definitely end up using that to make my lut generation look a little nicer |
07:09:04 | FromDiscord | <ElegantBeef> Yea the bodies dont need to be typed so it's wonderful |
07:17:56 | FromDiscord | <ElegantBeef> Which means you can do `1000..1001` and not do it in the string |
07:25:29 | FromDiscord | <mattrb> Well it needs to be valid nim, right? |
07:25:40 | FromDiscord | <mattrb> It's not a range |
07:26:24 | FromDiscord | <mattrb> E.g. it might be something like 10.011.010.. or something |
07:26:29 | FromDiscord | <mattrb> (edit) "10.011.010.." => "`10.011.010..`" |
07:26:43 | FromDiscord | <ElegantBeef> Well yea valid nim, but it doesnt have to be "Actual" nim |
07:26:55 | FromDiscord | <ElegantBeef> Aslong as you can massage the parser you're holden |
07:27:00 | FromDiscord | <ElegantBeef> (edit) "holden" => "golden" |
07:27:29 | FromDiscord | <mattrb> Don't think I can trick the parser into accepting "10.011.010.." unless it's in a string :p |
07:27:39 | FromDiscord | <mattrb> Unless you know of some fuckery haha |
07:28:50 | PMunch | Problem is that that isn't valid Nim |
07:29:01 | FromDiscord | <mattrb> Yeah exactly |
07:29:04 | PMunch | And you can't override . |
07:29:12 | FromDiscord | <mattrb> Which is why I was going to put it in a string |
07:30:03 | PMunch | There's basically a distinction between syntactically correct Nim and semantically correct Nim |
07:30:13 | PMunch | But that is neither :P |
07:30:42 | PMunch | As long as it is syntactically correct you can do pretty much whatever you like |
07:32:32 | FromDiscord | <mattrb> Awesome, thanks for confirming 👍 |
07:32:49 | FromDiscord | <mattrb> Oh no, I did another 👍 ElegantBeef is gonna break off a finger |
07:33:00 | FromDiscord | <ElegantBeef> lol |
07:42:45 | FromDiscord | <retkid> someone starting programming |
07:42:50 | FromDiscord | <retkid> they tried to learn c++ |
07:42:53 | FromDiscord | <retkid> they're fucking stupid |
07:42:57 | FromDiscord | <retkid> I told them to learn Nim |
07:43:02 | FromDiscord | <retkid> set them on the right path |
07:43:03 | FromDiscord | <retkid> 😎 |
07:43:35 | PMunch | We started learning C at university. It's not too bad if you do it methodically |
07:44:04 | FromDiscord | <retkid> well, she doesn't know... anything |
07:44:15 | FromDiscord | <retkid> she says shses doing ok |
07:44:21 | FromDiscord | <retkid> don't really believe her |
07:48:30 | PMunch | I 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:04 | FromDiscord | <ElegantBeef> Cmon it has all those modern smart ptrs or w/e |
07:50:41 | PMunch | Haha, 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:55 | FromDiscord | <jtiai> sent a code paste, see https://paste.rs/udd |
08:34:25 | FromDiscord | <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:26 | ForumUpdaterBot | New 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:18 | FromDiscord | <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:29 | PMunch | Possibly rapid, although I haven't tried it myself |
12:38:49 | Clonkk[m] | Maybe SDL2 ? |
12:39:18 | PMunch | He said he found it too complex |
12:39:34 | Clonkk[m] | Ah right, my bad, I read too fast |
12:40:02 | PMunch | It might help to check out my SDL gamelib I used it once for a gamejam and it worked pretty well |
12:40:31 | PMunch | Nico is also pretty cool, at least if you want to create retro looking games |
12:42:56 | FromDiscord | <jtiai> Mainly for my emulator. |
12:44:21 | FromDiscord | <jtiai> rapid looks promising. |
12:49:19 | FromDiscord | <ajusa> raylib is also an option |
12:59:40 | ForumUpdaterBot | New thread by Alexeypetrushin: Let's Make Async Great Again!, see https://forum.nim-lang.org/t/7842 |
13:03:41 | FromDiscord | <Rika> Async is too low level? So are we also going deprecate casting now? |
13:05:09 | PMunch | Casting is low level.. If you use it without a reason to go low level you're doing it wrong |
13:05:26 | FromDiscord | <Rika> Read the forum post |
13:06:33 | PMunch | I have.. |
13:07:42 | FromDiscord | <Rika> I don't know what you mean then |
13:08:31 | PMunch | You asked if we should deprecate casting. I just said that it is sorta deprecated already |
13:15:32 | FromDiscord | <exelotl> lol imagine an update that removes the cast keyword |
13:15:43 | FromDiscord | <exelotl> I'd be screwed :P |
13:19:02 | * | clyybber quit (Quit: WeeChat 3.1) |
13:19:54 | PMunch | Haha, ditto. Would be impossible to work with C code |
13:20:40 | PMunch | But I agree that we could do more with the async system |
13:21:49 | PMunch | It'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:00 | giaco__ | can a pure nim compiled lib be called from C code? |
13:24:49 | PMunch | Sure, if you design it right |
13:27:17 | giaco__ | 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:54 | PMunch | https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c |
13:29:29 | PMunch | There's certainly a bit more to it than that though |
13:29:53 | PMunch | Although less so with --gc:arc |
13:30:28 | giaco__ | sure, I just need to have a look at how it could work, not yet ready to even try to grok it |
13:30:53 | PMunch | It's not that hard |
13:31:33 | PMunch | I've written some DLLs in Nim that was called from a C program I had no control over |
13:32:44 | giaco__ | PMunch: cool! reverse engineering something? |
13:33:15 | PMunch | Nah, extending a DNS server |
13:34:17 | PMunch | First 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:26 | PMunch | It had support for Python modules, but the performance we where getting was just too bad |
13:36:02 | PMunch | So I could either A write some unreadable, optimised C code, or port the whole thing to Nim :D |
13:36:08 | giaco__ | couldn't you call C from python, ot cython, or numba, or something like that? |
13:36:12 | giaco__ | nuitka maybe |
13:36:43 | PMunch | Probably could, but why? |
13:37:10 | giaco__ | (ex python dev here that wants to get back to static typed world) |
13:37:38 | PMunch | Easier 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:03 | PMunch | Converting every DNS query to Python and back is already a bottleneck |
13:38:25 | giaco__ | sure it is, but not really the easiest way to implement a plugin if python is available |
13:38:47 | FromDiscord | <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:07 | giaco__ | yeah, performance wise there's not a chance for python |
13:39:26 | PMunch | Well I had already implemented the Python plugin, but it wasn't performing well enough |
13:39:45 | PMunch | It worked and did the same thing, but performance wasn't good enough |
13:49:04 | giaco__ | 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:10 | FromDiscord | <Zachary Carter> why does anyone use C instead of C++? |
13:50:32 | FromDiscord | <Zachary Carter> if you know the answer that question you'll understand why Nim has C and C++ backends |
13:50:40 | FromDiscord | <Zachary Carter> (edit) "if you know the answer that question you'll understand why Nim has ... C" added "separate" |
13:52:37 | PMunch | It'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:33 | FromGitter | <bung87> how you guys traverse NimNode? I want do some transform thing |
15:03:18 | narimiran | Nim 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:32 | PMunch | @bung87, manually or by using macroutils |
16:03:12 | * | blackpawn joined #nim |
16:26:15 | FromGitter | <bung87> @PMunch Thanks for sharing. |
16:35:31 | PMunch | Did the package naming discussion have an RFC already? |
16:38:46 | Clonkk[m] | I remember seeing a discussion on this topic on the rfc |
16:38:55 | PMunch | On which RFC? |
16:39:15 | Clonkk[m] | Don't remember the name atm |
16:39:29 | PMunch | I 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:15 | Clonkk[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:07 | reversem3 | So 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:33 | federico3 | compiled |
17:08:18 | reversem3 | Ok I thought so but in the book its says "translated to C" |
17:08:25 | reversem3 | semantics ? |
17:08:48 | leorize[m] | you can also just say that nim compiles to executable |
17:09:12 | leorize[m] | I never understood why we even have to explicitly put C in the middle |
17:10:12 | reversem3 | well its compiled to C right , if you look at the disassembly of nim executable to C it is different especially the header |
17:11:02 | federico3 | leorize[m]: because it's more portable and debuggable than some alternatives |
17:11:15 | reversem3 | Also 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:33 | PMunch | Compiled to C explains really quickly a lot of things about what the language probably can do |
17:11:42 | reversem3 | say for instance Qt or GTK |
17:12:11 | federico3 | reversem3: there's no runtime, it's not a VM. The executable is enough. |
17:12:44 | reversem3 | I know nim's not a runtime I mean the qt runtime or gtk or something else |
17:13:13 | leorize[m] | I'm not a fan of associating Nim with C tbh |
17:13:42 | reversem3 | I know I tried to compile SDL and run it on another machine and the machine needed SDL to run |
17:14:07 | leorize[m] | we call those libraries |
17:14:28 | leorize[m] | and yes you would need those on the machine that you want the application to run |
17:15:18 | PMunch | Unless you statically linked them |
17:15:19 | leorize[m] | this applies to all dynamically linked libraries (mostly a C/C++ thing) |
17:16:12 | * | PMunch quit (Quit: leaving) |
17:16:17 | reversem3 | so you could statically link dlls compile them and then run them on another machine without the dlls on the other machine? |
17:37:31 | FromDiscord | <haxscramper> Made PR for compiler explorer for nim 1.4.6, should be available soon |
17:48:25 | FromDiscord | <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:12 | FromDiscord | <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:29 | FromDiscord | <haxscramper> Though this works the same even on nim from `0.20` to `devel` so I guess this is most likely unrelated |
17:52:40 | FromDiscord | <haxscramper> Sorry, not a `deepCopy` but just `copyNimNode` |
17:54:52 | FromDiscord | <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:35 | FromDiscord | <Sabena Sema> nimterop is generally the best wrapper generator right? |
21:13:54 | FromDiscord | <mlokis> sent a code paste, see https://paste.rs/gES |
21:14:19 | FromDiscord | <mlokis> (edit) "https://play.nim-lang.org/#ix=31nR" => "https://paste.rs/OLM" |
21:14:32 | FromDiscord | <ElegantBeef> Yes |
21:15:17 | FromDiscord | <mlokis> nice this can make things lot easier, i can generate methods that convert tipy to id and vice versa |
21:15:21 | FromDiscord | <ElegantBeef> `type` or `typedesc` is actually compile time only |
21:16:37 | FromDiscord | <mlokis> In reply to @mlokis "nice this can make": not really |
21:16:46 | FromDiscord | <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:46 | FromDiscord | <mlokis> not vice versa |
21:16:48 | FromDiscord | <Sabena Sema> (edit) "etc)>" => "etc)?" |
21:16:57 | FromDiscord | <Sabena Sema> or {.header.} |
21:26:24 | FromDiscord | <Sabena Sema> ugh I missed the meetup _again_ |
21:26:43 | FromDiscord | <Sabena Sema> it was posted at 4AM for an 8AM event .... |
21:33:40 | FromDiscord | <creonico> Hey, I just found Nim and want to know the difference in performance with plain C |
21:34:18 | FromDiscord | <ElegantBeef> Can be on par or better |
21:35:12 | * | abm joined #nim |
21:36:10 | FromDiscord | <ElegantBeef> Highly depends on the code 😄 |
21:39:42 | FromDiscord | <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:13 | FromDiscord | <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:21 | FromDiscord | <Sabena Sema> COM, gobject, etc |
21:40:34 | FromDiscord | <ElegantBeef> It can also generate more compiler friendly code, atleast as i understand 😄 |
21:41:07 | FromDiscord | <Sabena Sema> a lot of that is for compile speeds, not runtime speeds (nim can perfectly forward declare everything) |
21:42:17 | FromDiscord | <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:26 | FromDiscord | <Sabena Sema> The type system _does_ have more .... dusty corners .... than most others |
22:00:09 | FromDiscord | <JSONBash> I might be ignorant here, but whats good about CPS? and why is it not just callbacks? |
22:01:03 | FromDiscord | <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:14 | FromDiscord | <Sabena Sema> it is kinda just a callback, but is created automatically |
22:02:01 | FromDiscord | <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:44 | FromDiscord | <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:19 | FromDiscord | <Sabena Sema> yeah that's not quite what I'm asking |
22:09:44 | * | tane quit (Quit: Leaving) |
22:09:48 | FromDiscord | <Sabena Sema> oh closure iterators |
22:09:50 | FromDiscord | <Sabena Sema> OK that makes sense |
22:31:41 | * | hyiltiz quit (Ping timeout: 260 seconds) |
22:32:08 | FromDiscord | <mattrb> Pretty happy with this and wanted to share 🙂 https://play.nim-lang.org/#ix=31B3 |
22:32:22 | FromDiscord | <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:52 | FromDiscord | <exelotl> wowww |
22:39:10 | FromDiscord | <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:09 | FromDiscord | <ElegantBeef> Wow look what i've made you do, spend time refactoring code you were going to hide and never touch |
22:43:35 | FromDiscord | <Sabena Sema> I'm not seeing the code in that link |
22:43:54 | FromDiscord | <ElegantBeef> Playground is a bit buggy recently so refresh might fix it |
22:44:05 | FromDiscord | <Sabena Sema> there it is! |
22:44:29 | * | NimBot joined #nim |
22:44:58 | * | Gustavo6046 joined #nim |
22:45:23 | FromDiscord | <mattrb> Macro trickery is more fun than hiding it in some other file ;p |
22:46:29 | FromDiscord | <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:34 | FromDiscord | <clyybber> and the playground uses ix.io |
22:47:26 | FromDiscord | <Sabena Sema> how do closures store their state? Is it heap allocated someplace? |
22:48:00 | FromDiscord | <Sabena Sema> I guess their state is going to be their position and local variables, since parameters can be changed between suspensions |
22:50:49 | FromDiscord | <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:34 | FromDiscord | <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 |