<< 28-02-2022 >>

00:00:18*tk quit (Quit: Well, this is unexpected.)
00:00:44*tk joined #nim
00:04:26FromDiscord<abdu> sent a code paste, see https://play.nim-lang.org/#ix=3QXp
00:08:33FromDiscord<ynfle> In reply to @Elegantbeef "<@767093711112241162>\: https://play.nim-lang.org/#": Rookie mistake. I don't hinki've ever used inheritance in nim
00:08:44FromDiscord<ynfle> (edit) "hinki've" => "think I've"
00:13:17FromDiscord<Elegantbeef> Nim doesnt have goto
00:13:17FromDiscord<Elegantbeef> There are while loops, named blocks, and for loops, goto is generaly unneeded
00:13:34NimEventerNew thread by Mardiyah: Performing goto in Nim , see https://forum.nim-lang.org/t/8963
00:14:32FromDiscord<ynfle> What is with peple quickly posting the same question on mutiple platform?
00:15:11FromDiscord<huantian> it's actually just this one person
00:15:34FromDiscord<huantian> at least I think it is
00:15:45FromDiscord<Elegantbeef> Cause fuck me i guess
00:16:14FromDiscord<Elegantbeef> It's this person a lot
00:16:18FromDiscord<Elegantbeef> They go here SO and the forum
00:16:27FromDiscord<Elegantbeef> They get their answer here but dont trust me i guess
00:17:44*Gustavo6046_ joined #nim
00:17:45nrds<Prestige99> Lol
00:18:36FromDiscord<Elegantbeef> And if you ping them they dont come back
00:19:48FromDiscord<creikey> In reply to @Elegantbeef "Cause fuck me i": I gotta say you're in like the top 3 people for answering technical questions I've ever seen over the internet
00:19:56FromDiscord<creikey> It's kinda nuts
00:19:59*Gustavo6046 quit (Ping timeout: 256 seconds)
00:20:46FromDiscord<Elegantbeef> Hey i'm kinda nuts!
00:21:40*Gustavo6046 joined #nim
00:23:02*Gustavo6046_ quit (Ping timeout: 240 seconds)
00:23:40FromDiscord<ynfle> In reply to @Elegantbeef "Hey i'm kinda nuts!": Canadian
00:23:55FromDiscord<Elegantbeef> No i'm very Canadian
00:27:41FromDiscord<ynfle> I hear man
00:28:21FromDiscord<Elegantbeef> You hear man
00:29:50FromDiscord<ynfle> Does being very Canadian make one kinda nuts?
00:30:26FromDiscord<Elegantbeef> Perhaps
00:46:52FromDiscord<Patitotective> In reply to @Elegantbeef "They get their answer": i confirm lmao
01:27:23FromDiscord<Elegantbeef> @Patitotective\: why no trust me
01:29:01FromDiscord<Patitotective> In reply to @Elegantbeef "<@762008715162419261>\: why no trust": you pay more attention to the answers in the forum than here in discord, then when you understand the answer in the forum you reread your message and realize you were right
01:29:45FromDiscord<Patitotective> also you should have a role like _trust me_
01:30:04FromDiscord<Patitotective> like veteran and active members should have it
01:30:12FromDiscord<Patitotective> (edit) "and" => "and"
01:37:28FromDiscord<huantian> you should have to take a quiz on nim to get the role 😛
01:38:38FromDiscord<ynfle> In reply to @huantian "you should have to": Fix 10 compiler bugs
01:40:30FromDiscord<Elegantbeef> have i even fixed 10 bugs?!
01:41:58FromDiscord<huantian> we could also have a role for introducing 10 compiler bugs
01:42:18FromDiscord<ynfle> In reply to @Elegantbeef "have i even fixed": Yup https://github.com/nim-lang/Nim/commits?author=beef331
01:45:55FromDiscord<Elegantbeef> damn thats more than i remember
01:48:32FromDiscord<Patitotective> for contributions too
01:49:02FromDiscord<ynfle> I counted more than 10 bug fixes
01:49:06FromDiscord<abdu> In reply to @Elegantbeef "There are while loops,": how to do symbol named block: then
01:49:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QXK
01:49:36FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3QXL
01:49:51FromDiscord<Elegantbeef> Gotos just introduce bad flow control, that's hard to reason
01:50:10FromDiscord<Elegantbeef> procedures and templates are just nicer to reason
01:51:38*vicecea quit (Remote host closed the connection)
01:52:45*vicecea joined #nim
01:58:09FromDiscord<demotomohiro> Nim has block statement with name and you can exit the block with `break <block name>`.↵https://nim-lang.org/docs/manual.html#statements-and-expressions-block-statement
02:02:06FromDiscord<demotomohiro> Long time ago, people wrote code with many goto and that result in hard to read code. People called it spageti code. Then C and other programming language introduced structual programming so that people can write code without using goto.
02:55:17*neurocyte0917090 quit (Ping timeout: 252 seconds)
03:16:18*arkurious quit (Quit: Leaving)
03:16:43FromDiscord<sOkam!> In reply to @sOkam! "When you create a": Any pointers on to what to read or test to understand this?
03:17:39FromDiscord<Elegantbeef> what's a C static function?
03:20:25FromDiscord<sOkam!> In reply to @Elegantbeef "what's a C static": afaik (unless I misunderstood), static is a function that can only be used in the same file that is declared. something like cpp private (ish)↵so they don't need to appear in header files, since they are only called in functions lower in the same file where they are defined/declared
03:22:06FromDiscord<Elegantbeef> So then that answers your question no?
03:22:39FromDiscord<sOkam!> In reply to @Elegantbeef "So then that answers": If it does, I don't know how it works
03:23:05FromDiscord<sOkam!> They don't appear in headers, but... what happens to them when the project is binded?
03:24:00FromDiscord<Elegantbeef> Eh i dont know C enough, but I'd reason that static functions arent a concern to Nim, i could be wrong
03:24:17FromDiscord<Elegantbeef> You cannot make code that calls a static function if you expose code enough
03:24:21FromDiscord<sOkam!> I guess the misunderstanding comes from not knowing how the C code is actually accessed in a binding
03:24:25FromDiscord<Elegantbeef> expose code properly\
03:26:33FromDiscord<sOkam!> In reply to @Elegantbeef "Eh i dont know": They might not be, I just don't know. Asking just to understand how they work 🤷‍♂️
03:32:38FromDiscord<Elegantbeef> Well you have your `extern`'d procedures you call
03:37:18FromDiscord<sOkam!> sent a long message, see http://ix.io/3QXZ
03:37:22FromDiscord<demotomohiro> static functions or variables in C is only used in the .c file it declared and other .c file or Nim doesnt need to care.
03:38:58FromDiscord<Elegantbeef> Well they just limit you to calling the procedure from it's object file
03:38:59FromDiscord<Elegantbeef> So when talking about libraries they're 100% useless
03:39:00FromDiscord<Elegantbeef> It's more for writing pure C afaict
03:39:01FromDiscord<demotomohiro> Binding only need to declare C functions Nim directly uses.
03:39:45FromDiscord<sOkam!> how does the compiler then know how to compile the C code that's not binded?
03:40:19FromDiscord<sOkam!> as you can see, i understand nothing about compilers 👶
03:40:35FromDiscord<sOkam!> (edit) "how does the ... compiler" added "Nim"
03:43:22FromDiscord<Elegantbeef> When does Nim compiler C code that's not binded?
03:44:00FromDiscord<Elegantbeef> the way you use C is either with a `compile` statement in code, as an external library or with `{.emit.}`, static only matters in the first and last cases
03:44:04FromDiscord<demotomohiro> Header file or bindings just tells compiler that there are C functions in other .c code. You need to compile and link the .c file containing the C functions you use. Linker takes all compiled .c file (.o or .obj files) and links function calls and called functions in different file.
03:45:08FromDiscord<Elegantbeef> Headers are just for exposed code afterall, and since statics are unexposable.... there is no reason to care about static functions
03:45:24FromDiscord<sOkam!> I see
04:06:01*supakeen quit (Quit: WeeChat 3.4)
04:06:31*supakeen joined #nim
04:26:08nrds<Prestige99> Is it possible to have a proc `foo+=` that works without having do to `foo+=`(someValue) to invoke it?
04:27:28FromDiscord<Elegantbeef> What do you mean? `+=` that doesnt need `foo`
04:28:09nrds<Prestige99> like I want to be able to do myThing.foo += 5
04:28:31nrds<Prestige99> where `foo+=` is a proc
04:28:32FromDiscord<Elegantbeef> and `foo` doesnt exist?
04:28:38nrds<Prestige99> Yeah
04:29:08FromDiscord<Elegantbeef> Uhh aside from making `foo` a macro i dont think so
04:29:18nrds<Prestige99> hm okay
04:29:37FromDiscord<Elegantbeef> What're you trying to do overall if I may know?
04:31:08nrds<Prestige99> I have a Camera that has two separate variables for zoom, zoomX and zoomY - I want to be able to just do camera.zoom += 1.4 or whatever
04:31:21nrds<Prestige99> but I have to do `zoom+=`(camera, 1.4)
04:31:49FromDiscord<Elegantbeef> `camera.zoomIn(1.4)` 😛
04:31:58nrds<Prestige99> meh
04:32:33nrds<Prestige99> Just annoying because I prefer operator overloading, but it only sort of works
04:35:23FromDiscord<Elegantbeef> Well you could do `camera.zoom = Zoom 1.4` where ` = Zoom` is an additive operation
04:35:31FromDiscord<Elegantbeef> But yea not that nice
04:38:19NimEventerNew post on r/nim by truggyguhh: NimSkull - A reimagining of Nim, see https://reddit.com/r/nim/comments/t36zqe/nimskull_a_reimagining_of_nim/
04:39:47FromDiscord<retkid> alright just to make sure i got this
04:39:57FromDiscord<retkid> there is no sane way use nimpy
04:40:02FromDiscord<retkid> (edit) "there is no sane way use nimpy ... " added "for local files"
04:41:18FromDiscord<Elegantbeef> No clue
04:42:06FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/947715260641603664/unknown.png
04:42:14FromDiscord<retkid> because while this certainly is code
04:42:29madpropsso nimskull is nim with a code of conduct lmao
04:43:01FromDiscord<Elegantbeef> And progressing to an actual spec
04:44:07FromDiscord<retkid> is nimskull kinda like common-lisp to lisp?
04:44:09FromDiscord<retkid> what is this
04:44:28FromDiscord<retkid> yea seems like it
04:45:05FromDiscord<retkid> > standard library, package management, and more had an acceptable trajectory.↵jeez, cat claws
04:45:44FromDiscord<retkid> i wonder if this will go anywhere.
04:46:14FromDiscord<Elegantbeef> No clue
04:47:06FromDiscord<retkid> There is no specifics here.
04:47:30FromDiscord<retkid> we believe that an element of the vision was lost.↵What was lost? Where? When? What wen't wrong?
04:48:08FromDiscord<Elegantbeef> The language has a bunch of cruft and the compiler is full of tech debt is what they'd probably say
04:48:30FromDiscord<Elegantbeef> Dont know why it's suddenly getting talked about more, it's a few members working on a fork attempting to make the compiler 'better'
04:49:10FromDiscord<retkid> its a small community, word echoes
04:50:30FromDiscord<retkid> O'
04:51:01FromDiscord<retkid> I'm quite confident this will go nowhere seeing as how they have no solid design goals apart from disliking the higher-up maintainers of nim
04:51:50FromDiscord<Elegantbeef> You say that like they dont have a plan
04:52:22FromDiscord<retkid> they have a plan but in order to complete a giant undertaking you need a lot of ambition and good reasons
04:53:26FromDiscord<Rika> In reply to @retkid "I'm quite confident this": ...have you read the thing
04:53:29FromDiscord<Bloss> I don't get it, are they making changes that wouldn't be accepted in Nim?
04:53:57FromDiscord<Elegantbeef> "Establish a spec" is their prime directive
04:54:08FromDiscord<retkid> In reply to @Rika "...have you read the": I literally just read the entire documentation on their wip spec and the only things mentioned are different ways of submitting code and refactoring in the compiler
04:54:26FromDiscord<Rika> im not sure what you expected then, do you think nim has those?
04:54:35FromDiscord<Bloss> Nim getting "cancelled" would not be nice for me
04:54:54FromDiscord<Bloss> The first thing I thought of is the CoffeeScript forks
04:55:00FromDiscord<Rika> In reply to @blans "Nim getting "cancelled" would": doubt it would happen
04:55:00FromDiscord<retkid> In reply to @Rika "im not sure what": No, it doesn't but, you can change that without making a separate language
04:55:03FromDiscord<Rika> its already a fracture
04:55:10FromDiscord<retkid> In reply to @blans "The first thing I": those exist?
04:55:16FromDiscord<Rika> In reply to @retkid "No, it doesn't but,": do you think they havent tried
04:55:39FromDiscord<Rika> of course no one wants to make this fork happen
04:55:47FromDiscord<Bloss> Did they propose changes and they were rejected?
04:56:13FromDiscord<retkid> In reply to @Rika "its already a fracture": seems less like a fracture and more like a splinter
04:56:15FromDiscord<Bloss> CoffeeScript had like 10 forks all going in different directions and the language died hard
04:56:26FromDiscord<retkid> ah so thats how it died?
04:56:28FromDiscord<Rika> In reply to @retkid "seems less like a": i dont care what you call it, it is whatever you want to call it
04:56:31FromDiscord<Elegantbeef> And they think they have good reasons, so i dont see the issue 😛
04:57:01FromDiscord<Rika> im not sure why you're bashing it that hard in the first place
04:57:31FromDiscord<Bloss> I'm just not seeing the conflict of interesst
04:57:33FromDiscord<retkid> it seems pretty melodramatic to me
04:57:41FromDiscord<Elegantbeef> Yes they are making possible breaking changes
04:57:48FromDiscord<Elegantbeef> It will be it's own language eventually, but takes time to make things
04:58:17FromDiscord<retkid> ~~Nim with brackets would be neat ~~
04:58:23FromDiscord<Rika> In reply to @retkid "it seems pretty melodramatic": im not sure if you've even seen what's happened then
04:58:32FromDiscord<Rika> In reply to @blans "I'm just not seeing": perhaps you have not been here for long enough
04:58:33nrds<Prestige99> I agree about brackets tbh
04:58:36FromDiscord<ElegantBeef> Matrix bridge is having a time
04:58:41FromDiscord<Elegantbeef> Uhoh matrix slow down again
04:59:06FromDiscord<sOkam!> as long as you don't force the use of brackets
04:59:08FromDiscord<retkid> I want the option to have brackets. I like the languages that can do both
04:59:10FromDiscord<sOkam!> because that'
04:59:15FromDiscord<Rika> In reply to @retkid "I want the option": it existed before
04:59:21FromDiscord<ElegantBeef> Languages that do both are more tedious to maintain
04:59:25FromDiscord<Rika> removed because no one maintained/wanted to maintain it
04:59:30FromDiscord<Bloss> Scala
04:59:43FromDiscord<Rika> In reply to @blans "Scala": that does not change what beef stated
04:59:48FromDiscord<Rika> it is still more tedious to maintain
04:59:49FromDiscord<retkid> In reply to @Rika "im not sure if": I haven't where can i find the dramaposting
04:59:59FromDiscord<retkid> is it on the forum in december?
05:00:02FromDiscord<Rika> In reply to @retkid "I haven't where can": a lot of it is in issues and the older logs here
05:00:08FromDiscord<sOkam!> (edit) "that'" => "that's one of the biggest selling points of nim for me, that you are not forced to use them and make your code hard to read (its harder for me, for whatever reason, and thats a big one in my opinion)"
05:00:14FromDiscord<Rika> the forum is relatively new i believe
05:00:27FromDiscord<Rika> i mean the drama there is kinda new somewhat
05:00:35FromDiscord<Bloss> One thing I will say is the Nim dev team should be bigger
05:01:12FromDiscord<ElegantBeef> We all agree there should be hundreds of core devs, would make it so less tech debt exists
05:01:14FromDiscord<retkid> that is easier said then done?
05:01:24FromDiscord<Rika> of course
05:01:45FromDiscord<Bloss> I mean these guys are already kind of showing they have what it takes
05:01:49FromDiscord<retkid> we could all be core devs but how much of us actually wanna sit down and comb through the code beyond solving unexpected outputs in a module
05:02:00FromDiscord<ElegantBeef> I dont mind
05:02:02FromDiscord<Rika> In reply to @blans "I mean these guys": now how many people are working on scala
05:02:07FromDiscord<ElegantBeef> Compiler dev is fun!
05:02:27FromDiscord<Rika> i prolly wouldnt mind if i wanted to program recently but i dont
05:03:01FromDiscord<retkid> For me, I dont ever not want to code, sometimes I dont wanna think
05:03:02FromDiscord<retkid> lmao
05:03:25FromDiscord<retkid> In reply to @retkid "For me, I dont": English 100
05:03:29FromDiscord<Rika> half of me wants to code the other half wishes i could do things twice as fast
05:03:42FromDiscord<Rika> double negative
05:03:45FromDiscord<retkid> yea
05:03:47FromDiscord<Rika> do you want to code or not
05:03:54FromDiscord<retkid> im upset at my double negative
05:03:56FromDiscord<ElegantBeef> Eitherway I dont see the point of judging whether nimskull devs work on it, if it succeeds will be down to them
05:04:03FromDiscord<retkid> but I've decided not to edit here because of the IRC users
05:04:22FromDiscord<Bloss> I would really like it if there was a convergence because I don't think Nim would survive a fracture
05:04:54FromDiscord<retkid> Well, on the other hand, where do we go if Nim dies? Theres no language quite like it
05:04:57FromDiscord<retkid> Rust? eh
05:05:05FromDiscord<Rika> In reply to @blans "I would really like": that would need agreement between the 2nd and 1st team
05:05:05FromDiscord<ElegantBeef> How does Nim die?
05:05:11FromDiscord<retkid> In reply to @ElegantBeef "How does Nim die?": It doesn't
05:05:12FromDiscord<Rika> feel free to try to mediate it
05:05:23FromDiscord<Bloss> No libraries
05:05:24FromDiscord<Rika> In reply to @retkid "Rust? eh": ada :OMEGALUL:
05:05:27FromDiscord<ElegantBeef> It's an OSS langauge it cannot die, people still write pascal
05:05:38FromDiscord<ElegantBeef> "No libraries" how does that happen, does C also die?
05:05:55FromDiscord<Bloss> Like part of using Nim now is investing in the fact that it will be better later
05:06:05FromDiscord<retkid> In reply to @blans "No libraries": We've dealt with that for 10 years, why do you think every library is written by @treeform
05:06:27FromDiscord<Bloss> If that goes away and also nothing is getting updated the reason to use it diminishes
05:06:31FromDiscord<Bloss> If not it just gets worse to use
05:06:52FromDiscord<Bloss> C might not get updates but compilers constantly do
05:07:03FromDiscord<ElegantBeef> How does it get worst to use?
05:07:17FromDiscord<Bloss> I mean it feels worse
05:07:24FromDiscord<retkid> If nim dies I will do all my programming in J
05:07:56FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/947721764232888350/sl14.png
05:07:58FromDiscord<Rika> if nim dies i will program in apl
05:08:09FromDiscord<ElegantBeef> If Nim dies, i'll still write Nim
05:08:18FromDiscord<Bloss> Perl kinda died
05:08:27FromDiscord<Rika> not really
05:08:37FromDiscord<Bloss> Just a little bit maybe
05:08:37*sagax quit (Quit: Konversation terminated!)
05:08:56FromDiscord<Bloss> It's used less now and that's not necessarily because there's better alternatives
05:09:14FromDiscord<ElegantBeef> To me the simple fact is languages dont just up and die
05:09:30FromDiscord<sOkam!> In reply to @ElegantBeef "If Nim dies, i'll": +100
05:09:40FromDiscord<retkid> whats that one language that completely fractured and died
05:09:40FromDiscord<ElegantBeef> There are dialects of even relatively unpopular languages that people still write today
05:09:44FromDiscord<retkid> its like perl but not
05:09:50FromDiscord<Rika> python /s
05:09:59FromDiscord<ElegantBeef> In reply to @Rika "python /s": We could only hope
05:10:01FromDiscord<retkid> it has like 9 version and one of them has a butterfly
05:10:01FromDiscord<Rika> crystal?
05:10:04FromDiscord<Rika> oh raku
05:10:07FromDiscord<retkid> RAKU
05:10:16FromDiscord<Rika> the fucking butterfly man
05:10:18FromDiscord<Bloss> I just want Nim with Java ecosystem
05:10:36FromDiscord<retkid> > Nim↵with↵> Java
05:10:39FromDiscord<retkid> ??????
05:10:41FromDiscord<ElegantBeef> <https://github.com/search?q=language%3Araku> ded language
05:10:45FromDiscord<Rika> go write a jvm backend then 😛
05:11:05FromDiscord<retkid> I've done Nim - Java interop but it didn't work for some reason
05:11:07FromDiscord<ElegantBeef> Or just write kotlin and cry
05:11:14FromDiscord<Rika> coat lean
05:11:14*slowButPresent quit (Quit: leaving)
05:11:23FromDiscord<retkid> In reply to @retkid "I've done Nim -": nobody here could figure it out
05:11:28FromDiscord<retkid> and I couldn't either
05:11:28FromDiscord<ElegantBeef> JNI is hell that's why
05:11:30FromDiscord<retkid> some weird segfault
05:11:49FromDiscord<retkid> In reply to @ElegantBeef "JNI is hell that's": lol I just wanted the nim sever to run separately from JNI and get around that hell
05:11:55FromDiscord<retkid> but it couldn't even do that
05:12:10FromDiscord<ElegantBeef> It should work so i blame you
05:12:25FromDiscord<retkid> it was going to just do complex math on nim and send it back
05:12:35FromDiscord<retkid> so it wouldn't hold up the game
05:12:53FromDiscord<Rika> no one with the nim jvm backend?
05:12:55FromDiscord<retkid> now you guys wanna see something cool
05:12:58FromDiscord<retkid> https://github.com/carp-lang/Carp
05:13:16FromDiscord<Rika> i dont give a carp bro wtf
05:13:17FromDiscord<ElegantBeef> YALD
05:13:34FromDiscord<retkid> carp is a lisp with no gc
05:13:37FromDiscord<ElegantBeef> Yet Another Lisp Dialect
05:13:38FromDiscord<retkid> lisp system lang
05:14:03FromDiscord<retkid> https://github.com/pperle/yald
05:14:09FromDiscord<Bloss> I don't think you can add new backends without forking
05:14:23FromDiscord<ElegantBeef> You can add new backend if you make a PR probably
05:14:31FromDiscord<retkid> In reply to @blans "I don't think you": ofc, you gotta merge it upstream
05:14:34FromDiscord<ElegantBeef> But a Java backend would be tremendously hard
05:14:47FromDiscord<Rika> its a jvm backend not a java backend
05:14:52FromDiscord<Rika> subtle difference
05:14:58FromDiscord<retkid> its a backend that runs on jvm
05:14:58FromDiscord<ElegantBeef> I suppose
05:15:06FromDiscord<retkid> which probably isn't as hard
05:15:18FromDiscord<Rika> still hard tho
05:15:19FromDiscord<retkid> but is almost certainly very annoying
05:15:22FromDiscord<ElegantBeef> We'd finally be able to run Nim on 8000trillion devices
05:15:23FromDiscord<Rika> not as hard as a java backend
05:15:32FromDiscord<Bloss> It's not like JS because you need a class file for each type
05:15:47FromDiscord<retkid> uh
05:15:47FromDiscord<Rika> idk how the jvm works so yes ill agree
05:15:49FromDiscord<ElegantBeef> Well there's also the issue that Nim has user defined object and java doesnt
05:15:54FromDiscord<Rika> erlang vm backend when
05:16:05FromDiscord<Rika> im sorry these are some cursed suggestions
05:16:07FromDiscord<retkid> In reply to @Rika "idk how the jvm": in the .jar every class is a separate file and they reference each other
05:16:24FromDiscord<retkid> jvm is a mes
05:16:26FromDiscord<retkid> (edit) "mes" => "mess"
05:16:28FromDiscord<retkid> but its fine
05:16:44FromDiscord<Rika> nah its coarse
05:17:00FromDiscord<ElegantBeef> Rika going for the low brow jokes today
05:17:06FromDiscord<retkid> jvm is a perforated coarse language
05:17:18FromDiscord<retkid> not a lang, dont care
05:17:25FromDiscord<retkid> i need to focus on rewriting this code
05:19:33FromDiscord<lantos> rika is on like 24/7
05:19:42*vicfred joined #nim
05:19:43FromDiscord<ElegantBeef> Yea dont look at me
05:19:49FromDiscord<lantos> haha
05:20:41FromDiscord<lantos> actually is a GLM
05:21:32FromDiscord<ElegantBeef> "glm"
05:21:36FromDiscord<ElegantBeef> The fuck is a GLM
05:21:50FromDiscord<huantian> Good Luck Mate
05:21:52FromDiscord<lantos> general language model
05:22:31FromDiscord<Rika> me and beef are one and the same project, just differing models
05:22:37FromDiscord<Rika> thats also why we're online at different times
05:22:47FromDiscord<lantos> training off each other?
05:23:27FromDiscord<Rika> of course
05:23:30FromDiscord<Rika> of coarse
05:23:49FromDiscord<haxscramper> In reply to @retkid "There is no specifics": Specifics would look like a blame game, so we decided to keep it a bit more ambiguous instead of dumping page-long lost complaints and nitpicking on everything we don't like
05:24:16FromDiscord<haxscramper> (edit) "lost" => "list"
05:25:04FromDiscord<huantian> Oh huh nimskull reddit post
05:25:19FromDiscord<huantian> Anything new for the project or just getting the word out
05:25:30FromDiscord<ElegantBeef> Someone farming internet points
05:25:34FromDiscord<Bloss> Ambiguity just makes it incomprehensible though
05:25:45FromDiscord<huantian> In reply to @ElegantBeef "Someone farming internet points": Ah I see
05:25:49FromDiscord<Bloss> But it looks like you guys didn't want it to be seen
05:26:03FromDiscord<haxscramper> In reply to @blans "Ambiguity just makes it": There is a very unambiguous plan and list of issues that we made that we need to solve
05:26:13FromDiscord<lantos> elegantly starting beef
05:26:18FromDiscord<huantian> Also it seems as if Beef has leveled up to human status and is no longer a bot
05:26:25FromDiscord<retkid> In reply to @haxscramper "Specifics would look like": yes but if you actually gave me the end user idea changes wouldn't that help me want to support you more?
05:26:30FromDiscord<Elegantbeef> Is matrix still slow, this is test
05:26:36FromDiscord<Elegantbeef> Ah i can return to bot
05:26:51FromDiscord<lantos> pass me the butter
05:27:09FromDiscord<Elegantbeef> get your own fucking butter you lazy asshole
05:27:14FromDiscord<retkid> In reply to @lantos "pass me the butter": https://tenor.com/view/rick-and-morty-rick-morty-breakfast-robot-gif-5161060
05:27:29FromDiscord<Rika> haha butt
05:27:34FromDiscord<Bloss> I like issues being solved but not knowing why there's a fracture just leaves a bitter taste
05:27:50FromDiscord<haxscramper> In reply to @retkid "yes but if you": "end user idea" is a a"near-term development" roadmap as well as progress roadmap
05:28:50FromDiscord<lantos> elegant beef is a helpful agent that can elegantly formulate arguments and ideas. Occasionally starts beef out of no where but does so elegantly.↵↵human: pass me the butter
05:29:07FromDiscord<Bloss> I guess knowing why would also leave a bitter taste but it sucks regardless
05:29:21FromDiscord<Bloss> I don't think it's you guys' fault
05:29:51FromDiscord<haxscramper> In reply to @blans "I like issues being": Ok, the fracture is here because we learned the hard way mainline does not care about refactoring the compiler, having a proper specification, providing quality error message, focusing on tooling (yeah, IC for nimsuggest and then there are ~30 commits for half a year from Araq), documentation generator is also broken, compiler codebase is absolutely undocumented
05:30:08FromDiscord<retkid> In reply to @haxscramper ""end user idea" is": Yes but almost none of those are language philosophy changes that cant be merged with the current idea of nim.
05:30:24FromDiscord<retkid> apart from the compiler section
05:30:38FromDiscord<haxscramper> The state of error messages from Araq is "I don't care", and recently "ok I give up and accept I don't like rust error style, PRs are welcome"
05:31:09FromDiscord<retkid> Then PR it, I too hate the giant meaningless error messages for when my types are slightly wrong
05:31:22FromDiscord<retkid> but, it doesn't seem like it cant be merged
05:31:57FromDiscord<retkid> maybe im ignorant, who knows
05:33:29FromDiscord<haxscramper> Ok, but there is a minor detail - "then PR It" is a half year worth of work, and around 20k+ lines added, and touches every single part of compiler
05:33:46FromDiscord<haxscramper> And also requires changing testament, because right now we don't test data
05:33:55FromDiscord<haxscramper> Right now we test pretty printed garbage
05:34:10FromDiscord<haxscramper> So any improvements to errors would require people to change dozens of tests
05:35:15FromDiscord<retkid> if ocaml can get multi threading, anything can happen
05:35:40FromDiscord<Rika> delegated to nim 2.0 kinda thing prolly
05:35:52FromDiscord<Rika> i can imagine nimskull somewhat merging with nim 2.0 if ever
05:37:00FromDiscord<Rika> its not gonna be nice, nim shouldnt have done the "every breaking change is on the next major version and who knows then that comes out" kinda deal
05:37:09FromDiscord<Rika> leads to pythonesque scenarios
05:37:25FromDiscord<huantian> I mean id love nimskull to be merged but I mean at a certain point Id just like it done somewhere
05:38:44FromDiscord<retkid> In reply to @Rika "its not gonna be": its called the python 3 technique and has NEVER gone wrong EVER
05:39:01FromDiscord<Rika> In reply to @Rika "leads to pythonesque scenarios": see
05:39:23FromDiscord<retkid> i read that and I thought i had something to do with fire
05:39:28FromDiscord<retkid> python became pyro
05:39:30FromDiscord<Rika> pythonembre
05:39:31FromDiscord<Rika> (edit) "pythonembre" => "pythonember"
05:39:39FromDiscord<retkid> Yea honestly
05:39:45FromDiscord<huantian> Also id be fine with more breaking changes but maybe that’s cus I dont have much Nim to maintain rn
05:39:46FromDiscord<lantos> pyroember
05:39:52FromDiscord<retkid> kinda not looking forward for 2.0 because It'll be really overwhelming
05:40:05FromDiscord<retkid> I'd rather not have all the changes dumped upon me
05:40:12FromDiscord<Rika> of course
05:40:22FromDiscord<Rika> a lot of change is overwhelming
05:45:10FromDiscord<haxscramper> 2.0 changes are not that drastic
05:45:39FromDiscord<haxscramper> I don't really know where people get that idea about nim 2.0 breaking everything there is to break
05:45:46FromDiscord<haxscramper> It just cleans up the stdlib
05:46:02FromDiscord<haxscramper> And sorts out experimental features
05:46:13FromDiscord<haxscramper> Like making case macros non experimental
05:46:23FromDiscord<haxscramper> Which I think is absolutely stupid but whatever
05:53:29nrds<Prestige99> Why do you think that?
05:59:43*def- quit (Quit: -)
05:59:56*def- joined #nim
06:01:17FromDiscord<haxscramper> Case macros?
06:01:54FromDiscord<haxscramper> Or things I said about 2.0 changes in general
06:03:56nrds<Prestige99> Case macros
06:04:46FromDiscord<haxscramper> I think case macros are useless because they don't provide any additional benefits to code readability or compactness over an existing macro solutions, but they overload sematics of basic language constructs
06:05:07FromDiscord<haxscramper> You can do everything using regular macro
06:05:18FromDiscord<haxscramper> Including using "of" for branches
06:06:07FromDiscord<haxscramper> Case macros don't work properly in generics, or at least I couldn't make them work as I want to for pattern matching
06:09:35FromDiscord<haxscramper> Also you can't have more than one case macro for the same type, at least not without hacks with overloads and distinct
06:11:06FromDiscord<luphoria> is nim like ada?
06:11:29FromDiscord<Elegantbeef> They have similar origins and type systems
06:11:41FromDiscord<Elegantbeef> Both are inspired by wirth languages
06:12:08FromDiscord<luphoria> ada 🥰
06:12:42FromDiscord<luphoria> I have heard nothing negative about nim. planning on learning it
06:12:56FromDiscord<Elegantbeef> I say similar origins based off their inspiration, not history 🙂
06:13:08FromDiscord<Bloss> In reply to @haxscramper "I think case macros": I thought the point of case statements is that they are optimized versions of if/elif ==, and case macros allow you to extend this optimization to other types
06:13:16FromDiscord<Elegantbeef> They're both very pascally
06:13:20FromDiscord<luphoria> oh, yea. ada and nim are gonna be very historically different
06:13:41FromDiscord<luphoria> does nim have endif?
06:13:49FromDiscord<Elegantbeef> No it uses significant white space
06:14:05FromDiscord<luphoria> ack hmm
06:14:17FromDiscord<Bloss> The only problem with Nim's syntax I have is the Pascal style declarations
06:14:35FromDiscord<Bloss> They are not very flexible
06:14:41FromDiscord<Elegantbeef> Eh i find them fine
06:15:14FromDiscord<Elegantbeef> What's your issue with them?
06:15:41FromDiscord<Bloss> For example, you have to indent after `object`, you can't use `;` inside objects for multiple fields on a single line
06:16:09FromDiscord<Elegantbeef> Sure why would you want to have multiple definitions on a single line if they dont share types
06:16:30FromDiscord<Elegantbeef> I mean i'd agree that semicolon should work, but it's also "Why"
06:16:52FromDiscord<Bloss> It just hinders the flow of writing
06:17:07FromDiscord<Elegantbeef> I dont agree, but it's subjective
06:17:12FromDiscord<Bloss> It's different from all the other Nim syntax so you have to enter this mode
06:17:33FromDiscord<Elegantbeef> It's identical to how i write code everywhere else, 1 statement per line
06:18:13FromDiscord<Elegantbeef> But anywho i do agree `;` should probably work in typedefs
06:18:23FromDiscord<Elegantbeef> Not that i'd ever use it or like to see it
06:18:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/FBG
06:22:33FromDiscord<retkid> https://github.com/yglukhov/nimpy/tree/master/tests
06:22:36FromDiscord<retkid> these tests dont work for me
06:22:41FromDiscord<retkid> anyone else?
06:22:51FromDiscord<Rika> It should work, I agree
06:23:18FromDiscord<retkid> the better joke is "what would work, for you"
06:23:29FromDiscord<Elegantbeef> They have a CI so probably should wok yes
06:23:34FromDiscord<Elegantbeef> Work even
06:24:58FromDiscord<Rika> Sorry my brain lagged I mean the semicolon thing should work
06:25:19FromDiscord<retkid> i just wanna figure import local python files without putting them into my pylib or putting some disgusting code in there
06:25:56FromDiscord<Elegantbeef> Use memfiles to that load your python modules so then you can import them
06:26:04FromDiscord<Elegantbeef> Afaict nimpy uses paths to load files
06:28:01FromDiscord<Elegantbeef> Running tests i get `Unexpected error encountered: <type 'exceptions.ImportError'>: No module named numpy`
06:28:11FromDiscord<retkid> yea
06:28:13FromDiscord<Elegantbeef> Probably due to my python setup
06:28:20FromDiscord<retkid> is numpy installed
06:28:23FromDiscord<retkid> 🤔
06:29:05FromDiscord<Elegantbeef> My system `python` is 2.7 but my system `pip` is for python 3
06:29:09FromDiscord<Elegantbeef> So hell yea i fucking love python
06:29:12*Gustavo6046 quit (Quit: Leaving)
06:29:21FromDiscord<retkid> say what you want nimble never did this shit
06:29:45FromDiscord<retkid> y'know, javas package manager never gave me problems
06:29:56FromDiscord<retkid> cant have problems if you dont have one >:)
06:30:57FromDiscord<Elegantbeef> Yea seems i cant get pip for python 2
06:31:54FromDiscord<Elegantbeef> So 10/10 language
06:32:00FromDiscord<retkid> but why are you using python 2
06:32:10FromDiscord<Elegantbeef> Cause i dont fucking use python
06:32:14FromDiscord<Elegantbeef> It's what my system installed
06:32:26FromDiscord<retkid> i use python because the selenium binding sucks
06:32:33FromDiscord<retkid> and interop with nim is easier in py then JS
06:40:22FromDiscord<congusbongus> That’s the distros fault↵Iirc newest Ubuntu’s finally default to Python 3
06:40:41FromDiscord<Elegantbeef> It's called satire
06:40:51FromDiscord<retkid> i installed arch today
06:40:55FromDiscord<retkid> it came without python
06:58:37*mahlon quit (Ping timeout: 240 seconds)
07:21:03FromDiscord<haxscramper> In reply to @blans "I thought the point": No, the point of case statement macros is that you can write a macro that replaces "case" implementation
07:21:19FromDiscord<haxscramper> it does not provide any optimizations unless you implement them yourselves
07:21:39FromDiscord<haxscramper> pattern matching from fusion does not have any optimizations unless someone adds them
07:22:27FromDiscord<dangbinghoo> hi, pro, what's the `fromJsonHook` prototype for type of `array of char` looks like? ex. if my input param type is `array[10, char], array[20, char]`
07:22:52FromDiscord<Elegantbeef> `openArray[char]`?
07:26:36FromDiscord<Bloss> In reply to @haxscramper "it does not provide": Yes, my idea was that they are made for user optimizations over certain types
07:26:55FromDiscord<Bloss> Since the manual underlines that you are supposed to overload it
07:26:59FromDiscord<Bloss> With types
07:27:54FromDiscord<Bloss> In reply to @dangbinghoo "hi, pro, what's the": Not sure how `fromJsonHook` works but maybe you can make it generic like `proc fromJsonHook[I](input: array[I, char])`
07:28:52FromDiscord<Bloss> In reply to @haxscramper "No, the point of": I don't get why the manual would specifically point out that you can overload it with types if this is the case
07:29:56FromDiscord<dangbinghoo> yeah, I'm converting a json-str to jsonNode and then convert a JString to C land cstring, currently, `fromJson` in jsonutils is dealing this : `of JString: a = b.str` which is giving a GCed string memory to cstring, it's wrong.
07:31:04FromDiscord<dangbinghoo> so, I'm think that, I can convert `Jstring` to C land's something like `uchar cstr[16]`
07:31:57FromDiscord<dangbinghoo> In reply to @blans "Not sure how `fromJsonHook`": hi, so, the I need to be predictable in compile-time?
07:32:09FromDiscord<dangbinghoo> (edit) "I" => "`I`"
07:32:23FromDiscord<Elegantbeef> Of course it does
07:32:37FromDiscord<Elegantbeef> That C array is static sized
07:33:05FromDiscord<dangbinghoo> ok, I will try it, thanks!
07:33:18FromDiscord<Elegantbeef> The openarray should also work though
07:34:28FromDiscord<dangbinghoo> In reply to @Elegantbeef "The openarray should also": OK
07:34:50FromDiscord<Bloss> I guess you could just make your own macro instead of overriding `case` but if you think of `case` like an operator then it's like operator overloading
07:36:09*mahlon joined #nim
07:36:55FromDiscord<haxscramper> I wouldn't be especially thrilled to overload + into a macro that has completely different semantics
07:37:08FromDiscord<haxscramper> From regular addition
07:38:01FromDiscord<Bloss> I guess but in practice you can make it predictable
07:38:18FromDiscord<Bloss> It's obviously not a super crucial feature
07:38:43FromDiscord<haxscramper> Or just use a different name for things that function completely differently
07:39:06FromDiscord<haxscramper> Regular case is an O(1) operation on ordinal values and strings
07:39:31FromDiscord<haxscramper> Pattern matching case is an O(n) for any structured value and has a complex DSL
07:39:39FromDiscord<Bloss> Yeah I assumed the macro is supposed to also generate an O(1) operation for custom types
07:40:34FromDiscord<Bloss> Like I assumed that was the purpose, so you can optimize if/elif == structures for your own custom types
07:40:44FromDiscord<Bloss> The same way Nim does for numbers and strings
07:40:56FromDiscord<Bloss> It just happens that the only thing that can do that is macros
07:41:03FromDiscord<haxscramper> String uses strcmp inside
07:41:22FromDiscord<haxscramper> The manual says hashing but I've never actually seen it
07:41:38FromDiscord<haxscramper> Maybe this was changed since then
07:42:38FromDiscord<Bloss> I don't see how the feature could be compatible with pattern matching at all
07:42:53FromDiscord<Bloss> But I guess I still wouldn't miss it if it wasn't in the language
07:43:27FromDiscord<Bloss> I mean pattern matching also includes regular assignment
07:43:29FromDiscord<haxscramper> I can add trillion layers of compiles() checks and use hashing
07:43:37FromDiscord<Bloss> Like with `let`
07:44:37FromDiscord<Bloss> Do you plan on adding pattern matching to NimSkull?
07:47:57*PMunch joined #nim
07:51:22FromDiscord<haxscramper> Eventually yes
07:51:27FromDiscord<haxscramper> I hop
07:51:29FromDiscord<haxscramper> Hope
07:51:41FromDiscord<haxscramper> Also Result/Either and more functional stuff
07:51:57FromDiscord<haxscramper> Leorize's union
07:52:04FromDiscord<haxscramper> But for now that's not a priority
07:53:39*jjido joined #nim
07:58:08FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QYv
07:58:18FromDiscord<retkid> that
07:58:21FromDiscord<retkid> certainly is code
07:58:38FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3QYw
07:58:58FromDiscord<Elegantbeef> Always passes by copy in procedure calls
07:59:01PMunchIt forces it to be passed by copy
07:59:02FromDiscord<dangbinghoo> compiles this shows that: my `fromJsonHook` was not be called?
07:59:37FromDiscord<retkid> In reply to @Elegantbeef "Always passes by copy": so it never passes by reference and stops side affects?
07:59:41FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QYx
07:59:52FromDiscord<retkid> In reply to @dangbinghoo "this is coverted from": that explains why it looks very weird
08:00:11FromDiscord<Elegantbeef> Nim has `var` references for mutabillity so it's unrelated to side effects
08:00:24FromDiscord<Elegantbeef> It's about overriding optimizations and ensuring you get a copy
08:00:32FromDiscord<retkid> hrrr
08:00:33FromDiscord<retkid> ok
08:01:45FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QYB
08:02:57FromDiscord<dangbinghoo> it seems my `fromJsonHook` were not be picked when compiling. I got `Error: unhandled exception: a.len == b.len failed: (10, 0, "array[0..9, char]") [ValueError]`
08:03:36FromDiscord<Elegantbeef> It's not due to using a generic
08:04:15FromDiscord<Elegantbeef> That's not it
08:04:39FromDiscord<Elegantbeef> \I take it back perhaps it is
08:05:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QYE
08:06:10FromDiscord<Elegantbeef> Thought that might be for the string, now that i think about it
08:06:30FromDiscord<Elegantbeef> Ah nvm that's a `cstring`
08:08:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QYF
08:11:43FromDiscord<Elegantbeef> `nimble install fusion`
08:11:43FromDiscord<fbpyr> for doing a fetch in js-frontend I found https://nim-lang.github.io/fusion/src/fusion/js/jsxmlhttprequest (hoping this is module to use for this use-case(?)), but when I try to import `import src/fusion/js/jsxmlhttprequest` I get `Error: cannot open file: src/fusion/js/jsxmlhttprequest` from the compiler.↵on attempt to nimble `install ` I get \`Error\: Package not found.\`\`↵what would be the canonical way to use this package?
08:12:14FromDiscord<fbpyr> ahh thank you!!
08:12:14FromDiscord<Elegantbeef> no problem
08:12:36FromDiscord<Elegantbeef> There is also https://nim-lang.org/docs/jsfetch.html
08:13:27FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QYI
08:14:58FromDiscord<fbpyr> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: thank you, for the pointer, jsfetch I tried before but got errors on `Error: undeclared identifier: 'await'` so I though I might try another route.. 🤔
08:15:20FromDiscord<Elegantbeef> did you `import std/[jsfetch, jsasync]`?
08:15:31FromDiscord<Elegantbeef> sorry `asyncjs`
08:16:25FromDiscord<fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=3QYJ
08:17:06FromDiscord<Elegantbeef> I just compiled the example fine
08:17:31FromDiscord<fbpyr> ah? ok - then I need to retry.. thx!
08:18:29*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:20:44FromDiscord<fbpyr> sent a code paste, see https://paste.rs/YMU
08:25:11FromDiscord<retkid> I haven't done much async in nim, only in python and js
08:25:42FromDiscord<retkid> whats the best way to request like 20 things then wait for them all to finish
08:26:14FromDiscord<retkid> my idea was to make an async proc, have it append its output to a seq and wait for the seq to be the expected size
08:26:47FromDiscord<Elegantbeef> Yea await isnt inside asyncjs, so no fucking clue where `await` on the js async comes from
08:26:53FromDiscord<Rika> Sequence of futures, use the “all” from async futures
08:27:27FromDiscord<krautbyte> Yo so what does this language do?
08:27:37FromDiscord<retkid> In reply to @krautbyte "Yo so what does": nim?
08:27:45FromDiscord<krautbyte> Yeah
08:27:45FromDiscord<Rika> Pretty much anything
08:27:49FromDiscord<retkid> Nim does math
08:27:56FromDiscord<retkid> its run on a computer
08:27:59FromDiscord<retkid> it does computations
08:28:06FromDiscord<retkid> these computations can do almost anything
08:28:09FromDiscord<krautbyte> Great, the next JS clone? Or is there some advances to it?
08:28:18FromDiscord<Rika> BRB making a mechanical machine that can run Nim code
08:28:28FromDiscord<retkid> In reply to @Rika "BRB making a mechanical": already been done
08:28:41FromDiscord<Elegantbeef> Well it's JS backend is one part of it
08:28:42FromDiscord<Rika> Which is
08:28:45FromDiscord<retkid> In reply to @krautbyte "Great, the next JS": well, its completely nothing at all like JS whatsoever but y'know
08:28:51FromDiscord<retkid> In reply to @Rika "Which is": a cpu
08:28:51FromDiscord<Elegantbeef> Nim compiles to C/C++/JS
08:29:27FromDiscord<Elegantbeef> Ironically how the fuck does one use `asyncjs`
08:29:37FromDiscord<Elegantbeef> Unironically\
08:29:45FromDiscord<retkid> you dont
08:29:46FromDiscord<fbpyr> yep, me and my ide are puzzled as well.. 🤔
08:29:56FromDiscord<Elegantbeef> Await isnt even inside of that module
08:30:01FromDiscord<Elegantbeef> Where the hell does one get `await` for js
08:30:12FromDiscord<mronetwo> sent a code paste, see https://play.nim-lang.org/#ix=3QYN
08:30:20FromDiscord<fbpyr> and await is used there a couple of times..
08:30:21FromDiscord<Elegantbeef> `let a = ["one", "two"]`
08:30:31FromDiscord<retkid> In reply to @mronetwo "Quick question, hope it's": let a = @["one, "two"]
08:30:34FromDiscord<Elegantbeef> There is not reverse inference in Nim
08:30:38FromDiscord<retkid> elegant beef types faster than me
08:30:38FromDiscord<retkid> :(
08:30:43FromDiscord<mronetwo> In reply to @retkid "let a = @["one,": that's a seq right?
08:30:44FromDiscord<Elegantbeef> And more correctly
08:30:49FromDiscord<retkid> yes but you dont need it
08:31:00FromDiscord<retkid> listen to beef
08:31:03FromDiscord<Elegantbeef> Use my code and be merry
08:31:08FromDiscord<retkid> ^
08:31:22FromDiscord<retkid> my code is pretty uh, cool
08:31:23FromDiscord<retkid> right beef
08:31:35FromDiscord<Elegantbeef> "wrong" is what i'd say
08:31:40FromDiscord<Elegantbeef> Hurts me on so many levels
08:31:55FromDiscord<Rika> @@@@@@@@@@@@@@@
08:31:58FromDiscord<retkid> @@@@@@@@
08:32:00FromDiscord<Rika> Does this hurt you more
08:32:07FromDiscord<Elegantbeef> Yes
08:32:11FromDiscord<Rika> Good
08:32:26FromDiscord<retkid> what about this
08:32:32FromDiscord<Elegantbeef> @juan_carlos\: I think you'd know, where the hell is js's `await` written?
08:32:40FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3QYP
08:33:01FromDiscord<Elegantbeef> Oh god i'm dumb
08:33:01FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3QYP" => "https://play.nim-lang.org/#ix=3QYQ"
08:33:02FromDiscord<Elegantbeef> I figured it out
08:33:09FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3QYQ" => "https://play.nim-lang.org/#ix=3QYP"
08:33:20FromDiscord<Rika> You need a type somewhere
08:33:20FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3QYR
08:33:27FromDiscord<retkid> In reply to @Rika "Can’t work": I've accepted this but the idea is what must hurt him
08:33:32FromDiscord<Elegantbeef> [fbpyr](https://matrix.to/#/@fbpyr:tchncs.de)\: the JS async method is done using async procedures, so to await the procedure needs to be marked `async`
08:33:41FromDiscord<Rika> In reply to @retkid "I've accepted this but": It is the same with just [] actually
08:34:18FromDiscord<mronetwo> ok thanks guys
08:34:40FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/gZE
08:34:55FromDiscord<Elegantbeef> The async macro does what's required for async js, i was missing this forever ago and just figured it out
08:35:22FromDiscord<fbpyr> ahaa! thank you [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) 🙂 will try..
08:35:34FromDiscord<Elegantbeef> Please for the love of all things good and holy someone make a PR that adds that little nifty information to `asyncjs`
08:35:42FromDiscord<retkid> ~~is cookies Cookie or Cookies
08:35:51FromDiscord<mronetwo> sent a code paste, see https://play.nim-lang.org/#ix=3QYS
08:35:55FromDiscord<retkid> uh
08:36:17FromDiscord<Elegantbeef> No there is not anyway to keep the type but omit count, Nim doesnt do reverse inference like i said
08:36:18FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3QYT
08:36:22FromDiscord<retkid> let me make sure that works
08:36:53FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3QYT" => "https://play.nim-lang.org/#ix=3QYU"
08:36:55FromDiscord<retkid> its var
08:37:18FromDiscord<mronetwo> got you, thanks
08:37:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QYV
08:38:30FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/R3f
08:38:38FromDiscord<Elegantbeef> Which emits an array of `(string , string)`
08:39:46FromDiscord<mronetwo> nice, thanks again 🙂
08:54:25FromDiscord<fbpyr> sent a code paste, see https://paste.rs/Pmk
08:54:52FromDiscord<Rika> No that means that the window on load is a sync proc
08:54:55FromDiscord<Rika> And not async
08:55:20FromDiscord<fbpyr> ah ok, await the window.onload then?
08:55:39FromDiscord<Elegantbeef> No type safety is winning here
08:56:26Amun-Rawhat am I doing wrong in that generic `init2` declaration? https://play.nim-lang.org/#ix=3QUG
08:56:38FromDiscord<Elegantbeef> You basically need to call `doFetch` sync instead of async
08:56:45FromDiscord<fbpyr> ah ok, awaiting would not make sense because it is sync, sry that took a bit..
08:58:40FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QZ1 amun here's a "workaround"
08:59:02FromDiscord<Elegantbeef> You then can do `typeof(t).T`
08:59:16FromDiscord<Elegantbeef> Also are you looking at versioning Nim types using an enum and migrating between them?
08:59:24FromDiscord<fbpyr> but then the `fetch` does not work anymore?
08:59:39FromDiscord<Elegantbeef> What i'm saying is fetch needs to be sync
08:59:56FromDiscord<fbpyr> ah I see. and it is not. hmm..
09:00:52FromDiscord<Elegantbeef> I do not know how to sync wait for a procedure in js
09:01:08FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QZ6
09:01:10FromDiscord<fbpyr> so is then there a way to do `window.onload` in async instead?
09:01:18FromDiscord<Elegantbeef> Nope
09:01:19Amun-RaElegantbeef: nice, thank you; I'm writing wrappers for gtk2 and gtk3 libraries
09:01:30FromDiscord<fbpyr> hmm.. bummer.
09:01:44FromDiscord<Elegantbeef> The solution is to waitfor the `fetch` proc
09:01:55FromDiscord<dangbinghoo> (edit) "https://play.nim-lang.org/#ix=3QZ6" => "https://paste.rs/otU"
09:02:10FromDiscord<fbpyr> I see.
09:02:57FromDiscord<Elegantbeef> Dont know if we can just cast the proc
09:03:04*jmdaemon joined #nim
09:03:18FromDiscord<fbpyr> hmm `Error: undeclared identifier: 'waitFor'`
09:03:21FromDiscord<Elegantbeef> `window.onload = cast[proc(e: Event){.closure.}](on_load)` may work
09:03:22FromDiscord<dangbinghoo> sent a code paste, see https://paste.rs/9tt
09:03:28FromDiscord<fbpyr> ah ok it was not meant literally.. 🙂
09:04:15FromDiscord<fbpyr> unfortunately that gives `Error: expression cannot be cast to proc (e: Event){.closure.}`
09:05:07FromDiscord<fbpyr> is there some executor to which I would need to pass the async aparatus?
09:05:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QZ7
09:05:50FromDiscord<Elegantbeef> There you go dangbinghoo
09:06:35FromDiscord<Elegantbeef> shit that should be `0..model.high`
09:08:00FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QZ8
09:08:13FromDiscord<Elegantbeef> It does not
09:09:03FromDiscord<Elegantbeef> i suppose you might be able to do `cast[array[10, char]]("abc\0")`
09:09:31FromDiscord<dangbinghoo> ok, thanks
09:10:05FromDiscord<Elegantbeef> I dont think having onload call a async procedure makes sense fbpyr, but no clue. Hopefully someone with a brain with the JS backend pops on
09:12:13FromDiscord<fbpyr> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: thank you! I will try to see, if I can get it to run without the on\_load..
09:13:15FromDiscord<fbpyr> if I compile it without it, currently the not called procs get optimized/compiled out though..
09:13:26FromDiscord<dangbinghoo> And, bother you again:
09:13:31FromDiscord<fbpyr> I feel I got closer though..
09:13:39FromDiscord<dangbinghoo> sent a code paste, see https://play.nim-lang.org/#ix=3QZa
09:14:02FromDiscord<Elegantbeef> `cast[string](a)` is 100% wrong
09:14:19FromDiscord<dangbinghoo> `toJsonHook ` not be called
09:16:25FromDiscord<dangbinghoo> In reply to @Elegantbeef "`cast[string](a)` is 100% wrong": hmm, not find a way to do this.
09:16:44FromDiscord<Elegantbeef> The issue is the `var openArray[char]` it is not immutable
09:17:05FromDiscord<Elegantbeef> Well Nim strings are not arrays, they're heap allocated so casting `array` to `string` is 100% wrong
09:18:04FromDiscord<dangbinghoo> In reply to @Elegantbeef "The issue is the": so, need to new a string, and copy array element each one to string's data ?
09:26:11FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QZd
09:30:20FromDiscord<Elegantbeef> Whoops i left sugar in
09:30:56FromDiscord<dangbinghoo> does `proc add(x: var string; y: openArray[char]) ` in `std/strbasics` make help for convert "array[N, char]" to a string?
09:31:29FromDiscord<Elegantbeef> It's what i implemented basically
09:31:30*ltriant quit (Ping timeout: 272 seconds)
09:31:44FromDiscord<fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=3QZf
09:31:48FromDiscord<Elegantbeef> thought it's probably not `\0` aware
09:32:00*shalokshalom joined #nim
09:32:24FromDiscord<dangbinghoo> In reply to @Elegantbeef "thought it's probably not": yes, thanks for you help.
09:33:08FromDiscord<Elegantbeef> No problem
09:54:19*jjido joined #nim
10:49:52NimEventerNew thread by Mardiyah: Need variable to be constant on runtime without initialization at declaring, see https://forum.nim-lang.org/t/8964
10:53:17FromDiscord<Rika> how would that work...
10:59:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:02:56FromDiscord<demotomohiro> Just use if expression to initialize let variable
11:05:23*jmdaemon quit (Ping timeout: 256 seconds)
11:14:57FromDiscord<ajusa> In reply to @NimEventer "New thread by Mardiyah:": Potentially the global pragma? This guy has some strange questions though
11:21:29FromDiscord<enthus1ast> ah i misread
11:21:40FromDiscord<ajusa> Nah your answer makes sense to me
12:06:02*supakeen quit (Quit: WeeChat 3.4)
12:06:32*supakeen joined #nim
12:38:58*jjido joined #nim
12:52:40PMunch@ajusa, pretty sure it's a language barrier thing
12:58:16FromDiscord<ajusa> In reply to @PMunch "<@102899813149855744>, pretty sure it's": I don't think the phrasing is all that strange, more of the content? Language barriers can be weird though
12:59:32PMunchThe content?
13:00:00PMunchI guess it's a bit odd to wonder how to assign let statements to variables if you didn't know that was a possible feature
13:00:49PMunchWhat I find interesting though is that except for the goto question all their questions can be answered super easily
13:00:59PMunchJust goes to show how flexible Nim is I guess :)
13:01:39FromDiscord<retkid> Code as data without compiler magic when 😔
13:02:06PMunchSometime back in the 70's I think
13:02:07*kayabaNerve_ joined #nim
13:02:23PMunchWell, I guess it depends on your definition of compiler magic :P
13:02:28PMunchWhat're you trying to do?
13:02:33FromDiscord<retkid> I mean In nim
13:02:44FromDiscord<retkid> I mean literally {.magic.}
13:03:35FromDiscord<retkid> In reply to @PMunch "Sometime back in the": I feel like most questions can be answered with this
13:04:13*kayabaNerve quit (Ping timeout: 240 seconds)
13:04:38PMunchAah right, I mean some of the {.magic.} stuff could probably be implemented as macros
13:06:15FromDiscord<retkid> I've never programmed with it myself
13:06:28FromDiscord<retkid> i just see it in verbose compiler code and it confuses me
13:10:22FromDiscord<ynfle> In reply to @retkid "i just see it": `{.magic.}` means "the logic is implmented in the compiler directly"
13:23:33FromDiscord<demotomohiro> `+`, `-` and `` operators for int or float are procedures with `{.magic.}`
13:28:04FromDiscord<ynfle> In reply to @demotomohiro "`+`, `-` and `*`": Yup, that means they can't be passed as a proc value to map, for example,
13:28:07FromDiscord<ynfle> (edit) "example," => "example"
13:39:13FromDiscord<retkid> pargma to copy a var on all threads
13:39:26FromDiscord<retkid> 8pragma
13:39:28FromDiscord<retkid> pragma
13:39:45FromDiscord<retkid> {.threadvar.}]
13:41:08PMunchHuh?
13:41:15FromDiscord<Rika> ?
13:42:09FromDiscord<fbpyr> is there such thing in nim like gopackr in go? meaning\: ↵the executable can "carry" additional compressed files (e.g. dll) with it and unpack+use them when being run?
13:42:42FromDiscord<fbpyr> ^^ this would be in the context of a win pc
13:43:23PMunch@fbpyr, you can `readfile` during compilation and then just write them out on runtime
13:46:54PMunchThere might be a library for it, but I'm not 100% sure
13:51:42FromDiscord<enthus1ast> [fbpyr](https://matrix.to/#/@fbpyr:tchncs.de)\: just use a const variable
13:51:52FromDiscord<enthus1ast> and staticRead
13:52:36FromDiscord<enthus1ast> but if you'r application depend on the dll, and you've used the default nim ffi, then it will not work.
13:52:53FromDiscord<enthus1ast> it will check and load the dll before your application code
13:53:22FromDiscord<retkid> so i have a sequence of futures
13:53:30FromDiscord<retkid> how do i await for all of them then get their value?
13:54:15FromDiscord<retkid> well more how do i wait for all of them, don't you just do .read() to get the enclosed var
13:54:45PMunchYou can use this: https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D
13:54:58PMunchTo create one new future that will complete once all the futures are completed
13:55:39FromDiscord<retkid> so my out array should be a future itself?
13:55:57FromDiscord<retkid> Future[seq[Future[seq[string]]]
13:56:11FromDiscord<retkid> (edit) "Future[seq[Future[seq[string]]]" => "Future[seq[Future[seq[string]]]]"
13:56:32FromDiscord<ynfle> No. Futue[seq[seq[string]]] I think
13:57:12FromDiscord<retkid> then... how do i add to it if its a... future?
13:58:00FromDiscord<ynfle> ?
13:58:07FromDiscord<ynfle> Concrete code is easier to talk about
13:58:44FromDiscord<retkid> if my output array is a future
13:58:54FromDiscord<retkid> then how do i add the future to it that i have to wait upon
13:59:32FromDiscord<retkid> sent a code paste, see https://paste.rs/lN9
13:59:44FromDiscord<retkid> uh i dont know how i forgot you use # and not //
13:59:47FromDiscord<retkid> but its there now
13:59:51FromDiscord<ynfle> x.add await futureine
13:59:56*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:00:07FromDiscord<ynfle> (edit) "futureine" => "futureint"
14:00:45FromDiscord<retkid> yea this aint workin in my code or in my brain
14:00:50FromDiscord<retkid> this is why I dont usually do async
14:02:18FromDiscord<retkid> in fact i dare say it makes no sense at all.
14:02:32FromDiscord<retkid> why is there no example.
14:02:58FromDiscord<ynfle> Provide for us to help you with
14:03:04FromDiscord<ynfle> (edit) "Provide ... for" added "code"
14:03:15FromDiscord<ynfle> Concrete code is easier to talk about
14:03:41PMunch@retkid, basically if you have an array of ten futures you want to await you should be able to do `await all(myFutures)`
14:04:09FromDiscord<retkid> that makes much more sense
14:04:11PMunchIf the futures there are Future[string] the result of that call will be seq[string]
14:05:43FromDiscord<retkid> how can i use await outside of an async function because this is a tad bit confusing
14:08:19FromDiscord<ynfle> In reply to @retkid "how can i use": awaitfor
14:08:25FromDiscord<ynfle> (edit) "awaitfor" => "`awaitFor`"
14:08:40PMunchwaitFor*
14:10:32PMunchYou can't use await outside an async procedure, because it would try to return the control flow (this is what await does, returns control flow to the caller on the promise that it will get it back once the thing it's waiting for is done). `waitFor` on the other hand doesn't return the control but rather just loops the async dispatcher until the thing it is waiting for is complete
14:11:10FromDiscord<retkid> honestly my least favorite part of nim is the async and thread implementation and having to write abstract classes for basic things
14:12:10FromDiscord<retkid> it often seems overly complicated and infuriating and needlessly so.
14:12:12FromDiscord<retkid> but what do i know
14:13:37FromDiscord<ynfle> Which language do you understand async in?
14:13:58FromDiscord<retkid> JS's promises are a bit better
14:14:00FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R07
14:14:22FromDiscord<retkid> Kotlin's stuff is pretty ok iirc
14:14:40FromDiscord<ynfle> sent a code paste, see https://paste.rs/Ogx
14:15:04FromDiscord<retkid> yes but don't you ever look at this stuff
14:15:06FromDiscord<retkid> and go
14:15:19FromDiscord<fbpyr> thank you [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz) - exactly, the idea was if I could ship it with a dll that it could run.. 🤔
14:15:22FromDiscord<retkid> "surely there is a better way" https://media.discordapp.net/attachments/371759389889003532/947859527313788998/unknown.png
14:15:35FromDiscord<retkid> then having to write out stuff like seq[Future[string]]
14:15:48FromDiscord<enthus1ast> i would just put everything in a folder and zip it
14:15:52FromDiscord<enthus1ast> OR use nsis
14:16:13FromDiscord<fbpyr> nsis? ok will look up - thx!
14:16:14FromDiscord<enthus1ast> OR create a wrapper that just dumps the files and call you'r real executable
14:16:27FromDiscord<fbpyr> ahh right - I could layer it..
14:16:28FromDiscord<enthus1ast> best imho is zip or nsis
14:16:40FromDiscord<auxym> In reply to @PMunch "Sometime back in the": well, the original lisp is from 1958, apparently 😛
14:21:23FromDiscord<retkid> either way
14:21:29FromDiscord<retkid> async was not the right solution i should have threaded it
14:21:54FromDiscord<ynfle> sent a code paste, see https://paste.rs/U0u
14:22:03FromDiscord<ynfle> But that wasn't what you asked.
14:23:07FromDiscord<ynfle> Nim's async works like this. If you want to make a proc async, you wrap the return value in future signifying that you it has to be `await`ed. Then, anytime you want to convert from a `Future` to a "real" value you use await or all
14:29:06FromDiscord<retkid> yea I know how it works
14:29:20FromDiscord<retkid> it just isn't a good system
14:29:34PMunchWhat are you actually trying to do?
14:30:16FromDiscord<ynfle> I find it easier to use than javascript's
14:30:26*arkurious joined #nim
14:35:30PMunch@retkid ^
14:36:08FromDiscord<retkid> In reply to @PMunch "What are you actually": I'm just upset from my general usage of it over time rather than this one occurrence which is rather simple
14:37:22PMunchIt's a pretty decent system if you know how to use it
14:37:33PMunchBut if not it's a bit counter-intuitive
14:44:09FromDiscord<dom96> you could probably write a JS promises emulation on top of Nim's futures fairly easily
14:44:15FromDiscord<dom96> if you prefer that then just do it 🙂
14:46:55FromDiscord<0ffh> I'd like to try and create bindings for https://github.com/Nelarius/imnodes↵How do I best learn to make bindings for a C++ library, and what tool (if any) would I want to use?↵In case it makes a difference, I don't mind to compile to C++ instead of C.
14:48:22FromDiscord<retkid> In reply to @dom96 "you could probably write": I don't like JS's systems either
14:48:34FromDiscord<retkid> I just find them less annoying
14:48:56FromDiscord<retkid> I could probably think of something I like but then i gotta try and implement it then it'll be months and I'll cry
14:50:01FromDiscord<ynfle> In reply to @retkid "I could probably think": Just get Beef to write a macro for you
14:57:38*PMunch quit (Quit: Leaving)
14:58:55*wyrd quit (Ping timeout: 240 seconds)
15:11:56*anddam quit (Quit: WeeChat 3.4)
15:12:29FromDiscord<ajusa> In reply to @ynfle "Just get Beef to": This is the way
15:14:29FromDiscord<ynfle> There should be a Macro Engineer for Beef
15:16:16FromDiscord<ynfle> (edit) "There should be a Macro Engineer ... for" added "title"
15:16:22FromDiscord<ynfle> In reply to @ynfle "There should be a": title
15:16:26FromDiscord<ynfle> (edit) removed "title"
15:18:01*anddam joined #nim
15:31:25*jjido joined #nim
15:32:20FromDiscord<Schelz> anyone have tried to make in nim custom push message to home assistant ?
15:32:26FromDiscord<Schelz> (edit) "to" => "for"
15:33:07FromDiscord<Schelz> (edit) removed "have"
15:42:33FromDiscord<federico3> @Schelz\: huh?
15:45:03FromDiscord<Schelz> Like ask google home assistant a question and he respond with a message from nim webhook.
15:45:27FromDiscord<Schelz> lol this is a hard concept to explain
15:49:22*slowButPresent joined #nim
16:05:24FromDiscord<blabla3131> hey
16:05:43FromDiscord<blabla3131> who can help me about compress dir to zip or rar
16:14:51*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
16:17:40FromDiscord<Sense> So I want to encrypt a link, after this link will be encrypted at some point the link will be decrypted and my software will send a request to the server, how do I do something like that?
16:18:59FromDiscord<retkid> Is there a rhythm detection library
16:19:13FromDiscord<retkid> Like anyway to detect music in a video
16:19:43FromDiscord<retkid> Actually I’ll just write more python it’s fine
16:28:25*Gustavo6046 joined #nim
16:31:27FromDiscord<ynfle> In reply to @Sense "So I want to": What do you mean by "encypt a link"
16:31:42FromDiscord<ynfle> In reply to @blabla3131 "who can help me": Specifically those formats or just in general
16:32:37FromDiscord<ynfle> In reply to @blabla3131 "who can help me": https://github.com/guzba/zippy
16:33:39FromDiscord<retkid> alright
16:33:41FromDiscord<retkid> im tired enough
16:33:48FromDiscord<retkid> i bet i can write a beat detection library
16:34:14NimEventerNew question by itil memek cantik: Nim is to assign variable in or beside other expression once, see https://stackoverflow.com/questions/71298160/nim-is-to-assign-variable-in-or-beside-other-expression-once
16:34:21FromDiscord<retkid> i just need to do trig
16:34:24FromDiscord<retkid> oh god i need to do trig
16:45:56nrds<Prestige99> trig is fun
16:53:26FromDiscord<auxym> In reply to @ynfle "https://github.com/guzba/zippy": I had a look and I don't think create zip files is supported by zippy
17:00:52FromDiscord<Anuke> I'm running into a strange compiler error related to large staticRead inputs: https://play.nim-lang.org/#ix=3R14↵↵Documentation reads: "The maximum file size limit that staticRead and slurp can read is near or equal to the free memory of the device you are using to compile.", while the file is 1GB, and my device has far more free memory than that.
17:06:34FromDiscord<Anuke> Now, I realize that embedding 1GB files in executables is ridiculous, but this was an experiment to see how and when static resources are actually loaded into RAM
17:22:40FromDiscord<blabla3131> any format is okay which works on Windows and can send over httpclient↵(@ynfle)
17:28:22FromDiscord<retkid> was collect changed recently
17:28:25FromDiscord<retkid> i cant get it to work at all
17:28:47FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R1c
17:29:11FromDiscord<auxym> i stand corrected, ty
17:29:32FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3R1d
17:29:47FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3R1d" => "https://play.nim-lang.org/#ix=3R1e"
17:29:52FromDiscord<retkid> no long works?
17:30:02FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R1f
17:30:20FromDiscord<ynfle> In reply to @retkid "no long works?": https://play.nim-lang.org/#ix=3R1g
17:30:29FromDiscord<retkid> does not compile for me...
17:30:31FromDiscord<retkid> is the aur outdated
17:30:34FromDiscord<retkid> oh god the aurs outdated
17:31:23FromDiscord<Sense> In reply to @ynfle "What do you mean": Whatever, now. I figured out everything.
17:34:03FromDiscord<ynfle> In reply to @retkid "oh god the aurs": Choosenim is better
17:34:48FromDiscord<retkid> In reply to @ynfle "Choosenim is better": yea already done
17:34:51FromDiscord<retkid> i forgot about that
17:35:14FromDiscord<ynfle> In reply to @auxym "i stand corrected, ty": Never mind, not sure how to do it actually
17:54:49FromDiscord<Sense> So I want to send a request with `auth` header in puppy (https://github.com/treeform/puppy)↵It sends a `get` request to the Discord's api `https://discordapp.com/api/v6/users/@me`
17:55:10FromDiscord<Sense> How it will look in the code?
17:58:29*jjido joined #nim
18:12:32FromDiscord<retkid> I've learned a few things in the last hour
18:13:06FromDiscord<retkid> 1. encodings are stupid complex and sparsely documented↵2. holy shit the math needed for this takes so much spacd
18:16:31*vicecea quit (Remote host closed the connection)
18:17:01*vicecea joined #nim
18:25:14FromDiscord<Waldecir Santos> Is it possible to use `case of` on generics so I have different code paths depending on the type ? I did `case T: of....` but I've got ` Error: selector must be of an ordinal type, float or string` maybe I should use typeof(T) ?
18:27:42FromDiscord<haxscramper> no, and pattern matching does not work for that either
18:28:23FromDiscord<haxscramper> https://github.com/nim-lang/fusion/pull/33#issuecomment-716140197
18:30:27FromDiscord<Waldecir Santos> Hmm that is sad, I'm working a generic-proc that needs to do different processing depending on the generic type
18:30:38FromDiscord<konsumlamm> as the error message says, you can't use a type in a case-of
18:30:45FromDiscord<konsumlamm> you'll need to use `when` instead
18:30:58FromDiscord<Waldecir Santos> OH 🤦‍♂️
18:31:17FromDiscord<Waldecir Santos> Let me try, thank you
18:32:59*cyraxjoe quit (Quit: No Ping reply in 180 seconds.)
18:34:14*cyraxjoe joined #nim
18:34:43FromDiscord<Waldecir Santos> It worked:
18:34:56FromDiscord<Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3R1w
18:35:04FromDiscord<Waldecir Santos> (edit)
18:35:11FromDiscord<Waldecir Santos> Thank you @haxscramper @konsumlamm
18:37:21FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Vj2
18:38:31FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3R1x
18:38:47FromDiscord<haxscramper> `static:` is not necessary, but that is an old code
18:39:12FromDiscord<Waldecir Santos> Do I need `typecase` macro for this to work ?
18:39:14FromDiscord<haxscramper> `$typeof(entry)` should be `"tjsonTag2 does not support conversion for type" & $T`
18:39:23FromDiscord<haxscramper> In reply to @Waldecir Santos "Do I need `typecase`": yes,
18:39:37FromDiscord<haxscramper> I would still use `when` thoug
18:39:43FromDiscord<Waldecir Santos> What is the diference between both versions ?
18:40:10FromDiscord<haxscramper> `when` is more explicit
18:40:15FromDiscord<Waldecir Santos> I love seeing different approaches so keep them coming
18:40:19FromDiscord<haxscramper> I don't like voodoo magic in my generic code
18:40:28FromDiscord<Waldecir Santos> Yeah, I agree
18:40:50FromDiscord<haxscramper> In reply to @Waldecir Santos "What is the diference": or you meant `typeof`?
18:41:32FromDiscord<Waldecir Santos> I mean the diference between my example and what you posted, why would one use `typecase`
18:42:32FromDiscord<haxscramper> because `typecase` is a macro that makes the code work
18:42:52FromDiscord<haxscramper> using `of`
18:43:13FromDiscord<haxscramper> that's the whole point, I linked it because you originally tried doing it with `case of`
18:43:39FromDiscord<Waldecir Santos> Oh I see, got it.
18:45:49*anddam left #nim (WeeChat 3.4)
18:45:53*anddam joined #nim
19:07:19*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:15:48*mjsir911 quit (Quit: Goodbye, World!)
19:16:16NimEventerNew thread by DMisener: How to correctly augment async future data, see https://forum.nim-lang.org/t/8965
19:16:20*mjsir911 joined #nim
19:19:53FromDiscord<michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3R1L
19:23:22FromDiscord<Phil> sent a long message, see http://ix.io/3R1N
19:23:25*mjsir911 quit (Remote host closed the connection)
19:24:24*mjsir911 joined #nim
19:25:55FromDiscord<Phil> I could imagine an entire generic module full of generic procs that can be imported by specific modules and use some consts that provide types to... why didn't I do that one sooner
19:25:56FromDiscord<Phil> Hmmmmm
19:31:03FromDiscord<Phil> It feels like the kind of thing that could very quickly get very messy though, particularly in nim
19:39:02FromDiscord<Elegantbeef> You might be able to use a template with all the procedures declared inside, thought it didnt work overly well when i tried it
19:42:26FromDiscord<Phil> I'm doing a little experiment that is (for my tastes) way too reminiscent of inheritance sortof.↵An "abstractModule" with a bunch of public generic procs that uses other procs declared via "mixin" that your importer module then has to define. What I fear though is that this type of pattern might be impossible to debug
19:42:50FromDiscord<Elegantbeef> You say that like that's not how generics are supposed t obe used
19:43:08FromDiscord<Elegantbeef> Use concepts to constrain the generics and you're golden
19:43:30FromDiscord<Elegantbeef> You get a public facing checklist that you can easily say "Hey anything needs to match X type"
19:44:43FromDiscord<Phil> Hmmm I may not understand mixin though it seems, not the way I want anyway
19:44:48FromDiscord<Phil> One sec, drawio diagram coming up
19:45:05FromDiscord<Elegantbeef> Minus the concepts this is how `tables` `jsonutils` and anything else that allows user defined overrides work
19:48:33FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/947943375749910619/abstractModule.png
19:50:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3R1S
19:52:13FromDiscord<Phil> I had believed that "getCircumference" could stay private because "getDoubleCircumference" is moved into the context of "circle.nim" when it's being imported
19:52:38FromDiscord<Elegantbeef> `obj.getCircumferanc` vs `getCircumferance(ob)`
19:52:50FromDiscord<Phil> wait, the latter works?
19:52:51FromDiscord<Phil> one sec
19:53:19FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3R1T
19:54:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3R1U
19:57:29FromDiscord<Phil> In reply to @TurtleP "Hey, I'm trying to": You get invalid storage access where? On "os.isValidFilename"?
19:57:45FromDiscord<Elegantbeef> Yes
19:57:46FromDiscord<demotomohiro> @TurtleP Maybe you are returning empty string?
20:00:06FromDiscord<demotomohiro> @TurtleP casting `set[char]` to `string` seems dangrous.
20:01:00FromDiscord<Elegantbeef> instantiation happens at the callsite, so you need to call it inside circle if you dont want to expose the `getCircumfurance`
20:01:17FromDiscord<Elegantbeef> Also you could consider trying https://github.com/beef331/traitor although it's heavily untested and just for fun mostly 🙂
20:02:08FromDiscord<Phil> In reply to @Elegantbeef "instantiation happens at the": Hmm so the "helper" methods of the module have to be public
20:02:23FromDiscord<Phil> Since an "abstract" module such as abstractShape shouldn't have to import the individual modules that spawn from it
20:02:53FromDiscord<Elegantbeef> or they can be called internally
20:02:53FromDiscord<TurtleP> In reply to @Isofruit "You get invalid storage": I believe when I call the replace, name is a valid string
20:03:00*krux02 joined #nim
20:03:20FromDiscord<TurtleP> the documentation specified I could strip out these invalid chars, so that's what I'm trying to do
20:03:28FromDiscord<Phil> In reply to @Elegantbeef "or they can be": How do you mean?
20:03:41FromDiscord<Elegantbeef> `discard typeof getDoublCirc(obj)` as a top level statement in the `circle` module might make it work
20:05:15FromDiscord<Phil> Hmmm it works as a bottom level statement if it's an actual proc instantiation
20:05:46FromDiscord<Phil> sent a code paste, see https://paste.rs/QJr
20:06:30FromDiscord<demotomohiro> @TurtleP `cast[string](invalid)` can cause error.
20:06:45FromDiscord<TurtleP> right, but then how am I supposed to strip these chars?
20:10:22FromDiscord<demotomohiro> @TurtleP Find each invalid char with https://nim-lang.org/docs/strutils.html#find%2Cstring%2Cset%5Bchar%5D%2CNatural%2Cint and delete it.
20:10:23FromDiscord<Phil> ... can I alias "discard" ?
20:11:19FromDiscord<Phil> Turns out I can't, I am now sad, I'd have loved to rename that to "instantiate" or something and then use that at the end of modules
20:14:03*jmdaemon joined #nim
20:17:44FromDiscord<Elegantbeef> That's a top level statement↵(@Phil)
20:18:41FromDiscord<Phil> In reply to @Elegantbeef "That's a top level": Ohh, top as in "not indented and thus executed upon startup" ?
20:19:16FromDiscord<Phil> ... maybe implementing a spring service fumbled my brain again today, my mind went to top as in top-of-the-file
20:21:40FromDiscord<vlkrs> I’m getting a test failure when running stdlib/tsharedlist.nim with 1.6.4 … is that test known to break?
21:12:20FromDiscord<Waldecir Santos> In reply to @Isofruit "Turns out I can't,": can't you do it with a macro ?
21:14:17FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3R2h
21:14:39*jjido joined #nim
21:14:57FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3R2h" => "https://play.nim-lang.org/#ix=3R2j"
21:16:03FromDiscord<Phil> In reply to @Waldecir Santos "can't you do it": Haven't tried, I'm not particularly at the point where I actually "do" macros
21:28:08*ltriant joined #nim
21:30:50FromDiscord<haolian9 (高浩亮)> can anyone explain the replies a bit in [this thread](https://forum.nim-lang.org/t/8962)? seems i just asked a stupid question.
21:31:07*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:32:37*ltriant quit (Ping timeout: 240 seconds)
21:44:18*wyrd joined #nim
21:45:27FromDiscord<haxscramper> I don't know where the "code is invalid regardless of the used mm scheme" came from, because to me it seems like a hole in the spec, where `cstring()` works like `addr` on one MM scheme, and works differently on the other one
21:45:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3R2u
21:46:10FromDiscord<haxscramper> arc does switch underlying C string implementation to a different behavior IIRC
21:52:12FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R2y
21:55:45FromDiscord<haolian9 (高浩亮)> thanks. anyway, i dont want to ask it further
22:00:13*ltriant joined #nim
22:27:56FromDiscord<dom96> In reply to @haolian9 (高浩亮) "can anyone explain the": There are no stupid questions here. Getting different behaviour based on MM scheme does seem confusing
22:28:04FromDiscord<dom96> (edit) "In reply to @haolian9 (高浩亮) "can anyone explain the": There are no stupid questions here. Getting different behaviour based on MM scheme does seem confusing ... " added "here"
22:29:33FromDiscord<demotomohiro> In reply to @haolian9 (高浩亮) "can anyone explain the": I think it means `y.add("d")` can reallocate internal storage and `z` become invalid pointer.
22:45:40FromDiscord<Elegantbeef> @Phil\: there are multiple solutions here, you can manual subscribe procedures using a macro if you so wished, you could use something like traitor, could just expose the procedure and deal with instantiation errors if it's not in scope of instantiation
22:46:19FromDiscord<Elegantbeef> The issue is how generics are instantiated, Nim doesnt bind anything but hooks to types, as such you cannot have a procedure call a procedure that doesnt exist in scope of instantiation
22:46:24FromDiscord<Elegantbeef> After the procedure is instantiated it's fair game
23:14:41*jmdaemon quit (Ping timeout: 256 seconds)
23:22:38*jmdaemon joined #nim
23:24:52*girvo joined #nim
23:25:17girvohey all :)
23:25:30FromDiscord<huantian> hewwo
23:25:48girvofinally back to using Nim in anger at work, stoked lol
23:28:52*jjido joined #nim
23:33:22*oprypin quit (Quit: Bye)
23:33:32*oprypin joined #nim
23:34:54*jmdaemon quit (Ping timeout: 260 seconds)
23:37:28FromDiscord<Elegantbeef> Nice
23:38:30FromDiscord<Elegantbeef> Hopefully the anger is due to another language abusing you 😛
23:42:24*jmdaemon joined #nim
23:51:38*shalokshalom quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)