<< 19-04-2022 >>

00:00:07*flynn quit (Read error: Connection reset by peer)
00:01:21*flynn joined #nim
00:01:34FromDiscord<Rika> In reply to @Patitotective "hey <@259277943275126785> how are": Your code is more cursed than just callbacks
00:01:42FromDiscord<Rika> I don’t understand how you’d stop the server
00:02:32FromDiscord<huantian> you can just send some specific message
00:02:42FromDiscord<huantian> like`("", "")`
00:06:31*flynn quit (Read error: Connection reset by peer)
00:06:56FromDiscord<Omicron666> why no in-browser interpreter... ^^
00:07:05FromDiscord<huantian> wdym
00:07:45*flynn joined #nim
00:07:50FromDiscord<Omicron666> get rid of docker
00:07:53FromDiscord<Elegantbeef> This is where i say "there is" https://www.jasonbeetham.com/snake/nicoscripter.html
00:08:40FromDiscord<Omicron666> couldn't this be on official website?
00:08:51FromDiscord<Elegantbeef> PRs welcome?
00:09:04FromDiscord<Elegantbeef> I do want to make a proper P5js like thingy, but i cannot be arsed
00:09:08FromDiscord<exelotl> dang that's pretty epic
00:09:21FromDiscord<Omicron666> great animation 😄
00:11:32FromDiscord<exelotl> does giving a proc a `static` return type force it to be evaluated at compile-time?
00:12:28FromDiscord<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:39FromDiscord<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:00FromDiscord<exelotl> so you can't return anything unless it's known at compile time
00:20:01FromDiscord<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:53FromDiscord<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:28FromDiscord<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:42FromDiscord<exelotl> sadly I can't make it work any way other than `untyped` as the return type
00:29:54FromDiscord<Yardanico> can't you do that with {.compiletime.}
00:30:16FromDiscord<Yardanico> procs with compiletime are always executed at compile-time
00:30:31FromDiscord<Yardanico> but this means that if you have a runtime argument it won't really work
00:30:37FromDiscord<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:52FromDiscord<exelotl> just that it should eagerly evaluate as much as possible at compile time
00:31:25FromDiscord<exelotl> maybe I could do it with an overload that takes `static` params though...
00:31:59*flynn joined #nim
00:32:39FromDiscord<Yardanico> yes
00:36:50*flynn quit (Read error: Connection reset by peer)
00:38:03*flynn joined #nim
00:39:28FromDiscord<exelotl> nope https://play.nim-lang.org/#ix=3Vup :(
00:40:41FromDiscord<exelotl> oh well, at least the templates work 😅
00:40:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vuq
00:41:52FromDiscord<ajusa> Micros is cool
00:42:02FromDiscord<Elegantbeef> Thanks
00:42:05FromDiscord<ajusa> Now I can avoid learning how to write real macros
00:42:14FromDiscord<Elegantbeef> I mean they're real macros
00:42:19FromDiscord<Elegantbeef> They're how macros should be written
00:42:28FromDiscord<ajusa> Actually though I always wished stuff like fieldPairs existed for proc params
00:42:49FromDiscord<ajusa> They are but much easier to reason about than NimNodes imo
00:43:11FromDiscord<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:51FromDiscord<exelotl> sent a code paste, see https://paste.rs/RAh
00:43:55FromDiscord<Elegantbeef> I do want to make the API cover a majority of Nim code, but that takes time
00:44:23FromDiscord<Elegantbeef> Inline it then
00:44:35*flynn joined #nim
00:44:55FromDiscord<exelotl> for example it would make debugging with -O0 even more of a pain
00:45:07FromDiscord<Elegantbeef> Ok
00:45:22FromDiscord<Elegantbeef> Ajusa have any examples of your macros written with micros?
00:45:51*lumo_e joined #nim
00:47:43FromDiscord<ajusa> not yet, I'm trying to use it for some actual code now
00:48:11FromDiscord<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:08FromDiscord<Elegantbeef> Ah so the iterator i have will make your life easy
00:51:38FromDiscord<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:31FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Vur
00:52:40FromDiscord<Elegantbeef> Yea
00:52:56FromDiscord<ajusa> Error: undeclared field: 'routine'
00:52:57FromDiscord<Elegantbeef> Sorry i dont have any docgen setup, or proper examples 😄
00:53:10FromDiscord<Elegantbeef> did you `import micros`?
00:53:14FromDiscord<ajusa> does it not export everything, or do I need to import something in the stdlib?
00:53:16FromDiscord<ajusa> yeah
00:53:33FromDiscord<Elegantbeef> `routineNode`
00:53:37FromDiscord<Elegantbeef> Did i make a fuck up somewhere?
00:54:21FromDiscord<ajusa> `for idefs in myProc.routineNode.params:` ? that doesn't work either
00:54:42FromDiscord<Elegantbeef> What's the error?
00:54:44FromDiscord<ajusa> and yeah I was going off of https://nim-lang.org/blog/2022/04/04/this-month-with-nim.html
00:54:56FromDiscord<Elegantbeef> Ah we'll just say i fucked up writting the examples there
00:55:07FromDiscord<ajusa> sent a code paste, see https://paste.rs/fUS
00:55:21FromDiscord<Elegantbeef> You still need to use it inside macros
00:56:03FromDiscord<ajusa> oh I can't use it within a template?
00:56:13FromDiscord<Elegantbeef> Of course not
00:56:20FromDiscord<Elegantbeef> It's still macro code
00:56:57FromDiscord<ajusa> oh, I misunderstood then. I thought I could use it similar to fieldPairs, which unrolls the loop
00:57:13FromDiscord<ajusa> this is a library to build macros, not a library of macros
00:57:22FromDiscord<ajusa> (edit) "macros," => "macros more easily,"
00:57:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vut
00:57:40FromDiscord<Elegantbeef> I mean you can of course make your macros using this
00:57:48FromDiscord<Elegantbeef> This makes it a breeze to do
00:57:52FromDiscord<ajusa> yeah that's a heck of a lot easier
00:58:13*flynn quit (Read error: Connection reset by peer)
00:58:25FromDiscord<Elegantbeef> so you can always make a `ForLoop` macro which is used on a `proc`
00:58:33FromDiscord<Elegantbeef> then unrolls the body
00:59:26*flynn joined #nim
01:02:03*noeontheend quit (Ping timeout: 260 seconds)
01:02:28FromDiscord<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:58FromDiscord<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:33FromDiscord<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:47FromDiscord<Elegantbeef> One could make the first emit the second of course
01:15:57FromDiscord<Elegantbeef> then you could have `for name in procParams(myProc)`
01:16:21FromDiscord<Elegantbeef> Anyway sorry for letting you down
01:16:22FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Vuy
01:16:35*flynn joined #nim
01:16:37FromDiscord<ajusa> would micros help me solve that problem?
01:16:43FromDiscord<Elegantbeef> Yes
01:17:20FromDiscord<ajusa> ok, I will make an actual attempt to learn how to write macros
01:17:46FromDiscord<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:50FromDiscord<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:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vuz
01:20:12FromDiscord<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:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VuA
01:23:09*flynn joined #nim
01:24:48FromDiscord<Elegantbeef> will need the most recent micros for the above with an anonymous proc, forgot that those existed
01:25:11FromDiscord<Elegantbeef> You can also just do everything micros does manually if you want
01:26:21FromDiscord<retkid> imagine if instead of C
01:26:24FromDiscord<retkid> we had Nim in this timeline
01:26:33FromDiscord<retkid> or well maybe a more low level nim
01:26:43FromDiscord<retkid> what a neat timeline
01:26:44FromDiscord<ajusa> we'd have a rough time compiling to a language that doesn't exist then
01:26:55FromDiscord<retkid> well
01:26:58FromDiscord<retkid> it would have its own compiler
01:27:39FromDiscord<Yardanico> we already have nlvm
01:27:56FromDiscord<retkid> its technically impossible because a lot of the ideas come from JS, perl, etc
01:27:57FromDiscord<retkid> but still
01:28:08FromDiscord<Elegantbeef> Just write pascal
01:28:10FromDiscord<retkid> imagine the nim descendent languages we'd use
01:28:18FromDiscord<retkid> yea nim->pascal
01:28:19*flynn quit (Read error: Connection reset by peer)
01:28:30FromDiscord<retkid> thats stupid I love it
01:28:40FromDiscord<retkid> anyone wanna do that
01:28:59FromDiscord<Elegantbeef> I mean alot of Nim translates 1\:1
01:29:00FromDiscord<retkid> nim->ada compiler
01:29:11FromDiscord<retkid> modula 2
01:29:11FromDiscord<retkid> (edit) "2" => "3"
01:29:26FromDiscord<Elegantbeef> Anyway ajusa hopefully what i suggested makes any sense
01:29:31*flynn joined #nim
01:32:03FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuB
01:32:31FromDiscord<Elegantbeef> ` for param in params:` is me being sick
01:32:33FromDiscord<ajusa> and I don't quite get the nested for loop
01:32:40FromDiscord<Elegantbeef> drop that and you're good
01:33:29FromDiscord<Elegantbeef> params iterates over the ident defs(`a: int`, `b, c, d: string`)
01:33:41FromDiscord<Elegantbeef> `names` iterates over each variable in those defs
01:34:03FromDiscord<Elegantbeef> so `a`, `b,` , `c`, `d`
01:34:11FromDiscord<ajusa> oh
01:34:44*flynn quit (Read error: Connection reset by peer)
01:35:10FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuD
01:35:24FromDiscord<Elegantbeef> `result = newStmtList()` before the loop
01:35:56*flynn joined #nim
01:36:02FromDiscord<Elegantbeef> and this wont work btw
01:36:08FromDiscord<Elegantbeef> `theParamString` still needs to be reasoned
01:37:15FromDiscord<Elegantbeef> you technically dont even need the `let` stmt and can just add `newCall("parse",...)` to `newCall`
01:37:35FromDiscord<Elegantbeef> But yes you need to pass the split string from the got string into `theParamString` slot
01:37:37FromDiscord<Yardanico> i wonder if we should create something like #appdev or #guidev specifically for applications (or GUI applications)
01:37:44FromDiscord<Yardanico> although it does overlap with #main quite a lot, but still
01:37:46FromDiscord<Yardanico> 🤔
01:37:55FromDiscord<Elegantbeef> That implies anyone using Nim makes GUIs 😛
01:38:03FromDiscord<Yardanico> we even have #langdev (!) but no #appdev
01:38:49FromDiscord<Yardanico> also yeah, waiting for PMunch to wake up so I can tell him that Futhark worked fine for me for Sciter
01:39:01FromDiscord<Yardanico> there are still some things, but generally it's as usable as the previous nimterop-generated binding
01:39:21FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuH
01:39:28FromDiscord<Yardanico> poor repo getting updates half a year https://media.discordapp.net/attachments/371759389889003532/965788689626185799/unknown.png
01:39:48FromDiscord<Elegantbeef> Yea it's a looked up symbol `ident(name.NimNode)` resolves it
01:39:55FromDiscord<Elegantbeef> but like i said you dont need the let statement
01:40:14FromDiscord<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:50FromDiscord<ajusa> ident doesn't seem to fix it for me, as the signature for newLetStmt requires a nimnode
01:44:38FromDiscord<ajusa> oh wait
01:44:48FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuI
01:46:01FromDiscord<ajusa> this doesn't work` Error: internal error: expr(skType); unknown symbol`
01:47:07FromDiscord<Elegantbeef> What's the code you're using?
01:47:39FromDiscord<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:37FromDiscord<Elegantbeef> Odd
01:53:20FromDiscord<Elegantbeef> Ah it's `params.typ` being sym'd
01:53:42FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuM
01:54:07FromDiscord<Elegantbeef> Yea that works
01:54:10*flynn quit (Read error: Connection reset by peer)
01:54:23FromDiscord<ajusa> forgot that inline tuples were a thing
01:54:33FromDiscord<retkid> does nlvm allow nim to be more of a systems language?
01:54:34FromDiscord<Elegantbeef> I mean i hate it but you do you
01:54:38FromDiscord<ajusa> since they're usually discouraged
01:54:39FromDiscord<ajusa> lol
01:54:46FromDiscord<Elegantbeef> "More of a systems language"
01:54:48FromDiscord<Elegantbeef> How is Nim not a systems language
01:54:51FromDiscord<retkid> In reply to @ajusa "here is a substantially": oh i just looked over this, what the fuck are you doing
01:55:00FromDiscord<ajusa> writing code
01:55:21FromDiscord<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:24FromDiscord<retkid> i want his approval
01:55:38FromDiscord<Elegantbeef> And what does Nim need to be a systems language
01:55:52FromDiscord<Rika> What does he say
01:55:54FromDiscord<retkid> nah
01:56:10FromDiscord<retkid> In reply to @Rika "What does he say": He be like "whatever, just go learn Rust"
01:56:16FromDiscord<Rika> Ask him why he considers every language he does as a system language and not Nim
01:56:22FromDiscord<Rika> Don’t argue with the stubborn
01:56:24FromDiscord<Rika> Why even care
01:56:32FromDiscord<Elegantbeef> How about just write faster code then his without the fighting borrower checker 😄
01:56:36FromDiscord<Yardanico> :nimble:
01:56:46FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3VuN
01:56:55FromDiscord<retkid> In reply to @Elegantbeef "How about just write": no lifetimes and cool macros
01:56:55FromDiscord<retkid> :)
01:57:05FromDiscord<Elegantbeef> Eh rust has procedural macros
01:57:13FromDiscord<retkid> are they cool tho
01:57:17FromDiscord<Rika> They’re not good
01:57:21FromDiscord<retkid> exactly
01:57:35FromDiscord<Rika> AFAIK they’re token macros so
01:57:43FromDiscord<retkid> the #1 I look for in a language is coolness
01:58:01FromDiscord<Elegantbeef> I thought it was whether the language got approval from a turdwaffle
01:58:06FromDiscord<Yardanico> In reply to @Elegantbeef "Eh rust has procedural": they're based on tokens, not AST
01:58:08FromDiscord<retkid> thats #2
01:58:16FromDiscord<Yardanico> because they don't want to expose AST to end users
01:58:29FromDiscord<Elegantbeef> Well that's arguably good given that AST isnt stable
01:58:32FromDiscord<Elegantbeef> Like look at macros
01:58:33FromDiscord<retkid> I kinda miss programming in Nim but I kinda took april off as an existential crisis month
01:58:43FromDiscord<Yardanico> In reply to @Elegantbeef "Well that's arguably good": what about `typed` or similar
01:58:52FromDiscord<Elegantbeef> What?
01:59:07FromDiscord<Elegantbeef> Give a formalized spec for typed and it's good
01:59:15*Onionhammer quit (Read error: Connection reset by peer)
01:59:22FromDiscord<Elegantbeef> There is no spec for typed firstly, and yea exposing AST does give benefits but also gives negatives
01:59:36FromDiscord<Elegantbeef> Nim's locked into a AST due to macros, any changes to the AST causes macros to break
02:00:02FromDiscord<Rika> That’s just versioning
02:00:13FromDiscord<Rika> A matter of versioning I mean
02:00:24*flynn quit (Read error: Connection reset by peer)
02:00:30FromDiscord<Elegantbeef> Well yes, but it causes more maintance if you want to support 2 versions with a single macro
02:01:05FromDiscord<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:38FromDiscord<Elegantbeef> I dont know which i prefer i just know there are benefits to each
02:01:47FromDiscord<Rika> This is a major change so I’d assume it wouldn’t happen on minors
02:03:32FromDiscord<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:29FromDiscord<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:46FromDiscord<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:46FromDiscord<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:55FromDiscord<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:19FromDiscord<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:45FromDiscord<cyberbird träumend> like a systems language is one used in OS's
03:34:08FromDiscord<Elegantbeef> "Whic provide value to people" is the odd part
03:48:10FromDiscord<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:52FromDiscord<Elegantbeef> I mean that's a pointless delimiter
03:49:31FromDiscord<Elegantbeef> If we're talking about what makes a system language "making money" does not change the functional capability
03:50:07FromDiscord<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:17FromDiscord<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:41FromDiscord<Elegantbeef> Atleast that's what i understand when people say "system language"
03:57:09*slowButPresent quit (Quit: leaving)
04:17:27FromDiscord<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:49FromDiscord<creikey> I would say more as a requirement before I consider it on the table as a systems language
04:18:20FromDiscord<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:39FromDiscord<creikey> being an early adopter for something so time consuming does not make much sense to me
04:18:54FromDiscord<Elegantbeef> I mean i still dont see how that makes it a system language
04:19:06FromDiscord<Elegantbeef> It makes it a visibly and demonstrably usable language
04:19:17FromDiscord<creikey> of course most languages are
04:19:18FromDiscord<Elegantbeef> Hardly differentiates it between "system" and not
04:19:25FromDiscord<creikey> maybe the differentiator could be "useful" systems language
04:19:32FromDiscord<creikey> where use is creating something valuable with software
04:19:37FromDiscord<Elegantbeef> Except most languages dont fall into "System language"
04:19:57FromDiscord<Elegantbeef> Python, Lua, C#, Java, Kotlin, Scala, Go are not considered system languages
04:20:36FromDiscord<creikey> if it's by your definition Go does
04:20:42FromDiscord<creikey> python also compiles to C with cython
04:20:47FromDiscord<Elegantbeef> Go doesnt give manual memory management
04:20:52FromDiscord<creikey> you can turn the gc off
04:21:17FromDiscord<creikey> do you see what I mean like technically
04:21:20FromDiscord<creikey> I think most of those languages
04:21:22FromDiscord<creikey> except lua
04:21:25FromDiscord<creikey> are systems programming languages
04:21:35FromDiscord<Elegantbeef> And i'd say you're wrong given there are caveats
04:21:36FromDiscord<creikey> but have they been used to make value as a systems language? not really
04:23:27FromDiscord<huantian> what do you have against lua 😛↵(@creikey)
04:23:33FromDiscord<creikey> In reply to @huantian "what do you have": interpreted
04:23:50FromDiscord<Rika> In reply to @creikey "interpreted": Java is “interpreted” by that definition
04:23:56FromDiscord<creikey> In reply to @Rika "Java is “interpreted” by": there are services that compile java
04:24:00FromDiscord<creikey> companies for embedded java
04:24:19FromDiscord<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:36FromDiscord<creikey> In reply to @Rika "There are probably programs": lua is included then
04:25:02FromDiscord<Elegantbeef> You can theoretically make a native compiler for any language but that doesnt describe it's conventional and practical usage
04:25:07FromDiscord<Rika> I don’t understand how Lua being “interpreted” leaves it out of systems programming anyway
04:25:08FromDiscord<creikey> In reply to @Elegantbeef "You can theoretically make": exactly
04:25:13FromDiscord<creikey> that's why I have the "has it created value" yet caveat
04:25:25FromDiscord<Rika> There’s no reason you can’t provide facilities for manual memory management in Lua
04:25:35FromDiscord<creikey> In reply to @Rika "I don’t understand how": I guess this is ture
04:25:36FromDiscord<creikey> (edit) "ture" => "true"
04:25:45FromDiscord<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:56FromDiscord<Rika> And Lua is most likely embedded heavier than Python
04:25:57FromDiscord<creikey> In reply to @Elegantbeef "The simple thing is": this is what I am saying
04:26:00FromDiscord<creikey> about nim
04:26:07FromDiscord<creikey> where has it been used at scale to make something valuable
04:26:11FromDiscord<creikey> other than the nim compiler
04:26:14FromDiscord<Elegantbeef> It's conventionally used as one though
04:26:14FromDiscord<creikey> as a systems programming language
04:26:21FromDiscord<Elegantbeef> Many people use it for embedded
04:26:25FromDiscord<Elegantbeef> Many people use it for gamedev
04:26:28FromDiscord<Rika> You have to normalise against popularity as well
04:26:32FromDiscord<creikey> that's true
04:26:42FromDiscord<Rika> If you don’t then you’re just eliminating anything tiny
04:27:11FromDiscord<Elegantbeef> Nim comes to you conventionally as a systems language, you dont need to jump through hoops to get it
04:27:22FromDiscord<Rika> Ugh this is reminding me of statistics again
04:27:32FromDiscord<Elegantbeef> Lol everything is statistics
04:27:33FromDiscord<creikey> In reply to @Elegantbeef "Nim comes to you": this is true actually I think I'm very wrong in my definition
04:27:43FromDiscord<creikey> the more I think about it
04:27:57FromDiscord<creikey> I've just been having a lot of debates about whether to use C++ or nim with programming friends
04:28:03FromDiscord<creikey> for new things
04:28:16FromDiscord<Rika> Can’t you just respect each other’s opinions
04:28:53FromDiscord<creikey> In reply to @Rika "Can’t you just respect": I mean of course I respect opinions
04:28:56FromDiscord<Elegantbeef> No only my opinion is right!
04:29:12FromDiscord<creikey> what do you think opinions should never be talked about?
04:29:25FromDiscord<Rika> No when you say debates I just imagine argument
04:29:39FromDiscord<creikey> no I just mean like talking about what's going on
04:29:47FromDiscord<creikey> how do you make good software
04:30:43FromDiscord<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:48FromDiscord<Rika> Then again
04:30:54FromDiscord<Rika> It’s never that black and white
04:31:06FromDiscord<Rika> Every language has its polished parts and abysses
04:31:31FromDiscord<Rika> It’s just that when something is mature, popular, or old
04:31:40FromDiscord<Rika> You more easily know what’s good or bad about it
04:31:46FromDiscord<Rika> It’s a fear of the unknown I guess
04:31:52FromDiscord<creikey> one of the big things we don't really understand is whether nim's gc causes bad software
04:31:56FromDiscord<Rika> What
04:32:06FromDiscord<Elegantbeef> Lol
04:32:09FromDiscord<creikey> so like having a gc makes it really easy to use ref objects everywhere right
04:32:22FromDiscord<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:26FromDiscord<creikey> the argument is that causes you to naturally allocate all the time which is bad practice for a lot of software
04:32:30FromDiscord<Rika> No
04:32:35FromDiscord<Rika> Not if you have a brain
04:32:37FromDiscord<Elegantbeef> Not it doesnt
04:32:41FromDiscord<Elegantbeef> You use references for reference semantics
04:32:48FromDiscord<Elegantbeef> If you dont need reference semantics you dont use it
04:32:50FromDiscord<Elegantbeef> Especially with arc/orc
04:32:51FromDiscord<Rika> If you’re taught improperly sure
04:33:01FromDiscord<Rika> Just like how if you’re taught C improperly you could get memory leaks
04:33:07FromDiscord<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:08FromDiscord<Elegantbeef> In reality most avid Nim programmers default to `object` not `ref object`
04:33:21FromDiscord<creikey> of course of course
04:33:27FromDiscord<Rika> Okay
04:33:32FromDiscord<Rika> I see now
04:33:35FromDiscord<creikey> to be clear this is not my thinking
04:33:41FromDiscord<Rika> No yeah I see
04:33:57FromDiscord<!Patitotective> In reply to @Solitude "no, because then i": 💀
04:34:19FromDiscord<creikey> In reply to @Rika "Who gives a fuck": most java programs I interact with I would say are bad
04:34:27FromDiscord<Yardanico> In reply to @Solitude "no, because then i": i'm in your ~~walls~~ code
04:34:39FromDiscord<creikey> like minecraft had to explicitly pass the xyz floats of vectors instead of the object to avoid the gc
04:34:46FromDiscord<creikey> (edit) "the" => "a vector"
04:34:51FromDiscord<Rika> Minecraft is a different story
04:35:02FromDiscord<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:08FromDiscord<Rika> Okay
04:35:20FromDiscord<Elegantbeef> Sure but that's Java a language that doesnt have value types
04:35:20FromDiscord<Rika> Yes but that’s usually due to limitations like as you say with Java
04:35:21FromDiscord<Elegantbeef> Not all languages that have gc are equal
04:35:35FromDiscord<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:46FromDiscord<creikey> but still a lot of times you want reference types without managed memory
04:35:59FromDiscord<Elegantbeef> So then do that?
04:36:09FromDiscord<creikey> it's easier to not do that so the majority of nim software uses managed memory
04:36:19FromDiscord<Rika> In reply to @creikey "but still a lot": Why?
04:36:22FromDiscord<Rika> What case?
04:36:25FromDiscord<Yardanico> In reply to @creikey "but still a lot": can you tell examples of these "lot of times"?
04:36:29FromDiscord<Rika> Yeah
04:36:31FromDiscord<Elegantbeef> Needing manual memory management can be achieved with a GC
04:36:32FromDiscord<Yardanico> you can use `ref object` just fine even on embedded
04:36:39FromDiscord<Yardanico> with ARC/ORC
04:36:41FromDiscord<Elegantbeef> Do people not realize you can do `GcRef` and `GcUnref`
04:36:52FromDiscord<Rika> In reply to @Elegantbeef "Do people not realize": Yes
04:36:56FromDiscord<Rika> People don’t know about it
04:36:58FromDiscord<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:59FromDiscord<Elegantbeef> https://www.jasonbeetham.com/pointerexplanation.html here you go
04:37:03FromDiscord<Elegantbeef> Read that then come back to me
04:37:18FromDiscord<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:30FromDiscord<Rika> In reply to @Elegantbeef "https://www.jasonbeetham.com/pointerexplanation.htm": I will always read your name like beet then ham
04:37:40FromDiscord<Elegantbeef> Hey me too
04:37:58FromDiscord<creikey> I'm almost halfway through the nim manual
04:38:01FromDiscord<creikey> it's actually not that long
04:38:09FromDiscord<Rika> In reply to @creikey "I'm almost halfway through": Read it another 5 times after
04:38:14FromDiscord<Yardanico> well reading the manual just for the manual isn't that beneficial :)
04:38:21FromDiscord<Yardanico> but when you're writing something and often refer to it, you do learn it
04:38:23FromDiscord<creikey> In reply to @Yardanico "well reading the manual": I want to know what to ctrl f in the manual
04:38:24FromDiscord<huantian> I didn't read most of it tbh ↵the pragma session is a tad stale
04:38:28FromDiscord<!Patitotective> In reply to @Yardanico "but when you're writing": ⬆️
04:38:39FromDiscord<creikey> this is how I learned godot and it went really well
04:39:01FromDiscord<huantian> I don't have the attention spam to read that much 😅
04:39:09FromDiscord<Rika> I read your article beef and god damn first paragraph there’s a run on sentence already
04:39:16FromDiscord<Rika> Or rather a missing comma
04:39:32FromDiscord<huantian> well his name is beef and not be good at grammar
04:39:35FromDiscord<Elegantbeef> Probably i'm not a great writererer
04:39:42FromDiscord<Rika> In reply to @huantian "I don't have the": Sucks that Attention Spam™️ is sold out nowadays no?
04:39:54FromDiscord<huantian> Spam is so good
04:40:01FromDiscord<huantian> I love spam it's just like ham but better
04:40:04FromDiscord<huantian> and even more unhealthy
04:40:52FromDiscord<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:58FromDiscord<Elegantbeef> This is where i say the truth that i generally prefer fish and i'm shunned!
04:41:06FromDiscord<Rika> What
04:41:13FromDiscord<Rika> ElegantFish
04:41:16FromDiscord<huantian> fish is good but like gets old↵maybe cus I always eat the same style of fish...
04:41:22FromDiscord<creikey> how does arc process gcref and unref
04:41:27FromDiscord<creikey> cause it has to insert the destructor calls right
04:41:29FromDiscord<huantian> Also bones 😔
04:41:40FromDiscord<Rika> Bones scary
04:41:40FromDiscord<Elegantbeef> It increments the reference counter just like an ongoing reference
04:42:58FromDiscord<Yardanico> In reply to @creikey "cause it has to": ARC does refcounting
04:43:38FromDiscord<creikey> I misread the info page
04:45:12FromDiscord<Elegantbeef> Also rika where is the run on sentence?
04:46:06FromDiscord<Rika> “Not to worry[,] this writeup will hopefully”
04:46:39FromDiscord<Rika> “Hey, this does not seem too complicated[. Y]ou”
04:46:51FromDiscord<Rika> (edit) "“Hey," => "“Hey[,]"
04:47:14FromDiscord<Rika> “mess it up[?] You already”
04:47:30FromDiscord<Rika> “yourself[,] "ah”
04:47:46FromDiscord<Elegantbeef> Feel free to just grab the source and fix it, it's easier than the entire list
04:47:58FromDiscord<Rika> HAHAHAHAHA okay later, is this on a repo?
04:48:09FromDiscord<Elegantbeef> It's just on the very bottom there is a "view source"
04:48:17FromDiscord<Rika> Gotcha I’ll PR if I remember
04:54:32FromDiscord<retkid> gonna be honest
04:54:38FromDiscord<retkid> i despise web dev
04:54:42FromDiscord<retkid> however few things are more rewarding
04:55:04FromDiscord<retkid> except the rewards are much fewer and far between than low level maths
04:55:04FromDiscord<Rika> Huh why
04:55:33FromDiscord<retkid> well, I learned this framework, I had strife, i cried, I watch day turn to night and turn back today
04:55:35FromDiscord<retkid> (edit) "today" => "to day"
04:55:39FromDiscord<retkid> but i did it
04:55:45FromDiscord<retkid> i got a shitty looking application
04:56:34FromDiscord<Yardanico> @beef another arc funny
04:56:34FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/18341
04:56:48FromDiscord<Yardanico> with latest compiler the diff is 350 times, but with clang it's the same between refc and arc
04:56:52FromDiscord<Yardanico> gcc is dead?!?!?!
04:57:02FromDiscord<retkid> WHAT
04:57:12FromDiscord<Yardanico> what? it can happen
04:57:17FromDiscord<huantian> clang is like two characters longer than gcc
04:57:21FromDiscord<huantian> not worth
04:57:22FromDiscord<Yardanico> maybe clang noticed a good optimization with arc while gcc didn't
04:57:38FromDiscord<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:40FromDiscord<retkid> I Suppose
04:57:42FromDiscord<retkid> 60 years from now
04:57:44FromDiscord<retkid> if i write C
04:57:50FromDiscord<retkid> will i use the same compiler
04:57:51FromDiscord<retkid> probably not
04:57:58FromDiscord<Rika> In reply to @huantian "clang is like two": Just alias clang to cc or something
04:58:12FromDiscord<Yardanico> if we don't have quantum computers, it's likely you'll be using gcc or clang :P
04:58:14FromDiscord<retkid> though I think my mind would be too mushy to understand c
04:58:19FromDiscord<Rika> 60 years from now you’re probably not writing code
04:58:22FromDiscord<retkid> yea
04:58:23FromDiscord<Yardanico> @retkid gcc has been around for 35 years
04:58:37FromDiscord<Yardanico> clang is much younger of couirse
04:58:38FromDiscord<Yardanico> (edit) "couirse" => "course"
04:58:43FromDiscord<retkid> im sure theres 80 year old programmers
04:58:47FromDiscord<retkid> writing cool things
04:59:06FromDiscord<Rika> People who are half the age of GCC are teenagers Jesus Christ
04:59:19FromDiscord<retkid> im just under half
04:59:19FromDiscord<retkid> at 18
04:59:26FromDiscord<retkid> (edit) "under" => "over"
04:59:38FromDiscord<Rika> In reply to @retkid "im just over half": Quick maths
04:59:44FromDiscord<retkid> shut up
04:59:50FromDiscord<huantian> dang I'm younger than gcc too
04:59:58FromDiscord<Rika> Lots of people are so
05:00:02FromDiscord<retkid> god it would make me depressed if i was older than gcc
05:00:17FromDiscord<huantian> guess I just doxed myself I'm under 35yr old
05:00:24FromDiscord<retkid> im omw to your location rn
05:00:36FromDiscord<huantian> my ip is 127.0.0.1
05:00:42FromDiscord<Rika> In reply to @huantian "guess I just doxed": I Have Triangulated Your Location
05:01:03FromDiscord<retkid> In reply to @huantian "my ip is 127.0.0.1": this statement is true
05:01:10FromDiscord<Rika> No but that’s my IP
05:01:21FromDiscord<retkid> wait a sec
05:01:23FromDiscord<retkid> thats my ip too
05:01:25FromDiscord<retkid> 🤔
05:03:09FromDiscord<huantian> hm we must be in the same location then
05:03:11FromDiscord<huantian> are you guys in my walls
05:04:02FromDiscord<Rika> Yeah that’s where I live how did you know
05:04:23FromDiscord<huantian> I did that thing with the stethoscope on the walls yk
05:04:40FromDiscord<retkid> if i ping that ip it must go to all of us
05:04:43FromDiscord<huantian> but I used a stud detector instead of a stethoscope
05:05:00FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/965840416421314570/unknown.png
05:05:04FromDiscord<retkid> its like you live right next to me
05:05:10FromDiscord<Yardanico> #offtopic :forsenThink:
05:05:20FromDiscord<Yardanico> but ok, i'm in your walls
05:05:21FromDiscord<retkid> 😴
05:05:26FromDiscord<Elegantbeef> I just use a drill and keep going until i ht a stud
05:05:30FromDiscord<Elegantbeef> Doxxed yourself
05:05:30FromDiscord<Elegantbeef> Haha yard you have no power here!
05:05:37FromDiscord<Yardanico> damnit
05:05:49FromDiscord<Yardanico> so does anyone remember how to emit LLVM IR with nim
05:06:00FromDiscord<Yardanico> except nlvm
05:06:03FromDiscord<Rika> Fuck
05:06:11FromDiscord<Elegantbeef> This guy took my only answer
05:06:20FromDiscord<Yardanico> I know clang has -S -emit-llvm but they're not working for me, maybe I'm missing something
05:06:28FromDiscord<Yardanico> ah nvm it works
05:06:32FromDiscord<Rika> Lmao
05:06:33FromDiscord<Yardanico> ` nim c -d:danger --gc:arc --cc:clang --passC:"-S -emit-llvm" pup.nim`
05:06:39FromDiscord<Yardanico> the only problem is that the LLVM IR is stored in .o files
05:06:54FromDiscord<Elegantbeef> O
05:07:10FromDiscord<huantian> O\_O
05:07:17FromDiscord<demotomohiro> Is it just passing some option to clang?
05:07:18FromDiscord<Rika> Not in .ll?
05:07:21FromDiscord<Yardanico> yes @demotomohiro
05:07:23FromDiscord<Rika> In reply to @demotomohiro "Is it just passing": Yes
05:07:30FromDiscord<Yardanico> In reply to @Rika "Not in .ll?": because you can't tell nim to do this
05:07:32FromDiscord<Yardanico> or i don't remember
05:07:43FromDiscord<demotomohiro> Then, you can find the answer in clang manual.
05:07:59FromDiscord<Yardanico> i already found it on stackoverflow, but thanks :)
05:10:05FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/965841694769676288/unknown.png
05:10:21FromDiscord<Yardanico> this is indeed very readable (no)
05:10:32FromDiscord<Elegantbeef> Hey nice rust
05:10:55FromDiscord<aph> im new, is this python
05:11:47FromDiscord<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:44FromDiscord<Yardanico> at least it's not GCC's GIMPLE
05:14:40FromDiscord<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:03FromDiscord<Rika> In reply to @Yardanico "at least it's not": Sounds very GOMPLEX
05:15:07FromDiscord<Elegantbeef> What?
05:15:19FromDiscord<Elegantbeef> It's due to the fact most nim programmers dont want ref semantics
05:15:23FromDiscord<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:31FromDiscord<Yardanico> of course no one cares if you can read them or not, but the fact is there
05:15:58FromDiscord<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:14FromDiscord<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:18FromDiscord<Phil> They'll still gravitate towards object instead of ref object because less typing
05:16:33FromDiscord<Elegantbeef> I mean that's beneficial depending on the code
05:16:35FromDiscord<Elegantbeef> References can slow down code
05:16:41FromDiscord<Elegantbeef> Generally they do
05:16:56FromDiscord<Elegantbeef> Pointer indirection is a hell of a drug
05:17:21FromDiscord<Yardanico> oh right, gcc loves S-expressions so much that they have RTL
05:17:25FromDiscord<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:26FromDiscord<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:51FromDiscord<Elegantbeef> Unironically the fact Nim uses ref objects for it's AST is one reason the compiler is relatively slow
05:18:06FromDiscord<Elegantbeef> If it used a DOD it'd be much much faster
05:18:11FromDiscord<Rika> DOD?
05:18:17FromDiscord<Yardanico> data oriented design
05:18:18FromDiscord<Yardanico> iirc
05:18:19FromDiscord<Elegantbeef> Data oriented design
05:18:20FromDiscord<Rika> Okay
05:18:28FromDiscord<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:36FromDiscord<Yardanico> not surprising knowing the roots of gcc, but still interesting
05:18:37FromDiscord<Elegantbeef> I was talking to phil mostly
05:19:06FromDiscord<Elegantbeef> Since they brought noobs defaulting to `object`
05:20:03FromDiscord<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:16FromDiscord<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:19FromDiscord<Elegantbeef> Yea they generally want aliasing and ref semantics as it's what they're used to
05:20:26FromDiscord<Rika> I’m just thinking how a tree structure like AST would look like as DOD
05:20:36FromDiscord<Yardanico> In reply to @Rika "I’m just thinking how": ask zig :P
05:20:49FromDiscord<Elegantbeef> Yep Zig does packed AST where it's a bunch of indicies to the value
05:21:10FromDiscord<Elegantbeef> So your ast is stored as small objects that benefit from cache coherency
05:21:12FromDiscord<Yardanico> https://ziglang.org/download/0.8.0/release-notes.html#Reworked-Memory-Layout
05:21:18FromDiscord<Elegantbeef> generally it's like `kind, left, right`
05:21:21FromDiscord<Phil> sent a code paste, see https://paste.rs/6dn
05:21:30FromDiscord<Yardanico> In reply to @Isofruit "Curiosity question, why does": `let` doesn't do deep immutability
05:21:30FromDiscord<Elegantbeef> the pointer is immutable not the fields
05:21:48FromDiscord<Elegantbeef> strictfuncs will enforce it on parameters atleast
05:21:51FromDiscord<Yardanico> if you want deep immutability, use `func` with `{.experimental: strictFuncs.}` enabled
05:21:53FromDiscord<Yardanico> arhgh
05:21:55FromDiscord<Elegantbeef> Where `a: ref int` isnt immutable
05:22:01FromDiscord<Elegantbeef> isnt mutable\
05:22:28FromDiscord<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:29FromDiscord<Solitude> !eval let a = new int; a[] = 5; echo a
05:22:30NimBotCompile failed: /usercode/in.nim(1, 32) Error: type mismatch: got <ref int>
05:22:41FromDiscord<Yardanico> so you can't do `x = y` if your `x` is a `let` of some ref object
05:22:42FromDiscord<Solitude> In reply to @NimBot "Compile failed: /usercode/in.nim(1, 32)": bastard
05:22:43FromDiscord<Elegantbeef> echo `a[]` 😛
05:23:03FromDiscord<Elegantbeef> You cannot change where the pointer points but you can change the data it points to
05:23:15FromDiscord<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:21FromDiscord<Rika> Oh here
05:23:27FromDiscord<Rika> Let only prevents value mutation
05:23:35FromDiscord<Elegantbeef> There you go
05:23:39FromDiscord<Rika> The value of a reference is the pointer
05:23:41FromDiscord<Elegantbeef> \unless you use unsafe methods
05:23:54FromDiscord<Rika> How that value is interpreted isn’t relevant to “let”
05:24:11FromDiscord<Elegantbeef> Anyway we've beat the horse
05:24:24FromDiscord<Elegantbeef> If phill dosnt get it yet we need to crowdfund a computer science textbook
05:25:17FromDiscord<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:32FromDiscord<Elegantbeef> Would be fun but i'm drain bamaged
05:26:20FromDiscord<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:22FromDiscord<Rika> 0.5+0.5 = 1 so let’s write one together beef
05:26:41FromDiscord<Phil> I barely use ref semantics because I see no point in nim when none of my data structures are particularly large
05:26:44FromDiscord<Rika> In reply to @Isofruit "Nah, I got it,": Valid? Yes, consistent with former behaviour? No
05:26:50FromDiscord<Elegantbeef> It'd be the most offensive book to the reader
05:27:03FromDiscord<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:08FromDiscord<Yardanico> nim passes big objects by reference
05:27:11FromDiscord<Elegantbeef> That's not the point of ref semantics 😄↵(@Phil)
05:27:28FromDiscord<Phil> Wasn't the entire point to pass references to avoid copies of large amounts of data?
05:27:29FromDiscord<Elegantbeef> Ref semantics is more about data relationships and inheritance in Nim
05:27:35FromDiscord<Elegantbeef> If you have a linked list you use `ref`
05:27:51FromDiscord<Elegantbeef> I mean kinda but we have movesemantics
05:28:07FromDiscord<Elegantbeef> move semantics allow us to give up memory in cases and avoid copies
05:28:24FromDiscord<Elegantbeef> `ref object` is less about that since we have `{.byref.}` and `var T`
05:28:39FromDiscord<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:03FromDiscord<Phil> (edit) "finfer" => "finer"
05:29:07FromDiscord<Phil> (edit) "missunderstood" => "misunderstood"
05:29:09FromDiscord<Rika> I think I missed the part about Zig and DOD tree AST whatever whatever
05:29:22FromDiscord<Yardanico> In reply to @Rika "I think I missed": i gave you a direct link 🤔
05:29:26FromDiscord<Rika> In reply to @Elegantbeef "generally it's like `kind,": Oh here it is
05:29:48FromDiscord<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:00FromDiscord<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:08FromDiscord<spoon> are there any resources on the compiler library besides the source code?
05:31:12FromDiscord<Rika> Hmm, Lua interpreter in Nim, hmmmmmm
05:31:28FromDiscord<spoon> wot
05:31:29FromDiscord<kiell> is there a way i can read symbols from another nim file from nim
05:31:44FromDiscord<Elegantbeef> Not programatically
05:31:49FromDiscord<Elegantbeef> You can manually pass them
05:32:13FromDiscord<spoon> even with `include`?
05:32:47FromDiscord<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:33FromDiscord<Phil> In reply to @spoon "are there any resources": Best I can tell you are the compiler usage docs
05:33:46FromDiscord<spoon> it'll work if you carve the wood first no problem
05:33:50FromDiscord<Rika> In reply to @Elegantbeef "Using include is like": Wait you mean you aren’t supposed to do that?
05:34:17FromDiscord<Elegantbeef> There is https://nim-lang.github.io/Nim/intern.html spoon
05:36:31FromDiscord<spoon> meant the module that contains llstream and nimeval
05:36:42FromDiscord<Elegantbeef> Ah yea no docs
05:36:46FromDiscord<spoon> sad
05:37:04FromDiscord<Elegantbeef> 'PRs welcome'
05:38:35FromDiscord<huantian> In reply to @Rika "Hmm, Lua interpreter in": Waiting for lua as a compilation target
05:38:48FromDiscord<Elegantbeef> Well get at it huan
05:39:38FromDiscord<Elegantbeef> Completely unrelated, but anyone willing to give me a nose, mine presently doesnt work
05:40:02FromDiscord<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:13FromDiscord<spoon> they sell noses that come with glasses and moustaches in costume shops
05:41:06FromDiscord<Elegantbeef> What did you need to reimplment?↵(@Solitude)
05:41:09FromDiscord<spoon> the world would be much better if lua arrays started at 0
05:41:27FromDiscord<Solitude> In reply to @Elegantbeef "What did you need": bitwise math
05:41:32FromDiscord<Elegantbeef> Ah
05:41:47FromDiscord<Solitude> also exceptions are kinda quirky
05:42:05FromDiscord<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:59FromDiscord<Elegantbeef> I mean generally lua in game engines is sandboxed
05:43:05FromDiscord<Elegantbeef> So yea you're not doing that
05:43:13FromDiscord<Elegantbeef> I still want to investigate wasmer based scripting
05:43:22FromDiscord<Elegantbeef> It's the most interesting solution to me
05:43:28FromDiscord<Elegantbeef> Language agnostic plugin system
05:43:52FromDiscord<spoon> yea, wasm seems cool
05:45:09FromDiscord<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:25FromDiscord<Elegantbeef> there is an errata or whatever it's called
05:45:50FromDiscord<spoon> errata?
05:46:18FromDiscord<Elegantbeef> https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
05:46:39FromDiscord<spoon> ah, alright good to know
05:52:43FromDiscord<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:52NimEventerNew 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:36FromDiscord<Equinox> In reply to @spoon "the world would be": Agreed
08:40:54*flynn quit (Read error: Connection reset by peer)
08:41:17FromDiscord<Equinox> Arrays start at zero people that don’t get that just shouldn’t design languages 🤷‍♂️
08:42:08*flynn joined #nim
08:42:19FromDiscord<Rika> Arrays starting at zero is an arbitrary choice, but that does not mean there are no merits to using it
08:42:57FromDiscord<Rika> It’s the same idea with math and 0^0
08:43:02FromDiscord<Equinox> In reply to @Rika "Arrays starting at zero": It’s not arbitrary, it’s the offset
08:43:06FromDiscord<Rika> There are instances where = 1 works
08:43:18FromDiscord<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:30FromDiscord<Rika> I mean that it would be arbitrary at a higher level
08:43:47FromDiscord<Equinox> In reply to @Rika "I mean that it": That’s true
08:44:00FromDiscord<Equinox> But why create two different ways of doing something so simple
08:44:19FromDiscord<Rika> Same argument can be used if you reversed the roles
08:44:30FromDiscord<Solitude> In reply to @Equinox "But why create two": why not
08:44:33FromDiscord<Rika> Why use 0 if we have 1? Why use 1 if we have 0?
08:44:52FromDiscord<Equinox> In reply to @Rika "Why use 0 if": But they aren’t reversed
08:45:09FromDiscord<Equinox> And if they were I would argue the other side than I am now
08:46:19PMunchJust updated the playground, hopefully this should fix some of the ix paste related issues
08:46:23FromDiscord<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:56FromDiscord<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:14FromDiscord<Equinox> And most people will find 0 perfectly reasonable
08:47:17FromDiscord<Rika> Because that’ll break code for sure
08:47:34FromDiscord<Rika> In reply to @Equinox "And most people will": Ask people who haven’t programmed at all
08:47:42FromDiscord<Rika> “Why do we start arrays at 0”
08:48:01FromDiscord<Rika> Or even new programmers
08:48:22*flynn joined #nim
08:48:26FromDiscord<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:36FromDiscord<Equinox> It doesn’t seem intuitive at first
08:48:40FromDiscord<Rika> You said reasoning
08:48:47FromDiscord<Rika> I gave you a question about reasoning
08:49:27FromDiscord<Equinox> Well if you explained why it starts at 0 to people they would understand why it’s like that
08:49:47FromDiscord<Rika> Well you don’t need to explain for 1 🙂
08:50:01FromDiscord<Equinox> You do for the computer
08:50:11FromDiscord<Rika> The computer doesn’t need to reason
08:50:16FromDiscord<Solitude> im sure he will understand
08:50:34FromDiscord<Rika> Well whatever
08:52:11FromDiscord<Equinox> In reply to @Rika "The computer doesn’t need": The good thing about computers but also the bad
08:52:30FromDiscord<Rika> In reply to @Equinox "You do for the": You already have to explain what print means to the computer
08:53:19FromDiscord<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:31FromDiscord<Equinox> Seems kinda inconsiderate
08:53:53FromDiscord<Rika> In reply to @Equinox "So why do we": What’s wrong with one more?
08:54:05FromDiscord<Rika> Never stopped Python
08:54:09FromDiscord<Rika> Never stopped JavaScript
08:54:12FromDiscord<Rika> Never stopped Java
08:54:18*flynn quit (Read error: Connection reset by peer)
08:54:23FromDiscord<Rika> Never stopped every other language adding a new kind of abstraction
08:55:30*flynn joined #nim
08:56:05FromDiscord<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:55FromDiscord<Rika> I don’t know dude, it’s not even a matter of one or the other
08:57:09FromDiscord<Rika> We could easily have both if the other had a different operator
08:59:03Amun-Rawhat do we add by starting at 1? confusion
08:59:33FromDiscord<Rika> Only because 0 is already established
08:59:51FromDiscord<Rika> And that can always be changed over time
09:00:17FromDiscord<Rika> Well again whatever
09:01:05*flynn quit (Read error: Connection reset by peer)
09:02:19*flynn joined #nim
09:03:13Amun-Rait's established bc of that pointer arithmetic on tables and what have you
09:03:41FromDiscord<Rika> And my argument is that is that really relevant to most array handling nowadays
09:04:02FromDiscord<Rika> But again I don’t want to continue (yet I can’t resist), someone else can if they want
09:04:17Amun-Rait's similar to qwerty layout, we don't use mechanical typewriters anymore, no risk of jamming anymore
09:05:17FromDiscord<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:21Amun-Rayes, still, I would vote for what's already established
09:07:41*flynn quit (Read error: Connection reset by peer)
09:08:33FromDiscord<Rika> People don’t like change after all
09:08:54*flynn joined #nim
09:09:12Amun-Ramy #1 question would be whether it's worth a change
09:09:23Amun-Rabut 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:10FromDiscord<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:38FromDiscord<hotdog> In reply to @jmgomez "Hey guys, is there": I have a feeling I’ve seen a macro for this somewhere
09:39:42FromDiscord<hotdog> Maybe on the forum
09:40:25FromDiscord<enthus1ast> @deech\: has this in his talk imho
09:41:22FromDiscord<jmgomez> Ohh in which one?
09:41:59FromDiscord<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:41FromDiscord<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:10FromDiscord<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:40FromDiscord<Rika> Doesn’t “object of T” do the combining
09:49:00FromDiscord<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:48FromDiscord<jmgomez> yes, it feels a bit odd that nim doesnt support it specially since you it has distinct and sum
09:52:05FromDiscord<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:29FromDiscord<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:59FromDiscord<Forest> Anyone know why repl.it doesn't like Nim? https://replit.com/@Mythical-Forest-Collective/PulseNim#start.sh
10:11:08FromDiscord<Forest> It freezes up on the Nim command
10:11:24FromDiscord<Forest> when compiling specifically
10:14:22*flynn quit (Remote host closed the connection)
10:15:35*flynn joined #nim
10:20:17FromDiscord<Solitude> In reply to @Andreas "how come that ?": nim tries to fit literals into int and fails
10:20:26FromDiscord<Solitude> !eval echo 14695981039346656037'u64
10:20:28NimBot14695981039346656037
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:27FromDiscord<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:34FromDiscord<Solitude> config file
10:39:34*flynn quit (Read error: Connection reset by peer)
10:40:46*flynn joined #nim
10:45:12FromDiscord<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:19FromDiscord<ShalokShalom> In reply to @Amun-Ra "what do we add": Not confusing newbies
11:25:33FromDiscord<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:29FromDiscord<ShalokShalom> sent a long message, see https://paste.rs/P3k
11:35:07FromDiscord<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:31FromDiscord<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:48FromDiscord<ShalokShalom> Yes, absolutely.
11:38:02FromDiscord<ShalokShalom> Nim is a very weird and awesome mix, I have never seen anything like that.
11:38:54FromDiscord<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:46FromDiscord<Rika> I’m still thinking about the heavy type inference thing you mentioned last time
11:40:06FromDiscord<ShalokShalom> Yeah 😄
11:40:35FromDiscord<ShalokShalom> Did you see it in action yourself? As in fsharp or so?
11:40:49FromDiscord<ShalokShalom> I guess its easier to experience it, other than just speaking about.
11:40:58FromDiscord<Rika> No, I’m thinking that it’s probably nice given the tooling
11:41:05FromDiscord<ShalokShalom> Yeah, totally.
11:41:10FromDiscord<Rika> But then I’d be reliant on tooling
11:41:22FromDiscord<Rika> I don’t like relying too hard on it since I do a lot of things analogue
11:41:28FromDiscord<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:41FromDiscord<Rika> Tooling that could convert between…
11:41:52FromDiscord<Rika> Yeah wishful thinking for now
11:41:55FromDiscord<ShalokShalom> Yes, the VSCode tooling does that
11:42:14FromDiscord<Rika> I don’t think I’d be too against it, but right now the capability and manpower isn’t here yet
11:42:24FromDiscord<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:51FromDiscord<ShalokShalom> Yeah, sure
11:44:05FromDiscord<ShalokShalom> The thing is, Andreas is heavily against it anyway
11:44:13FromDiscord<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:22FromDiscord<ShalokShalom> @Rika https://media.discordapp.net/attachments/371759389889003532/965942933893308416/Screenshot_42.png
11:53:30FromDiscord<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:00FromDiscord<Rika> ideally id do it without clicking
11:57:06FromDiscord<Rika> but thats a matter of interface
11:58:07FromDiscord<ShalokShalom> yeah
11:58:35FromDiscord<ShalokShalom> the point is, you really have it only at exposing functions, so everything you use somewhere else
11:58:47FromDiscord<Forest> In reply to @ShalokShalom "I think support for": There's Risc-V too
11:58:47FromDiscord<ShalokShalom> like in fsharp
11:58:54FromDiscord<ShalokShalom> Yep, totally
11:58:58FromDiscord<ShalokShalom> What I meant. 🙂
11:59:16FromDiscord<ShalokShalom> RISC-V is really like a company and implementation, isnt it?
11:59:24FromDiscord<ShalokShalom> And RISC the architecture.
11:59:34FromDiscord<Rika> RISC-V is the architecture
11:59:37FromDiscord<ShalokShalom> Ah.
11:59:39FromDiscord<Rika> RISC is just the kind
11:59:45FromDiscord<Rika> x86 is CISC
11:59:46FromDiscord<ShalokShalom> Ah, ok.
11:59:50FromDiscord<Rika> ARM is RISC
11:59:55FromDiscord<ShalokShalom> Yeah, yeah. True
12:00:08FromDiscord<ShalokShalom> I heard ARM is not 100% RISC anymore, isnt it?
12:00:16FromDiscord<ShalokShalom> I think they added a couple of fixed instructions.
12:00:18FromDiscord<ShalokShalom> afiak
12:00:29FromDiscord<Rika> theyre not black and white yeah
12:00:50FromDiscord<Rika> and CISC doesnt really mean fixed and RISC not variable
12:01:15*flynn quit (Remote host closed the connection)
12:02:21FromDiscord<ShalokShalom> yeah, isnt R short for reduced
12:02:28*flynn joined #nim
12:02:39FromDiscord<ShalokShalom> but in practice, I think it comes down to fixed and variable?
12:02:40*jjido joined #nim
12:03:11FromDiscord<Rika> i guess so
12:03:23FromDiscord<Rika> but yeah arm has some large and specific insturctions nowadays
12:07:30FromDiscord<Generic> ARM always had those
12:07:33*flynn quit (Read error: Connection reset by peer)
12:07:56FromDiscord<Generic> also aarch64 has no variable length instructions, the only ARM variant which has it to my knowledge is thumb 2
12:08:45FromDiscord<Generic> (technically also thumb 1 but only a single instruction)
12:08:45*flynn joined #nim
12:09:06FromDiscord<ShalokShalom> SiFive is the company, which I did mean
12:09:15FromDiscord<ShalokShalom> V = Five
12:09:17FromDiscord<Generic> but in contrast RISC-V actually has a mixed instruction length mode
12:09:18FromDiscord<ShalokShalom> = Confusion 😄
12:13:59FromDiscord<ShalokShalom> Oh, they have the new board ready ^-^
12:13:59*flynn quit (Read error: Connection reset by peer)
12:14:00FromDiscord<ShalokShalom> https://www.sifive.com/boards/hifive-unmatched
12:14:37FromDiscord<ShalokShalom> Does Nim run on RISC-V by any chance?
12:14:44FromDiscord<ShalokShalom> I know Godot does.
12:15:05FromDiscord<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:19FromDiscord<ShalokShalom> _Video game development on a RISC-V board_
12:15:38FromDiscord<ShalokShalom> Like, few years ago gaming and Linux didnt even match
12:15:58FromDiscord<ShalokShalom> And there was no architecture, that was open source in this capacity.
12:16:22FromDiscord<ShalokShalom> They actually use common PCIe GPUs
12:18:08FromDiscord<ShalokShalom> And I saw a Youtube video, that shows how one guy ported the driver
12:18:13FromDiscord<ShalokShalom> I took him like hours.
12:18:15FromDiscord<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:38PMunchHmm, it's annoying that you can't do things like ignore some rules when importing CSS..
12:38:46PMunchCSS 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:20FromDiscord<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:11FromDiscord<ShalokShalom> https://tenor.com/view/family-guy-css-open-window-annoyed-pissed-gif-12014506
12:52:37FromDiscord<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:47FromDiscord<ShalokShalom> It could be awesome, to have a library that can similar things as this:↵https://github.com/mdgriffith/elm-ui#readme
12:57:10FromDiscord<enthus1ast> would be awesome if most sites would just use css
12:57:13FromDiscord<enthus1ast> ähm
12:57:13FromDiscord<enthus1ast> html
12:58:39FromDiscord<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:21FromDiscord<jmgomez> In reply to @deech "All the code is": awesome, thanks and for the talks too!
13:03:38FromDiscord<deech> In reply to @jmgomez "awesome, thanks and for": It's pretty low tech so I urge you not to deploy it. 🙂
13:05:01FromDiscord<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:08FromDiscord<jmgomez> @deech you think can be possible to define an operator like I posted above?↵type C = A | B
13:06:14FromDiscord<jmgomez> (edit) "|" => "&"
13:06:47*flynn joined #nim
13:07:11*neurocyte8614492 joined #nim
13:07:33FromDiscord<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:31FromDiscord<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:49FromDiscord<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:06FromDiscord<Rika> what do people usually do when they need type info in a macro but also some minor DSLing
13:24:23PMunchTwo macros
13:24:33PMunchOne which does the DSL transform into calls to the second macro
13:24:38*flynn quit (Read error: Connection reset by peer)
13:25:04PMunchSo the work of the DSL macro is only to transform the AST from your DSL into calls to the typed macro
13:25:11FromDiscord<Rika> okay, that was what was being used already, was wondering if there can be another way
13:25:27PMunchNot really
13:25:30*arkurious joined #nim
13:25:51*flynn joined #nim
13:26:10PMunchWell, you could potentially use templates to make the DSL valid
13:26:18PMunchBut it's the same concept
13:26:46PMunchThe double macro pattern is what I use for Futhark: https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L402
13:28:04PMunchBut 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:52PMunchSo 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:04FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=3VwN
13:29:28PMunchI've actually been thinking about writing a Nim macros design patterns article
13:29:52PMunchOver 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:19PMunchWhat's the benefit of using a compile-time proc over a typed macro @deech`
13:34:06FromDiscord<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:53FromDiscord<Rika> im not sure what you mean with the proc, as in you'd use the proc as the external api?
13:36:13FromDiscord<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:56FromDiscord<Rika> or `macro(untyped) = p(...) -> p(NimNode, ...): NimNode {.ct.} -> splice(p())`? i'm a bit lost
13:37:02FromDiscord<Rika> what happened to the DSL part
13:37:33*flynn joined #nim
13:38:18FromDiscord<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:32FromDiscord<deech> (edit) "☝️is" => "What I showed is"
13:38:55FromDiscord<Rika> oh okay
13:39:09FromDiscord<Rika> i have a dsl/custom syntax, but i also need type information
13:39:18FromDiscord<Rika> thats p much it
13:39:43FromDiscord<deech> The DSL is some kind of data structure, yes?
13:40:51FromDiscord<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:17FromDiscord<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:13FromDiscord<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:54PMunch@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:18PMunchI do use compileTime procedures, but it's pretty rare
13:49:35*PMunch quit (Quit: Leaving)
13:52:40FromDiscord<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:45FromDiscord<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:42FromDiscord<Rika> In reply to @Isofruit "I think the only": haha i'm currently suffering reading nimlua's code so far
13:55:53FromDiscord<Rika> baby steps i guess, its just very complex
13:56:08FromDiscord<Phil> is nimula that much macro?
13:56:16FromDiscord<Rika> do you want to see
13:56:26FromDiscord<Phil> I'm afraid now, but a glimpse can't kill me
13:56:27FromDiscord<Phil> I think
13:56:28FromDiscord<Rika> https://github.com/jangko/nimLUA/blob/master/nimLUA.nim
13:56:29FromDiscord<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:26FromDiscord<Phil> can't you just write "static seq"?
13:57:39FromDiscord<Phil> instead of {.compileTime.} ?
13:59:49FromDiscord<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:08FromDiscord<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:40FromDiscord<deech> What is the difference between `proc p(s:seq[int] ...) {.compileTime.}` vs `proc p(s: static seq[int] ...) {.compileTime.}`?
14:13:25FromDiscord<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:42FromDiscord<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:28FromDiscord<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:36FromDiscord<ShalokShalom> https://diataxis.fr/
14:18:44FromDiscord<ShalokShalom> Wondering what you guys think about this
14:18:51FromDiscord<ShalokShalom> (Documentation)
14:19:28*v9fk joined #nim
14:20:23*flynn quit (Read error: Connection reset by peer)
14:20:47FromDiscord<deech> As an aside it's a shame that `static:` forces a scope that can't be accessed from another `static:` block.
14:20:47FromDiscord<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:26FromDiscord<Andreas> howto sort the keys of a OrderedTable ? is that via .toOpenArray() and the use algorithm.sorted ?
14:51:42FromDiscord<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:45FromDiscord<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:54FromDiscord<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:17FromDiscord<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:31FromDiscord<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:43FromDiscord<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:51FromDiscord<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:56FromDiscord<ShalokShalom> Ah.
15:28:01FromDiscord<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:14FromDiscord<Solitude> In reply to @2F42BBA1 "I know which GUI": https://github.com/khchen/winim maybe this
15:28:17*noeontheend joined #nim
15:28:28FromDiscord<2F42BBA1> In reply to @Solitude "https://github.com/khchen/winim maybe this": https://github.com/khchen/wNim
15:28:39FromDiscord<2F42BBA1> wNim is based on winim
15:28:53FromDiscord<Solitude> i know
15:29:33FromDiscord<ShalokShalom> But it has API access
15:30:15*flynn quit (Read error: Connection reset by peer)
15:31:03FromDiscord<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:44FromDiscord<huantian> Yeah I think that module does work
15:32:18FromDiscord<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:30FromDiscord<Solitude> i just linked you package that wraps windows apis
15:45:21*flynn joined #nim
15:45:22FromDiscord<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:59FromDiscord<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:50FromDiscord<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:13FromDiscord<sOkam!> am I doing something dummie?
18:20:06FromDiscord<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:50Amun-Raconst foo = staticRead"a file"
18:23:18*flynn quit (Read error: Connection reset by peer)
18:23:25FromDiscord<sOkam!> is it good practice to use `staticRead` instead of `readFile` for shader code files?
18:23:50Amun-RastaticRead is useful for embedding file contents into code
18:24:15Amun-Rayou do not rely on external file when run
18:24:17FromDiscord<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:53FromDiscord<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:53Amun-Rayes
18:26:41FromDiscord<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:14Amun-Rait's a good method
18:28:59FromDiscord<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:09FromDiscord<2F42BBA1> nvm figured it out
18:35:34*flynn quit (Read error: Connection reset by peer)
18:36:47*flynn joined #nim
18:37:30FromDiscord<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:08FromDiscord<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:27PMunch@RattleyCooper, not quite sure what you're asking
18:44:51*jjido joined #nim
18:46:33FromDiscord<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:46FromDiscord<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:05PMunchstaticRead 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:37PMunchI 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:42FromDiscord<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:43Yardanico_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:16YardanicoI 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:23Yardanicoeven though Futhark errored on some definitions (I think) it made a correct Nim file
18:55:46YardanicoI mostly need to change the type of procs from `ptr Functiontype` to `Functiontype` because Nim has the procs themselves as pointers
18:55:55PMunchYardanico, great to hear that it works better now :)
18:56:07FromDiscord<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:09PMunchHmm, that's strange
18:56:23PMunchI though I had fixed those
18:57:10PMunch@RattleyCooper, what would be the point of that?
18:57:12FromDiscord<Yardanico> This is how the generated Nim file looks like - https://gist.github.com/Yardanico/72b8b7cc6fc4a34377f63621c79b60fc
18:58:34PMunchAha, that's a bit unfortunate
18:58:43FromDiscord<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:41PMunchBut 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:45FromDiscord<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:43FromDiscord<Yardanico> also @PMunch I'm getting a bunch of deprecated warnings due to the fact that Futhark uses `cuchar` which is deprecated
19:03:56PMunchI know
19:04:03PMunchI guess I should fix that
19:04:14FromDiscord<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:06PMunchYardanico, 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:18FromDiscord<ShalokShalom> In reply to @sOkam! "uhhh.... i can't find": I had this tons already too
19:23:24FromDiscord<sOkam!> how can I cast the output of `readFile():string=` safely into a `cstring` type?
19:23:46FromDiscord<ShalokShalom> Pieces of code in the docs are not supposed to be able to be compiled, so far as I can tell
19:23:53FromDiscord<ShalokShalom> Its more.. pseudocode
19:24:09*flynn quit (Read error: Connection reset by peer)
19:25:22*flynn joined #nim
19:25:34FromDiscord<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:40FromDiscord<Yardanico> In reply to @ShalokShalom "Pieces of code in": if you mean the manual, in a lot of cases yes
19:26:50PMunchsOkam, 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:50FromDiscord<Yardanico> but in module docs code examples are supposed to compile and most of them are actually tested
19:27:07FromDiscord<Yardanico> @PMunch io is alwas imported :)
19:27:11FromDiscord<Yardanico> (edit) "alwas" => "always"
19:27:19FromDiscord<Yardanico> until it gets moved out into std/syncio
19:27:32PMunchOh yeah, you're right
19:27:48PMunchNot sure then why sOkam is having trouble with that snippet
19:28:31FromDiscord<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:46FromDiscord<Yardanico> ah I see what you mean @sOkam!
19:28:50FromDiscord<Yardanico> yeah some code examples in the manual are old
19:28:57FromDiscord<sOkam!> yeah i figured
19:29:06FromDiscord<Yardanico> nowadays it's just `open` to open files
19:29:35*flynn quit (Read error: Connection reset by peer)
19:29:35FromDiscord<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:10FromDiscord<Yardanico> you don't "cast it"
19:30:24FromDiscord<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:33FromDiscord<Yardanico> so if your string gets out of scope and gets destroyed, cstring will become invalid
19:30:47*flynn joined #nim
19:30:50FromDiscord<Yardanico> what is the specific usecase you need the cstring for?
19:31:02FromDiscord<sOkam!> its passing into a C library, which needs cstring
19:31:20FromDiscord<Yardanico> and does the C library want ownership of that C string or not?
19:31:22FromDiscord<sOkam!> they are bindings for opengl, specifically nimgl
19:31:42FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyB
19:31:45FromDiscord<Yardanico> (usually the C APIs expect the length of the string as well)
19:32:04*jmdaemon joined #nim
19:32:20FromDiscord<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:19FromDiscord<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:31FromDiscord<Yardanico> if the original string gets destroyed (out of scope, etc), your cstring will point to invalid address
19:33:59FromDiscord<Yardanico> is there a problem for your API calls using cstring in the call itself like I showed?
19:34:02FromDiscord<Yardanico> (edit) "using" => "to use"
19:34:35*fredrikhr quit (Ping timeout: 260 seconds)
19:35:00FromDiscord<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:47FromDiscord<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:24FromDiscord<Yardanico> yeah, I mean this could work, but making a normal string and passing cstring() is a bit more correct IMO
19:38:12FromDiscord<Yardanico> btw, a bit of offtopic question, does anyone know if `class` in C++ is heap-allocated?
19:38:15FromDiscord<sOkam!> `glShaderSource(r.fragment.id, 1, r.fragment.src.addr, nil)`
19:38:16FromDiscord<Yardanico> i'm not good at C++
19:39:21FromDiscord<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:45FromDiscord<sOkam!> it asks for the adress of that cstring, not for the string itself
19:40:16FromDiscord<sOkam!> is that still more correct in that scenario?
19:40:17*flynn quit (Read error: Connection reset by peer)
19:41:05FromDiscord<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:09FromDiscord<Yardanico> but yes, the code you showed will work
19:41:16FromDiscord<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:36FromDiscord<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:53FromDiscord<Yardanico> https://stackoverflow.com/questions/22100408/what-is-the-meaning-of-the-parameters-to-glshadersource
19:42:10*jjido joined #nim
19:42:46FromDiscord<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:07FromDiscord<sOkam!> (edit) "that" => "which" | "corretly" => "correctly"
19:43:17FromDiscord<sOkam!> (edit) "works.(that" => "works (that"
19:43:36FromDiscord<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:23FromDiscord<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:23FromDiscord<Yardanico> i guess in the end it works around the same way
19:45:32FromDiscord<Yardanico> In reply to @sOkam! "with my current understanding,": again, as I said, `cstring` does not create anything new
19:45:49FromDiscord<Yardanico> it doesn't hold any memory by itself really, it just stores the address to the first element of theNormalString
19:45:56FromDiscord<Yardanico> and when theNormalString gets destroyed, cstring points to nothing anymore
19:46:33*flynn quit (Read error: Connection reset by peer)
19:46:49FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyF
19:46:49FromDiscord<Yardanico> both echos output the same value
19:46:59FromDiscord<Yardanico> because, as I said, cstring just points to the first element in the string
19:47:38FromDiscord<sOkam!> is `cstring(theNormalString).addr` still a correct address for opengl to understand?
19:47:46*flynn joined #nim
19:47:57FromDiscord<Yardanico> in reality it works, but it's a bit not correct
19:48:07FromDiscord<Yardanico> as I said, opengl expects an array of pointers to cstrings
19:48:17FromDiscord<Yardanico> if you just pass a pointer to one cstring, that's just an array of one element
19:48:30FromDiscord<sOkam!> but i didn't code nimgl or the tutorial 😔
19:48:43FromDiscord<Yardanico> i know, but everyone makes mistakes :)
19:48:53FromDiscord<Yardanico> and I guess you don't need the multiple strings feature when passing shaders to opengl often
19:49:55FromDiscord<sOkam!> i don't know what the multiple strings feature is, ngl
19:50:23FromDiscord<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:43FromDiscord<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:21FromDiscord<sOkam!> ah i see
19:52:54FromDiscord<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:20FromDiscord<sOkam!> im just trying to understand how to make that line work, that's it really
19:54:21FromDiscord<Yardanico> well it works even with the default code, right
19:54:22*flynn joined #nim
19:55:56*Zectbumo joined #nim
19:55:57FromDiscord<sOkam!> In reply to @Yardanico "well it works even": ?
19:56:08FromDiscord<Yardanico> you said that nimgl default code already works, right?
19:56:15FromDiscord<sOkam!> not from a file
19:56:54FromDiscord<Yardanico> ??
19:57:01FromDiscord<sOkam!> readFile into a `let XX:cstring` gives me a compile error↵staticRead into a `const XX:cstring` works, but its embedded
19:57:02FromDiscord<Yardanico> that API proc never claims to be able to read from a file
19:57:29FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VyI
19:58:05FromDiscord<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:00FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VyK
19:59:14FromDiscord<sOkam!> which is why I reasked, because that's the exact same syntax I asked about
19:59:20FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/966065481691832421/unknown.png
19:59:34FromDiscord<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:08FromDiscord<sOkam!> In reply to @Yardanico "i said that it's": https://media.discordapp.net/attachments/371759389889003532/966066187337355324/unknown.png
20:02:22FromDiscord<Yardanico> yes, that definition is not 100% correct
20:02:35FromDiscord<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:13FromDiscord<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:44FromDiscord<Yardanico> again, glShaderSource will copy the string to its own memory so you don't need to care about that
20:04:47FromDiscord<sOkam!> I'm not a low level programmer, memory allocation and all this jazz goes waaay over my head
20:05:12FromDiscord<Yardanico> "The source code strings are not scanned or parsed at this time; they are simply copied into the specified shader object."
20:05:27FromDiscord<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:49FromDiscord<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:53FromDiscord<Yardanico> of course not
20:05:59FromDiscord<Yardanico> most C APIs make a copy of the string you pass to them
20:06:11FromDiscord<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:45FromDiscord<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:17FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3VyZ
20:26:38*flynn joined #nim
20:27:22FromDiscord<ynfle> In reply to @b4mbus "is unpacking a type": You can do a double loop and iterate over the fields
20:27:43FromDiscord<b4mbus> iterate over the fields?
20:28:32FromDiscord<Yardanico> fieldPairs
20:28:57FromDiscord<ynfle> https://nim-lang.org/docs/iterators.html#fields.i%2CT
20:29:00FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Vz0
20:29:13FromDiscord<Yardanico> fields and fieldPairs iterators are unrolled at compile-time
20:29:27FromDiscord<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:27FromDiscord<Yardanico> never say "no way"
20:30:29FromDiscord<ynfle> If you want destructering, use tuples
20:30:31FromDiscord<Yardanico> you can always do that with a macro :)
20:30:37*flynn quit (Remote host closed the connection)
20:30:38FromDiscord<ynfle> But, be careful
20:30:46FromDiscord<b4mbus> Yeah I really dont wanna use tuples
20:31:36FromDiscord<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:06FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Vz6
20:55:36FromDiscord<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:43FromDiscord<ShalokShalom> And how is this related to var/const?
20:56:55FromDiscord<ShalokShalom> And why is this error message so bad 😛
20:57:01FromDiscord<sOkam!> are those methods reading from different cwd?
20:57:15FromDiscord<Elegantbeef> This error message isnt bad
20:57:24FromDiscord<Elegantbeef> It's an exception error message
20:57:33FromDiscord<ShalokShalom> Well, it could say what you did
20:57:35FromDiscord<Elegantbeef> What's your file directory?
20:57:39FromDiscord<ShalokShalom> You give a better error message
20:57:41FromDiscord<ShalokShalom> So its bad
20:57:42FromDiscord<Elegantbeef> It's an exception
20:57:47*flynn joined #nim
20:57:55FromDiscord<Elegantbeef> It's a runtime error
20:58:08FromDiscord<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:24FromDiscord<Elegantbeef> It compiles it's not running
20:58:29FromDiscord<Elegantbeef> Show the file directory please
20:59:01FromDiscord<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:40FromDiscord<Elegantbeef> Just show a tree of the directorry
20:59:42FromDiscord<Elegantbeef> Please for the love of all things good in the world i just want a tree\:D
20:59:47FromDiscord<sOkam!> 😄
21:00:34FromDiscord<sOkam!> not sure if i have a tool that shows trees, i never use them
21:01:33FromDiscord<Elegantbeef> depending on os you can easily get one from your package manager
21:02:34FromDiscord<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:06FromDiscord<sOkam!> In reply to @Elegantbeef "Think windows has it": im on linux, though
21:05:02FromDiscord<Elegantbeef> so install `tree` and live your life happily
21:05:32FromDiscord<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:03FromDiscord<Elegantbeef> Yea there's your problem it needs to be `engine/render/simple.vert` at runtime
21:07:15FromDiscord<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:57FromDiscord<Elegantbeef> Oh hey zoom you might appreciate what i'm presently doing. Benchmarking closure iterators with/without move against inline iterators
21:13:14FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966084081139994644/image.png
21:13:27FromDiscord<Elegantbeef> With complex objects turns out copying data is much much worse than moving data 😛
21:14:09FromDiscord<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:37FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Vze
21:20:49FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=3Vze" => "https://play.nim-lang.org/#ix=3Vzf"
21:21:01FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=3Vzf" => "https://play.nim-lang.org/#ix=3Vzg"
21:21:31*flynn joined #nim
21:21:48FromDiscord<Elegantbeef> doesnt `glShaderSource` take in a `CStringArray`?
21:21:52FromDiscord<sOkam!> is there any reason I should care about storing a `string` instead of a `cstring`?
21:22:04FromDiscord<sOkam!> In reply to @Elegantbeef "doesnt `glShaderSource` take in": nope, pointer to a cstring
21:22:05FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L31-L86 like this is how i do it
21:22:08FromDiscord<sOkam!> nimgl stuff
21:22:13FromDiscord<Elegantbeef> That's a cstring array
21:22:17FromDiscord<sOkam!> nope
21:22:21FromDiscord<sOkam!> checked
21:22:24FromDiscord<Elegantbeef> Yes
21:22:28FromDiscord<sOkam!> its in the library
21:22:37FromDiscord<Elegantbeef> ptr cstring is a cstring array
21:22:47FromDiscord<sOkam!> In reply to @sOkam! "": ☝️
21:22:53FromDiscord<ShalokShalom> In reply to @Elegantbeef "It's an exception": Idc what it is
21:22:57FromDiscord<ShalokShalom> I care about the result
21:23:08FromDiscord<ShalokShalom> And the message tells me very little compared to you
21:23:13FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966086591930069002/image.png
21:23:24FromDiscord<ShalokShalom> Its a compliment 🙂
21:25:40FromDiscord<Elegantbeef> Like i said it's a cstring array even though it doesnt say it is
21:25:41FromDiscord<Elegantbeef> This is why C fucking sucks
21:26:10FromDiscord<Elegantbeef> Weakly typed language used for interop make me sad
21:26:31FromDiscord<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:01FromDiscord<sOkam!> If there is a better way of loading from a file, then that's certainly what I'm looking for
21:27:04FromDiscord<Elegantbeef> Sure and in this case it's passing an address to a cstring which is an array of 0
21:27:08FromDiscord<sOkam!> the example just does it that way
21:27:19FromDiscord<Elegantbeef> So follow what they do
21:27:24*flynn quit (Read error: Connection reset by peer)
21:27:29FromDiscord<Elegantbeef> Honestly it's what i should do aswell
21:27:38FromDiscord<Elegantbeef> `var myCstring = myString.cstring` then pass the `addr` of it
21:27:38FromDiscord<sOkam!> aka hardcode the src inside the sourcecode?
21:27:42FromDiscord<Elegantbeef> No
21:27:44FromDiscord<sOkam!> they are not using files
21:27:50FromDiscord<Elegantbeef> ....
21:28:09FromDiscord<Elegantbeef> `var myCstringShader = cstring myShaderSource` then do `addr myCstringShader`
21:28:09FromDiscord<sOkam!> i was recommended to not use cstring. i was just using cstring before like they do
21:28:25FromDiscord<sOkam!> yeah, that's what I had before and worked
21:28:38*flynn joined #nim
21:29:45FromDiscord<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:28FromDiscord<SirOlaf> Can a macro receive a raw string like `"\x2E."` without explicitly making the string raw? Probably not I guess
21:30:36FromDiscord<Elegantbeef> No you need to convert to a cstring here
21:30:37FromDiscord<SirOlaf> Need to escape some byte regexes
21:31:16FromDiscord<Elegantbeef> if you do `myMacro"\x2E."` it'd do it, but that only works for a single call
21:31:55FromDiscord<SirOlaf> So why is myMacro("\x2E.") different from myMacro"\x2E."
21:32:02FromDiscord<SirOlaf> Something to do with literal types?
21:32:17FromDiscord<SirOlaf> Either way, thanks
21:32:25FromDiscord<Elegantbeef> It's a feature to make life a bit better
21:33:34*flynn quit (Read error: Connection reset by peer)
21:34:24FromDiscord<SirOlaf> Can I also disallow the () syntax somehow
21:34:31FromDiscord<Elegantbeef> Nope
21:34:34FromDiscord<SirOlaf> That sucks
21:34:43FromDiscord<Elegantbeef> Hardly an issue if you ask me
21:34:47*flynn joined #nim
21:34:55FromDiscord<SirOlaf> Allows for some dumb mistakes
21:36:11FromDiscord<SirOlaf> Guess I can check node type
21:36:22FromDiscord<SirOlaf> This syntax without () converts to a raw string implicitly
21:39:15FromDiscord<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:54FromDiscord<Elegantbeef> Yea sadly twice as slow as inline it seems
21:40:45*flynn joined #nim
21:40:58FromDiscord<Elegantbeef> Though it can be like 10 times slower for other types, `seq[int]` for instance
21:41:07FromDiscord<Elegantbeef> Oddly arc doesnt automatically move data for closure generators that have a `sink T` though
21:43:06FromDiscord<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:20FromDiscord<sOkam!> In reply to @Elegantbeef "<@186489007247589376>\: well anyway thanks": wdym? 🙂
21:47:33*flynn joined #nim
21:47:49FromDiscord<Elegantbeef> I realized i could do it without `alloccstringarray`
21:48:16FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/commit/94154350b64a56c8bc0db1bfa04b94795df7c44a for your viewing pleasure
21:48:27FromDiscord<sOkam!> you use your own wrapper or something?
21:49:08FromDiscord<Elegantbeef> [Zoom](https://matrix.to/#/@Zoom:matrix.org)\: i brokey the benchmark
21:49:11FromDiscord<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:34FromDiscord<Elegantbeef> Seems LTO caused the benchmark to implode
21:55:54FromDiscord<Zoom> That doesn't look right \:)
21:56:08FromDiscord<Elegantbeef> GCC's lto doesnt like the benchmark
21:56:33FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966094983109156884/image.png
21:56:34FromDiscord<Elegantbeef> With clang it's fine
21:57:51FromDiscord<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:32FromDiscord<Elegantbeef> so `-passc:"-flto"` causes gcc to not like the closure code
22:08:38FromDiscord<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:01FromDiscord<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:25FromDiscord<Elegantbeef> Are you asking for json node navigation?
22:19:57FromDiscord<Elegantbeef> Ie `myJson["a"]["b"]["c"]["d"].to(MyType)`
22:20:25FromDiscord<Elegantbeef> If so you dont really benefit from jsony
22:22:30FromDiscord<Zoom> Guess so. I like the custom parse hooks
22:23:00FromDiscord<Elegantbeef> Yea i mean the stdlib now also has them, but still will be slower
22:23:35FromDiscord<Elegantbeef> But given you're needing the parsed json structure you might aswell just use the stdlib's json library for this
22:24:05FromDiscord<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:26FromDiscord<Zoom> I thought there were some plans to extract json from std, right?
22:36:47FromDiscord<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:21FromDiscord<!Patitotective> i must be doing something wrong, im downloading an image of 11kb and it creats a file of 693kb 💀
23:38:07FromDiscord<huantian> Don’t worry it’s just adding extra data for you
23:38:26FromDiscord<huantian> Did you make sure You’re not have any duplicate file names
23:39:06FromDiscord<!Patitotective> In reply to @huantian "Did you make sure": im sure
23:39:11FromDiscord<!Patitotective> but the image it downloads doesnt work
23:39:19FromDiscord<!Patitotective> my system can't load it, either stb_image
23:40:39FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VzS
23:41:25FromDiscord<!Patitotective> maybe because i added a `downTable` where i store if files are being downloaded or if they already are
23:42:34FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VzU
23:52:39NimEventerNew thread by Archnim: Varargs limitation, see https://forum.nim-lang.org/t/9118
23:55:58FromDiscord<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:37FromDiscord<Elegantbeef> They're procs attached to `DateTime`