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