<< 27-05-2022 >>

00:01:06FromDiscord<Elegantbeef> Could use strscans
00:01:07FromDiscord<Elegantbeef> `line.scanf("### a-b-c", year, month, day)`
00:01:11*krux02 quit (Remote host closed the connection)
00:01:30FromDiscord<Elegantbeef> If you want to make the code less indented you could also use a try except https://play.nim-lang.org/#ix=3YFC
00:02:20FromDiscord<commander_c> Wow nice. OK let me see if I can get what I have here to compile, that's awesome news though.
00:02:51FromDiscord<Elegantbeef> Sorry it'd be `line.scanf("### $i-$i-$i", year, month, day)` i had a brain fart
00:03:00FromDiscord<Elegantbeef> You'd also have to declare `var year, month, day = 0`
00:03:23FromDiscord<Elegantbeef> Probably better to do `line.scanF("### $+", myDateString)` then try to parse that
00:04:17FromDiscord<commander_c> Ah, it's great to have the hazy indentation issues behind me, it's compiling now.
00:04:52FromDiscord<commander_c> OK with my copious free time I will study line.scanf and the try/except.
00:05:08FromDiscord<Elegantbeef> Copious free time gang unite! 😜
00:05:58FromDiscord<commander_c> I had started this project using procutils and parseUntil, but that was looking so wrong. I was glad to see `contains` 😅
00:06:32FromDiscord<Elegantbeef> Hey i'm just happy you didnt use regex
00:07:26FromDiscord<!Patitotective> In reply to @Elegantbeef "Hey i'm just happy": s-sorr.y..
00:07:28FromDiscord<commander_c> Uh, well I did try to start this project using grep. But lucky for me I suck at grep and couldn't even get grepping for `+timesheet` to output with escapes in place
00:07:30FromDiscord<!Patitotective> (edit) "s-sorr.y.." => "s-sorry..."
00:07:42FromDiscord<commander_c> (using -E)
00:08:13FromDiscord<commander_c> Then I thought, "ok, to Pascal we go" and then I had a structure-headache and remembered Nim, so here I am 😊
00:10:47FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3YFF
00:10:54FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3YFF" => "https://play.nim-lang.org/#ix=3YFG"
00:10:56FromDiscord<Elegantbeef> No it will not work on windows
00:11:04FromDiscord<Elegantbeef> Windows doesnt have a `/usr/lib` path
00:11:07FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3YFG" => "https://play.nim-lang.org/#ix=3YFH"
00:11:32FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3YFH" => "https://play.nim-lang.org/#ix=3YFI"
00:11:57FromDiscord<Elegantbeef> If you want to make it work for windows use a `-d:tinyFDSysPath -d:tinyFDPath` ....
00:12:23FromDiscord<Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L33-L40 similar to how i use `wasmEdgePath` here
00:16:04FromDiscord<!Patitotective> In reply to @Elegantbeef "https://github.com/beef331/wasmedge_playground/blob": but here you dont change the sysPath, is it because its not supposed to work on windows?↵and how would i "make" the user compile it with his sysPath?
00:16:21FromDiscord<Elegantbeef> I just told you how
00:16:23FromDiscord<Elegantbeef> Do you not listen
00:16:45FromDiscord<Elegantbeef> `-d:tinyFdSysPath:"/some/path"`
00:16:53FromDiscord<!Patitotective> :[
00:17:28FromDiscord<!Patitotective> but do i distribute the futhark generated module?
00:17:40FromDiscord<Elegantbeef> If you want to
00:18:16FromDiscord<!Patitotective> and if i want futhark to generate it on installation how would i know what `tinyFdSysPath` is?
00:18:19FromDiscord<!Patitotective> (edit) "and if i want futhark to generate it on installation how would i know what `tinyFdSysPath` is? ... " added ":["
00:18:30FromDiscord<Elegantbeef> Did you look at my code?
00:19:01FromDiscord<!Patitotective> yes and sysPath is not changed at all↵https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L34
00:19:10FromDiscord<Elegantbeef> Look at wasmpath
00:19:15FromDiscord<Elegantbeef> Look at wasmedge path
00:19:19FromDiscord<Elegantbeef> It's the same thing
00:19:30FromDiscord<michaelb.eth> is there a way to use the `is` operator in the signature of a generic proc as opposed to e.g. using it in the proc body with `when`?↵↵I thought I had seen something like that previously, but having trouble hunting for it
00:19:48FromDiscord<Elegantbeef> What do you mean?
00:21:08FromDiscord<Elegantbeef> Are you trying to constrain the generic parameters to specific types?
00:22:15FromDiscord<michaelb.eth> In reply to @Elegantbeef "Are you trying to": yes, basically
00:22:31FromDiscord<Elegantbeef> Do you have an example of what you're after?
00:23:09FromDiscord<Elegantbeef> `proc doThing[T: int](a: T)` doesnt work for you?
00:23:26FromDiscord<Andreas> How come when i read thru a channel - don't mutate anything i read - my main-thread gets in trouble ? Using SmartPtr from threading/smartptrs ?
00:23:33FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=3YFL
00:23:49FromDiscord<Elegantbeef> `proc myLen[T: FooBase](obj: T)`
00:24:26FromDiscord<!Patitotective> In reply to @Elegantbeef "Look at wasmedge path": but you use that because you do not ship wasmedge with your library↵i do, so i already have the `path`↵what i want is the installation to be automatic and find the `sysPath`, i dont want the user to define it (he could override it but by default there should be one)
00:24:29FromDiscord<Elegantbeef> You might be thinking of concepts
00:24:30FromDiscord<michaelb.eth> In reply to @Elegantbeef "`proc myLen[T: FooBase](obj: T)`": ah nice
00:24:43FromDiscord<Elegantbeef> There isnt an automatic way to find it patito
00:24:49FromDiscord<Elegantbeef> Atleast reliably
00:25:02FromDiscord<Elegantbeef> You need to have libclang installed and where it is up to the user/OS
00:25:09FromDiscord<Elegantbeef> It's not even consistent across linux
00:25:29FromDiscord<Elegantbeef> Atleast it might not be i dont recall
00:29:37FromDiscord<Elegantbeef> The way to do it is have a flag for the path and if that's set you use futhark otherwise you use the pregen'd file
00:39:59FromDiscord<!Patitotective> pregen file is nice then :]
00:40:14FromDiscord<!Patitotective> (edit) "nice" => "okay"
00:47:53*vicfred quit (Quit: Leaving)
00:49:26*wallabra_ joined #nim
00:50:35*wallabra quit (Ping timeout: 255 seconds)
00:50:43*wallabra_ is now known as wallabra
00:51:10NimEventerNew thread by Ggibson: Changing mingw cross compiler path?, see https://forum.nim-lang.org/t/9175
01:00:03FromDiscord<!Patitotective> how could i get the path of the futhark generated file? hehe↵`walkFiles` doesnt work for nimscript :[
01:00:23FromDiscord<Elegantbeef> You manually grab it
01:00:50FromDiscord<!Patitotective> this looks sus https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L498
01:00:54FromDiscord<!Patitotective> In reply to @Elegantbeef "You manually grab it": :[
01:01:06FromDiscord<!Patitotective> thats not what a ~~beginner~~ programmer would say
01:01:08FromDiscord<!Patitotective> (edit) "thats not what a ~~beginner~~ programmer would say" => "do"
01:01:14FromDiscord<!Patitotective> (edit)
01:01:28FromDiscord<Elegantbeef> I mean you can grab it automatically
01:01:39FromDiscord<Elegantbeef> But just pester pmunch to add a `writeTo` 😄
01:02:05FromDiscord<!Patitotective> In reply to @Elegantbeef "But just pester pmunch": foss be like
01:02:19FromDiscord<Elegantbeef> I mean you can add it yourself
01:02:28FromDiscord<Elegantbeef> He said he already plans to add it
01:04:45FromDiscord<!Patitotective> @PMunch do you plan to add a `writeTo` proc to futhark? hehe :]
01:04:50FromDiscord<Andreas> @ElegantBeef when i use `-d:useMalloc` i see errors when use `threading/smartptrs` in a 100-percent safe way ? Without `useMalloc` i'm fine ?
01:05:02FromDiscord<Andreas> (edit) "@ElegantBeef when i use `-d:useMalloc` i see errors when ... use" added "i"
01:05:11FromDiscord<Elegantbeef> I do not know
01:05:26FromDiscord<Andreas> In reply to @Elegantbeef "I do not know": thats why i tell you
01:06:20FromDiscord<!Patitotective> beef dont knows panic
01:06:57FromDiscord<Elegantbeef> I've never touched smart ptrs so i dont even know what they are so yes i dont know 😄
01:08:21FromDiscord<Elegantbeef> Where are you getting these socalled smart pointers
01:11:40FromDiscord<ripluke> How can I run shell command and store the output as a variable, and not have it show the execution of the command, or the code (1/0) it returns
01:12:05FromDiscord<Andreas> In reply to @Elegantbeef "Where are you getting": grab yourself some from threading/smartptrs - they come in three flavours Unique/Shared/Weak and Const.. from the nim-lang-repo.
01:12:26FromDiscord<Elegantbeef> ripluke https://nim-lang.org/docs/osproc.html#execProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] and similar
01:12:39FromDiscord<!Patitotective> sooo beef if i want to include the module that generates the bindings in the repo should i add futhark as a dependency? 🤔
01:13:10FromDiscord<Elegantbeef> No answer
01:14:09FromDiscord<Elegantbeef> Are you using `orc` andreas?
01:14:23FromDiscord<Andreas> In reply to @Elegantbeef "Are you using `orc`": close, ARC
01:14:31FromDiscord<Elegantbeef> Well that works too 😄
01:16:13*arkurious quit (Quit: Leaving)
01:16:25FromDiscord<Elegantbeef> Anyway do you have a min repro i can test?
01:16:51FromDiscord<Andreas> @ElegantBeef in case i have thread that recieves some Ptr via a channel and reads the pointed value - that cannot disturb the main-thread in any way ? if the main-thread writes/mutates/invalidates smth. then the problem is on the receiving side - garbled stuff or nil..
01:26:21FromDiscord<ripluke> Also how can I read a specific line from a file? The readline function only reads the First line
01:27:39FromDiscord<Elegantbeef> you read lines until the line number you want
01:30:46FromDiscord<ripluke> In reply to @Elegantbeef "you read lines until": So I just repeat the readline function?
01:31:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YFU
01:32:01FromDiscord<Elegantbeef> for got the `inc line`
01:32:09FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3YFV
01:32:12FromDiscord<Elegantbeef> can also just do `for _ in 0..<lineIWant`
01:32:17FromDiscord<ripluke> In reply to @Elegantbeef "for got the `inc": Ok I’ll add it
01:39:23FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3YFX
02:30:59FromDiscord<!Patitotective> to use the futhark generated module should i grab the whole folder?
02:31:14FromDiscord<!Patitotective> like the includes and so
02:31:19FromDiscord<!Patitotective> beef
02:31:39FromDiscord<Elegantbeef> To use the generated module you just need the `.so` and to link it
02:34:06FromDiscord<!Patitotective> In reply to @Elegantbeef "To use the generated": you mean the compiled binary or should there be a `.so` in the cache?
02:34:37FromDiscord<Elegantbeef> Is this a source library or dynamic library i dont recall
02:36:13FromDiscord<!Patitotective> source, i think
02:36:22FromDiscord<Elegantbeef> Then you need the C files
02:36:49FromDiscord<!Patitotective> the c files and the futhark generated `.nim` in cache or?
02:37:02FromDiscord<Elegantbeef> The tinyfd source files
02:37:58FromDiscord<!Patitotective> only the source files?
02:38:11FromDiscord<!Patitotective> (edit) "only the ... source" added "tinyfd"
02:38:15FromDiscord<Elegantbeef> You only need the generated futhark file and source files for tinyfd
02:38:25FromDiscord<Elegantbeef> Why would you need anything else
02:45:18FromDiscord<!Patitotective> where should i put the `{.compile.}` pragma? at the end of the futhark generated file ooor
02:51:16FromDiscord<Elegantbeef> Ah deleted messages i can see patito is using their brian
02:52:10FromDiscord<!Patitotective> i dont have brian
03:00:23FromDiscord<!Patitotective> b-beef... is this okay? https://github.com/Patitotective/nim_tinyfiledialogs↵;-;
03:00:39FromDiscord<!Patitotective> i mean the _project structure_
03:05:21FromDiscord<Elegantbeef> Seems fine though you're missing a `when defined useFuthark` or similar to regen it
03:06:50FromDiscord<!Patitotective> why would you want to regen it? 🤨
03:06:58FromDiscord<Elegantbeef> The API changes?
03:07:23FromDiscord<Elegantbeef> I guess since you have source included it doesnt matter
03:08:45FromDiscord<!Patitotective> yea well, ill try to update the source frequently :]
03:09:26FromDiscord<!Patitotective> i should put somewhere which version onf tinyfd im using
03:09:29FromDiscord<!Patitotective> (edit) "onf" => "of"
03:09:49FromDiscord<Elegantbeef> Do not make it the package version
03:10:03FromDiscord<!Patitotective> hehe
03:10:55FromDiscord<!Patitotective> woop last update 2021-12-03↵its either dead or the code is so good it doesnt need updates
03:36:30*ehmry joined #nim
03:57:22FromDiscord<!Patitotective> cmon where is position 354 https://github.com/nim-lang/packages/pull/2243/checks#step:5:9
03:57:50FromDiscord<!Patitotective> json does not allow trailing commas?
05:10:17FromDiscord<j-james> how can i get the children of a nnkStmtList (or any list, really) for macros?
05:13:20FromDiscord<j-james> i keep getting `Error: Invalid node kind nnkProcDef for macros.` when trying to call functions defined for NimNodes
05:14:33*gsalazar quit (Remote host closed the connection)
05:14:51*gsalazar joined #nim
05:17:11FromDiscord<Elegantbeef> Can you do `.sons` on a NimNode dont recall
05:17:24FromDiscord<Elegantbeef> What are you trying to do?
05:18:58FromDiscord<j-james> implement a `pub` operator
05:19:59FromDiscord<j-james> my thought was that it would take something like a `ProcDef` and simply add `Postfix Ident ""` where needed
05:20:07FromDiscord<Elegantbeef> You can
05:20:35FromDiscord<Elegantbeef> I mean partially
05:20:41FromDiscord<Elegantbeef> Nim macros dont let you change the syntax
05:21:29FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/49I
05:23:04FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=3YGM
05:23:10FromDiscord<Elegantbeef> No that doesnt compile
05:23:17FromDiscord<Elegantbeef> Parser says "No"
05:23:50FromDiscord<j-james> parser says "no" in what way?
05:24:07FromDiscord<Elegantbeef> It doesnt parse it cause it's invalid code
05:26:02FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/GCo
05:26:59FromDiscord<j-james> yeah, i was hoping to get around needing to declare it in a block
05:27:15FromDiscord<Elegantbeef> You cannot since it's just not parsable
05:27:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YGQ
05:29:03FromDiscord<j-james> oh, so would `pub_proc` work?
05:29:22FromDiscord<Elegantbeef> It'd
05:29:31FromDiscord<Elegantbeef> If you're wanting to turn Nim more rusty, just stop
05:29:36FromDiscord<Elegantbeef> If you're wanting to learn macros carry on
05:30:17FromDiscord<j-james> coming from the developer of traitor 😃
05:30:29FromDiscord<j-james> this is mostly a project to learn macros
05:30:44FromDiscord<Elegantbeef> Traitor isnt to make it rusty
05:30:58FromDiscord<Elegantbeef> Traitor was to make concepts more affirmative and to use them for runtime dispatch
05:32:33FromDiscord<gordoncatlover> Dipping my toes in templates/macros, but I'm struggling to understand something fundamental about typedesc. Line 5 does not work inside the template, but fine outside. Any guidance very appreciated. 🙏 https://play.nim-lang.org/#ix=3YGP
05:33:43FromDiscord<Elegantbeef> `genericParams` returns a type either do `default(genericParams(T))` or do `var params: genericParams(T)`
05:34:17FromDiscord<Elegantbeef> Types cannot be assigned to variables
05:36:32*haliucinas joined #nim
05:37:01FromDiscord<Elegantbeef> Gordon what are you attempting to do?
05:37:22FromDiscord<Elegantbeef> Recurse down the collection and find the base type?
05:38:01*ltriant_ joined #nim
05:39:01FromDiscord<gordoncatlover> Thank you. Indeed, recurring down to the base type and output as a string `uint8[16][32]`
05:40:23*ltriant quit (Ping timeout: 255 seconds)
05:40:25FromDiscord<gordoncatlover> Not sure if my approach is even a good idea.
05:40:43FromDiscord<Elegantbeef> No macros would be smarter than recursive template calls
05:43:35FromDiscord<Elegantbeef> There you go that's better
05:43:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YGU
05:44:49FromDiscord<gordoncatlover> Genius. Thank you.
05:45:14FromDiscord<Elegantbeef> No problem, always use the simplest tool
06:45:40FromDiscord<my mom said 👇> sent a code paste, see https://play.nim-lang.org/#ix=3YHi
06:45:46FromDiscord<my mom said 👇> pls don't attack me....
06:46:07FromDiscord<Elegantbeef> Perhaps i dont know
06:46:55FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/4Kp
06:46:58FromDiscord<Elegantbeef> Shit
06:47:08FromDiscord<my mom said 👇> In reply to @Elegantbeef "Shit": lel
06:47:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YHk
06:48:25FromDiscord<my mom said 👇> sent a code paste, see https://paste.rs/ADh
06:48:56FromDiscord<Elegantbeef> read strscans
06:49:22FromDiscord<Elegantbeef> int, optional space, `+`, optional space, int
06:49:52FromDiscord<my mom said 👇> In reply to @uncle jim "ik this might sound": but what about this? is this an interpreter?
06:54:14*xaltsc joined #nim
07:02:48*jjido joined #nim
07:09:29*ltriant_ quit (Ping timeout: 255 seconds)
07:33:05*vicecea quit (Remote host closed the connection)
07:33:35*vicecea joined #nim
07:47:42FromDiscord<Rika> Technically?
07:53:27FromDiscord<uncle jim> In reply to @Rika "Technically?": wdym
07:53:27FromDiscord<uncle jim> ?
07:54:00NimEventerNew thread by Georgeethan: Is it possible to have a nim forum rss feed publicly?, see https://forum.nim-lang.org/t/9176
07:59:01FromDiscord<Rika> In reply to @uncle jim "wdym": It interprets some kind of language so it’s technically an interpreter but most people wouldn’t consider it one perhaps because the language it interprets is not Turing complete?
07:59:44FromDiscord<uncle jim> In reply to @Rika "It interprets some kind": bruh
08:00:03FromDiscord<uncle jim> soooo it's technically an interpreter right?
08:00:23FromDiscord<Rika> I told you already
08:01:24FromDiscord<uncle jim> In reply to @Rika "It interprets some kind": https://tenor.com/view/imitationgame-alanturing-hug-benedict-cumberbatch-gif-14553592
08:26:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:30:14FromDiscord<jmgomez> can you define a global static of any type? i.e. Im trying to define a stringtable but cant find the right syntax (const doesnt work)
08:36:07FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3YI1
08:36:10FromDiscord<ynfle> What are you trying to do?
08:36:21FromDiscord<Yardanico> In reply to @ynfle "You can't because it's": huh? you can define it as a global
08:36:22FromDiscord<PMunch> In reply to @Patitotective "<@392962235737047041> do you plan": `writeTo`?
08:36:28FromDiscord<Yardanico> there are no restrictions on global values being refs
08:36:47FromDiscord<ynfle> In reply to @Yardanico "there are no restrictions": Global compile time const?
08:36:48FromDiscord<Elegantbeef> Pmunch that's the write the futhark file to a given directory
08:36:56FromDiscord<ynfle> In reply to @ynfle "Global compile time const?": ref
08:37:01FromDiscord<Yardanico> yes
08:37:24FromDiscord<ynfle> In reply to @Yardanico "yes": How do you do it?
08:38:25FromDiscord<Yardanico> hm, guess I'm wrong and it doesn't work with const then, weird
08:42:11FromDiscord<jmgomez> In reply to @ynfle "You can't because it's": ohh ok, thanks!
08:42:25FromDiscord<jmgomez> Im just defining a type mapper
08:42:46FromDiscord<jmgomez> one other thing, can you pass two argumentes to a macro/pragma or do you have to wrap in a tuple or something?
08:43:16FromDiscord<Yardanico> In reply to @jmgomez "one other thing, can": yes, of course you can
08:43:42FromDiscord<Yardanico> just don't forget to differentiate between arguments that get passed as NimNodes (if you just specify their type), or as actual values (if you use `static`)
08:44:56FromDiscord<jmgomez> but how you specify them on the call? it seems to get confused with a comma and spec it to be another pragma, ie
08:45:07FromDiscord<Yardanico> In reply to @jmgomez "but how you specify": can you show the code?
08:46:07FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3YIa
08:46:13NimEventerNew thread by Cmc: Small improvement discussion: Use `let` to lock variable previously declared as `var`, see https://forum.nim-lang.org/t/9177
08:48:37FromDiscord<Yardanico> @jmgomez that's not how you pass arguments to a macro
08:48:43FromDiscord<Yardanico> try using parens for multiple args
08:48:49FromDiscord<Yardanico> .typeFrom(Test, myStrTable)
08:51:00FromDiscord<jmgomez> oh I see, but now I get a missing values and types is not allowed error (due to Test and the const I guess)
08:51:56FromDiscord<jmgomez> (edit) "missing" => "mixing"
09:40:38*ltriant joined #nim
09:59:12*haliucinas left #nim (#nim)
10:20:45FromDiscord<mbrc> Did owned refs ever make it to the current implementation of nim?
10:21:16FromDiscord<mbrc> I see Araqs post and a closed RFC
10:21:16FromDiscord<Andreas> In reply to @mbrc "Did owned refs ever": yes, its there.
10:21:59FromDiscord<mbrc> Is it documented in the manual?
10:22:56FromDiscord<Andreas> In reply to @mbrc "Is it documented in": yes, https://nim-lang.org/docs/system.html#owned
10:27:32FromDiscord<Yardanico> In reply to @Andreas "yes, its there.": although it's only really has an effect with `--newruntime` which is kinda abandoned
10:27:45FromDiscord<Yardanico> or actually it works with arc too, not sure
10:28:56FromDiscord<Andreas> In reply to @Yardanico "or actually it works": i use it - can't say if it has effect - i see no errors..
10:29:01FromDiscord<Yardanico> what do you use it for?
10:30:29FromDiscord<Andreas> In reply to @Yardanico "what do you use": a data-structure called 'Hamt' - part of closure-folk from some years ago 😉 "It only 20-percent slower compared to a naive Map"
10:30:43FromDiscord<Yardanico> well, does really anything change if you just remove all `owned` annotations?
10:30:43FromDiscord<Andreas> (edit) ""It" => ""Its"
10:30:45FromDiscord<Yardanico> and compile again
10:31:24FromDiscord<Andreas> In reply to @Yardanico "well, does really anything": no, makes no change... but i did not know about --newruntime
10:31:34FromDiscord<Yardanico> that's also abandoned in favour of arc/orc
10:31:38FromDiscord<Andreas> (edit) "naive" => "native"
10:31:43FromDiscord<Yardanico> newruntime/owned refs/etc were there before the final idea of ARC/ORC emerged
10:31:58FromDiscord<Andreas> In reply to @Yardanico "newruntime/owned refs/etc were there": ok, i use ARC
10:33:23FromDiscord<Andreas> (edit) "In reply to @Yardanico "newruntime/owned refs/etc were there": ok, i use ARC ... " added "- so theres no difference in `onwed smth` or `ref smth` ?"
10:38:13FromDiscord<Yardanico> In reply to @Andreas "ok, i use ARC": i don't think there's a difference between `owned T` and `T`
10:38:44FromDiscord<Yardanico> `owned` is made for `ref` only anyway
10:38:53FromDiscord<Yardanico> using it on non-ref types is pointless
10:39:18FromDiscord<Andreas> In reply to @Yardanico "i don't think there's": roger that - later i'll try something and replace the `owned` with a `threading/smartptr` se what that does..
10:39:35FromDiscord<Andreas> (edit) "se" => "see"
10:41:38FromDiscord<mbrc> I dont see any docs for it in the manual
10:41:40FromDiscord<mbrc> I searched owned and nothing turned up
10:42:01FromDiscord<Yardanico> because it's more or less abandoned, at least what's what I know
10:42:41FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/12953#issuecomment-808748503 for example
10:42:58FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/12443#issuecomment-791083825
10:43:06FromDiscord<Yardanico> newruntime/owned were really experiments
10:45:41FromDiscord<mbrc> I see
10:45:45FromDiscord<mbrc> Thanks for the information!
11:16:25FromDiscord<golova> @ElegantBeef why can't I export generic procs to nimscript?
11:17:10FromDiscord<blashyrk> In reply to @blashyrk "Hi, is there a": Bump on this as I'm really trying to wrap my head around importing stuff in nim :)
11:18:53FromDiscord<Rika> It sounded like a bug really
11:19:56*PMunch joined #nim
11:19:59FromDiscord<golova> In reply to @golova "<@145405730571288577> why can't I": nvm, im dumb
11:34:30*arkurious joined #nim
11:43:50*matt_1337 joined #nim
11:47:35*ltriant quit (Ping timeout: 255 seconds)
13:00:06FromDiscord<whisper> Is there any decent tui library capable of things like htop does?
13:01:56FromDiscord<enthus1ast> @whisper\: give illwill a try
13:03:09FromDiscord<enthus1ast> Have also build some simple Mousse enabled Widgets on top of it\: https://github.com/enthus1ast/illwillWidgets
13:15:36*vicfred joined #nim
13:23:23FromDiscord<!Patitotective> In reply to @PMunch "`writeTo`?": yes to specify the path of the module futhark generates
13:25:06PMunchOoh, yeah I have plans for a similar thing
13:34:14FromDiscord<!Patitotective> :eyh
13:34:19FromDiscord<!Patitotective> (edit) ":eyh" => "👀"
13:47:30FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/TLH
13:47:53FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3YKa" => "https://play.nim-lang.org/#ix=3YKb"
14:02:32FromDiscord<Yardanico> openArray is not just pointers to things
14:02:36FromDiscord<Yardanico> it also has length
14:02:48FromDiscord<Yardanico> you should instead try doing `filterPatterns[0].unsafeAddr`
14:06:11FromDiscord<!Patitotective> i just found this https://github.com/juancarlospaco/nim-tinyfiledialogs↵damn, how did i not notice?
14:07:41FromDiscord<Rika> because you never checked?
14:07:43FromDiscord<Yardanico> XD
14:09:07FromDiscord<!Patitotective> buuuut my bindings have color picker, he doesnt
14:09:51FromDiscord<!Patitotective> the problem is that they have the same name, ill have to rename mine :[
14:10:25FromDiscord<!Patitotective> (edit) "he" => "his bindings"
14:10:30FromDiscord<!Patitotective> (edit) "doesnt" => "do not"
14:11:53FromDiscord<!Patitotective> In reply to @Yardanico "you should instead try": yey it worked, thanks
14:11:55FromDiscord<!Patitotective> (edit) "In reply to @Yardanico "you should instead try": yey it worked, thanks ... " added ":]"
14:12:10NimEventerNew question by ZeDragon: Using mutable varargs doesnt work as expected in Nim, see https://stackoverflow.com/questions/72406736/using-mutable-varargs-doesnt-work-as-expected-in-nim
14:19:38FromDiscord<!Patitotective> In reply to @Patitotective "the problem is that": what about _tinydialogs_? lol
14:21:05FromDiscord<Rika> tiefiedie
14:27:36FromDiscord<!Patitotective> to fix the name conflict should i open another PR? the initial PR already got merged so I can't modify it
14:28:38FromDiscord<dom96> In reply to @Patitotective "i just found this": bah, that's what I get for assuming that no other package with that name can possibly exist and merging the PR lol
14:28:54FromDiscord<dom96> yeah, please open another PR
14:28:56FromDiscord<!Patitotective> yea sorry, i ddint check
14:29:01FromDiscord<!Patitotective> (edit) "ddint" => "didnt"
14:29:10FromDiscord<dom96> the CI would have told us :)
14:29:19FromDiscord<dom96> if I waited for it patiently, oops
14:36:29FromDiscord<Yardanico> @dom96 but it's not in nimble
14:36:31FromDiscord<Yardanico> juan's package
14:36:37FromDiscord<Yardanico> oh it is actually, nvm
14:36:50FromDiscord<Yardanico> but yeah, @!Patitotective IMO you can just take over juan's package really
14:37:01FromDiscord<Yardanico> as he didn't update it and it only has barebones wrapper without nim APIs on top
14:37:16FromDiscord<!Patitotective> :]
14:39:42FromDiscord<!Patitotective> lol https://media.discordapp.net/attachments/371759389889003532/979755782281252964/unknown.png https://media.discordapp.net/attachments/371759389889003532/979755782537093120/unknown.png
14:45:14FromDiscord<Yardanico> In reply to @Patitotective "lol": huh, i don't think so
14:45:20FromDiscord<Yardanico> there are multiple packages with spaces in tags
14:48:31FromDiscord<dom96> yeah, because nobody cared to correct them :)
14:48:48FromDiscord<Yardanico> but why is it wrong?
14:49:01FromDiscord<Yardanico> nimble directory seems happy about them, and it makes the search better i think
14:49:54FromDiscord<dom96> meh, I guess it doesn't matter too much
14:49:57FromDiscord<dom96> the tags are a mess anyway
14:50:06FromDiscord<dom96> they've become keywords
14:51:38FromDiscord<Rika> what are they supposed to be
14:51:40FromDiscord<Rika> if not keywords
14:52:02FromDiscord<dom96> The idea I had behind them was that you'd be able to browse packages with a specific tag. Like get a list of all libraries with the "library" tag
14:52:12FromDiscord<dom96> or a list of all binary packages with the "binary" tag
14:52:53FromDiscord<dom96> that's typically what tags represent
14:54:02FromDiscord<!Patitotective> in that case users shouldnt be able to create tags
14:54:17FromDiscord<dom96> also if we do treat them as "keywords" then adding "file dialogs" for a package called "tinyfiledialogs" is redundant :)
14:54:41FromDiscord<!Patitotective> In reply to @dom96 "also if we do": now called tinydialogs lol
14:55:04FromDiscord<!Patitotective> In reply to @Patitotective "in that case users": just to select them or you can add them manually when PRs
15:13:52NimEventerNew Nimble package! tinydialogs - Tiny file dialogs Nim bindings., see https://github.com/Patitotective/tinydialogs
15:14:43FromDiscord<huantian> Wow new patito package
15:17:30FromDiscord<!Patitotective> In reply to @huantian "Wow new patito package": :]
15:30:51FromDiscord<untoreh> If I mark a proc with `{.async.}` but the call blocks what can be the cause?
15:32:32FromDiscord<Yardanico> CPU intensive functions, `sleep`, etc
15:32:36FromDiscord<Yardanico> Can you show the code of the proc?
15:33:09FromDiscord<Yardanico> And if you're doing `await call()`, it's expected to block the current async procedure until call completes
15:39:02FromDiscord<Phil> Is there a way for troubleshooting purposes for me to print out all symbols available in a given module (including from the imports)?
15:43:51*ltriant joined #nim
15:47:06FromDiscord<!Patitotective> yard do you plan to add "windows support"? maybe you can distribute the libvlc and the futhark generated module all together https://github.com/Yardanico/nim-libvlc
15:48:28*ltriant quit (Ping timeout: 258 seconds)
17:01:54FromDiscord<!Patitotective> why are there no working audio libraries? :[
17:03:53FromDiscord<exelotl> you can use SDL or Raylib for audio right?
17:10:46FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3YL7
17:11:02FromDiscord<exelotl> and it actually worked (first time I've ever done something with views that worked lol)
17:11:12FromDiscord<exelotl> but then I checked the manual: https://nim-lang.org/docs/manual_experimental.html#view-types
17:11:38FromDiscord<exelotl> and apparently `var T` as a view isn't a thing anymore? You're supposed to use `lent T`
17:12:36FromDiscord<exelotl> but if I change it to `var buf: lent M4Mem = ...` it fails on `buf.clear()` because the compiler claims that `buf` is immutable
17:12:49FromDiscord<Generic> https://github.com/nim-lang/Nim/issues/18683
17:12:54FromDiscord<Generic> see the conversation
17:14:57FromDiscord<Rika> "let xx: var T" looks so cursed ngl
17:15:05FromDiscord<Rika> "SO IS IT IMMUTABLE OR MUTABLE"
17:15:15FromDiscord<exelotl> haha
17:15:40FromDiscord<exelotl> right, so I guess there's just a gap between the current implementation and the planned implementation
17:17:07FromDiscord<Generic> yeah and the spec you refered to is incomplete, because as said in the linked issue, `var T` is a view type
17:17:18FromDiscord<Phil> Wait, that is actually legal syntax?
17:17:36FromDiscord<Generic> with view types it should be
17:18:01FromDiscord<Generic> In reply to @Rika ""let xx: var T"": I mean it's basically just `T& const`
17:21:09FromDiscord<exelotl> In reply to @Generic "yeah and the spec": iirc `var T` used to be in the spec, but then araq figured it's not the job of view types to describe mutability (so instead `var x: lent T` is a mutable view, `let x: lent T` is an immutable view)
17:21:51FromDiscord<exelotl> but I haven't been keeping up with this stuff so I'm not sure what the current status is 😅
17:25:09*jjido joined #nim
17:30:08FromDiscord<!Patitotective> In reply to @exelotl "you can use SDL": ill try to _implement_ pythons playsound↵https://github.com/TaylorSMarks/playsound/blob/master/playsound.py
17:31:36FromDiscord<Generic> In reply to @exelotl "iirc `var T` used": hm ok that makes sense too, though wouldn't it kindof break with the existing syntax for parameters?
17:37:35FromDiscord<exelotl> Ah here's where I read it: https://discord.com/channels/371759389889003530/768367394547957761/892413727486410772↵It's mainly referring to variables and object fields, I guess an exception would have to be made for var params and var return values to keep their current syntax as opposed to something ugly like `x: var lent T`
17:42:49FromDiscord<Rika> ~~vent~~
17:52:56*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:05:40FromDiscord<axilirate> getting this error on macos running nimble `ould not load: libcrypto(.1.1|.38|.39|.41|.43|.44|.45|.46|.47|.48|.10|.1.0.2|.1.0.1|.1.0.0|.0.9.9|.0.9.8|).dylib↵`
18:05:52FromDiscord<axilirate> (edit) "`ould" => "`could"
18:06:05FromDiscord<axilirate> dependencies are installed
18:31:14FromDiscord<axilirate> nvm works now
18:40:35*def- quit (Quit: -)
18:55:34*xet7 quit (Remote host closed the connection)
18:57:19*def- joined #nim
19:04:17FromDiscord<eyecon> Hello, it's EyeCon and we have a new episode of "How to Crash the Nim Compiler with the Least Effort" tonight
19:04:44FromDiscord<eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3YLB
19:05:01FromDiscord<eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3YLC
19:05:22FromDiscord<eyecon> I mean, I would get if that crashed
19:05:28FromDiscord<Yardanico> it should be `var` or `let` I think (`testBytes`)
19:05:29FromDiscord<eyecon> Because of the length not matching etc.
19:05:37FromDiscord<eyecon> But not compiling?
19:05:43FromDiscord<Yardanico> also, if you use arc you need to call `prepareMutation` on `tempStr` before using `copyMem`
19:06:49FromDiscord<eyecon> In reply to @Yardanico "also, if you use": Yes, but I thought the only downside would be the string not updating in some cases, I thought
19:07:00FromDiscord<eyecon> In any case, the problem is the `const`, it appears
19:07:04FromDiscord<Yardanico> In reply to @Yardanico "it should be `var`": yes ^
19:07:20FromDiscord<eyecon> Yes, `let`ting it works, ty
19:07:30FromDiscord<eyecon> But is this compiler error expected? Idk
19:07:43FromDiscord<Yardanico> it's not supposed to be a C compiler error, you can create an issue of course
19:08:00FromDiscord<Yardanico> also, as I said if you use arc/orc you must really call `prepareMutation` on `tempStr` before doing stuff like `copyMem`
19:08:22FromDiscord<eyecon> In reply to @Yardanico "also, as I said": Understood
19:08:35FromDiscord<Yardanico> otherwise you'll have fun getting random crashes with SIGBUS/SIGSEGV/etc
19:09:03FromDiscord<Yardanico> because with ARC/ORC strings are CoW so Nim doesn't know that you want to write to a string if you use things like `copyMem` (it inserts `prepareMutation` calls automatically in normal cases where you e.g. just add something to a string)
19:09:25FromDiscord<Yardanico> also yeah, it also won't work because you have to preallocate the string of the specified length before copyMem :)
19:09:32FromDiscord<Yardanico> `var tempStr = newString(testBytes.len)`
19:11:37FromDiscord<eyecon> In reply to @Yardanico "also yeah, it also": That I'm doing in the real case, I'm just overwriting a part
19:11:45FromDiscord<eyecon> That went south when simplifying
19:11:59FromDiscord<eyecon> Didn't really expect it not to compile
19:12:26FromDiscord<Yardanico> well, nim `const`s are inlined in a lot of cases
19:12:39FromDiscord<Yardanico> in this case it inlined `testBytes[0]`
19:13:00FromDiscord<Yardanico> but as I said, you can open an issue on github (if there isn't one already), it should properly throw a compiler error
19:13:39FromDiscord<martinium> Does anyone know a simple way to avoid the too many open files OSError when keeping a file open and writing to it asynchronously?
19:14:25FromDiscord<Yardanico> In reply to @martinium "Does anyone know a": I don't think it should error with that at all if you only have 1 file open, do you happen to use stuff like httpclient in your program?
19:15:16FromDiscord<Yardanico> just asking because you need to call `close` on an httpclient instance (both sync and async) after using them, and nim doesn't warn you if you don't so your program silently leaks FDs and stuff
19:16:13*def- quit (Quit: -)
19:16:53FromDiscord<eyecon> In reply to @Yardanico "but as I said,": https://github.com/nim-lang/Nim/issues/19840
19:18:02FromDiscord<martinium> In reply to @Yardanico "I don't think it": Yeah, I am using the asynchttpclient but in the function that calls the client I do not call close thinking it would just reuse the existing connection.
19:18:04FromDiscord<martinium> let me test
19:18:20FromDiscord<Yardanico> every time you do `let stuff = newAsyncHttpClient()` it creates a new client
19:18:47FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YLE
19:19:50FromDiscord<Elegantbeef> Generic procs need to have been instantiated in native code, so generic procedures themselves cannot but instantiations should be able to be↵(@golova)
19:20:23*def- joined #nim
19:22:02FromDiscord<martinium> In reply to @Yardanico "if you have a": just added client.close to request proc and hit maximum fd error reached
19:22:23FromDiscord<Yardanico> do you maybe do too many requests in a second? like thousands of them
19:22:30FromDiscord<martinium> I do have request function running in a for loop so does that not close them out even with client.close
19:22:56FromDiscord<martinium> I am playing around with the pokemon api 🙂
19:23:15FromDiscord<Yardanico> can you share the code or at least part of it? that would be easier to check
19:23:20FromDiscord<martinium> sent a code paste, see https://play.nim-lang.org/#ix=3YLF
19:23:38FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YLG
19:23:39FromDiscord<Yardanico> when compiling you even get a warning about unreachable code
19:23:41FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=3YLG" => "https://paste.rs/6PI"
19:24:02FromDiscord<martinium> relevant part of for loop:
19:24:10FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YLH
19:24:11FromDiscord<martinium> sent a code paste, see https://paste.rs/rAi
19:24:16FromDiscord<Yardanico> so yeah, as I said, you're not closing the client in your original code since you return before closing
19:24:39FromDiscord<martinium> ah
19:24:56FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YLI
19:24:58FromDiscord<martinium> man, its so obvious too not htat you mention it lmao
19:24:59FromDiscord<Yardanico> since url is always string, and getContent always returns a string, it can just be this
19:25:08FromDiscord<martinium> (edit) "not htat" => "now that"
19:25:47FromDiscord<martinium> I just made it generic in case I decide to reuse the function for other endpoints which may have different data types
19:25:57*def- quit (Quit: -)
19:26:24FromDiscord<commander_c> Anyone know if it's possible to open, write to, and save LibreOffice Writer ODT files in Nim?
19:26:50*def- joined #nim
19:27:02FromDiscord<Yardanico> In reply to @commander_c "Anyone know if it's": there is a pure nim xls(x) writer/reader, but no clue about ODT, let me try to find something
19:27:10FromDiscord<Yardanico> in worst case you can find an existing C/C++ lib that does this and use it
19:28:05FromDiscord<commander_c> Ah cool. I'd try that for sure.
19:28:18FromDiscord<Yardanico> yeah, doesn't look like there's an ODT reader from my brief search
19:28:20FromDiscord<commander_c> Trying to decide between writing HTML and then converting to PDF, or writing LO Writer format somehow.
19:28:35FromDiscord<Yardanico> there must be C/C++ libs that do this for sure
19:28:39FromDiscord<Forest> Anyone able to help me use futhark so i can use `physac` in Nim?
19:28:52FromDiscord<enthus1ast> Depending on the usecase xlsx etc is a zipped folder containing xml files↵(@Yardanico)
19:28:58FromDiscord<Yardanico> i know
19:29:42FromDiscord<Forest> I'm generally just quite confused on how to go about this, since i already have Raylib installed via Naylib so don't wanna have two copies of the library lol
19:30:01FromDiscord<Yardanico> In reply to @Forest "I'm generally just quite": huh?
19:30:10FromDiscord<Yardanico> did you mean to write in #gamedev maybe?
19:30:55FromDiscord<enthus1ast> Sure you wanna use physac?↵(@Forest)
19:31:10FromDiscord<Forest> In reply to @enthus1ast "Sure you wanna use": Yeah
19:31:18FromDiscord<commander_c> @Yardanico I'll try wkhtmltopdf.
19:31:19FromDiscord<martinium> Yardanico, thanks for your help dude. Always helpful 🙂
19:31:26FromDiscord<Forest> In reply to @Yardanico "huh?": I figured this would be better to be asked here since I'm asking for help with Futhark
19:31:30FromDiscord<enthus1ast> It's super limited, you cannot even get collision callbacks
19:31:42FromDiscord<enthus1ast> Better use chipmunks
19:31:45FromDiscord<Forest> No idea what that means lol
19:32:01FromDiscord<Forest> Chipmunk is complicated rip- Idk how to intergrate it with Naylib at all
19:32:02FromDiscord<enthus1ast> You cannot react on a collision
19:32:11FromDiscord<Forest> Aah
19:33:23FromDiscord<enthus1ast> Actually I found chipmunk quite straightforward from nim
19:33:58FromDiscord<Forest> Huh
19:34:17FromDiscord<Forest> Could you give me a bit of advice of just how to generally... Understand it? :P
19:34:57FromDiscord<enthus1ast> Create a world, create bodies in it, set the position of your Sprite to the one of the body
19:35:09FromDiscord<enthus1ast> In your draw
19:35:18FromDiscord<Forest> Aah okay
19:35:23FromDiscord<Forest> Now gotta figure that out lmao
19:35:26FromDiscord<Forest> Doc reading time
19:35:52FromDiscord<enthus1ast> I have some older example code (but useing raylib forever)
19:35:56*jmdaemon joined #nim
19:37:00FromDiscord<enthus1ast> Can check later if you like, but it mainly boils down to what I written above
19:43:10FromDiscord<Forest> In reply to @enthus1ast "I have some older": Oh? That'd be useful aha
19:43:17FromDiscord<Forest> In reply to @enthus1ast "Can check later if": Fair, thanks for the advice!
19:48:50FromDiscord<enthus1ast> Mh yeah I'm looking through the old project, not sure if this is a good example because the physic code is quite splattered all over
19:49:21FromDiscord<enthus1ast> But this is it\: https://github.com/enthus1ast/EoC
19:49:49FromDiscord<retkid> how can I do math operations with the full 64 bit float
19:50:01FromDiscord<retkid> i.e 2.0+ 2.0 == 2.0000000000[nonsense]
19:50:37FromDiscord<enthus1ast> This is a client server multiplayer demo, so the client and the server does some physic
20:03:36FromDiscord<Forest> In reply to @enthus1ast "Mh yeah I'm looking": Lol understandable, but thanks!
20:05:21FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=3YLU
20:05:41FromDiscord<Forest> Also would this just let me do `Vect$` to convert the type? Or can i do `$Vect` too?
20:08:21FromDiscord<justanotherinternetguy> is there any reason why nim is case and underscore insensitive?
20:09:00FromDiscord<Elegantbeef> It's style insensitive not case insensitive
20:09:05FromDiscord<golova> In reply to @justanotherinternetguy "is there any reason": Design choice
20:09:22FromDiscord<Elegantbeef> It's to allow ergonomic usage between libraries without forcing a specific convention on you
20:09:29FromDiscord<justanotherinternetguy> oh i see
20:09:30FromDiscord<justanotherinternetguy> ty
20:09:44FromDiscord<justanotherinternetguy> i was just very confused, coming from languages that are very picky about cases
20:09:47FromDiscord<Elegantbeef> snake vs camel case is not a debate since you can call both without issue in the other
20:09:52FromDiscord<justanotherinternetguy> i see i see
20:09:58FromDiscord<justanotherinternetguy> that makes life much easier
20:10:19FromDiscord<Elegantbeef> I personally like it very much as it applies everywhere including machine wrapped C libraries so you dont need to shout their constnats
20:10:38FromDiscord<Elegantbeef> `glEnable(GL_DEPTH_TEST)` is god awful i prefer my `glEnable(GlDepthTest)` 😛
20:11:34FromDiscord<Andreas> `glEnable GlDepthTest` i'd prefer
20:12:18FromDiscord<Elegantbeef> Heh never thought about the command syntax for it since reading mostly C/C++ code 😄
20:12:38FromDiscord<Andreas> (edit) "prefer" => "prefer, or maybe `gl_Enable Gl_Depth_Test` not sure"
20:17:17FromDiscord<dom96> https://github.com/nim-lang/RFCs/issues/456 👀
20:20:58FromDiscord<!Patitotective> https://github.com/nim-lang/RFCs/issues/456#issuecomment-1114034014 ⬆️
20:25:10NimEventerNew post on r/nim by hc0re: Moving compilation parameters like -d:ssl into the *.nimble project file?, see https://reddit.com/r/nim/comments/uz6z2c/moving_compilation_parameters_like_dssl_into_the/
20:25:17FromDiscord<dom96> ⬆️ indeed. But treat it as an error not a warning :D
20:29:49FromDiscord<enthus1ast> You could also create a `converter`↵(@Forest)
20:30:27FromDiscord<Elegantbeef> Converter + concept
20:30:36FromDiscord<enthus1ast> Yes
20:31:20FromDiscord<Forest> In reply to @enthus1ast "You could also create": What's that? I think i heard of it before but forgot lol
20:31:56FromDiscord<Rika> implicit conversion for types
20:32:14FromDiscord<enthus1ast> And/or I would create a vector etc that you use internally and only store these in your own objects
20:32:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YM2
20:32:25FromDiscord<Elegantbeef> WED
20:32:27FromDiscord<Elegantbeef> QED even
20:32:40FromDiscord<enthus1ast> Then convert to the various other vectors
20:32:52FromDiscord<Rika> WED
20:33:04FromDiscord<Elegantbeef> Dont say that too much rika someone might get married
20:33:26FromDiscord<Forest> In reply to @enthus1ast "And/or I would create": I was thinking of that too aha
20:34:23FromDiscord<enthus1ast> There also is some gls like vector manipulation library for nim but forgot the name
20:34:25FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=3YM4
20:34:55FromDiscord<Forest> eh tbf i don't think i'll be converting between the types much, so should be fine?
20:35:10FromDiscord<Forest> Oh wait i might actually
20:35:15FromDiscord<Forest> rip
20:35:26FromDiscord<Elegantbeef> The concept checks if the type has a `x` and `y` field
20:35:46FromDiscord<Elegantbeef> That converter will implicitly kick in if the type needs to be converted to `Vector2` for a call
20:38:39FromDiscord<Forest> Is `Vec2` a built-in Nim type?
20:38:45FromDiscord<Elegantbeef> No
20:38:51FromDiscord<Forest> ah okay then
20:39:10FromDiscord<Elegantbeef> It's a user defined concept which allows for behaviour like this
20:39:36FromDiscord<enthus1ast> This one\: https://github.com/stavenko/nim-glm
20:39:37FromDiscord<Forest> Ah okay
20:39:46FromDiscord<Forest> In reply to @enthus1ast "This one\: https://github.com/stavenko/nim-glm": ah neat
20:40:01FromDiscord<Forest> eh i shouldn't need it but if i do it shouldn't be too hard to add later
20:41:53FromDiscord<Forest> `converter chipToRay(v:Vect):Vector2 = Vector2(x:v.x, y:v.y)` this line should just work then?
20:43:41FromDiscord<Elegantbeef> Assuming you have the concept i have sure
20:44:08FromDiscord<Forest> I don't understand the concept thing :p
20:44:19FromDiscord<Forest> Since i'm converting between the existing types
20:44:36FromDiscord<Elegantbeef> It goes "hey does this type have a `.x` that is a float32 and does it have a `.y` that is a float32?" if so you can use the converter
20:44:50FromDiscord<Forest> Ah okay
20:45:01FromDiscord<Elegantbeef> Dont say ah okay then in 2 minutes go "i dont understand"
20:45:04FromDiscord<Forest> Might just be better off making my own type for this tbh
20:45:04FromDiscord<Elegantbeef> You did it once already 😄
20:45:22FromDiscord<Forest> Yeah ik, i'm just kinda lost and tinkering with it a bit
20:49:01FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=3YMb
20:49:25FromDiscord<Forest> Is there no difference between object and concept?
20:49:31FromDiscord<Elegantbeef> Yes there is
20:49:38FromDiscord<Forest> Since this worked perfectly
20:49:47FromDiscord<Forest> In reply to @Elegantbeef "Yes there is": What's the diff?
20:49:57FromDiscord<Elegantbeef> Concepts are not concrete types
20:49:57FromDiscord<Elegantbeef> They're constraints
20:50:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YMc
20:50:37FromDiscord<Elegantbeef> Which if you looked at the following types it worked on even types with `a, b, c: int, x, y: float`
20:51:28FromDiscord<Forest> Ooh okay that makes more sense now
20:51:42FromDiscord<Forest> In reply to @Elegantbeef "Which if you looked": So it'd ignore a b and c>
20:51:44FromDiscord<Forest> ?
20:52:01FromDiscord<Forest> yeah that's not what i want then, it should ideally just fail on those conversions
20:52:09FromDiscord<Elegantbeef> It doesnt ignore it, it creates a generic procedure that accepts `MyType` and you only access the `.x` `.y`
20:52:10FromDiscord<Forest> since Vector 3 and 4
20:52:19FromDiscord<Forest> In reply to @Elegantbeef "It doesnt ignore it,": ah okay
20:52:22FromDiscord<Elegantbeef> I'd argue your converters should work on any vector
20:52:32FromDiscord<Forest> Yeah fair
20:52:41FromDiscord<Forest> Will do that now, thanks for the help!
20:53:02FromDiscord<Elegantbeef> The benefit is that it'd work with any vector even ones that arent written yet
20:53:09FromDiscord<Elegantbeef> It's the ultimate code reuse imo
20:54:22FromDiscord<Forest> This works :D
20:54:25FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=3YMf
20:54:31FromDiscord<Elegantbeef> Of course it does
20:54:33FromDiscord<Rika> wow
20:54:47FromDiscord<Elegantbeef> `wow((x: 100, y: 300))` also works
20:55:18FromDiscord<Forest> In reply to @Rika "wow": Coming from Python and Java it looks like magic, no explicit conversion needed-
20:55:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YMg
20:55:45FromDiscord<Forest> huh neat
20:56:03FromDiscord<Elegantbeef> This is the benefit of the concept it gives you a structural match instead of a named match
20:56:05FromDiscord<Forest> How does Nim do so much cool stuff
20:56:19FromDiscord<Forest> And why isn't it more talked about
20:59:02FromDiscord<Phil> ~~Because I'm too busy using said cool stuff~~
20:59:43FromDiscord<Forest> lmao
20:59:58FromDiscord<Phil> And also too busy in screwing myself over by not understanding how nim decides which proc to apply multiple with the same signature are floating around in the same context
21:00:22FromDiscord<Phil> Fixed it now but man that was a bug hunt
21:02:16FromDiscord<Forest> fair, bugs are annoying and the bane of my existence
21:14:46FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3YMn
21:15:00FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3YMn" => "https://play.nim-lang.org/#ix=3YMo"
21:16:08FromDiscord<Elegantbeef> only the pointer of a `ref` is immutable the data is not
21:16:23FromDiscord<Elegantbeef> `result = node` does not copy it points to the same datas
21:16:26FromDiscord<Elegantbeef> data\
21:16:49FromDiscord<Elegantbeef> you need to copy the `node` in the `added` proc
21:17:56FromDiscord<!Patitotective> In reply to @Elegantbeef "you need to copy": how
21:18:55FromDiscord<Elegantbeef> `deepcopy` is one way
21:19:20FromDiscord<Elegantbeef> Alternatively dont use a reference
21:20:17FromDiscord<!Patitotective> i used a reference because JsonNode did lol
21:20:52FromDiscord<Elegantbeef> You dont need a reference for the root node it just makes it a bit faster if you're dynamically joining these
21:26:32FromDiscord<Phil> The entire ref-type/value-type thing gave me such a better understanding between the two. I still don't have a good feeling when the obvious usecase starts for using ref-types, but at least I understand the difference in their behaviour much better now.
21:27:03FromDiscord<Elegantbeef> You only really use ref when you need OOP or pointer lik objects
21:27:30FromDiscord<Phil> Yeah but when do you need OOP?
21:27:52FromDiscord<Elegantbeef> When you need user extensible types that seamlessly work with your own
21:28:07FromDiscord<Elegantbeef> Personally the only time i've used OOP in my own projects is this GUI
21:29:08FromDiscord<Elegantbeef> Speaking of i fixed my layout for most things and.... broke it for something
21:29:12FromDiscord<Elegantbeef> Fuck yea layout logic is fun!
21:30:38FromDiscord<!Patitotective> this looks like an #appdev topic
21:30:53FromDiscord<Elegantbeef> Why appdev
21:30:56FromDiscord<Elegantbeef> It's gamedev
21:31:21FromDiscord<Phil> I'd argue general dev with an example of its application in gamedev
21:31:33FromDiscord<!Patitotective> In reply to @Elegantbeef "Why appdev": its GUI
21:31:39FromDiscord<Elegantbeef> It's game gui
21:31:47FromDiscord<Elegantbeef> It's not anything like any GUI frameworks
21:32:10FromDiscord<Phil> I'd regard appdev is basically "What I would do in angular, but for native"
21:32:13FromDiscord<Rika> Why are you arguing about a transient topic
21:32:15FromDiscord<Phil> I would not build a game in angular
21:32:19FromDiscord<Elegantbeef> If some numpty wants to use my GUI for app development they're fucking dumb
21:32:36FromDiscord<Elegantbeef> Rika dont ask me we have gamedev not appdev, and who's going to tell me what to do!
21:32:53FromDiscord<Phil> In reply to @Elegantbeef "Rika dont ask me": You yourself
21:33:10FromDiscord<Rika> You tell yourself to do things? I just do things
21:34:06FromDiscord<Phil> There are days where it's rainy out and I'm really not feeling the desire to go for sports but do it anyway because I know after the initial 5 minutes of not wanting to I'll be alright with it
21:34:33FromDiscord<Phil> So yeah, sometimes tell yourself to do things 😛
21:34:47FromDiscord<Rika> You don’t tell yourself to do that, you’re deciding to do it nonetheless
21:35:03FromDiscord<!Patitotective> we should rename this channel to _philosophy_
21:54:59FromDiscord<michaelb.eth> is there a cross-platofrm, inexpensive way to check whether a filesystem directory is empty?
21:56:49*PMunch quit (Quit: leaving)
21:56:56FromDiscord<Generic> no idea how expensive this is, but you can try using walkDir from os
21:57:04FromDiscord<Yardanico> maybe https://nim-lang.github.io/Nim/os.html#getFileInfo%2Cstring ?
21:57:49FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3YMz
22:11:16FromDiscord<Rika> doesnt look cursed to me, what would be cursed here?
22:11:24FromDiscord<Rika> oh maybe the else discard is cursed
22:11:51FromDiscord<Rika> ah, also mix of result and implicit return
22:12:02FromDiscord<Rika> though it doesnt matter because its within a when else
22:12:07FromDiscord<Rika> but still, not good
22:13:16FromDiscord<Rika> hmm, okay its kinda starting to make sense why youd ask if this is cursed
22:13:40FromDiscord<Rika> why is the body of the case when pseq and val isnot string duplicated
22:15:14FromDiscord<huantian> I'd probably get rid of the `result =` and just use `default(result)`
22:15:22FromDiscord<huantian> if that works lol
22:16:22FromDiscord<Yardanico> huh? what would that do
22:16:30FromDiscord<Rika> result is default... by default
22:17:03FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YMB
22:17:04FromDiscord<Rika> contains cant return anything else but a bool anyway
22:17:46FromDiscord<Rika> actually perhaps you could fudge it with a return T and a T -> bool converter but thats fucked
22:19:46FromDiscord<Elegantbeef> I'd probably just use two different procedures
22:19:47FromDiscord<Elegantbeef> `proc contains(node: PrefNodes, val: string)` and the present one
22:20:01FromDiscord<Yardanico> yeah i had a thought about that too
22:20:48FromDiscord<michaelb.eth> In reply to @Generic "no idea how expensive": nice, thanks, turned out to be quite feasible that way
22:21:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YMC
22:21:04FromDiscord<Elegantbeef> The way it's meant to be 😛
22:21:27*ltriant joined #nim
22:23:21*rockcavera quit (Remote host closed the connection)
22:24:09FromDiscord<Rika> except the single line proc thats cursed
22:24:31FromDiscord<Elegantbeef> Best not be insulting single line procs
22:25:25FromDiscord<Elegantbeef> The real cursed thing is converting a string to a Pnode to check if it contains it
22:34:41*ltriant quit (Ping timeout: 255 seconds)
22:36:55*jjido joined #nim
22:47:17*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:54:43FromDiscord<demotomohiro> I tried to explain the difference bitween object types and ref object types: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
22:56:19FromDiscord<Yardanico> @demotomohiro "Parent reference type can refer inherit type" not sure what this means
22:56:25FromDiscord<Yardanico> object inheritance works with both object/ref object
22:59:04FromDiscord<demotomohiro> If type B inherits type A, var a:A can refer B if they are ref type.
23:00:57FromDiscord<Yardanico> oh, yeah, but it's better to change the wording of this I feel
23:01:24FromDiscord<demotomohiro> If you do `var b = B(); a: A = b` and A and B were `object` type, only a part of B is copied to a.
23:07:38FromDiscord<demotomohiro> "Type `A` variable can refer any objects that inherits type `A` if `A` is ref type."↵Is this better?
23:08:31FromDiscord<Yardanico> In reply to @demotomohiro ""Type `A` variable can": "A variable of a type `A` can contain any other objects as long as they inherit from `A` if `A` is a ref type"
23:08:35FromDiscord<Yardanico> maybe something like this?
23:09:03FromDiscord<Yardanico> (edit) "any other objects" => "an object of another type" | "they inherit" => "it inherits" | "as long asit inheritsfrom ... `A`" added ""
23:10:06FromDiscord<demotomohiro> It looks better. Thank you!
23:10:07FromDiscord<Elegantbeef> "When A is a inheritable reference object, a variable or field of the base type can point to a child type due to the fact they're heap allocated and can be dynamically sized"
23:11:06FromDiscord<Yardanico> 👺
23:11:33FromDiscord<Rika> In reply to @Elegantbeef ""When A is a": Is this a serious suggestion or a joke I can’t tell
23:11:47FromDiscord<Elegantbeef> Why not both
23:11:48FromDiscord<Yardanico> In reply to @Rika "Is this a serious": i mean he explained it even better than I did, just a bit more wordy
23:12:16FromDiscord<Yardanico> the "due to the fact they're heap allocated and can be dynamically sized" isn't really needed unless you want the readers to know the internal details
23:12:43FromDiscord<Rika> Not sure if beginners would understand that honestly
23:12:52FromDiscord<Elegantbeef> Probably not
23:13:11FromDiscord<Elegantbeef> I started rotting my brain and writing shitty explanations of generics last night
23:13:20FromDiscord<Elegantbeef> Worlds shittiest start of a generic writeup
23:13:39FromDiscord<demotomohiro> I will use what @Yardanico told.
23:17:11FromDiscord<Andreas> In reply to @Elegantbeef "Worlds shittiest start of": let me proof read it - if i my tiny brain can make sense of it - it might be good enough for newbies.
23:17:51FromDiscord<Elegantbeef> Eh it's nowhere near done
23:20:30FromDiscord<Andreas> In reply to @Elegantbeef "Eh it's nowhere near": most things are WIP - funny Yardanico explained this mornin to me that `owned` - which i use - is already kind of deprecated 😉 but `threading/smartptr` are already around - so many things in-flight or WIP
23:32:42FromDiscord<Elegantbeef> Yea i know that but I intend on rewriting it all pretty much
23:44:02FromDiscord<Andreas> In reply to @Elegantbeef "Yea i know that": 'rewriting it all' beeing what ?
23:44:17FromDiscord<Andreas> (edit) "beeing" => "meaning"
23:46:13*ltriant joined #nim
23:47:46FromDiscord<Elegantbeef> I intend on pretty much scraping it and starting from the start, wrote it when i was tired so it doesnt have my typical charm
23:50:28FromDiscord<Elegantbeef> It's as dry as a cracker sitting out in the Sahara
23:51:11FromDiscord<!Patitotective> In reply to @Rika "why is the body": if you pass a string and its of kind `PObject` its a key↵otherwise its an element of a `PSeq`
23:53:06FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3YMK
23:55:40FromDiscord<Rika> He got it backwards
23:55:43FromDiscord<Elegantbeef> You'd forward declare it
23:55:48FromDiscord<Elegantbeef> Or yea