00:00:07 | * | flynn quit (Read error: Connection reset by peer) |
00:01:21 | * | flynn joined #nim |
00:01:34 | FromDiscord | <Rika> In reply to @Patitotective "hey <@259277943275126785> how are": Your code is more cursed than just callbacks |
00:01:42 | FromDiscord | <Rika> I don’t understand how you’d stop the server |
00:02:32 | FromDiscord | <huantian> you can just send some specific message |
00:02:42 | FromDiscord | <huantian> like`("", "")` |
00:06:31 | * | flynn quit (Read error: Connection reset by peer) |
00:06:56 | FromDiscord | <Omicron666> why no in-browser interpreter... ^^ |
00:07:05 | FromDiscord | <huantian> wdym |
00:07:45 | * | flynn joined #nim |
00:07:50 | FromDiscord | <Omicron666> get rid of docker |
00:07:53 | FromDiscord | <Elegantbeef> This is where i say "there is" https://www.jasonbeetham.com/snake/nicoscripter.html |
00:08:40 | FromDiscord | <Omicron666> couldn't this be on official website? |
00:08:51 | FromDiscord | <Elegantbeef> PRs welcome? |
00:09:04 | FromDiscord | <Elegantbeef> I do want to make a proper P5js like thingy, but i cannot be arsed |
00:09:08 | FromDiscord | <exelotl> dang that's pretty epic |
00:09:21 | FromDiscord | <Omicron666> great animation 😄 |
00:11:32 | FromDiscord | <exelotl> does giving a proc a `static` return type force it to be evaluated at compile-time? |
00:12:28 | FromDiscord | <Elegantbeef> Dont think you can have static as a return type |
00:13:35 | * | flynn quit (Read error: Connection reset by peer) |
00:14:48 | * | flynn joined #nim |
00:19:39 | FromDiscord | <exelotl> hmm it appears you can, but it effectively gives `result` the semantics of a `static` variable |
00:19:57 | * | flynn quit (Read error: Connection reset by peer) |
00:20:00 | FromDiscord | <exelotl> so you can't return anything unless it's known at compile time |
00:20:01 | FromDiscord | <Elegantbeef> Yea just make it an int and call it with `static: ` |
00:21:10 | * | flynn joined #nim |
00:25:31 | * | flynn quit (Read error: Connection reset by peer) |
00:25:53 | FromDiscord | <exelotl> welp, I think this is the best I'm gonna get https://play.nim-lang.org/#ix=3Vum |
00:26:44 | * | flynn joined #nim |
00:27:28 | FromDiscord | <exelotl> I very much want them to be templates so that the Nim compiler evaluates them at compile time even when it doesn't need to (like when you do `var x = 123.toFixed(...)`) |
00:28:42 | FromDiscord | <exelotl> sadly I can't make it work any way other than `untyped` as the return type |
00:29:54 | FromDiscord | <Yardanico> can't you do that with {.compiletime.} |
00:30:16 | FromDiscord | <Yardanico> procs with compiletime are always executed at compile-time |
00:30:31 | FromDiscord | <Yardanico> but this means that if you have a runtime argument it won't really work |
00:30:37 | FromDiscord | <exelotl> yeah, I do want it to be usable at runtime too |
00:30:46 | * | flynn quit (Read error: Connection reset by peer) |
00:30:52 | FromDiscord | <exelotl> just that it should eagerly evaluate as much as possible at compile time |
00:31:25 | FromDiscord | <exelotl> maybe I could do it with an overload that takes `static` params though... |
00:31:59 | * | flynn joined #nim |
00:32:39 | FromDiscord | <Yardanico> yes |
00:36:50 | * | flynn quit (Read error: Connection reset by peer) |
00:38:03 | * | flynn joined #nim |
00:39:28 | FromDiscord | <exelotl> nope https://play.nim-lang.org/#ix=3Vup :( |
00:40:41 | FromDiscord | <exelotl> oh well, at least the templates work 😅 |
00:40:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vuq |
00:41:52 | FromDiscord | <ajusa> Micros is cool |
00:42:02 | FromDiscord | <Elegantbeef> Thanks |
00:42:05 | FromDiscord | <ajusa> Now I can avoid learning how to write real macros |
00:42:14 | FromDiscord | <Elegantbeef> I mean they're real macros |
00:42:19 | FromDiscord | <Elegantbeef> They're how macros should be written |
00:42:28 | FromDiscord | <ajusa> Actually though I always wished stuff like fieldPairs existed for proc params |
00:42:49 | FromDiscord | <ajusa> They are but much easier to reason about than NimNodes imo |
00:43:11 | FromDiscord | <Elegantbeef> Yep, that's the point a reasonable abstraction on top of untyped NimNodes |
00:43:23 | * | flynn quit (Read error: Connection reset by peer) |
00:43:25 | * | lumo_e quit (Ping timeout: 256 seconds) |
00:43:51 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/RAh |
00:43:55 | FromDiscord | <Elegantbeef> I do want to make the API cover a majority of Nim code, but that takes time |
00:44:23 | FromDiscord | <Elegantbeef> Inline it then |
00:44:35 | * | flynn joined #nim |
00:44:55 | FromDiscord | <exelotl> for example it would make debugging with -O0 even more of a pain |
00:45:07 | FromDiscord | <Elegantbeef> Ok |
00:45:22 | FromDiscord | <Elegantbeef> Ajusa have any examples of your macros written with micros? |
00:45:51 | * | lumo_e joined #nim |
00:47:43 | FromDiscord | <ajusa> not yet, I'm trying to use it for some actual code now |
00:48:11 | FromDiscord | <ajusa> looking into building something like fastapi in Nim, so I needed a way to read proc parameters |
00:50:53 | * | flynn quit (Read error: Connection reset by peer) |
00:51:08 | FromDiscord | <Elegantbeef> Ah so the iterator i have will make your life easy |
00:51:38 | FromDiscord | <Elegantbeef> Feel free to PR or make issues if lacking API of course |
00:52:05 | * | flynn joined #nim |
00:52:29 | * | lumo_e quit (Ping timeout: 256 seconds) |
00:52:31 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Vur |
00:52:40 | FromDiscord | <Elegantbeef> Yea |
00:52:56 | FromDiscord | <ajusa> Error: undeclared field: 'routine' |
00:52:57 | FromDiscord | <Elegantbeef> Sorry i dont have any docgen setup, or proper examples 😄 |
00:53:10 | FromDiscord | <Elegantbeef> did you `import micros`? |
00:53:14 | FromDiscord | <ajusa> does it not export everything, or do I need to import something in the stdlib? |
00:53:16 | FromDiscord | <ajusa> yeah |
00:53:33 | FromDiscord | <Elegantbeef> `routineNode` |
00:53:37 | FromDiscord | <Elegantbeef> Did i make a fuck up somewhere? |
00:54:21 | FromDiscord | <ajusa> `for idefs in myProc.routineNode.params:` ? that doesn't work either |
00:54:42 | FromDiscord | <Elegantbeef> What's the error? |
00:54:44 | FromDiscord | <ajusa> and yeah I was going off of https://nim-lang.org/blog/2022/04/04/this-month-with-nim.html |
00:54:56 | FromDiscord | <Elegantbeef> Ah we'll just say i fucked up writting the examples there |
00:55:07 | FromDiscord | <ajusa> sent a code paste, see https://paste.rs/fUS |
00:55:21 | FromDiscord | <Elegantbeef> You still need to use it inside macros |
00:56:03 | FromDiscord | <ajusa> oh I can't use it within a template? |
00:56:13 | FromDiscord | <Elegantbeef> Of course not |
00:56:20 | FromDiscord | <Elegantbeef> It's still macro code |
00:56:57 | FromDiscord | <ajusa> oh, I misunderstood then. I thought I could use it similar to fieldPairs, which unrolls the loop |
00:57:13 | FromDiscord | <ajusa> this is a library to build macros, not a library of macros |
00:57:22 | FromDiscord | <ajusa> (edit) "macros," => "macros more easily," |
00:57:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vut |
00:57:40 | FromDiscord | <Elegantbeef> I mean you can of course make your macros using this |
00:57:48 | FromDiscord | <Elegantbeef> This makes it a breeze to do |
00:57:52 | FromDiscord | <ajusa> yeah that's a heck of a lot easier |
00:58:13 | * | flynn quit (Read error: Connection reset by peer) |
00:58:25 | FromDiscord | <Elegantbeef> so you can always make a `ForLoop` macro which is used on a `proc` |
00:58:33 | FromDiscord | <Elegantbeef> then unrolls the body |
00:59:26 | * | flynn joined #nim |
01:02:03 | * | noeontheend quit (Ping timeout: 260 seconds) |
01:02:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vuw |
01:04:25 | * | flynn quit (Read error: Connection reset by peer) |
01:04:58 | FromDiscord | <Elegantbeef> Odd it's untyped, could've sworn that's supposed to be a typed AST |
01:05:38 | * | flynn joined #nim |
01:09:52 | * | flynn quit (Read error: Connection reset by peer) |
01:11:05 | * | flynn joined #nim |
01:12:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vux |
01:15:23 | * | flynn quit (Remote host closed the connection) |
01:15:47 | FromDiscord | <Elegantbeef> One could make the first emit the second of course |
01:15:57 | FromDiscord | <Elegantbeef> then you could have `for name in procParams(myProc)` |
01:16:21 | FromDiscord | <Elegantbeef> Anyway sorry for letting you down |
01:16:22 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Vuy |
01:16:35 | * | flynn joined #nim |
01:16:37 | FromDiscord | <ajusa> would micros help me solve that problem? |
01:16:43 | FromDiscord | <Elegantbeef> Yes |
01:17:20 | FromDiscord | <ajusa> ok, I will make an actual attempt to learn how to write macros |
01:17:46 | FromDiscord | <Elegantbeef> you could have `get "/hello/#1/someOtherUrl/#2"` which then uses some parsers to attempt to parse `#1` and `#2` then send it to the proc |
01:18:50 | FromDiscord | <ajusa> Yeah I won't struggle with the parsing bit, I'm struggling more with the unwrapping parameters into variables then passing those into the proc bit |
01:20:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vuz |
01:20:12 | FromDiscord | <Elegantbeef> ideally you dont use `parseInt` but like `proc parse(_: typedesc[int], data: openArray[char])` |
01:21:56 | * | flynn quit (Remote host closed the connection) |
01:22:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VuA |
01:23:09 | * | flynn joined #nim |
01:24:48 | FromDiscord | <Elegantbeef> will need the most recent micros for the above with an anonymous proc, forgot that those existed |
01:25:11 | FromDiscord | <Elegantbeef> You can also just do everything micros does manually if you want |
01:26:21 | FromDiscord | <retkid> imagine if instead of C |
01:26:24 | FromDiscord | <retkid> we had Nim in this timeline |
01:26:33 | FromDiscord | <retkid> or well maybe a more low level nim |
01:26:43 | FromDiscord | <retkid> what a neat timeline |
01:26:44 | FromDiscord | <ajusa> we'd have a rough time compiling to a language that doesn't exist then |
01:26:55 | FromDiscord | <retkid> well |
01:26:58 | FromDiscord | <retkid> it would have its own compiler |
01:27:39 | FromDiscord | <Yardanico> we already have nlvm |
01:27:56 | FromDiscord | <retkid> its technically impossible because a lot of the ideas come from JS, perl, etc |
01:27:57 | FromDiscord | <retkid> but still |
01:28:08 | FromDiscord | <Elegantbeef> Just write pascal |
01:28:10 | FromDiscord | <retkid> imagine the nim descendent languages we'd use |
01:28:18 | FromDiscord | <retkid> yea nim->pascal |
01:28:19 | * | flynn quit (Read error: Connection reset by peer) |
01:28:30 | FromDiscord | <retkid> thats stupid I love it |
01:28:40 | FromDiscord | <retkid> anyone wanna do that |
01:28:59 | FromDiscord | <Elegantbeef> I mean alot of Nim translates 1\:1 |
01:29:00 | FromDiscord | <retkid> nim->ada compiler |
01:29:11 | FromDiscord | <retkid> modula 2 |
01:29:11 | FromDiscord | <retkid> (edit) "2" => "3" |
01:29:26 | FromDiscord | <Elegantbeef> Anyway ajusa hopefully what i suggested makes any sense |
01:29:31 | * | flynn joined #nim |
01:32:03 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuB |
01:32:31 | FromDiscord | <Elegantbeef> ` for param in params:` is me being sick |
01:32:33 | FromDiscord | <ajusa> and I don't quite get the nested for loop |
01:32:40 | FromDiscord | <Elegantbeef> drop that and you're good |
01:33:29 | FromDiscord | <Elegantbeef> params iterates over the ident defs(`a: int`, `b, c, d: string`) |
01:33:41 | FromDiscord | <Elegantbeef> `names` iterates over each variable in those defs |
01:34:03 | FromDiscord | <Elegantbeef> so `a`, `b,` , `c`, `d` |
01:34:11 | FromDiscord | <ajusa> oh |
01:34:44 | * | flynn quit (Read error: Connection reset by peer) |
01:35:10 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuD |
01:35:24 | FromDiscord | <Elegantbeef> `result = newStmtList()` before the loop |
01:35:56 | * | flynn joined #nim |
01:36:02 | FromDiscord | <Elegantbeef> and this wont work btw |
01:36:08 | FromDiscord | <Elegantbeef> `theParamString` still needs to be reasoned |
01:37:15 | FromDiscord | <Elegantbeef> you technically dont even need the `let` stmt and can just add `newCall("parse",...)` to `newCall` |
01:37:35 | FromDiscord | <Elegantbeef> But yes you need to pass the split string from the got string into `theParamString` slot |
01:37:37 | FromDiscord | <Yardanico> i wonder if we should create something like #appdev or #guidev specifically for applications (or GUI applications) |
01:37:44 | FromDiscord | <Yardanico> although it does overlap with #main quite a lot, but still |
01:37:46 | FromDiscord | <Yardanico> 🤔 |
01:37:55 | FromDiscord | <Elegantbeef> That implies anyone using Nim makes GUIs 😛 |
01:38:03 | FromDiscord | <Yardanico> we even have #langdev (!) but no #appdev |
01:38:49 | FromDiscord | <Yardanico> also yeah, waiting for PMunch to wake up so I can tell him that Futhark worked fine for me for Sciter |
01:39:01 | FromDiscord | <Yardanico> there are still some things, but generally it's as usable as the previous nimterop-generated binding |
01:39:21 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuH |
01:39:28 | FromDiscord | <Yardanico> poor repo getting updates half a year https://media.discordapp.net/attachments/371759389889003532/965788689626185799/unknown.png |
01:39:48 | FromDiscord | <Elegantbeef> Yea it's a looked up symbol `ident(name.NimNode)` resolves it |
01:39:55 | FromDiscord | <Elegantbeef> but like i said you dont need the let statement |
01:40:14 | FromDiscord | <Elegantbeef> The more important thing right now is splitting the string and passing it to the `parseCall` |
01:41:31 | * | flynn quit (Read error: Connection reset by peer) |
01:42:44 | * | flynn joined #nim |
01:43:50 | FromDiscord | <ajusa> ident doesn't seem to fix it for me, as the signature for newLetStmt requires a nimnode |
01:44:38 | FromDiscord | <ajusa> oh wait |
01:44:48 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuI |
01:46:01 | FromDiscord | <ajusa> this doesn't work` Error: internal error: expr(skType); unknown symbol` |
01:47:07 | FromDiscord | <Elegantbeef> What's the code you're using? |
01:47:39 | FromDiscord | <ajusa> sent a code paste, see https://paste.rs/o2f |
01:47:53 | * | flynn quit (Read error: Connection reset by peer) |
01:49:05 | * | flynn joined #nim |
01:50:37 | FromDiscord | <Elegantbeef> Odd |
01:53:20 | FromDiscord | <Elegantbeef> Ah it's `params.typ` being sym'd |
01:53:42 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuM |
01:54:07 | FromDiscord | <Elegantbeef> Yea that works |
01:54:10 | * | flynn quit (Read error: Connection reset by peer) |
01:54:23 | FromDiscord | <ajusa> forgot that inline tuples were a thing |
01:54:33 | FromDiscord | <retkid> does nlvm allow nim to be more of a systems language? |
01:54:34 | FromDiscord | <Elegantbeef> I mean i hate it but you do you |
01:54:38 | FromDiscord | <ajusa> since they're usually discouraged |
01:54:39 | FromDiscord | <ajusa> lol |
01:54:46 | FromDiscord | <Elegantbeef> "More of a systems language" |
01:54:48 | FromDiscord | <Elegantbeef> How is Nim not a systems language |
01:54:51 | FromDiscord | <retkid> In reply to @ajusa "here is a substantially": oh i just looked over this, what the fuck are you doing |
01:55:00 | FromDiscord | <ajusa> writing code |
01:55:21 | FromDiscord | <retkid> In reply to @Elegantbeef "How is Nim not": I know someone that looks at me and rolls his eyes when i say I do systems programming in Nim |
01:55:22 | * | flynn joined #nim |
01:55:24 | FromDiscord | <retkid> i want his approval |
01:55:38 | FromDiscord | <Elegantbeef> And what does Nim need to be a systems language |
01:55:52 | FromDiscord | <Rika> What does he say |
01:55:54 | FromDiscord | <retkid> nah |
01:56:10 | FromDiscord | <retkid> In reply to @Rika "What does he say": He be like "whatever, just go learn Rust" |
01:56:16 | FromDiscord | <Rika> Ask him why he considers every language he does as a system language and not Nim |
01:56:22 | FromDiscord | <Rika> Don’t argue with the stubborn |
01:56:24 | FromDiscord | <Rika> Why even care |
01:56:32 | FromDiscord | <Elegantbeef> How about just write faster code then his without the fighting borrower checker 😄 |
01:56:36 | FromDiscord | <Yardanico> :nimble: |
01:56:46 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuN |
01:56:55 | FromDiscord | <retkid> In reply to @Elegantbeef "How about just write": no lifetimes and cool macros |
01:56:55 | FromDiscord | <retkid> :) |
01:57:05 | FromDiscord | <Elegantbeef> Eh rust has procedural macros |
01:57:13 | FromDiscord | <retkid> are they cool tho |
01:57:17 | FromDiscord | <Rika> They’re not good |
01:57:21 | FromDiscord | <retkid> exactly |
01:57:35 | FromDiscord | <Rika> AFAIK they’re token macros so |
01:57:43 | FromDiscord | <retkid> the #1 I look for in a language is coolness |
01:58:01 | FromDiscord | <Elegantbeef> I thought it was whether the language got approval from a turdwaffle |
01:58:06 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Eh rust has procedural": they're based on tokens, not AST |
01:58:08 | FromDiscord | <retkid> thats #2 |
01:58:16 | FromDiscord | <Yardanico> because they don't want to expose AST to end users |
01:58:29 | FromDiscord | <Elegantbeef> Well that's arguably good given that AST isnt stable |
01:58:32 | FromDiscord | <Elegantbeef> Like look at macros |
01:58:33 | FromDiscord | <retkid> I kinda miss programming in Nim but I kinda took april off as an existential crisis month |
01:58:43 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Well that's arguably good": what about `typed` or similar |
01:58:52 | FromDiscord | <Elegantbeef> What? |
01:59:07 | FromDiscord | <Elegantbeef> Give a formalized spec for typed and it's good |
01:59:15 | * | Onionhammer quit (Read error: Connection reset by peer) |
01:59:22 | FromDiscord | <Elegantbeef> There is no spec for typed firstly, and yea exposing AST does give benefits but also gives negatives |
01:59:36 | FromDiscord | <Elegantbeef> Nim's locked into a AST due to macros, any changes to the AST causes macros to break |
02:00:02 | FromDiscord | <Rika> That’s just versioning |
02:00:13 | FromDiscord | <Rika> A matter of versioning I mean |
02:00:24 | * | flynn quit (Read error: Connection reset by peer) |
02:00:30 | FromDiscord | <Elegantbeef> Well yes, but it causes more maintance if you want to support 2 versions with a single macro |
02:01:05 | FromDiscord | <Elegantbeef> You now need a `when (NimMajorVersion, NimMinorVersion) >= (1, 7)` for things like variable def macros |
02:01:25 | * | Onionhammer joined #nim |
02:01:36 | * | flynn joined #nim |
02:01:38 | FromDiscord | <Elegantbeef> I dont know which i prefer i just know there are benefits to each |
02:01:47 | FromDiscord | <Rika> This is a major change so I’d assume it wouldn’t happen on minors |
02:03:32 | FromDiscord | <Elegantbeef> Yea I just mean you have to maintain it, afaik with a token stream macro system you dont, but I also dont know how you'd get type information there |
02:05:26 | * | flynn quit (Read error: Connection reset by peer) |
02:06:38 | * | flynn joined #nim |
02:12:48 | * | flynn quit (Read error: Connection reset by peer) |
02:14:01 | * | flynn joined #nim |
02:19:09 | * | flynn quit (Read error: Connection reset by peer) |
02:20:22 | * | flynn joined #nim |
02:24:30 | * | flynn quit (Read error: Connection reset by peer) |
02:25:43 | * | flynn joined #nim |
02:28:29 | FromDiscord | <ajusa> In reply to @ajusa "here is a substantially": so uh the cursed tuple thing I tried using earlier isn't the same, forgot that procs let you specify default values |
02:28:52 | * | Gustavo6046 quit (Remote host closed the connection) |
02:28:52 | * | Gustavo6046_ joined #nim |
02:29:46 | FromDiscord | <huantian> In reply to @Elegantbeef "I dont know which": Classic software dilemma of long term support/stability vs new breaking features |
02:30:13 | * | flynn quit (Remote host closed the connection) |
02:31:25 | * | flynn joined #nim |
02:36:40 | * | flynn quit (Read error: Connection reset by peer) |
02:37:15 | * | Gustavo6046_ quit (Ping timeout: 260 seconds) |
02:37:53 | * | flynn joined #nim |
02:38:49 | * | Gustavo6046 joined #nim |
02:40:09 | * | Gustavo6046 quit (Max SendQ exceeded) |
02:40:57 | * | Gustavo6046 joined #nim |
02:43:21 | * | flynn quit (Read error: Connection reset by peer) |
02:44:34 | * | flynn joined #nim |
02:49:40 | * | flynn quit (Remote host closed the connection) |
02:50:53 | * | flynn joined #nim |
02:54:46 | FromDiscord | <creikey> In reply to @Elegantbeef "And what does Nim": it needs to be used by systems applications which provide value to people |
02:55:17 | * | flynn quit (Read error: Connection reset by peer) |
02:56:29 | * | flynn joined #nim |
02:58:55 | FromDiscord | <Elegantbeef> Uh odd definition |
03:00:18 | * | arkurious quit (Quit: Leaving) |
03:01:46 | * | flynn quit (Read error: Connection reset by peer) |
03:02:58 | * | flynn joined #nim |
03:07:51 | * | flynn quit (Read error: Connection reset by peer) |
03:09:04 | * | flynn joined #nim |
03:14:48 | * | flynn quit (Read error: Connection reset by peer) |
03:16:02 | * | flynn joined #nim |
03:20:25 | * | flynn quit (Read error: Connection reset by peer) |
03:21:28 | * | ltriant quit (Ping timeout: 248 seconds) |
03:21:38 | * | flynn joined #nim |
03:27:14 | * | flynn quit (Read error: Connection reset by peer) |
03:28:27 | * | flynn joined #nim |
03:33:19 | FromDiscord | <cyberbird träumend> In reply to @Elegantbeef "Uh odd definition": but isn't that the definition |
03:33:38 | * | flynn quit (Remote host closed the connection) |
03:33:45 | FromDiscord | <cyberbird träumend> like a systems language is one used in OS's |
03:34:08 | FromDiscord | <Elegantbeef> "Whic provide value to people" is the odd part |
03:48:10 | FromDiscord | <creikey> In reply to @Elegantbeef ""Whic provide value to": by that I mean it has to be part of something people value, one proxy of that is it has to make money |
03:48:52 | FromDiscord | <Elegantbeef> I mean that's a pointless delimiter |
03:49:31 | FromDiscord | <Elegantbeef> If we're talking about what makes a system language "making money" does not change the functional capability |
03:50:07 | FromDiscord | <Elegantbeef> Like yes it makes it more compelling to use but it's a complete dis-regression of what's required for a system language |
03:51:17 | FromDiscord | <Elegantbeef> Arguably the requirements for a 'system langauge' are\:↵A high level language↵Directly or indirectly compiles to native code↵Ability to manually manage memory |
03:51:41 | FromDiscord | <Elegantbeef> Atleast that's what i understand when people say "system language" |
03:57:09 | * | slowButPresent quit (Quit: leaving) |
04:17:27 | FromDiscord | <creikey> In reply to @Elegantbeef "I mean that's a": the point is it's empirical evidence that it serves its purpose as a systems language |
04:17:49 | FromDiscord | <creikey> I would say more as a requirement before I consider it on the table as a systems language |
04:18:20 | FromDiscord | <creikey> you could say that delimiter is what keeps it from ever passing it because it's like chicken and egg problem, but I'll let others figure out how to make money with something unproven before I attempt to do so |
04:18:39 | FromDiscord | <creikey> being an early adopter for something so time consuming does not make much sense to me |
04:18:54 | FromDiscord | <Elegantbeef> I mean i still dont see how that makes it a system language |
04:19:06 | FromDiscord | <Elegantbeef> It makes it a visibly and demonstrably usable language |
04:19:17 | FromDiscord | <creikey> of course most languages are |
04:19:18 | FromDiscord | <Elegantbeef> Hardly differentiates it between "system" and not |
04:19:25 | FromDiscord | <creikey> maybe the differentiator could be "useful" systems language |
04:19:32 | FromDiscord | <creikey> where use is creating something valuable with software |
04:19:37 | FromDiscord | <Elegantbeef> Except most languages dont fall into "System language" |
04:19:57 | FromDiscord | <Elegantbeef> Python, Lua, C#, Java, Kotlin, Scala, Go are not considered system languages |
04:20:36 | FromDiscord | <creikey> if it's by your definition Go does |
04:20:42 | FromDiscord | <creikey> python also compiles to C with cython |
04:20:47 | FromDiscord | <Elegantbeef> Go doesnt give manual memory management |
04:20:52 | FromDiscord | <creikey> you can turn the gc off |
04:21:17 | FromDiscord | <creikey> do you see what I mean like technically |
04:21:20 | FromDiscord | <creikey> I think most of those languages |
04:21:22 | FromDiscord | <creikey> except lua |
04:21:25 | FromDiscord | <creikey> are systems programming languages |
04:21:35 | FromDiscord | <Elegantbeef> And i'd say you're wrong given there are caveats |
04:21:36 | FromDiscord | <creikey> but have they been used to make value as a systems language? not really |
04:23:27 | FromDiscord | <huantian> what do you have against lua 😛↵(@creikey) |
04:23:33 | FromDiscord | <creikey> In reply to @huantian "what do you have": interpreted |
04:23:50 | FromDiscord | <Rika> In reply to @creikey "interpreted": Java is “interpreted” by that definition |
04:23:56 | FromDiscord | <creikey> In reply to @Rika "Java is “interpreted” by": there are services that compile java |
04:24:00 | FromDiscord | <creikey> companies for embedded java |
04:24:19 | FromDiscord | <Rika> In reply to @creikey "there are services that": There are probably programs that could compile Lua as well, I don’t understand |
04:24:36 | FromDiscord | <creikey> In reply to @Rika "There are probably programs": lua is included then |
04:25:02 | FromDiscord | <Elegantbeef> You can theoretically make a native compiler for any language but that doesnt describe it's conventional and practical usage |
04:25:07 | FromDiscord | <Rika> I don’t understand how Lua being “interpreted” leaves it out of systems programming anyway |
04:25:08 | FromDiscord | <creikey> In reply to @Elegantbeef "You can theoretically make": exactly |
04:25:13 | FromDiscord | <creikey> that's why I have the "has it created value" yet caveat |
04:25:25 | FromDiscord | <Rika> There’s no reason you can’t provide facilities for manual memory management in Lua |
04:25:35 | FromDiscord | <creikey> In reply to @Rika "I don’t understand how": I guess this is ture |
04:25:36 | FromDiscord | <creikey> (edit) "ture" => "true" |
04:25:45 | FromDiscord | <Elegantbeef> The simple thing is that they're not conventially used as such and there is no reason to consider them as such |
04:25:56 | FromDiscord | <Rika> And Lua is most likely embedded heavier than Python |
04:25:57 | FromDiscord | <creikey> In reply to @Elegantbeef "The simple thing is": this is what I am saying |
04:26:00 | FromDiscord | <creikey> about nim |
04:26:07 | FromDiscord | <creikey> where has it been used at scale to make something valuable |
04:26:11 | FromDiscord | <creikey> other than the nim compiler |
04:26:14 | FromDiscord | <Elegantbeef> It's conventionally used as one though |
04:26:14 | FromDiscord | <creikey> as a systems programming language |
04:26:21 | FromDiscord | <Elegantbeef> Many people use it for embedded |
04:26:25 | FromDiscord | <Elegantbeef> Many people use it for gamedev |
04:26:28 | FromDiscord | <Rika> You have to normalise against popularity as well |
04:26:32 | FromDiscord | <creikey> that's true |
04:26:42 | FromDiscord | <Rika> If you don’t then you’re just eliminating anything tiny |
04:27:11 | FromDiscord | <Elegantbeef> Nim comes to you conventionally as a systems language, you dont need to jump through hoops to get it |
04:27:22 | FromDiscord | <Rika> Ugh this is reminding me of statistics again |
04:27:32 | FromDiscord | <Elegantbeef> Lol everything is statistics |
04:27:33 | FromDiscord | <creikey> In reply to @Elegantbeef "Nim comes to you": this is true actually I think I'm very wrong in my definition |
04:27:43 | FromDiscord | <creikey> the more I think about it |
04:27:57 | FromDiscord | <creikey> I've just been having a lot of debates about whether to use C++ or nim with programming friends |
04:28:03 | FromDiscord | <creikey> for new things |
04:28:16 | FromDiscord | <Rika> Can’t you just respect each other’s opinions |
04:28:53 | FromDiscord | <creikey> In reply to @Rika "Can’t you just respect": I mean of course I respect opinions |
04:28:56 | FromDiscord | <Elegantbeef> No only my opinion is right! |
04:29:12 | FromDiscord | <creikey> what do you think opinions should never be talked about? |
04:29:25 | FromDiscord | <Rika> No when you say debates I just imagine argument |
04:29:39 | FromDiscord | <creikey> no I just mean like talking about what's going on |
04:29:47 | FromDiscord | <creikey> how do you make good software |
04:30:43 | FromDiscord | <Rika> Either you use something that’s already good and mature and extend from there or you become a fore runner and exert a lot of effort to make something good with what you’re given |
04:30:48 | FromDiscord | <Rika> Then again |
04:30:54 | FromDiscord | <Rika> It’s never that black and white |
04:31:06 | FromDiscord | <Rika> Every language has its polished parts and abysses |
04:31:31 | FromDiscord | <Rika> It’s just that when something is mature, popular, or old |
04:31:40 | FromDiscord | <Rika> You more easily know what’s good or bad about it |
04:31:46 | FromDiscord | <Rika> It’s a fear of the unknown I guess |
04:31:52 | FromDiscord | <creikey> one of the big things we don't really understand is whether nim's gc causes bad software |
04:31:56 | FromDiscord | <Rika> What |
04:32:06 | FromDiscord | <Elegantbeef> Lol |
04:32:09 | FromDiscord | <creikey> so like having a gc makes it really easy to use ref objects everywhere right |
04:32:22 | FromDiscord | <Rika> Who gives a fuck about that, Java has its old honking absolute shit GC yet the software isn’t BAD per se |
04:32:26 | FromDiscord | <creikey> the argument is that causes you to naturally allocate all the time which is bad practice for a lot of software |
04:32:30 | FromDiscord | <Rika> No |
04:32:35 | FromDiscord | <Rika> Not if you have a brain |
04:32:37 | FromDiscord | <Elegantbeef> Not it doesnt |
04:32:41 | FromDiscord | <Elegantbeef> You use references for reference semantics |
04:32:48 | FromDiscord | <Elegantbeef> If you dont need reference semantics you dont use it |
04:32:50 | FromDiscord | <Elegantbeef> Especially with arc/orc |
04:32:51 | FromDiscord | <Rika> If you’re taught improperly sure |
04:33:01 | FromDiscord | <Rika> Just like how if you’re taught C improperly you could get memory leaks |
04:33:07 | FromDiscord | <Solitude> In reply to @creikey "one of the big": no, because then i look at your code and write mean message to you in private |
04:33:08 | FromDiscord | <Elegantbeef> In reality most avid Nim programmers default to `object` not `ref object` |
04:33:21 | FromDiscord | <creikey> of course of course |
04:33:27 | FromDiscord | <Rika> Okay |
04:33:32 | FromDiscord | <Rika> I see now |
04:33:35 | FromDiscord | <creikey> to be clear this is not my thinking |
04:33:41 | FromDiscord | <Rika> No yeah I see |
04:33:57 | FromDiscord | <!Patitotective> In reply to @Solitude "no, because then i": 💀 |
04:34:19 | FromDiscord | <creikey> In reply to @Rika "Who gives a fuck": most java programs I interact with I would say are bad |
04:34:27 | FromDiscord | <Yardanico> In reply to @Solitude "no, because then i": i'm in your ~~walls~~ code |
04:34:39 | FromDiscord | <creikey> like minecraft had to explicitly pass the xyz floats of vectors instead of the object to avoid the gc |
04:34:46 | FromDiscord | <creikey> (edit) "the" => "a vector" |
04:34:51 | FromDiscord | <Rika> Minecraft is a different story |
04:35:02 | FromDiscord | <creikey> it's harder to write the good code than the bad code sometimes in a language is what I'm trying to say |
04:35:08 | FromDiscord | <Rika> Okay |
04:35:20 | FromDiscord | <Elegantbeef> Sure but that's Java a language that doesnt have value types |
04:35:20 | FromDiscord | <Rika> Yes but that’s usually due to limitations like as you say with Java |
04:35:21 | FromDiscord | <Elegantbeef> Not all languages that have gc are equal |
04:35:35 | FromDiscord | <creikey> In reply to @Elegantbeef "Not all languages that": of course nim having value types saves a lot of trouble on that front |
04:35:46 | FromDiscord | <creikey> but still a lot of times you want reference types without managed memory |
04:35:59 | FromDiscord | <Elegantbeef> So then do that? |
04:36:09 | FromDiscord | <creikey> it's easier to not do that so the majority of nim software uses managed memory |
04:36:19 | FromDiscord | <Rika> In reply to @creikey "but still a lot": Why? |
04:36:22 | FromDiscord | <Rika> What case? |
04:36:25 | FromDiscord | <Yardanico> In reply to @creikey "but still a lot": can you tell examples of these "lot of times"? |
04:36:29 | FromDiscord | <Rika> Yeah |
04:36:31 | FromDiscord | <Elegantbeef> Needing manual memory management can be achieved with a GC |
04:36:32 | FromDiscord | <Yardanico> you can use `ref object` just fine even on embedded |
04:36:39 | FromDiscord | <Yardanico> with ARC/ORC |
04:36:41 | FromDiscord | <Elegantbeef> Do people not realize you can do `GcRef` and `GcUnref` |
04:36:52 | FromDiscord | <Rika> In reply to @Elegantbeef "Do people not realize": Yes |
04:36:56 | FromDiscord | <Rika> People don’t know about it |
04:36:58 | FromDiscord | <creikey> In reply to @Yardanico "can you tell examples": I should stop saying these things because I'm not the one who believes them so I can't like represent this very well |
04:36:59 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/pointerexplanation.html here you go |
04:37:03 | FromDiscord | <Elegantbeef> Read that then come back to me |
04:37:18 | FromDiscord | <creikey> In reply to @Elegantbeef "Read that then come": am I going to be the middle man for the guy who says this stuff |
04:37:30 | FromDiscord | <Rika> In reply to @Elegantbeef "https://www.jasonbeetham.com/pointerexplanation.htm": I will always read your name like beet then ham |
04:37:40 | FromDiscord | <Elegantbeef> Hey me too |
04:37:58 | FromDiscord | <creikey> I'm almost halfway through the nim manual |
04:38:01 | FromDiscord | <creikey> it's actually not that long |
04:38:09 | FromDiscord | <Rika> In reply to @creikey "I'm almost halfway through": Read it another 5 times after |
04:38:14 | FromDiscord | <Yardanico> well reading the manual just for the manual isn't that beneficial :) |
04:38:21 | FromDiscord | <Yardanico> but when you're writing something and often refer to it, you do learn it |
04:38:23 | FromDiscord | <creikey> In reply to @Yardanico "well reading the manual": I want to know what to ctrl f in the manual |
04:38:24 | FromDiscord | <huantian> I didn't read most of it tbh ↵the pragma session is a tad stale |
04:38:28 | FromDiscord | <!Patitotective> In reply to @Yardanico "but when you're writing": ⬆️ |
04:38:39 | FromDiscord | <creikey> this is how I learned godot and it went really well |
04:39:01 | FromDiscord | <huantian> I don't have the attention spam to read that much 😅 |
04:39:09 | FromDiscord | <Rika> I read your article beef and god damn first paragraph there’s a run on sentence already |
04:39:16 | FromDiscord | <Rika> Or rather a missing comma |
04:39:32 | FromDiscord | <huantian> well his name is beef and not be good at grammar |
04:39:35 | FromDiscord | <Elegantbeef> Probably i'm not a great writererer |
04:39:42 | FromDiscord | <Rika> In reply to @huantian "I don't have the": Sucks that Attention Spam™️ is sold out nowadays no? |
04:39:54 | FromDiscord | <huantian> Spam is so good |
04:40:01 | FromDiscord | <huantian> I love spam it's just like ham but better |
04:40:04 | FromDiscord | <huantian> and even more unhealthy |
04:40:52 | FromDiscord | <Rika> Hey you’ll hurt Mr. Beet Ham’s feelings here (in all seriousness tell me if you don’t want these kinds of jokes) |
04:40:58 | FromDiscord | <Elegantbeef> This is where i say the truth that i generally prefer fish and i'm shunned! |
04:41:06 | FromDiscord | <Rika> What |
04:41:13 | FromDiscord | <Rika> ElegantFish |
04:41:16 | FromDiscord | <huantian> fish is good but like gets old↵maybe cus I always eat the same style of fish... |
04:41:22 | FromDiscord | <creikey> how does arc process gcref and unref |
04:41:27 | FromDiscord | <creikey> cause it has to insert the destructor calls right |
04:41:29 | FromDiscord | <huantian> Also bones 😔 |
04:41:40 | FromDiscord | <Rika> Bones scary |
04:41:40 | FromDiscord | <Elegantbeef> It increments the reference counter just like an ongoing reference |
04:42:58 | FromDiscord | <Yardanico> In reply to @creikey "cause it has to": ARC does refcounting |
04:43:38 | FromDiscord | <creikey> I misread the info page |
04:45:12 | FromDiscord | <Elegantbeef> Also rika where is the run on sentence? |
04:46:06 | FromDiscord | <Rika> “Not to worry[,] this writeup will hopefully” |
04:46:39 | FromDiscord | <Rika> “Hey, this does not seem too complicated[. Y]ou” |
04:46:51 | FromDiscord | <Rika> (edit) "“Hey," => "“Hey[,]" |
04:47:14 | FromDiscord | <Rika> “mess it up[?] You already” |
04:47:30 | FromDiscord | <Rika> “yourself[,] "ah” |
04:47:46 | FromDiscord | <Elegantbeef> Feel free to just grab the source and fix it, it's easier than the entire list |
04:47:58 | FromDiscord | <Rika> HAHAHAHAHA okay later, is this on a repo? |
04:48:09 | FromDiscord | <Elegantbeef> It's just on the very bottom there is a "view source" |
04:48:17 | FromDiscord | <Rika> Gotcha I’ll PR if I remember |
04:54:32 | FromDiscord | <retkid> gonna be honest |
04:54:38 | FromDiscord | <retkid> i despise web dev |
04:54:42 | FromDiscord | <retkid> however few things are more rewarding |
04:55:04 | FromDiscord | <retkid> except the rewards are much fewer and far between than low level maths |
04:55:04 | FromDiscord | <Rika> Huh why |
04:55:33 | FromDiscord | <retkid> well, I learned this framework, I had strife, i cried, I watch day turn to night and turn back today |
04:55:35 | FromDiscord | <retkid> (edit) "today" => "to day" |
04:55:39 | FromDiscord | <retkid> but i did it |
04:55:45 | FromDiscord | <retkid> i got a shitty looking application |
04:56:34 | FromDiscord | <Yardanico> @beef another arc funny |
04:56:34 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/18341 |
04:56:48 | FromDiscord | <Yardanico> with latest compiler the diff is 350 times, but with clang it's the same between refc and arc |
04:56:52 | FromDiscord | <Yardanico> gcc is dead?!?!?! |
04:57:02 | FromDiscord | <retkid> WHAT |
04:57:12 | FromDiscord | <Yardanico> what? it can happen |
04:57:17 | FromDiscord | <huantian> clang is like two characters longer than gcc |
04:57:21 | FromDiscord | <huantian> not worth |
04:57:22 | FromDiscord | <Yardanico> maybe clang noticed a good optimization with arc while gcc didn't |
04:57:38 | FromDiscord | <Yardanico> but the root issue is still around even if you compile with arc, it's just that clang is smarter than gcc in this specific case |
04:57:40 | FromDiscord | <retkid> I Suppose |
04:57:42 | FromDiscord | <retkid> 60 years from now |
04:57:44 | FromDiscord | <retkid> if i write C |
04:57:50 | FromDiscord | <retkid> will i use the same compiler |
04:57:51 | FromDiscord | <retkid> probably not |
04:57:58 | FromDiscord | <Rika> In reply to @huantian "clang is like two": Just alias clang to cc or something |
04:58:12 | FromDiscord | <Yardanico> if we don't have quantum computers, it's likely you'll be using gcc or clang :P |
04:58:14 | FromDiscord | <retkid> though I think my mind would be too mushy to understand c |
04:58:19 | FromDiscord | <Rika> 60 years from now you’re probably not writing code |
04:58:22 | FromDiscord | <retkid> yea |
04:58:23 | FromDiscord | <Yardanico> @retkid gcc has been around for 35 years |
04:58:37 | FromDiscord | <Yardanico> clang is much younger of couirse |
04:58:38 | FromDiscord | <Yardanico> (edit) "couirse" => "course" |
04:58:43 | FromDiscord | <retkid> im sure theres 80 year old programmers |
04:58:47 | FromDiscord | <retkid> writing cool things |
04:59:06 | FromDiscord | <Rika> People who are half the age of GCC are teenagers Jesus Christ |
04:59:19 | FromDiscord | <retkid> im just under half |
04:59:19 | FromDiscord | <retkid> at 18 |
04:59:26 | FromDiscord | <retkid> (edit) "under" => "over" |
04:59:38 | FromDiscord | <Rika> In reply to @retkid "im just over half": Quick maths |
04:59:44 | FromDiscord | <retkid> shut up |
04:59:50 | FromDiscord | <huantian> dang I'm younger than gcc too |
04:59:58 | FromDiscord | <Rika> Lots of people are so |
05:00:02 | FromDiscord | <retkid> god it would make me depressed if i was older than gcc |
05:00:17 | FromDiscord | <huantian> guess I just doxed myself I'm under 35yr old |
05:00:24 | FromDiscord | <retkid> im omw to your location rn |
05:00:36 | FromDiscord | <huantian> my ip is 127.0.0.1 |
05:00:42 | FromDiscord | <Rika> In reply to @huantian "guess I just doxed": I Have Triangulated Your Location |
05:01:03 | FromDiscord | <retkid> In reply to @huantian "my ip is 127.0.0.1": this statement is true |
05:01:10 | FromDiscord | <Rika> No but that’s my IP |
05:01:21 | FromDiscord | <retkid> wait a sec |
05:01:23 | FromDiscord | <retkid> thats my ip too |
05:01:25 | FromDiscord | <retkid> 🤔 |
05:03:09 | FromDiscord | <huantian> hm we must be in the same location then |
05:03:11 | FromDiscord | <huantian> are you guys in my walls |
05:04:02 | FromDiscord | <Rika> Yeah that’s where I live how did you know |
05:04:23 | FromDiscord | <huantian> I did that thing with the stethoscope on the walls yk |
05:04:40 | FromDiscord | <retkid> if i ping that ip it must go to all of us |
05:04:43 | FromDiscord | <huantian> but I used a stud detector instead of a stethoscope |
05:05:00 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/965840416421314570/unknown.png |
05:05:04 | FromDiscord | <retkid> its like you live right next to me |
05:05:10 | FromDiscord | <Yardanico> #offtopic :forsenThink: |
05:05:20 | FromDiscord | <Yardanico> but ok, i'm in your walls |
05:05:21 | FromDiscord | <retkid> 😴 |
05:05:26 | FromDiscord | <Elegantbeef> I just use a drill and keep going until i ht a stud |
05:05:30 | FromDiscord | <Elegantbeef> Doxxed yourself |
05:05:30 | FromDiscord | <Elegantbeef> Haha yard you have no power here! |
05:05:37 | FromDiscord | <Yardanico> damnit |
05:05:49 | FromDiscord | <Yardanico> so does anyone remember how to emit LLVM IR with nim |
05:06:00 | FromDiscord | <Yardanico> except nlvm |
05:06:03 | FromDiscord | <Rika> Fuck |
05:06:11 | FromDiscord | <Elegantbeef> This guy took my only answer |
05:06:20 | FromDiscord | <Yardanico> I know clang has -S -emit-llvm but they're not working for me, maybe I'm missing something |
05:06:28 | FromDiscord | <Yardanico> ah nvm it works |
05:06:32 | FromDiscord | <Rika> Lmao |
05:06:33 | FromDiscord | <Yardanico> ` nim c -d:danger --gc:arc --cc:clang --passC:"-S -emit-llvm" pup.nim` |
05:06:39 | FromDiscord | <Yardanico> the only problem is that the LLVM IR is stored in .o files |
05:06:54 | FromDiscord | <Elegantbeef> O |
05:07:10 | FromDiscord | <huantian> O\_O |
05:07:17 | FromDiscord | <demotomohiro> Is it just passing some option to clang? |
05:07:18 | FromDiscord | <Rika> Not in .ll? |
05:07:21 | FromDiscord | <Yardanico> yes @demotomohiro |
05:07:23 | FromDiscord | <Rika> In reply to @demotomohiro "Is it just passing": Yes |
05:07:30 | FromDiscord | <Yardanico> In reply to @Rika "Not in .ll?": because you can't tell nim to do this |
05:07:32 | FromDiscord | <Yardanico> or i don't remember |
05:07:43 | FromDiscord | <demotomohiro> Then, you can find the answer in clang manual. |
05:07:59 | FromDiscord | <Yardanico> i already found it on stackoverflow, but thanks :) |
05:10:05 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/965841694769676288/unknown.png |
05:10:21 | FromDiscord | <Yardanico> this is indeed very readable (no) |
05:10:32 | FromDiscord | <Elegantbeef> Hey nice rust |
05:10:55 | FromDiscord | <aph> im new, is this python |
05:11:47 | FromDiscord | <aph> In reply to @Yardanico "this is indeed very": i understand every word there, i just don't understand the code, yeah it's readable in a way |
05:12:44 | FromDiscord | <Yardanico> at least it's not GCC's GIMPLE |
05:14:40 | FromDiscord | <Phil> In reply to @Elegantbeef "In reality most avid": let's be honest, that is solely due to lazyness... I guess in that respect, the added word is good software design |
05:15:03 | FromDiscord | <Rika> In reply to @Yardanico "at least it's not": Sounds very GOMPLEX |
05:15:07 | FromDiscord | <Elegantbeef> What? |
05:15:19 | FromDiscord | <Elegantbeef> It's due to the fact most nim programmers dont want ref semantics |
05:15:23 | FromDiscord | <Yardanico> In reply to @Rika "Sounds very GOMPLEX": at least for GCC it's quite easy to make it spit out output of ALL compiler passes |
05:15:31 | FromDiscord | <Yardanico> of course no one cares if you can read them or not, but the fact is there |
05:15:58 | FromDiscord | <Phil> In reply to @Elegantbeef "It's due to the": That was more from the point of view of a beginner, e.g. somebody that came over from JS or Python |
05:16:14 | FromDiscord | <Solitude> In reply to @Isofruit "let's be honest, that": every other newbie sticks `ref object of piss` or something because they dont know what the hell does it mean. |
05:16:18 | FromDiscord | <Phil> They'll still gravitate towards object instead of ref object because less typing |
05:16:33 | FromDiscord | <Elegantbeef> I mean that's beneficial depending on the code |
05:16:35 | FromDiscord | <Elegantbeef> References can slow down code |
05:16:41 | FromDiscord | <Elegantbeef> Generally they do |
05:16:56 | FromDiscord | <Elegantbeef> Pointer indirection is a hell of a drug |
05:17:21 | FromDiscord | <Yardanico> oh right, gcc loves S-expressions so much that they have RTL |
05:17:25 | FromDiscord | <Yardanico> "The last part of the compiler work is done on a low-level intermediate representation called Register Transfer Language. In this language, the instructions to be output are described, pretty much one by one, in an algebraic form that describes what the instruction does." |
05:17:26 | FromDiscord | <Yardanico> "RTL is inspired by Lisp lists. It has both an internal form, made up of structures that point at other structures, and a textual form that is used in the machine description and in printed debugging dumps. The textual form uses nested parentheses to indicate the pointers in the internal form." |
05:17:51 | FromDiscord | <Elegantbeef> Unironically the fact Nim uses ref objects for it's AST is one reason the compiler is relatively slow |
05:18:06 | FromDiscord | <Elegantbeef> If it used a DOD it'd be much much faster |
05:18:11 | FromDiscord | <Rika> DOD? |
05:18:17 | FromDiscord | <Yardanico> data oriented design |
05:18:18 | FromDiscord | <Yardanico> iirc |
05:18:19 | FromDiscord | <Elegantbeef> Data oriented design |
05:18:20 | FromDiscord | <Rika> Okay |
05:18:28 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Unironically the fact Nim": yes i just wanted to share the fact that GCC uses lisp-inspired structures for a part of the compiler |
05:18:36 | FromDiscord | <Yardanico> not surprising knowing the roots of gcc, but still interesting |
05:18:37 | FromDiscord | <Elegantbeef> I was talking to phil mostly |
05:19:06 | FromDiscord | <Elegantbeef> Since they brought noobs defaulting to `object` |
05:20:03 | FromDiscord | <Yardanico> i think it's actually more likely for new Nim people to use `ref object` if they've previously used languages like Python |
05:20:16 | FromDiscord | <Yardanico> because they're confused by `var`, having to make the argument type of the function `var Something`, no recursion in types, etc |
05:20:19 | FromDiscord | <Elegantbeef> Yea they generally want aliasing and ref semantics as it's what they're used to |
05:20:26 | FromDiscord | <Rika> I’m just thinking how a tree structure like AST would look like as DOD |
05:20:36 | FromDiscord | <Yardanico> In reply to @Rika "I’m just thinking how": ask zig :P |
05:20:49 | FromDiscord | <Elegantbeef> Yep Zig does packed AST where it's a bunch of indicies to the value |
05:21:10 | FromDiscord | <Elegantbeef> So your ast is stored as small objects that benefit from cache coherency |
05:21:12 | FromDiscord | <Yardanico> https://ziglang.org/download/0.8.0/release-notes.html#Reworked-Memory-Layout |
05:21:18 | FromDiscord | <Elegantbeef> generally it's like `kind, left, right` |
05:21:21 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/6dn |
05:21:30 | FromDiscord | <Yardanico> In reply to @Isofruit "Curiosity question, why does": `let` doesn't do deep immutability |
05:21:30 | FromDiscord | <Elegantbeef> the pointer is immutable not the fields |
05:21:48 | FromDiscord | <Elegantbeef> strictfuncs will enforce it on parameters atleast |
05:21:51 | FromDiscord | <Yardanico> if you want deep immutability, use `func` with `{.experimental: strictFuncs.}` enabled |
05:21:53 | FromDiscord | <Yardanico> arhgh |
05:21:55 | FromDiscord | <Elegantbeef> Where `a: ref int` isnt immutable |
05:22:01 | FromDiscord | <Elegantbeef> isnt mutable\ |
05:22:28 | FromDiscord | <Yardanico> but yeah @Phil , basically with `let` you're telling that you don't want to be able to modify this variable itself |
05:22:29 | FromDiscord | <Solitude> !eval let a = new int; a[] = 5; echo a |
05:22:30 | NimBot | Compile failed: /usercode/in.nim(1, 32) Error: type mismatch: got <ref int> |
05:22:41 | FromDiscord | <Yardanico> so you can't do `x = y` if your `x` is a `let` of some ref object |
05:22:42 | FromDiscord | <Solitude> In reply to @NimBot "Compile failed: /usercode/in.nim(1, 32)": bastard |
05:22:43 | FromDiscord | <Elegantbeef> echo `a[]` 😛 |
05:23:03 | FromDiscord | <Elegantbeef> You cannot change where the pointer points but you can change the data it points to |
05:23:15 | FromDiscord | <Rika> You could also frame it like “let only prevents stack mutation” or so but technically it’s not the whole picture either |
05:23:21 | FromDiscord | <Rika> Oh here |
05:23:27 | FromDiscord | <Rika> Let only prevents value mutation |
05:23:35 | FromDiscord | <Elegantbeef> There you go |
05:23:39 | FromDiscord | <Rika> The value of a reference is the pointer |
05:23:41 | FromDiscord | <Elegantbeef> \unless you use unsafe methods |
05:23:54 | FromDiscord | <Rika> How that value is interpreted isn’t relevant to “let” |
05:24:11 | FromDiscord | <Elegantbeef> Anyway we've beat the horse |
05:24:24 | FromDiscord | <Elegantbeef> If phill dosnt get it yet we need to crowdfund a computer science textbook |
05:25:17 | FromDiscord | <Rika> I kinda want to write a book some day but I’m no good at writing and I’m no good at ideas |
05:25:32 | FromDiscord | <Elegantbeef> Would be fun but i'm drain bamaged |
05:26:20 | FromDiscord | <Phil> Nah, I got it, the permission is essentially associated with the pointer, not the object itself that is attached to the pointer. ↵I was just wondering whether it would've been a valid approach to e.g. not allow creating var-references from let-references |
05:26:22 | FromDiscord | <Rika> 0.5+0.5 = 1 so let’s write one together beef |
05:26:41 | FromDiscord | <Phil> I barely use ref semantics because I see no point in nim when none of my data structures are particularly large |
05:26:44 | FromDiscord | <Rika> In reply to @Isofruit "Nah, I got it,": Valid? Yes, consistent with former behaviour? No |
05:26:50 | FromDiscord | <Elegantbeef> It'd be the most offensive book to the reader |
05:27:03 | FromDiscord | <Yardanico> In reply to @Isofruit "I barely use ref": you don't really need to care about "big" that much, except if you have a lot of temporaries of that type in your functions |
05:27:08 | FromDiscord | <Yardanico> nim passes big objects by reference |
05:27:11 | FromDiscord | <Elegantbeef> That's not the point of ref semantics 😄↵(@Phil) |
05:27:28 | FromDiscord | <Phil> Wasn't the entire point to pass references to avoid copies of large amounts of data? |
05:27:29 | FromDiscord | <Elegantbeef> Ref semantics is more about data relationships and inheritance in Nim |
05:27:35 | FromDiscord | <Elegantbeef> If you have a linked list you use `ref` |
05:27:51 | FromDiscord | <Elegantbeef> I mean kinda but we have movesemantics |
05:28:07 | FromDiscord | <Elegantbeef> move semantics allow us to give up memory in cases and avoid copies |
05:28:24 | FromDiscord | <Elegantbeef> `ref object` is less about that since we have `{.byref.}` and `var T` |
05:28:39 | FromDiscord | <Phil> Huh, in that case I might've missunderstood the finfer details, I'll likely want to read through the nim tut sections on ref semantics again |
05:29:03 | FromDiscord | <Phil> (edit) "finfer" => "finer" |
05:29:07 | FromDiscord | <Phil> (edit) "missunderstood" => "misunderstood" |
05:29:09 | FromDiscord | <Rika> I think I missed the part about Zig and DOD tree AST whatever whatever |
05:29:22 | FromDiscord | <Yardanico> In reply to @Rika "I think I missed": i gave you a direct link 🤔 |
05:29:26 | FromDiscord | <Rika> In reply to @Elegantbeef "generally it's like `kind,": Oh here it is |
05:29:48 | FromDiscord | <demotomohiro> In reply to @Isofruit "let's be honest, that": object type can be placed continuously on memory but I don't know how to place ref objects on memory continuously.↵On modern PC, accessing memory linearly makes code run fast.↵Also, allocating/dellocating stack is faster than heap. |
05:31:00 | FromDiscord | <Rika> In reply to @Yardanico "i gave you a": Ooh I kinda wanna do challenging stuff now after reading it a bit god dammit |
05:31:08 | FromDiscord | <spoon> are there any resources on the compiler library besides the source code? |
05:31:12 | FromDiscord | <Rika> Hmm, Lua interpreter in Nim, hmmmmmm |
05:31:28 | FromDiscord | <spoon> wot |
05:31:29 | FromDiscord | <kiell> is there a way i can read symbols from another nim file from nim |
05:31:44 | FromDiscord | <Elegantbeef> Not programatically |
05:31:49 | FromDiscord | <Elegantbeef> You can manually pass them |
05:32:13 | FromDiscord | <spoon> even with `include`? |
05:32:47 | FromDiscord | <Elegantbeef> Using include is like using a bat to to losen a screw, it might work but only cause you've abused everything around it |
05:33:33 | FromDiscord | <Phil> In reply to @spoon "are there any resources": Best I can tell you are the compiler usage docs |
05:33:46 | FromDiscord | <spoon> it'll work if you carve the wood first no problem |
05:33:50 | FromDiscord | <Rika> In reply to @Elegantbeef "Using include is like": Wait you mean you aren’t supposed to do that? |
05:34:17 | FromDiscord | <Elegantbeef> There is https://nim-lang.github.io/Nim/intern.html spoon |
05:36:31 | FromDiscord | <spoon> meant the module that contains llstream and nimeval |
05:36:42 | FromDiscord | <Elegantbeef> Ah yea no docs |
05:36:46 | FromDiscord | <spoon> sad |
05:37:04 | FromDiscord | <Elegantbeef> 'PRs welcome' |
05:38:35 | FromDiscord | <huantian> In reply to @Rika "Hmm, Lua interpreter in": Waiting for lua as a compilation target |
05:38:48 | FromDiscord | <Elegantbeef> Well get at it huan |
05:39:38 | FromDiscord | <Elegantbeef> Completely unrelated, but anyone willing to give me a nose, mine presently doesnt work |
05:40:02 | FromDiscord | <Solitude> In reply to @huantian "Waiting for lua as": i was working on it, but lua is such barebones language that i had to reimplement a lot of shit that is builtin in c/js so i lost motivation |
05:40:13 | FromDiscord | <spoon> they sell noses that come with glasses and moustaches in costume shops |
05:41:06 | FromDiscord | <Elegantbeef> What did you need to reimplment?↵(@Solitude) |
05:41:09 | FromDiscord | <spoon> the world would be much better if lua arrays started at 0 |
05:41:27 | FromDiscord | <Solitude> In reply to @Elegantbeef "What did you need": bitwise math |
05:41:32 | FromDiscord | <Elegantbeef> Ah |
05:41:47 | FromDiscord | <Solitude> also exceptions are kinda quirky |
05:42:05 | FromDiscord | <huantian> Hm how does lua FFI work again? Is it not something you can do as a user if someone use lua as like a script in a game |
05:42:59 | FromDiscord | <Elegantbeef> I mean generally lua in game engines is sandboxed |
05:43:05 | FromDiscord | <Elegantbeef> So yea you're not doing that |
05:43:13 | FromDiscord | <Elegantbeef> I still want to investigate wasmer based scripting |
05:43:22 | FromDiscord | <Elegantbeef> It's the most interesting solution to me |
05:43:28 | FromDiscord | <Elegantbeef> Language agnostic plugin system |
05:43:52 | FromDiscord | <spoon> yea, wasm seems cool |
05:45:09 | FromDiscord | <spoon> oh yeah, need to read nim in action still since my university gives me access to it, is everything in there still up-to-date? |
05:45:25 | FromDiscord | <Elegantbeef> there is an errata or whatever it's called |
05:45:50 | FromDiscord | <spoon> errata? |
05:46:18 | FromDiscord | <Elegantbeef> https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html |
05:46:39 | FromDiscord | <spoon> ah, alright good to know |
05:52:43 | FromDiscord | <Rika> In reply to @huantian "Hm how does lua": Depends on how sandboxed it is as beef says |
05:53:16 | * | joshbaptiste quit (Ping timeout: 245 seconds) |
05:53:47 | * | joshbaptiste joined #nim |
05:58:42 | * | rockcavera quit (Remote host closed the connection) |
06:42:45 | * | jjido joined #nim |
06:54:16 | * | fredrikhr joined #nim |
07:18:10 | * | vicecea quit (Remote host closed the connection) |
07:18:41 | * | vicecea joined #nim |
07:39:03 | * | flynn joined #nim |
07:43:15 | * | flynn quit (Read error: Connection reset by peer) |
07:44:29 | * | flynn joined #nim |
07:45:55 | * | PMunch joined #nim |
07:48:58 | * | flynn quit (Read error: Connection reset by peer) |
07:50:11 | * | flynn joined #nim |
07:55:30 | * | flynn quit (Read error: Connection reset by peer) |
07:56:42 | * | flynn joined #nim |
07:56:52 | NimEventer | New thread by Archnim: Program level variables, see https://forum.nim-lang.org/t/9117 |
08:00:53 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
08:01:32 | * | flynn quit (Read error: Connection reset by peer) |
08:02:44 | * | flynn joined #nim |
08:08:46 | * | flynn quit (Read error: Connection reset by peer) |
08:09:59 | * | flynn joined #nim |
08:14:14 | * | flynn quit (Read error: Connection reset by peer) |
08:15:27 | * | flynn joined #nim |
08:20:34 | * | flynn quit (Read error: Connection reset by peer) |
08:21:47 | * | flynn joined #nim |
08:27:09 | * | flynn quit (Remote host closed the connection) |
08:28:22 | * | flynn joined #nim |
08:32:48 | * | flynn quit (Remote host closed the connection) |
08:34:00 | * | flynn joined #nim |
08:40:36 | FromDiscord | <Equinox> In reply to @spoon "the world would be": Agreed |
08:40:54 | * | flynn quit (Read error: Connection reset by peer) |
08:41:17 | FromDiscord | <Equinox> Arrays start at zero people that don’t get that just shouldn’t design languages 🤷♂️ |
08:42:08 | * | flynn joined #nim |
08:42:19 | FromDiscord | <Rika> Arrays starting at zero is an arbitrary choice, but that does not mean there are no merits to using it |
08:42:57 | FromDiscord | <Rika> It’s the same idea with math and 0^0 |
08:43:02 | FromDiscord | <Equinox> In reply to @Rika "Arrays starting at zero": It’s not arbitrary, it’s the offset |
08:43:06 | FromDiscord | <Rika> There are instances where = 1 works |
08:43:18 | FromDiscord | <Rika> In reply to @Equinox "It’s not arbitrary, it’s": And 1 is not arbitrary, it’s the first element therefore 1? |
08:43:30 | FromDiscord | <Rika> I mean that it would be arbitrary at a higher level |
08:43:47 | FromDiscord | <Equinox> In reply to @Rika "I mean that it": That’s true |
08:44:00 | FromDiscord | <Equinox> But why create two different ways of doing something so simple |
08:44:19 | FromDiscord | <Rika> Same argument can be used if you reversed the roles |
08:44:30 | FromDiscord | <Solitude> In reply to @Equinox "But why create two": why not |
08:44:33 | FromDiscord | <Rika> Why use 0 if we have 1? Why use 1 if we have 0? |
08:44:52 | FromDiscord | <Equinox> In reply to @Rika "Why use 0 if": But they aren’t reversed |
08:45:09 | FromDiscord | <Equinox> And if they were I would argue the other side than I am now |
08:46:19 | PMunch | Just updated the playground, hopefully this should fix some of the ix paste related issues |
08:46:23 | FromDiscord | <Rika> Well, because it isn’t how we think naturally, before programming. A programming language is an interface to the person and the computer, there’s no reason to make it more understandable for the computer since we can just translate it via programs. The main audience is the person |
08:46:56 | FromDiscord | <Equinox> In reply to @Rika "Well, because it isn’t": But we can’t go and change every programming language to use 1 |
08:47:10 | * | flynn quit (Read error: Connection reset by peer) |
08:47:14 | FromDiscord | <Equinox> And most people will find 0 perfectly reasonable |
08:47:17 | FromDiscord | <Rika> Because that’ll break code for sure |
08:47:34 | FromDiscord | <Rika> In reply to @Equinox "And most people will": Ask people who haven’t programmed at all |
08:47:42 | FromDiscord | <Rika> “Why do we start arrays at 0” |
08:48:01 | FromDiscord | <Rika> Or even new programmers |
08:48:22 | * | flynn joined #nim |
08:48:26 | FromDiscord | <Equinox> In reply to @Rika "“Why do we start": I would say that’s not really something normal people have to think about but sure I guess? |
08:48:36 | FromDiscord | <Equinox> It doesn’t seem intuitive at first |
08:48:40 | FromDiscord | <Rika> You said reasoning |
08:48:47 | FromDiscord | <Rika> I gave you a question about reasoning |
08:49:27 | FromDiscord | <Equinox> Well if you explained why it starts at 0 to people they would understand why it’s like that |
08:49:47 | FromDiscord | <Rika> Well you don’t need to explain for 1 🙂 |
08:50:01 | FromDiscord | <Equinox> You do for the computer |
08:50:11 | FromDiscord | <Rika> The computer doesn’t need to reason |
08:50:16 | FromDiscord | <Solitude> im sure he will understand |
08:50:34 | FromDiscord | <Rika> Well whatever |
08:52:11 | FromDiscord | <Equinox> In reply to @Rika "The computer doesn’t need": The good thing about computers but also the bad |
08:52:30 | FromDiscord | <Rika> In reply to @Equinox "You do for the": You already have to explain what print means to the computer |
08:53:19 | FromDiscord | <Equinox> In reply to @Rika "You already have to": So why do we add more to its plate by starting arrays at 1? |
08:53:31 | FromDiscord | <Equinox> Seems kinda inconsiderate |
08:53:53 | FromDiscord | <Rika> In reply to @Equinox "So why do we": What’s wrong with one more? |
08:54:05 | FromDiscord | <Rika> Never stopped Python |
08:54:09 | FromDiscord | <Rika> Never stopped JavaScript |
08:54:12 | FromDiscord | <Rika> Never stopped Java |
08:54:18 | * | flynn quit (Read error: Connection reset by peer) |
08:54:23 | FromDiscord | <Rika> Never stopped every other language adding a new kind of abstraction |
08:55:30 | * | flynn joined #nim |
08:56:05 | FromDiscord | <Solitude> In reply to @Equinox "So why do we": maybe the way its implemented it actually doesnt add more. you are so sure about inner workings of every 1-based language? |
08:56:55 | FromDiscord | <Rika> I don’t know dude, it’s not even a matter of one or the other |
08:57:09 | FromDiscord | <Rika> We could easily have both if the other had a different operator |
08:59:03 | Amun-Ra | what do we add by starting at 1? confusion |
08:59:33 | FromDiscord | <Rika> Only because 0 is already established |
08:59:51 | FromDiscord | <Rika> And that can always be changed over time |
09:00:17 | FromDiscord | <Rika> Well again whatever |
09:01:05 | * | flynn quit (Read error: Connection reset by peer) |
09:02:19 | * | flynn joined #nim |
09:03:13 | Amun-Ra | it's established bc of that pointer arithmetic on tables and what have you |
09:03:41 | FromDiscord | <Rika> And my argument is that is that really relevant to most array handling nowadays |
09:04:02 | FromDiscord | <Rika> But again I don’t want to continue (yet I can’t resist), someone else can if they want |
09:04:17 | Amun-Ra | it's similar to qwerty layout, we don't use mechanical typewriters anymore, no risk of jamming anymore |
09:05:17 | FromDiscord | <Rika> Yeah and we all know how many people who’ve looked into it have found out that it’s not close to good or whatever |
09:07:21 | Amun-Ra | yes, still, I would vote for what's already established |
09:07:41 | * | flynn quit (Read error: Connection reset by peer) |
09:08:33 | FromDiscord | <Rika> People don’t like change after all |
09:08:54 | * | flynn joined #nim |
09:09:12 | Amun-Ra | my #1 question would be whether it's worth a change |
09:09:23 | Amun-Ra | but that's subjective |
09:13:17 | * | flynn quit (Read error: Connection reset by peer) |
09:14:30 | * | flynn joined #nim |
09:15:46 | * | Zectbumo quit (Remote host closed the connection) |
09:20:10 | * | flynn quit (Read error: Connection reset by peer) |
09:21:23 | * | flynn joined #nim |
09:26:09 | * | flynn quit (Read error: Connection reset by peer) |
09:27:21 | * | flynn joined #nim |
09:32:30 | * | flynn quit (Read error: Connection reset by peer) |
09:33:43 | * | flynn joined #nim |
09:34:10 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/3Vw3 |
09:38:01 | * | flynn quit (Remote host closed the connection) |
09:39:14 | * | flynn joined #nim |
09:39:38 | FromDiscord | <hotdog> In reply to @jmgomez "Hey guys, is there": I have a feeling I’ve seen a macro for this somewhere |
09:39:42 | FromDiscord | <hotdog> Maybe on the forum |
09:40:25 | FromDiscord | <enthus1ast> @deech\: has this in his talk imho |
09:41:22 | FromDiscord | <jmgomez> Ohh in which one? |
09:41:59 | FromDiscord | <jmgomez> Actually I was present at the Lambda one, didnt know about nim back them. I was the guy who pointed to FSharp lol |
09:42:41 | FromDiscord | <enthus1ast> this one https://youtu.be/d2VRuZo2pdA?t=929 |
09:44:54 | * | flynn quit (Read error: Connection reset by peer) |
09:46:06 | * | flynn joined #nim |
09:46:10 | FromDiscord | <jmgomez> That's great but in the code that does it, it isnt shown. So I wonder if you think it would be possible to have an alias for it afterwards? |
09:48:40 | FromDiscord | <Rika> Doesn’t “object of T” do the combining |
09:49:00 | FromDiscord | <Rika> But only for one object so I guess not really |
09:50:29 | * | flynn quit (Read error: Connection reset by peer) |
09:51:41 | * | flynn joined #nim |
09:51:48 | FromDiscord | <jmgomez> yes, it feels a bit odd that nim doesnt support it specially since you it has distinct and sum |
09:52:05 | FromDiscord | <jmgomez> (edit) removed "you" |
09:52:20 | * | fredrikhr quit (Read error: Connection reset by peer) |
09:54:01 | * | fredrikhr joined #nim |
09:55:31 | * | flynn quit (Read error: Connection reset by peer) |
09:56:44 | * | flynn joined #nim |
10:02:14 | * | flynn quit (Read error: Connection reset by peer) |
10:03:26 | * | flynn joined #nim |
10:08:18 | * | flynn quit (Read error: Connection reset by peer) |
10:09:31 | * | flynn joined #nim |
10:09:55 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
10:10:29 | FromDiscord | <Andreas> how come that ?↵c-definition = `#define FNV1_64_INIT ((u_int64_t)14695981039346656037)`↵nim-definition = `uint64( 14695981039346656037 )`↵gives me a 'number out-of-range' - error ? |
10:10:59 | FromDiscord | <Forest> Anyone know why repl.it doesn't like Nim? https://replit.com/@Mythical-Forest-Collective/PulseNim#start.sh |
10:11:08 | FromDiscord | <Forest> It freezes up on the Nim command |
10:11:24 | FromDiscord | <Forest> when compiling specifically |
10:14:22 | * | flynn quit (Remote host closed the connection) |
10:15:35 | * | flynn joined #nim |
10:20:17 | FromDiscord | <Solitude> In reply to @Andreas "how come that ?": nim tries to fit literals into int and fails |
10:20:26 | FromDiscord | <Solitude> !eval echo 14695981039346656037'u64 |
10:20:28 | NimBot | 14695981039346656037 |
10:20:34 | * | flynn quit (Read error: Connection reset by peer) |
10:21:47 | * | flynn joined #nim |
10:26:31 | * | flynn quit (Read error: Connection reset by peer) |
10:27:44 | * | flynn joined #nim |
10:32:27 | FromDiscord | <TryAngle> In reply to @enthus1ast "this one https://youtu.be/d2VRuZo2pdA?t=929": how does he compile to arc without explicitly using the compile argument? |
10:33:09 | * | flynn quit (Read error: Connection reset by peer) |
10:34:21 | * | flynn joined #nim |
10:36:34 | FromDiscord | <Solitude> config file |
10:39:34 | * | flynn quit (Read error: Connection reset by peer) |
10:40:46 | * | flynn joined #nim |
10:45:12 | FromDiscord | <TryAngle> In reply to @Solitude "config file": thanks 🥺 |
10:45:52 | * | flynn quit (Read error: Connection reset by peer) |
10:47:04 | * | flynn joined #nim |
10:51:06 | * | flynn quit (Remote host closed the connection) |
10:52:18 | * | flynn joined #nim |
10:57:42 | * | flynn quit (Read error: Connection reset by peer) |
10:58:54 | * | flynn joined #nim |
11:04:39 | * | flynn quit (Remote host closed the connection) |
11:05:51 | * | flynn joined #nim |
11:10:39 | * | flynn quit (Read error: Connection reset by peer) |
11:11:52 | * | flynn joined #nim |
11:15:57 | * | flynn quit (Read error: Connection reset by peer) |
11:17:10 | * | flynn joined #nim |
11:21:41 | * | flynn quit (Read error: Connection reset by peer) |
11:22:54 | * | flynn joined #nim |
11:25:19 | FromDiscord | <ShalokShalom> In reply to @Amun-Ra "what do we add": Not confusing newbies |
11:25:33 | FromDiscord | <ShalokShalom> I also agree with Rika |
11:29:03 | * | flynn quit (Read error: Connection reset by peer) |
11:30:16 | * | flynn joined #nim |
11:34:29 | FromDiscord | <ShalokShalom> sent a long message, see https://paste.rs/P3k |
11:35:07 | FromDiscord | <Forest> Is there a way to prevent a certain line/string from being shown if there's an error while compiling? |
11:35:08 | * | flynn quit (Read error: Connection reset by peer) |
11:36:22 | * | flynn joined #nim |
11:37:31 | FromDiscord | <Rika> In reply to @ShalokShalom "Starting with 1 makes": I think we do a mix of both, so we shouldn’t embrace one or the other, and that having good support for both is good |
11:37:48 | FromDiscord | <ShalokShalom> Yes, absolutely. |
11:38:02 | FromDiscord | <ShalokShalom> Nim is a very weird and awesome mix, I have never seen anything like that. |
11:38:54 | FromDiscord | <ShalokShalom> I think support for both is important, so long as the whole world uses mainly x86 and ARM. And also maybe beyond, in case some people just suit this kind of thinking more, which I suspect. |
11:39:46 | FromDiscord | <Rika> I’m still thinking about the heavy type inference thing you mentioned last time |
11:40:06 | FromDiscord | <ShalokShalom> Yeah 😄 |
11:40:35 | FromDiscord | <ShalokShalom> Did you see it in action yourself? As in fsharp or so? |
11:40:49 | FromDiscord | <ShalokShalom> I guess its easier to experience it, other than just speaking about. |
11:40:58 | FromDiscord | <Rika> No, I’m thinking that it’s probably nice given the tooling |
11:41:05 | FromDiscord | <ShalokShalom> Yeah, totally. |
11:41:10 | FromDiscord | <Rika> But then I’d be reliant on tooling |
11:41:22 | FromDiscord | <Rika> I don’t like relying too hard on it since I do a lot of things analogue |
11:41:28 | FromDiscord | <ShalokShalom> Yep. It would be optional anyway. Like, you can always make your types. |
11:41:32 | * | flynn quit (Read error: Connection reset by peer) |
11:41:41 | FromDiscord | <Rika> Tooling that could convert between… |
11:41:52 | FromDiscord | <Rika> Yeah wishful thinking for now |
11:41:55 | FromDiscord | <ShalokShalom> Yes, the VSCode tooling does that |
11:42:14 | FromDiscord | <Rika> I don’t think I’d be too against it, but right now the capability and manpower isn’t here yet |
11:42:24 | FromDiscord | <Rika> In the end it’s always that |
11:42:45 | * | flynn joined #nim |
11:42:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:43:51 | FromDiscord | <ShalokShalom> Yeah, sure |
11:44:05 | FromDiscord | <ShalokShalom> The thing is, Andreas is heavily against it anyway |
11:44:13 | FromDiscord | <ShalokShalom> So just something for another project |
11:48:03 | * | flynn quit (Read error: Connection reset by peer) |
11:49:15 | * | flynn joined #nim |
11:52:22 | FromDiscord | <ShalokShalom> @Rika https://media.discordapp.net/attachments/371759389889003532/965942933893308416/Screenshot_42.png |
11:53:30 | FromDiscord | <ShalokShalom> Once you click that https://media.discordapp.net/attachments/371759389889003532/965943219022078012/Screenshot_45.png |
11:53:46 | * | flynn quit (Read error: Connection reset by peer) |
11:54:58 | * | flynn joined #nim |
11:57:00 | FromDiscord | <Rika> ideally id do it without clicking |
11:57:06 | FromDiscord | <Rika> but thats a matter of interface |
11:58:07 | FromDiscord | <ShalokShalom> yeah |
11:58:35 | FromDiscord | <ShalokShalom> the point is, you really have it only at exposing functions, so everything you use somewhere else |
11:58:47 | FromDiscord | <Forest> In reply to @ShalokShalom "I think support for": There's Risc-V too |
11:58:47 | FromDiscord | <ShalokShalom> like in fsharp |
11:58:54 | FromDiscord | <ShalokShalom> Yep, totally |
11:58:58 | FromDiscord | <ShalokShalom> What I meant. 🙂 |
11:59:16 | FromDiscord | <ShalokShalom> RISC-V is really like a company and implementation, isnt it? |
11:59:24 | FromDiscord | <ShalokShalom> And RISC the architecture. |
11:59:34 | FromDiscord | <Rika> RISC-V is the architecture |
11:59:37 | FromDiscord | <ShalokShalom> Ah. |
11:59:39 | FromDiscord | <Rika> RISC is just the kind |
11:59:45 | FromDiscord | <Rika> x86 is CISC |
11:59:46 | FromDiscord | <ShalokShalom> Ah, ok. |
11:59:50 | FromDiscord | <Rika> ARM is RISC |
11:59:55 | FromDiscord | <ShalokShalom> Yeah, yeah. True |
12:00:08 | FromDiscord | <ShalokShalom> I heard ARM is not 100% RISC anymore, isnt it? |
12:00:16 | FromDiscord | <ShalokShalom> I think they added a couple of fixed instructions. |
12:00:18 | FromDiscord | <ShalokShalom> afiak |
12:00:29 | FromDiscord | <Rika> theyre not black and white yeah |
12:00:50 | FromDiscord | <Rika> and CISC doesnt really mean fixed and RISC not variable |
12:01:15 | * | flynn quit (Remote host closed the connection) |
12:02:21 | FromDiscord | <ShalokShalom> yeah, isnt R short for reduced |
12:02:28 | * | flynn joined #nim |
12:02:39 | FromDiscord | <ShalokShalom> but in practice, I think it comes down to fixed and variable? |
12:02:40 | * | jjido joined #nim |
12:03:11 | FromDiscord | <Rika> i guess so |
12:03:23 | FromDiscord | <Rika> but yeah arm has some large and specific insturctions nowadays |
12:07:30 | FromDiscord | <Generic> ARM always had those |
12:07:33 | * | flynn quit (Read error: Connection reset by peer) |
12:07:56 | FromDiscord | <Generic> also aarch64 has no variable length instructions, the only ARM variant which has it to my knowledge is thumb 2 |
12:08:45 | FromDiscord | <Generic> (technically also thumb 1 but only a single instruction) |
12:08:45 | * | flynn joined #nim |
12:09:06 | FromDiscord | <ShalokShalom> SiFive is the company, which I did mean |
12:09:15 | FromDiscord | <ShalokShalom> V = Five |
12:09:17 | FromDiscord | <Generic> but in contrast RISC-V actually has a mixed instruction length mode |
12:09:18 | FromDiscord | <ShalokShalom> = Confusion 😄 |
12:13:59 | FromDiscord | <ShalokShalom> Oh, they have the new board ready ^-^ |
12:13:59 | * | flynn quit (Read error: Connection reset by peer) |
12:14:00 | FromDiscord | <ShalokShalom> https://www.sifive.com/boards/hifive-unmatched |
12:14:37 | FromDiscord | <ShalokShalom> Does Nim run on RISC-V by any chance? |
12:14:44 | FromDiscord | <ShalokShalom> I know Godot does. |
12:15:05 | FromDiscord | <Rika> dont think its made to run yet but i assume its not too difficult to get it running |
12:15:11 | * | flynn joined #nim |
12:15:19 | FromDiscord | <ShalokShalom> _Video game development on a RISC-V board_ |
12:15:38 | FromDiscord | <ShalokShalom> Like, few years ago gaming and Linux didnt even match |
12:15:58 | FromDiscord | <ShalokShalom> And there was no architecture, that was open source in this capacity. |
12:16:22 | FromDiscord | <ShalokShalom> They actually use common PCIe GPUs |
12:18:08 | FromDiscord | <ShalokShalom> And I saw a Youtube video, that shows how one guy ported the driver |
12:18:13 | FromDiscord | <ShalokShalom> I took him like hours. |
12:18:15 | FromDiscord | <ShalokShalom> Alone. |
12:20:24 | * | flynn quit (Read error: Connection reset by peer) |
12:21:36 | * | flynn joined #nim |
12:27:21 | * | flynn quit (Read error: Connection reset by peer) |
12:27:33 | * | v9fk quit (Remote host closed the connection) |
12:28:33 | * | flynn joined #nim |
12:34:01 | * | flynn quit (Read error: Connection reset by peer) |
12:35:14 | * | flynn joined #nim |
12:38:38 | PMunch | Hmm, it's annoying that you can't do things like ignore some rules when importing CSS.. |
12:38:46 | PMunch | CSS in general is very annoying.. |
12:40:03 | * | flynn quit (Read error: Connection reset by peer) |
12:41:17 | * | flynn joined #nim |
12:45:58 | * | flynn quit (Read error: Connection reset by peer) |
12:47:11 | * | flynn joined #nim |
12:50:20 | FromDiscord | <dom96> In reply to @ShalokShalom "Does Nim run on": it does, federico3 got it running IIRC |
12:51:56 | * | ldlework quit (Quit: co'o ro do) |
12:52:11 | FromDiscord | <ShalokShalom> https://tenor.com/view/family-guy-css-open-window-annoyed-pissed-gif-12014506 |
12:52:37 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/965958095090090066/family-guy-css.gif |
12:53:20 | * | flynn quit (Read error: Connection reset by peer) |
12:54:32 | * | flynn joined #nim |
12:55:16 | * | hexeme joined #nim |
12:56:47 | FromDiscord | <ShalokShalom> It could be awesome, to have a library that can similar things as this:↵https://github.com/mdgriffith/elm-ui#readme |
12:57:10 | FromDiscord | <enthus1ast> would be awesome if most sites would just use css |
12:57:13 | FromDiscord | <enthus1ast> ähm |
12:57:13 | FromDiscord | <enthus1ast> html |
12:58:39 | FromDiscord | <deech> In reply to @jmgomez "That's great but in": All the code is here: https://github.com/deech/NimNuggets/blob/master/backup/migrationmacros.nim |
12:59:39 | * | flynn quit (Read error: Connection reset by peer) |
13:00:52 | * | flynn joined #nim |
13:01:21 | FromDiscord | <jmgomez> In reply to @deech "All the code is": awesome, thanks and for the talks too! |
13:03:38 | FromDiscord | <deech> In reply to @jmgomez "awesome, thanks and for": It's pretty low tech so I urge you not to deploy it. 🙂 |
13:05:01 | FromDiscord | <jmgomez> In reply to @deech "It's pretty low tech": Im just getting started with macros so it's great stuff to study |
13:05:35 | * | flynn quit (Read error: Connection reset by peer) |
13:06:08 | FromDiscord | <jmgomez> @deech you think can be possible to define an operator like I posted above?↵type C = A | B |
13:06:14 | FromDiscord | <jmgomez> (edit) "|" => "&" |
13:06:47 | * | flynn joined #nim |
13:07:11 | * | neurocyte8614492 joined #nim |
13:07:33 | FromDiscord | <deech> In reply to @jmgomez "Im just getting started": Sure. It might get a little tricky with variants but if it just a straight key/value object it should be pretty straightforward. |
13:08:31 | FromDiscord | <deech> (edit) "In reply to @jmgomez "Im just getting started": Sure. It might get a little tricky with variants ... butset" added "or if objects have overlapping field names" | "straight" => "set of uniques" | "object" => "pairs" |
13:08:49 | FromDiscord | <deech> (edit) "uniques" => "unique" |
13:11:32 | * | flynn quit (Read error: Connection reset by peer) |
13:12:45 | * | flynn joined #nim |
13:14:52 | * | rockcavera joined #nim |
13:14:52 | * | rockcavera quit (Changing host) |
13:14:52 | * | rockcavera joined #nim |
13:17:37 | * | flynn quit (Read error: Connection reset by peer) |
13:18:50 | * | flynn joined #nim |
13:24:06 | FromDiscord | <Rika> what do people usually do when they need type info in a macro but also some minor DSLing |
13:24:23 | PMunch | Two macros |
13:24:33 | PMunch | One which does the DSL transform into calls to the second macro |
13:24:38 | * | flynn quit (Read error: Connection reset by peer) |
13:25:04 | PMunch | So the work of the DSL macro is only to transform the AST from your DSL into calls to the typed macro |
13:25:11 | FromDiscord | <Rika> okay, that was what was being used already, was wondering if there can be another way |
13:25:27 | PMunch | Not really |
13:25:30 | * | arkurious joined #nim |
13:25:51 | * | flynn joined #nim |
13:26:10 | PMunch | Well, you could potentially use templates to make the DSL valid |
13:26:18 | PMunch | But it's the same concept |
13:26:46 | PMunch | The double macro pattern is what I use for Futhark: https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L402 |
13:28:04 | PMunch | But that is for a slightly different reason. I need things like filenames as static strings, but I also wanted to support calling out to a procedure to get that string. |
13:28:52 | PMunch | So the `importc` macro only turns the statement into a call to `importcImpl` which requires static strings and lets Nim figure out how to turn A into B |
13:29:04 | FromDiscord | <deech> sent a code paste, see https://play.nim-lang.org/#ix=3VwN |
13:29:28 | PMunch | I've actually been thinking about writing a Nim macros design patterns article |
13:29:52 | PMunch | Over the years I have developed a set of "rules" for writing macros that makes them more robust and composable |
13:30:05 | * | flynn quit (Read error: Connection reset by peer) |
13:31:18 | * | flynn joined #nim |
13:31:19 | PMunch | What's the benefit of using a compile-time proc over a typed macro @deech` |
13:34:06 | FromDiscord | <deech> IME it's just easier to work with `proc`s than macros, eg. I was unable to simply pass a `seq[blah]` into a macro, it had to be `static[seq[blah]]` , once I found the pattern above I was able to avoid all that. |
13:34:53 | FromDiscord | <Rika> im not sure what you mean with the proc, as in you'd use the proc as the external api? |
13:36:13 | FromDiscord | <deech> As in `proc p(...):NimNode {.compileTime.} = ...` and then do a `splice(p(...))`. |
13:36:20 | * | flynn quit (Read error: Connection reset by peer) |
13:36:56 | FromDiscord | <Rika> or `macro(untyped) = p(...) -> p(NimNode, ...): NimNode {.ct.} -> splice(p())`? i'm a bit lost |
13:37:02 | FromDiscord | <Rika> what happened to the DSL part |
13:37:33 | * | flynn joined #nim |
13:38:18 | FromDiscord | <deech> Then I'm confused on what you mean by minor DSL'ing with type info. ☝️is how I'm doing DSL to AST transformation. |
13:38:32 | FromDiscord | <deech> (edit) "☝️is" => "What I showed is" |
13:38:55 | FromDiscord | <Rika> oh okay |
13:39:09 | FromDiscord | <Rika> i have a dsl/custom syntax, but i also need type information |
13:39:18 | FromDiscord | <Rika> thats p much it |
13:39:43 | FromDiscord | <deech> The DSL is some kind of data structure, yes? |
13:40:51 | FromDiscord | <deech> If all you need is type information you don't even need a macro because you're not transforming the AST. Again I'm missing something, my apologies for muddying the waters. It may help if you post something concrete. |
13:41:17 | FromDiscord | <Rika> i'm just looking at nimlua pretty much and planning out what to simplify |
13:41:57 | * | flynn quit (Read error: Connection reset by peer) |
13:42:13 | FromDiscord | <Phil> compileTime procs are great, love em |
13:43:10 | * | flynn joined #nim |
13:48:04 | * | flynn quit (Read error: Connection reset by peer) |
13:48:54 | PMunch | @deech, so instead of using static arguments to a macro you instead use a helper macro? Seems just about the same amount of work TBH.. |
13:49:17 | * | flynn joined #nim |
13:49:18 | PMunch | I do use compileTime procedures, but it's pretty rare |
13:49:35 | * | PMunch quit (Quit: Leaving) |
13:52:40 | FromDiscord | <Phil> I think the only time I use macros if it's a specific piece of syntax I explicitly can't do in a compile time proc, reduce macro code at all costs basically |
13:52:45 | FromDiscord | <deech> IME it is not the same amount of work because a helper compile time `proc`is a lot ieasier to debug. |
13:54:01 | * | flynn quit (Read error: Connection reset by peer) |
13:55:14 | * | flynn joined #nim |
13:55:42 | FromDiscord | <Rika> In reply to @Isofruit "I think the only": haha i'm currently suffering reading nimlua's code so far |
13:55:53 | FromDiscord | <Rika> baby steps i guess, its just very complex |
13:56:08 | FromDiscord | <Phil> is nimula that much macro? |
13:56:16 | FromDiscord | <Rika> do you want to see |
13:56:26 | FromDiscord | <Phil> I'm afraid now, but a glimpse can't kill me |
13:56:27 | FromDiscord | <Phil> I think |
13:56:28 | FromDiscord | <Rika> https://github.com/jangko/nimLUA/blob/master/nimLUA.nim |
13:56:29 | FromDiscord | <deech> Also IIRC if I had a compile time `seq` eg. `let s {.compileTime.} = @[1,2,3]` I could just pass it to `proc p(s:seq[int]):NimNode {.compileTime.} = ...` for a `macro m(s:static[seq[int]] ... ) = ...` I would have to wrap in `static`. That may have changed but I ran into it months ago and didn't try again. |
13:57:26 | FromDiscord | <Phil> can't you just write "static seq"? |
13:57:39 | FromDiscord | <Phil> instead of {.compileTime.} ? |
13:59:49 | FromDiscord | <deech> Yes you can. Not saying you can't pass typed arguments to macros just that IMO my way is easier. |
14:00:52 | * | flynn quit (Read error: Connection reset by peer) |
14:02:06 | * | flynn joined #nim |
14:07:08 | FromDiscord | <Phil> Hmmm I think my tastes differ there, I'd prefer having `proc p(s: static seq[int]): NimNode {.compileTime.} =`, but I guess that really does come down to just taste |
14:07:16 | * | flynn quit (Read error: Connection reset by peer) |
14:08:30 | * | flynn joined #nim |
14:11:40 | FromDiscord | <deech> What is the difference between `proc p(s:seq[int] ...) {.compileTime.}` vs `proc p(s: static seq[int] ...) {.compileTime.}`? |
14:13:25 | FromDiscord | <Phil> I mean, I haven't tried it out with seq specifically, but IIRC from the last time I wrote compiletime procs, none. It's just more explicit in that the seq is static, which is only implicit stated so via the compileTime pragma |
14:14:04 | * | flynn quit (Read error: Connection reset by peer) |
14:15:16 | * | flynn joined #nim |
14:15:42 | FromDiscord | <deech> You may have some issues running your proc in a static block. I think Nim will force you to wrap it in static even though it is in a static context. |
14:18:28 | FromDiscord | <Phil> I'll likely have to cross that bridge when i get there, so far only needed it to validate at compile time whether a dB query for a many to many relationship via orm was using the right combination of models |
14:18:36 | FromDiscord | <ShalokShalom> https://diataxis.fr/ |
14:18:44 | FromDiscord | <ShalokShalom> Wondering what you guys think about this |
14:18:51 | FromDiscord | <ShalokShalom> (Documentation) |
14:19:28 | * | v9fk joined #nim |
14:20:23 | * | flynn quit (Read error: Connection reset by peer) |
14:20:47 | FromDiscord | <deech> As an aside it's a shame that `static:` forces a scope that can't be accessed from another `static:` block. |
14:20:47 | FromDiscord | <Phil> Haven't tried and on the move atm so no opinion from my end. |
14:21:37 | * | flynn joined #nim |
14:26:57 | * | flynn quit (Read error: Connection reset by peer) |
14:28:11 | * | flynn joined #nim |
14:33:59 | * | flynn quit (Read error: Connection reset by peer) |
14:35:12 | * | flynn joined #nim |
14:40:31 | * | flynn quit (Read error: Connection reset by peer) |
14:41:44 | * | flynn joined #nim |
14:43:19 | * | fredrikhr quit (Ping timeout: 240 seconds) |
14:47:17 | * | flynn quit (Read error: Connection reset by peer) |
14:47:51 | * | Guest32 joined #nim |
14:48:19 | * | Guest32 quit (Client Quit) |
14:48:30 | * | flynn joined #nim |
14:51:26 | FromDiscord | <Andreas> howto sort the keys of a OrderedTable ? is that via .toOpenArray() and the use algorithm.sorted ? |
14:51:42 | FromDiscord | <Andreas> (edit) "the" => "then" |
14:52:46 | * | flynn quit (Remote host closed the connection) |
14:53:59 | * | flynn joined #nim |
15:00:42 | * | flynn quit (Read error: Connection reset by peer) |
15:01:55 | * | flynn joined #nim |
15:05:26 | * | flynn quit (Read error: Connection reset by peer) |
15:06:39 | * | flynn joined #nim |
15:06:44 | * | slowButPresent joined #nim |
15:11:50 | * | flynn quit (Read error: Connection reset by peer) |
15:12:45 | FromDiscord | <ph4qd> when working with a sequence of objects, is there a proc similar to golang's IndexFunc() which serves as a generic find function? |
15:12:54 | FromDiscord | <ph4qd> https://pkg.go.dev/golang.org/x/exp/slices#IndexFunc |
15:13:04 | * | flynn joined #nim |
15:18:03 | * | flynn quit (Read error: Connection reset by peer) |
15:19:16 | * | flynn joined #nim |
15:20:17 | FromDiscord | <2F42BBA1> So I have an idea to create a GUI application for game. What software does it deletes a registry entry for a game to destroy process and doing this whole thing is kinda clunky. |
15:20:31 | FromDiscord | <2F42BBA1> The question is how do I interact with Windows's registry on Nim? |
15:24:32 | * | flynn quit (Read error: Connection reset by peer) |
15:25:43 | FromDiscord | <ShalokShalom> I dont really understand the second sentence. Why dont you use a game engine, like Godot? And you find support for game development also in #gamedev |
15:25:44 | * | flynn joined #nim |
15:26:51 | FromDiscord | <2F42BBA1> In reply to @ShalokShalom "I dont really understand": Windows has registry. Game keeps all progress here, what I want to do is to create a simple gui utility which will delete some registry stuff of the game, so you could reset the progress this way. |
15:27:56 | FromDiscord | <ShalokShalom> Ah. |
15:28:01 | FromDiscord | <2F42BBA1> I know which GUI library I will use (wNim or ImGui). But the issue is that I don't know how to interact with registry here in Nim. |
15:28:14 | FromDiscord | <Solitude> In reply to @2F42BBA1 "I know which GUI": https://github.com/khchen/winim maybe this |
15:28:17 | * | noeontheend joined #nim |
15:28:28 | FromDiscord | <2F42BBA1> In reply to @Solitude "https://github.com/khchen/winim maybe this": https://github.com/khchen/wNim |
15:28:39 | FromDiscord | <2F42BBA1> wNim is based on winim |
15:28:53 | FromDiscord | <Solitude> i know |
15:29:33 | FromDiscord | <ShalokShalom> But it has API access |
15:30:15 | * | flynn quit (Read error: Connection reset by peer) |
15:31:03 | FromDiscord | <2F42BBA1> Anyway, the main question is that how I interact with registry. ↵I have only found that so far https://nim-lang.org/docs/registry.html |
15:31:28 | * | flynn joined #nim |
15:31:44 | FromDiscord | <huantian> Yeah I think that module does work |
15:32:18 | FromDiscord | <2F42BBA1> there's no option to delete though... |
15:34:30 | * | noeontheend quit (Remote host closed the connection) |
15:35:15 | * | noeontheend joined #nim |
15:37:37 | * | flynn quit (Read error: Connection reset by peer) |
15:38:49 | * | flynn joined #nim |
15:44:09 | * | flynn quit (Read error: Connection reset by peer) |
15:44:30 | FromDiscord | <Solitude> i just linked you package that wraps windows apis |
15:45:21 | * | flynn joined #nim |
15:45:22 | FromDiscord | <Solitude> https://github.com/khchen/winim/blob/b7b32603f4ef672bc34405bc6200e8aab2c366b1/winim/inc/winreg.nim here is even the module that interacts with registry |
15:47:44 | * | noeontheend quit (Remote host closed the connection) |
15:48:23 | * | noeontheend joined #nim |
15:50:46 | * | flynn quit (Read error: Connection reset by peer) |
15:50:47 | * | noeontheend quit (Remote host closed the connection) |
15:51:57 | * | flynn joined #nim |
15:53:05 | * | noeontheend joined #nim |
15:56:30 | * | flynn quit (Read error: Connection reset by peer) |
15:57:43 | * | flynn joined #nim |
16:02:40 | * | flynn quit (Read error: Connection reset by peer) |
16:03:53 | * | flynn joined #nim |
16:05:59 | * | noeontheend quit (Ping timeout: 240 seconds) |
16:09:48 | * | flynn quit (Read error: Connection reset by peer) |
16:11:00 | * | flynn joined #nim |
16:11:59 | FromDiscord | <Equinox> In reply to @Amun-Ra "what do we add": Yes exactly my point |
16:16:19 | * | flynn quit (Read error: Connection reset by peer) |
16:17:31 | * | flynn joined #nim |
16:22:42 | * | flynn quit (Read error: Connection reset by peer) |
16:23:55 | * | flynn joined #nim |
16:28:31 | * | flynn quit (Read error: Connection reset by peer) |
16:29:44 | * | flynn joined #nim |
16:34:40 | * | flynn quit (Read error: Connection reset by peer) |
16:35:52 | * | flynn joined #nim |
16:37:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:43:26 | * | flynn quit (Read error: Connection reset by peer) |
16:44:39 | * | flynn joined #nim |
16:48:52 | * | flynn quit (Read error: Connection reset by peer) |
16:50:04 | * | flynn joined #nim |
16:54:35 | * | flynn quit (Read error: Connection reset by peer) |
16:55:48 | * | flynn joined #nim |
17:00:16 | * | flynn quit (Read error: Connection reset by peer) |
17:01:29 | * | flynn joined #nim |
17:05:33 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
17:07:41 | * | cyraxjoe joined #nim |
17:08:14 | * | flynn quit (Read error: Connection reset by peer) |
17:09:26 | * | flynn joined #nim |
17:13:42 | * | flynn quit (Read error: Connection reset by peer) |
17:14:56 | * | flynn joined #nim |
17:19:35 | * | flynn quit (Read error: Connection reset by peer) |
17:20:48 | * | flynn joined #nim |
17:24:17 | * | fredrikhr joined #nim |
17:26:30 | * | flynn quit (Read error: Connection reset by peer) |
17:27:43 | * | flynn joined #nim |
17:33:19 | * | flynn quit (Read error: Connection reset by peer) |
17:34:32 | * | flynn joined #nim |
17:39:06 | * | flynn quit (Read error: Connection reset by peer) |
17:40:20 | * | flynn joined #nim |
17:45:00 | * | flynn quit (Read error: Connection reset by peer) |
17:46:14 | * | flynn joined #nim |
17:50:19 | * | flynn quit (Read error: Connection reset by peer) |
17:51:32 | * | flynn joined #nim |
17:51:49 | * | PMunch joined #nim |
17:56:21 | * | flynn quit (Read error: Connection reset by peer) |
17:57:34 | * | flynn joined #nim |
18:03:13 | * | flynn quit (Read error: Connection reset by peer) |
18:04:26 | * | flynn joined #nim |
18:07:29 | * | pro joined #nim |
18:10:27 | * | flynn quit (Read error: Connection reset by peer) |
18:11:40 | * | flynn joined #nim |
18:17:15 | * | flynn quit (Read error: Connection reset by peer) |
18:18:28 | * | flynn joined #nim |
18:18:50 | FromDiscord | <sOkam!> uhhh.... i can't find this function in nim's website, and it errors on compile saying it doesn't exist, but that is from the manual https://media.discordapp.net/attachments/371759389889003532/966040193377374268/unknown.png |
18:19:13 | FromDiscord | <sOkam!> am I doing something dummie? |
18:20:06 | FromDiscord | <sOkam!> I want to open a file, and store it in a variable as a raw string (its shader source code)↵What should I be using instead? 🤔 |
18:20:50 | Amun-Ra | const foo = staticRead"a file" |
18:23:18 | * | flynn quit (Read error: Connection reset by peer) |
18:23:25 | FromDiscord | <sOkam!> is it good practice to use `staticRead` instead of `readFile` for shader code files? |
18:23:50 | Amun-Ra | staticRead is useful for embedding file contents into code |
18:24:15 | Amun-Ra | you do not rely on external file when run |
18:24:17 | FromDiscord | <sOkam!> really handy for this opengl tut, but dunno how practical that methodology is for game engine dev |
18:24:31 | * | flynn joined #nim |
18:24:53 | FromDiscord | <sOkam!> In reply to @Amun-Ra "you do not rely": which means I would need to recompile the engine if the file changes, right? |
18:25:53 | Amun-Ra | yes |
18:26:41 | FromDiscord | <sOkam!> is `readFile` a good alternative for when I don't want to embed? or should i be using a different method? |
18:27:06 | * | pro quit (Quit: pro) |
18:27:14 | Amun-Ra | it's a good method |
18:28:59 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3Vyi |
18:29:45 | * | flynn quit (Read error: Connection reset by peer) |
18:30:58 | * | flynn joined #nim |
18:34:09 | FromDiscord | <2F42BBA1> nvm figured it out |
18:35:34 | * | flynn quit (Read error: Connection reset by peer) |
18:36:47 | * | flynn joined #nim |
18:37:30 | FromDiscord | <RattleyCooper> I really want to use the macros library to generate nim code I can compile later. Is there a way to do this, or something similar that doesn’t require the compiler? I really don’t like using string to build the scripts |
18:38:29 | * | neceve joined #nim |
18:39:08 | FromDiscord | <RattleyCooper> I like using ‘quote do:’ and then ‘repr’ to get the generated script |
18:40:54 | * | flynn quit (Read error: Connection reset by peer) |
18:42:07 | * | flynn joined #nim |
18:44:27 | PMunch | @RattleyCooper, not quite sure what you're asking |
18:44:51 | * | jjido joined #nim |
18:46:33 | FromDiscord | <RattleyCooper> I am making a build tool to embed my game resources into my executables |
18:47:07 | * | flynn quit (Read error: Connection reset by peer) |
18:48:20 | * | flynn joined #nim |
18:48:46 | FromDiscord | <RattleyCooper> Ideally I can just generate the template file with staticReads so I don’t have to write them by hand. I think I figured out a better way though |
18:51:05 | PMunch | staticRead is indeed the way to go to get resources into your executable. You can of course also do stuff to the loaded file on compile-time if you want |
18:51:37 | PMunch | I did this for my Arduboy game, loaded .bmp files during compilation, but only the converted, packed byte array was put in the executable |
18:53:42 | FromDiscord | <RattleyCooper> Yeah, I really hate having to ship a zip file full of resources lol. I have it all working but now I want to make it easier to do |
18:53:53 | * | flynn quit (Read error: Connection reset by peer) |
18:54:43 | Yardanico_ | PMunch: good evening, I've tried Futhark and this time it worked quite well for Sciter :) |
18:54:50 | * | Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:54:58 | * | Yardanico joined #nim |
18:55:05 | * | flynn joined #nim |
18:55:16 | Yardanico | I I still need to figure out how to retype some things (I've did that manually for now), but generally it's usable |
18:55:23 | Yardanico | even though Futhark errored on some definitions (I think) it made a correct Nim file |
18:55:46 | Yardanico | I mostly need to change the type of procs from `ptr Functiontype` to `Functiontype` because Nim has the procs themselves as pointers |
18:55:55 | PMunch | Yardanico, great to hear that it works better now :) |
18:56:07 | FromDiscord | <RattleyCooper> And I’m just using strings to generate the script. It’d be really cool to have something like ‘quote do:’ that could be used to dynamically generate nim code that isn’t executed/checked by compiler |
18:56:09 | PMunch | Hmm, that's strange |
18:56:23 | PMunch | I though I had fixed those |
18:57:10 | PMunch | @RattleyCooper, what would be the point of that? |
18:57:12 | FromDiscord | <Yardanico> This is how the generated Nim file looks like - https://gist.github.com/Yardanico/72b8b7cc6fc4a34377f63621c79b60fc |
18:58:34 | PMunch | Aha, that's a bit unfortunate |
18:58:43 | FromDiscord | <RattleyCooper> In reply to @PMunch "<@408056314342932491>, what would be": To generate my nim scripts without having to use string lol. I’m just being pretentious |
18:59:41 | PMunch | But if you're generating Nim (by the way Nim script is it's own thing :P) you can just use quote do.. |
19:00:19 | * | flynn quit (Read error: Connection reset by peer) |
19:01:32 | * | flynn joined #nim |
19:02:45 | FromDiscord | <RattleyCooper> Oh yeah haha, forgot about that. I’ve been away for a while lol. And yeah I think I was over-complicating it. I will just import the macro in all my projects |
19:03:43 | FromDiscord | <Yardanico> also @PMunch I'm getting a bunch of deprecated warnings due to the fact that Futhark uses `cuchar` which is deprecated |
19:03:56 | PMunch | I know |
19:04:03 | PMunch | I guess I should fix that |
19:04:14 | FromDiscord | <Yardanico> it's not a big deal, just sharing what I saw |
19:05:20 | * | flynn quit (Read error: Connection reset by peer) |
19:06:33 | * | flynn joined #nim |
19:08:39 | * | Gustavo6046 joined #nim |
19:09:31 | * | PMunch quit (Quit: leaving) |
19:09:46 | * | Gustavo6046 quit (Max SendQ exceeded) |
19:10:14 | * | Gustavo6046 joined #nim |
19:10:31 | * | PMunch joined #nim |
19:11:06 | PMunch | Yardanico, it just feels wrong to throw away type information like that |
19:11:29 | * | flynn quit (Read error: Connection reset by peer) |
19:12:41 | * | flynn joined #nim |
19:18:03 | * | flynn quit (Read error: Connection reset by peer) |
19:19:15 | * | flynn joined #nim |
19:23:18 | FromDiscord | <ShalokShalom> In reply to @sOkam! "uhhh.... i can't find": I had this tons already too |
19:23:24 | FromDiscord | <sOkam!> how can I cast the output of `readFile():string=` safely into a `cstring` type? |
19:23:46 | FromDiscord | <ShalokShalom> Pieces of code in the docs are not supposed to be able to be compiled, so far as I can tell |
19:23:53 | FromDiscord | <ShalokShalom> Its more.. pseudocode |
19:24:09 | * | flynn quit (Read error: Connection reset by peer) |
19:25:22 | * | flynn joined #nim |
19:25:34 | FromDiscord | <sOkam!> if I use `staticRead()` into a `const XX:cstring`, it seems to be working no problem↵but if I use `readFile()` into a `let XX:cstring`, the compiler says that it cannot read the file 🤔 |
19:26:40 | FromDiscord | <Yardanico> In reply to @ShalokShalom "Pieces of code in": if you mean the manual, in a lot of cases yes |
19:26:50 | PMunch | sOkam, in general everything in the manual should be executable, but sometimes you have to import the correct module. `readFile` in particular is from the io module: https://nim-lang.org/docs/io.html#readFile%2Cstring |
19:26:50 | FromDiscord | <Yardanico> but in module docs code examples are supposed to compile and most of them are actually tested |
19:27:07 | FromDiscord | <Yardanico> @PMunch io is alwas imported :) |
19:27:11 | FromDiscord | <Yardanico> (edit) "alwas" => "always" |
19:27:19 | FromDiscord | <Yardanico> until it gets moved out into std/syncio |
19:27:32 | PMunch | Oh yeah, you're right |
19:27:48 | PMunch | Not sure then why sOkam is having trouble with that snippet |
19:28:31 | FromDiscord | <sOkam!> In reply to @PMunch "sOkam, in general everything": yes, except io is from system (shouldn't be manually added), and the recommended method in the manual was `openFile`, which doesn't seem to exist |
19:28:46 | FromDiscord | <Yardanico> ah I see what you mean @sOkam! |
19:28:50 | FromDiscord | <Yardanico> yeah some code examples in the manual are old |
19:28:57 | FromDiscord | <sOkam!> yeah i figured |
19:29:06 | FromDiscord | <Yardanico> nowadays it's just `open` to open files |
19:29:35 | * | flynn quit (Read error: Connection reset by peer) |
19:29:35 | FromDiscord | <sOkam!> now the issue seems to be that I don't know how to cast a `string` into a `cstring` |
19:29:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:30:10 | FromDiscord | <Yardanico> you don't "cast it" |
19:30:24 | FromDiscord | <Yardanico> cstring doesn't increase the refcount so you should only use it to convert a string into cstring when passing into C parameters |
19:30:33 | FromDiscord | <Yardanico> so if your string gets out of scope and gets destroyed, cstring will become invalid |
19:30:47 | * | flynn joined #nim |
19:30:50 | FromDiscord | <Yardanico> what is the specific usecase you need the cstring for? |
19:31:02 | FromDiscord | <sOkam!> its passing into a C library, which needs cstring |
19:31:20 | FromDiscord | <Yardanico> and does the C library want ownership of that C string or not? |
19:31:22 | FromDiscord | <sOkam!> they are bindings for opengl, specifically nimgl |
19:31:42 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyB |
19:31:45 | FromDiscord | <Yardanico> (usually the C APIs expect the length of the string as well) |
19:32:04 | * | jmdaemon joined #nim |
19:32:20 | FromDiscord | <sOkam!> im just storing the data into a variable, and some other part of the code might be doing that but i dont remember |
19:33:19 | FromDiscord | <Yardanico> well the pattern is what I showed, you generally don't want to store `cstring` in a separate variable since that holds a "weak" reference |
19:33:31 | FromDiscord | <Yardanico> if the original string gets destroyed (out of scope, etc), your cstring will point to invalid address |
19:33:59 | FromDiscord | <Yardanico> is there a problem for your API calls using cstring in the call itself like I showed? |
19:34:02 | FromDiscord | <Yardanico> (edit) "using" => "to use" |
19:34:35 | * | fredrikhr quit (Ping timeout: 260 seconds) |
19:35:00 | FromDiscord | <sOkam!> the problm with it is that im using some tutorials, and copypasting code like a parrot for now until I start understanding what it does slowly. so... I can't really answer that question because I have no clue 😔 |
19:35:15 | * | flynn quit (Read error: Connection reset by peer) |
19:36:28 | * | flynn joined #nim |
19:36:47 | FromDiscord | <sOkam!> at the moment, what the code does is it creates a `let XX:cstring`, and that value is added to an element of an object a bit later |
19:37:24 | FromDiscord | <Yardanico> yeah, I mean this could work, but making a normal string and passing cstring() is a bit more correct IMO |
19:38:12 | FromDiscord | <Yardanico> btw, a bit of offtopic question, does anyone know if `class` in C++ is heap-allocated? |
19:38:15 | FromDiscord | <sOkam!> `glShaderSource(r.fragment.id, 1, r.fragment.src.addr, nil)` |
19:38:16 | FromDiscord | <Yardanico> i'm not good at C++ |
19:39:21 | FromDiscord | <sOkam!> `glShaderSource(r.fragment.id, 1, r.fragment.src.addr, nil)`↵`r` is the renderer object. `fragment` is a subobject of that, and `src` is the mentioned cstring |
19:39:45 | FromDiscord | <sOkam!> it asks for the adress of that cstring, not for the string itself |
19:40:16 | FromDiscord | <sOkam!> is that still more correct in that scenario? |
19:40:17 | * | flynn quit (Read error: Connection reset by peer) |
19:41:05 | FromDiscord | <Yardanico> I think the nimgl definition of glShaderSource is a bit wrong - glShaderSource expects a pointer to an array of pointers of strings |
19:41:09 | FromDiscord | <Yardanico> but yes, the code you showed will work |
19:41:16 | FromDiscord | <Yardanico> https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glShaderSource.xhtml "Specifies an array of pointers to strings containing the source code to be loaded into the shader." |
19:41:30 | * | flynn joined #nim |
19:41:36 | FromDiscord | <Yardanico> "The first sequence is an array of C-strings, either zero-terminated or not.↵↵The second sequence is an array of integers, indicating the length of each of the strings in the first sequence. This sequence is optional if the strings are zero-terminated, as the library will find the lengths by itself." |
19:41:53 | FromDiscord | <Yardanico> https://stackoverflow.com/questions/22100408/what-is-the-meaning-of-the-parameters-to-glshadersource |
19:42:10 | * | jjido joined #nim |
19:42:46 | FromDiscord | <sOkam!> yea. i know it works.(that is, when the cstring is correctly populated with the file, that is not being read corretly like I mentioned unless i do staticRead)↵Question is if that syntax you mentioned is still more correct if I need to pass an `addr` |
19:43:07 | FromDiscord | <sOkam!> (edit) "that" => "which" | "corretly" => "correctly" |
19:43:17 | FromDiscord | <sOkam!> (edit) "works.(that" => "works (that" |
19:43:36 | FromDiscord | <sOkam!> (edit) "yea. i know it works (that is, when the cstring is correctly populated with the file, which is not being read correctly like I mentioned unless i do staticRead)↵Question is if that syntax you mentioned is still more correct if I need to pass an `addr` ... " added "to the nimgl method" |
19:45:23 | FromDiscord | <sOkam!> with my current understanding, if i do `cstring(theNormalString)`, im creating a new cstring on the spot.... but... is it removed from memory? or what happens to it? because opengl expects that address to remain static in memory when it loads the contents of the shader program |
19:45:23 | FromDiscord | <Yardanico> i guess in the end it works around the same way |
19:45:32 | FromDiscord | <Yardanico> In reply to @sOkam! "with my current understanding,": again, as I said, `cstring` does not create anything new |
19:45:49 | FromDiscord | <Yardanico> it doesn't hold any memory by itself really, it just stores the address to the first element of theNormalString |
19:45:56 | FromDiscord | <Yardanico> and when theNormalString gets destroyed, cstring points to nothing anymore |
19:46:33 | * | flynn quit (Read error: Connection reset by peer) |
19:46:49 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyF |
19:46:49 | FromDiscord | <Yardanico> both echos output the same value |
19:46:59 | FromDiscord | <Yardanico> because, as I said, cstring just points to the first element in the string |
19:47:38 | FromDiscord | <sOkam!> is `cstring(theNormalString).addr` still a correct address for opengl to understand? |
19:47:46 | * | flynn joined #nim |
19:47:57 | FromDiscord | <Yardanico> in reality it works, but it's a bit not correct |
19:48:07 | FromDiscord | <Yardanico> as I said, opengl expects an array of pointers to cstrings |
19:48:17 | FromDiscord | <Yardanico> if you just pass a pointer to one cstring, that's just an array of one element |
19:48:30 | FromDiscord | <sOkam!> but i didn't code nimgl or the tutorial 😔 |
19:48:43 | FromDiscord | <Yardanico> i know, but everyone makes mistakes :) |
19:48:53 | FromDiscord | <Yardanico> and I guess you don't need the multiple strings feature when passing shaders to opengl often |
19:49:55 | FromDiscord | <sOkam!> i don't know what the multiple strings feature is, ngl |
19:50:23 | FromDiscord | <Yardanico> "The reason for making glShaderSource take more than one string is because OpenGL's shader compiler has exposed the concept of a file. Each of these strings represents the contents of one file, and it will compile as if these files are concatenated together" |
19:50:43 | FromDiscord | <Yardanico> so that you don't have to waste memory and allocations concatenating strings yourself and just pass the strings separately to OpenGL |
19:51:21 | FromDiscord | <sOkam!> ah i see |
19:52:54 | FromDiscord | <sOkam!> In reply to @sOkam! "is `cstring(theNormalString).addr` still a": what about this one, then? is this still correct syntax↵_(even if not perfect, but we mentioned i did not code nimgl, so can't really change how the library works)_ |
19:53:08 | * | flynn quit (Read error: Connection reset by peer) |
19:53:20 | FromDiscord | <sOkam!> im just trying to understand how to make that line work, that's it really |
19:54:21 | FromDiscord | <Yardanico> well it works even with the default code, right |
19:54:22 | * | flynn joined #nim |
19:55:56 | * | Zectbumo joined #nim |
19:55:57 | FromDiscord | <sOkam!> In reply to @Yardanico "well it works even": ? |
19:56:08 | FromDiscord | <Yardanico> you said that nimgl default code already works, right? |
19:56:15 | FromDiscord | <sOkam!> not from a file |
19:56:54 | FromDiscord | <Yardanico> ?? |
19:57:01 | FromDiscord | <sOkam!> readFile into a `let XX:cstring` gives me a compile error↵staticRead into a `const XX:cstring` works, but its embedded |
19:57:02 | FromDiscord | <Yardanico> that API proc never claims to be able to read from a file |
19:57:29 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyI |
19:58:05 | FromDiscord | <sOkam!> In reply to @Yardanico "that API proc never": that api proc asks for the address of a cstring, that's it↵and im trying to use nim methods to store the file content and pass that content into the cstring.addr |
19:59:00 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VyK |
19:59:14 | FromDiscord | <sOkam!> which is why I reasked, because that's the exact same syntax I asked about |
19:59:20 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/966065481691832421/unknown.png |
19:59:34 | FromDiscord | <Yardanico> i said that it's not fully correct (because that glShaderSource actually expects an array), but it works in reality |
19:59:55 | * | flynn quit (Read error: Connection reset by peer) |
20:00:48 | * | neurocyte8614492 quit (Ping timeout: 276 seconds) |
20:01:08 | * | flynn joined #nim |
20:02:08 | FromDiscord | <sOkam!> In reply to @Yardanico "i said that it's": https://media.discordapp.net/attachments/371759389889003532/966066187337355324/unknown.png |
20:02:22 | FromDiscord | <Yardanico> yes, that definition is not 100% correct |
20:02:35 | FromDiscord | <Yardanico> because Nim type system is more strict than the C type system, and it would be better to have an array there instead of just `ptr cstring` |
20:04:13 | FromDiscord | <sOkam!> I'm in no position to understand what the library is doing in the background. I just want to know if using cstring(Thing).addr will make the content of my shader file disappear from memory because X string was removed from memory. I don't understand 1% of what you explained, so I was asking about this specifically |
20:04:44 | FromDiscord | <Yardanico> again, glShaderSource will copy the string to its own memory so you don't need to care about that |
20:04:47 | FromDiscord | <sOkam!> I'm not a low level programmer, memory allocation and all this jazz goes waaay over my head |
20:05:12 | FromDiscord | <Yardanico> "The source code strings are not scanned or parsed at this time; they are simply copied into the specified shader object." |
20:05:27 | FromDiscord | <Yardanico> "OpenGL copies the shader source code strings when glShaderSource is called, so an application may free its copy of the source code strings immediately after the function returns." |
20:05:49 | FromDiscord | <sOkam!> In reply to @Yardanico "again, glShaderSource will copy": I thought it was using the address itself, and storing that, instead of making a copy of the contents of that adress into a new adress |
20:05:53 | FromDiscord | <Yardanico> of course not |
20:05:59 | FromDiscord | <Yardanico> most C APIs make a copy of the string you pass to them |
20:06:11 | FromDiscord | <sOkam!> I see, that makes sense then |
20:06:39 | * | flynn quit (Read error: Connection reset by peer) |
20:07:52 | * | flynn joined #nim |
20:13:15 | * | flynn quit (Read error: Connection reset by peer) |
20:14:28 | * | flynn joined #nim |
20:19:49 | * | flynn quit (Read error: Connection reset by peer) |
20:21:02 | * | flynn joined #nim |
20:21:45 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VyX |
20:25:25 | * | flynn quit (Read error: Connection reset by peer) |
20:26:17 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3VyZ |
20:26:38 | * | flynn joined #nim |
20:27:22 | FromDiscord | <ynfle> In reply to @b4mbus "is unpacking a type": You can do a double loop and iterate over the fields |
20:27:43 | FromDiscord | <b4mbus> iterate over the fields? |
20:28:32 | FromDiscord | <Yardanico> fieldPairs |
20:28:57 | FromDiscord | <ynfle> https://nim-lang.org/docs/iterators.html#fields.i%2CT |
20:29:00 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Vz0 |
20:29:13 | FromDiscord | <Yardanico> fields and fieldPairs iterators are unrolled at compile-time |
20:29:27 | FromDiscord | <b4mbus> hmm ok, so I can only do that, there's no way to destructure an object like C++'s aggregates structured binding? |
20:30:27 | FromDiscord | <Yardanico> never say "no way" |
20:30:29 | FromDiscord | <ynfle> If you want destructering, use tuples |
20:30:31 | FromDiscord | <Yardanico> you can always do that with a macro :) |
20:30:37 | * | flynn quit (Remote host closed the connection) |
20:30:38 | FromDiscord | <ynfle> But, be careful |
20:30:46 | FromDiscord | <b4mbus> Yeah I really dont wanna use tuples |
20:31:36 | FromDiscord | <ynfle> Y not? |
20:31:49 | * | flynn joined #nim |
20:33:48 | * | PMunch quit (Quit: leaving) |
20:37:20 | * | flynn quit (Remote host closed the connection) |
20:38:33 | * | flynn joined #nim |
20:43:42 | * | flynn quit (Read error: Connection reset by peer) |
20:44:55 | * | flynn joined #nim |
20:50:16 | * | flynn quit (Read error: Connection reset by peer) |
20:51:29 | * | flynn joined #nim |
20:55:06 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Vz6 |
20:55:36 | FromDiscord | <Elegantbeef> Your CWD isnt the same as the file's compilation directory |
20:56:34 | * | flynn quit (Read error: Connection reset by peer) |
20:56:43 | FromDiscord | <ShalokShalom> And how is this related to var/const? |
20:56:55 | FromDiscord | <ShalokShalom> And why is this error message so bad 😛 |
20:57:01 | FromDiscord | <sOkam!> are those methods reading from different cwd? |
20:57:15 | FromDiscord | <Elegantbeef> This error message isnt bad |
20:57:24 | FromDiscord | <Elegantbeef> It's an exception error message |
20:57:33 | FromDiscord | <ShalokShalom> Well, it could say what you did |
20:57:35 | FromDiscord | <Elegantbeef> What's your file directory? |
20:57:39 | FromDiscord | <ShalokShalom> You give a better error message |
20:57:41 | FromDiscord | <ShalokShalom> So its bad |
20:57:42 | FromDiscord | <Elegantbeef> It's an exception |
20:57:47 | * | flynn joined #nim |
20:57:55 | FromDiscord | <Elegantbeef> It's a runtime error |
20:58:08 | FromDiscord | <sOkam!> In reply to @Elegantbeef "What's your file directory?": the same in both cases. the top two compile, the bottom two don't |
20:58:24 | FromDiscord | <Elegantbeef> It compiles it's not running |
20:58:29 | FromDiscord | <Elegantbeef> Show the file directory please |
20:59:01 | FromDiscord | <sOkam!> that `./` is relative to the compiled file that uses them, but not to the one that im calling for `nim c -r` |
20:59:40 | FromDiscord | <Elegantbeef> Just show a tree of the directorry |
20:59:42 | FromDiscord | <Elegantbeef> Please for the love of all things good in the world i just want a tree\:D |
20:59:47 | FromDiscord | <sOkam!> 😄 |
21:00:34 | FromDiscord | <sOkam!> not sure if i have a tool that shows trees, i never use them |
21:01:33 | FromDiscord | <Elegantbeef> depending on os you can easily get one from your package manager |
21:02:34 | FromDiscord | <Elegantbeef> Think windows has it built in |
21:02:51 | * | flynn quit (Read error: Connection reset by peer) |
21:03:12 | * | neceve quit (Ping timeout: 276 seconds) |
21:04:04 | * | flynn joined #nim |
21:04:06 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Think windows has it": im on linux, though |
21:05:02 | FromDiscord | <Elegantbeef> so install `tree` and live your life happily |
21:05:32 | FromDiscord | <sOkam!> best I could do↵the file I showed, where the variables are coded, is`engine/render/core.nim`↵the file that I'm calling for `nim c -r` is `ROOT/rqe.nim` https://media.discordapp.net/attachments/371759389889003532/966082142272618606/unknown.png |
21:06:03 | FromDiscord | <Elegantbeef> Yea there's your problem it needs to be `engine/render/simple.vert` at runtime |
21:07:15 | FromDiscord | <Elegantbeef> Relative paths at runtime are relative to your CWD at compile time they're relative to the file |
21:08:43 | * | flynn quit (Read error: Connection reset by peer) |
21:09:55 | * | flynn joined #nim |
21:12:57 | FromDiscord | <Elegantbeef> Oh hey zoom you might appreciate what i'm presently doing. Benchmarking closure iterators with/without move against inline iterators |
21:13:14 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966084081139994644/image.png |
21:13:27 | FromDiscord | <Elegantbeef> With complex objects turns out copying data is much much worse than moving data 😛 |
21:14:09 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Vza is the code for anyone curious |
21:15:09 | * | flynn quit (Read error: Connection reset by peer) |
21:16:22 | * | flynn joined #nim |
21:20:19 | * | flynn quit (Read error: Connection reset by peer) |
21:20:37 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Vze |
21:20:49 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3Vze" => "https://play.nim-lang.org/#ix=3Vzf" |
21:21:01 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3Vzf" => "https://play.nim-lang.org/#ix=3Vzg" |
21:21:31 | * | flynn joined #nim |
21:21:48 | FromDiscord | <Elegantbeef> doesnt `glShaderSource` take in a `CStringArray`? |
21:21:52 | FromDiscord | <sOkam!> is there any reason I should care about storing a `string` instead of a `cstring`? |
21:22:04 | FromDiscord | <sOkam!> In reply to @Elegantbeef "doesnt `glShaderSource` take in": nope, pointer to a cstring |
21:22:05 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L31-L86 like this is how i do it |
21:22:08 | FromDiscord | <sOkam!> nimgl stuff |
21:22:13 | FromDiscord | <Elegantbeef> That's a cstring array |
21:22:17 | FromDiscord | <sOkam!> nope |
21:22:21 | FromDiscord | <sOkam!> checked |
21:22:24 | FromDiscord | <Elegantbeef> Yes |
21:22:28 | FromDiscord | <sOkam!> its in the library |
21:22:37 | FromDiscord | <Elegantbeef> ptr cstring is a cstring array |
21:22:47 | FromDiscord | <sOkam!> In reply to @sOkam! "": ☝️ |
21:22:53 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "It's an exception": Idc what it is |
21:22:57 | FromDiscord | <ShalokShalom> I care about the result |
21:23:08 | FromDiscord | <ShalokShalom> And the message tells me very little compared to you |
21:23:13 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966086591930069002/image.png |
21:23:24 | FromDiscord | <ShalokShalom> Its a compliment 🙂 |
21:25:40 | FromDiscord | <Elegantbeef> Like i said it's a cstring array even though it doesnt say it is |
21:25:41 | FromDiscord | <Elegantbeef> This is why C fucking sucks |
21:26:10 | FromDiscord | <Elegantbeef> Weakly typed language used for interop make me sad |
21:26:31 | FromDiscord | <sOkam!> In reply to @Elegantbeef "image.png": https://raw.githubusercontent.com/nimgl/nimgl/master/src/nimgl/opengl.nim↵ctrl+f `glShaderSource`↵I'm just following the opengl example from:↵https://github.com/nimgl/nimgl/blob/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/examples/topengl.nim#L113 |
21:27:01 | FromDiscord | <sOkam!> If there is a better way of loading from a file, then that's certainly what I'm looking for |
21:27:04 | FromDiscord | <Elegantbeef> Sure and in this case it's passing an address to a cstring which is an array of 0 |
21:27:08 | FromDiscord | <sOkam!> the example just does it that way |
21:27:19 | FromDiscord | <Elegantbeef> So follow what they do |
21:27:24 | * | flynn quit (Read error: Connection reset by peer) |
21:27:29 | FromDiscord | <Elegantbeef> Honestly it's what i should do aswell |
21:27:38 | FromDiscord | <Elegantbeef> `var myCstring = myString.cstring` then pass the `addr` of it |
21:27:38 | FromDiscord | <sOkam!> aka hardcode the src inside the sourcecode? |
21:27:42 | FromDiscord | <Elegantbeef> No |
21:27:44 | FromDiscord | <sOkam!> they are not using files |
21:27:50 | FromDiscord | <Elegantbeef> .... |
21:28:09 | FromDiscord | <Elegantbeef> `var myCstringShader = cstring myShaderSource` then do `addr myCstringShader` |
21:28:09 | FromDiscord | <sOkam!> i was recommended to not use cstring. i was just using cstring before like they do |
21:28:25 | FromDiscord | <sOkam!> yeah, that's what I had before and worked |
21:28:38 | * | flynn joined #nim |
21:29:45 | FromDiscord | <sOkam!> is there any reason in this context to not use cstring?↵honestly, I have no clue what the difference is between `cstring` and `string`, i was just trying to use string because someone recommended to not use cstring. idc what to use 🤷♂️ |
21:30:28 | FromDiscord | <SirOlaf> Can a macro receive a raw string like `"\x2E."` without explicitly making the string raw? Probably not I guess |
21:30:36 | FromDiscord | <Elegantbeef> No you need to convert to a cstring here |
21:30:37 | FromDiscord | <SirOlaf> Need to escape some byte regexes |
21:31:16 | FromDiscord | <Elegantbeef> if you do `myMacro"\x2E."` it'd do it, but that only works for a single call |
21:31:55 | FromDiscord | <SirOlaf> So why is myMacro("\x2E.") different from myMacro"\x2E." |
21:32:02 | FromDiscord | <SirOlaf> Something to do with literal types? |
21:32:17 | FromDiscord | <SirOlaf> Either way, thanks |
21:32:25 | FromDiscord | <Elegantbeef> It's a feature to make life a bit better |
21:33:34 | * | flynn quit (Read error: Connection reset by peer) |
21:34:24 | FromDiscord | <SirOlaf> Can I also disallow the () syntax somehow |
21:34:31 | FromDiscord | <Elegantbeef> Nope |
21:34:34 | FromDiscord | <SirOlaf> That sucks |
21:34:43 | FromDiscord | <Elegantbeef> Hardly an issue if you ask me |
21:34:47 | * | flynn joined #nim |
21:34:55 | FromDiscord | <SirOlaf> Allows for some dumb mistakes |
21:36:11 | FromDiscord | <SirOlaf> Guess I can check node type |
21:36:22 | FromDiscord | <SirOlaf> This syntax without () converts to a raw string implicitly |
21:39:15 | FromDiscord | <Zoom> [Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) cool to see some concrete measurements. |
21:39:33 | * | flynn quit (Read error: Connection reset by peer) |
21:39:54 | FromDiscord | <Elegantbeef> Yea sadly twice as slow as inline it seems |
21:40:45 | * | flynn joined #nim |
21:40:58 | FromDiscord | <Elegantbeef> Though it can be like 10 times slower for other types, `seq[int]` for instance |
21:41:07 | FromDiscord | <Elegantbeef> Oddly arc doesnt automatically move data for closure generators that have a `sink T` though |
21:43:06 | FromDiscord | <Elegantbeef> @sOkam!\: well anyway thanks for showing nimgl makes my code less allocatey 😛 |
21:46:20 | * | flynn quit (Read error: Connection reset by peer) |
21:47:20 | FromDiscord | <sOkam!> In reply to @Elegantbeef "<@186489007247589376>\: well anyway thanks": wdym? 🙂 |
21:47:33 | * | flynn joined #nim |
21:47:49 | FromDiscord | <Elegantbeef> I realized i could do it without `alloccstringarray` |
21:48:16 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/commit/94154350b64a56c8bc0db1bfa04b94795df7c44a for your viewing pleasure |
21:48:27 | FromDiscord | <sOkam!> you use your own wrapper or something? |
21:49:08 | FromDiscord | <Elegantbeef> [Zoom](https://matrix.to/#/@Zoom:matrix.org)\: i brokey the benchmark |
21:49:11 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966093125489672224/image.png |
21:52:59 | * | flynn quit (Read error: Connection reset by peer) |
21:54:12 | * | flynn joined #nim |
21:55:34 | FromDiscord | <Elegantbeef> Seems LTO caused the benchmark to implode |
21:55:54 | FromDiscord | <Zoom> That doesn't look right \:) |
21:56:08 | FromDiscord | <Elegantbeef> GCC's lto doesnt like the benchmark |
21:56:33 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966094983109156884/image.png |
21:56:34 | FromDiscord | <Elegantbeef> With clang it's fine |
21:57:51 | FromDiscord | <Elegantbeef> For some reason `-d:lto` causes weird performance but `--passL: flto` doesnt |
21:58:49 | * | flynn quit (Read error: Connection reset by peer) |
22:00:02 | * | flynn joined #nim |
22:04:35 | * | flynn quit (Remote host closed the connection) |
22:05:19 | * | noeontheend joined #nim |
22:05:49 | * | flynn joined #nim |
22:08:32 | FromDiscord | <Elegantbeef> so `-passc:"-flto"` causes gcc to not like the closure code |
22:08:38 | FromDiscord | <Elegantbeef> the moving closures go up to 10ms |
22:10:28 | * | flynn quit (Read error: Connection reset by peer) |
22:11:46 | * | flynn joined #nim |
22:17:43 | * | gsalazar quit (Ping timeout: 272 seconds) |
22:17:54 | * | flynn quit (Read error: Connection reset by peer) |
22:19:01 | FromDiscord | <Zoom> Hey [treeform#3712](https://matrix.to/#/%40_discord_107140179025735680%3At2bot.io) I'm parsing some json replies with jsony and have a question. Is there some way to not declare the whole bunch of objects just to peel the outer layers? The data is like 4-layers deep in single-field objects. |
22:19:07 | * | flynn joined #nim |
22:19:25 | FromDiscord | <Elegantbeef> Are you asking for json node navigation? |
22:19:57 | FromDiscord | <Elegantbeef> Ie `myJson["a"]["b"]["c"]["d"].to(MyType)` |
22:20:25 | FromDiscord | <Elegantbeef> If so you dont really benefit from jsony |
22:22:30 | FromDiscord | <Zoom> Guess so. I like the custom parse hooks |
22:23:00 | FromDiscord | <Elegantbeef> Yea i mean the stdlib now also has them, but still will be slower |
22:23:35 | FromDiscord | <Elegantbeef> But given you're needing the parsed json structure you might aswell just use the stdlib's json library for this |
22:24:05 | FromDiscord | <Elegantbeef> The data has to be parsed anyway to get there so it's not like it's that much slower |
22:24:58 | * | flynn quit (Read error: Connection reset by peer) |
22:26:12 | * | flynn joined #nim |
22:26:55 | * | lumo_e joined #nim |
22:30:09 | * | flynn quit (K-Lined) |
22:36:26 | FromDiscord | <Zoom> I thought there were some plans to extract json from std, right? |
22:36:47 | FromDiscord | <Elegantbeef> Dont think so, think there are plans to make it betterer and cleaner |
23:02:19 | * | oisota quit (Quit: The Lounge - https://thelounge.chat) |
23:02:39 | * | oisota joined #nim |
23:04:49 | * | oisota quit (Client Quit) |
23:05:32 | * | oisota joined #nim |
23:16:45 | * | Gustavo6046 quit (Remote host closed the connection) |
23:17:25 | * | Gustavo6046 joined #nim |
23:21:16 | * | oisota quit (Quit: The Lounge - https://thelounge.chat) |
23:21:41 | * | oisota joined #nim |
23:36:21 | FromDiscord | <!Patitotective> i must be doing something wrong, im downloading an image of 11kb and it creats a file of 693kb 💀 |
23:38:07 | FromDiscord | <huantian> Don’t worry it’s just adding extra data for you |
23:38:26 | FromDiscord | <huantian> Did you make sure You’re not have any duplicate file names |
23:39:06 | FromDiscord | <!Patitotective> In reply to @huantian "Did you make sure": im sure |
23:39:11 | FromDiscord | <!Patitotective> but the image it downloads doesnt work |
23:39:19 | FromDiscord | <!Patitotective> my system can't load it, either stb_image |
23:40:39 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VzS |
23:41:25 | FromDiscord | <!Patitotective> maybe because i added a `downTable` where i store if files are being downloaded or if they already are |
23:42:34 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VzU |
23:52:39 | NimEventer | New thread by Archnim: Varargs limitation, see https://forum.nim-lang.org/t/9118 |
23:55:58 | FromDiscord | <Zoom> I fail to make fromJsonHook work for DateTime. Bunch of type mismatch errors "got \<proc (x\: Time)\: ZonedTime{.closure, gcsafe, locks\: 0.}, JsonNode, string\>". Don't even know where does ZonedTime appear from. |
23:56:37 | FromDiscord | <Elegantbeef> They're procs attached to `DateTime` |