00:02:04 | nrds | <Prestige99> Should be merged and backported imo |
00:05:09 | FromDiscord | <Elegantbeef> Yea no clue i just pretend to fix things |
00:11:39 | * | duuude quit (Ping timeout: 260 seconds) |
00:16:24 | * | xet7 joined #nim |
00:22:12 | * | nsyd joined #nim |
00:27:54 | * | nsyd left #nim (WeeChat 3.5) |
00:29:29 | * | fowl1 joined #nim |
00:29:59 | * | fowl quit (Ping timeout: 246 seconds) |
00:29:59 | * | fowl1 is now known as fowl |
00:30:21 | FromDiscord | <SirOlaf> If I did this bisect right then this commit is evil https://github.com/nim-lang/Nim/commit/8e474fbb57c2f7b58a840b5b30230c2267633c8e |
00:30:34 | FromDiscord | <SirOlaf> Which is odd |
00:44:04 | * | duuude joined #nim |
00:47:31 | FromDiscord | <SirOlaf> Probably wrong though, hard to tell when the issue actually happens |
01:08:27 | * | vicfred quit (Quit: Leaving) |
01:15:24 | * | duuude quit (Ping timeout: 240 seconds) |
02:27:08 | FromDiscord | <xflywind> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/pull/19624#issuecom": @ElegantBeef, I don't know how to reproduce the issue (#19371). What am I missing? |
02:27:44 | FromDiscord | <Elegantbeef> Copy the code to a `.nim` file use `nimsuggest ./myfile.nim` and then `chk 1` |
02:29:01 | FromDiscord | <xflywind> I see, thanks. The command works. |
02:29:13 | FromDiscord | <Elegantbeef> It produces a false positive error |
02:30:05 | FromDiscord | <xflywind> yeah |
02:30:07 | FromDiscord | <Elegantbeef> Can i see your terminal output and nim version? |
02:30:50 | FromDiscord | <xflywind> I mean you are right đ |
02:30:51 | FromDiscord | <Elegantbeef> Rather nim suggest version |
02:30:57 | FromDiscord | <Elegantbeef> Oh |
02:31:07 | FromDiscord | <Elegantbeef> Thought you meant "The command works" as in "No issue" |
02:31:13 | FromDiscord | <Elegantbeef> Disregard that request them |
02:33:01 | FromDiscord | <Elegantbeef> If unclear the issue is cause nimsuggest creates multiple types/syms and as such the pointers are different which means we need the `id` check |
02:33:35 | FromDiscord | <xflywind> ok |
02:43:15 | * | arkurious quit (Quit: Leaving) |
04:10:42 | * | rockcavera quit (Remote host closed the connection) |
04:24:50 | * | slowButPresent quit (Quit: leaving) |
05:17:10 | FromDiscord | <charlie3> In reply to @creikey "I misread the info": hi |
05:18:46 | FromDiscord | <lemon2> In reply to @creikey "I misread the info": hi |
05:18:53 | FromDiscord | <charlie3> In reply to @creikey "how does arc process": hello? |
05:19:02 | FromDiscord | <lemon2> In reply to @creikey "how does arc process": baen |
05:19:08 | FromDiscord | <charlie3> In reply to @creikey "this is how I": ho ho ho |
05:19:30 | FromDiscord | <lemon2> In reply to @creikey "this is how I": noauh |
05:19:36 | FromDiscord | <charlie3> In reply to @creikey "I want to know": he he ho |
05:20:14 | FromDiscord | <lemon2> In reply to @creikey "I want to know": ha ha hooo |
05:20:26 | FromDiscord | <charlie3> whats not that long đ€ |
05:20:35 | FromDiscord | <charlie3> In reply to @creikey "it's actually not that": whats not that long đ€ |
05:20:50 | FromDiscord | <lemon2> In reply to @charlie3 "whats not that long": i think hes talking about his file size |
05:20:56 | FromDiscord | <charlie3> In reply to @lemon2 "i think hes talking": whats a file |
05:21:09 | FromDiscord | <lemon2> its ok cameron they go after the men who split them up |
05:21:27 | FromDiscord | <charlie3> In reply to @creikey "I'm almost halfway through": cameron the type of mf to play github |
05:21:48 | FromDiscord | <lemon2> In reply to @charlie3 "cameron the type of": bro smokin that double pack |
05:21:54 | FromDiscord | <charlie3> In reply to @lemon2 "bro smokin that double": double pump shotgun |
05:22:31 | FromDiscord | <lemon2> In reply to @charlie3 "double pump shotgun": anyways i prefer to use nano instead of vim |
05:22:52 | FromDiscord | <charlie3> In reply to @lemon2 "anyways i prefer to": most smartest regex user |
05:23:01 | FromDiscord | <charlie3> (edit) "user" => "memoriser" |
05:23:41 | FromDiscord | <lemon2> weakest nim user vs strongest javascript user |
05:24:15 | FromDiscord | <charlie3> weakest gdscript user vs strongest nim user |
05:25:07 | FromDiscord | <lemon2> weakest php user vs strongest react user |
05:25:08 | FromDiscord | <charlie3> In reply to @creikey "it's harder to write": no oen asekd |
05:26:05 | FromDiscord | <charlie3> In reply to @lemon2 "weakest php user vs": weakest html user vs strongest assembly user |
05:27:00 | FromDiscord | <lemon2> weakest hexadecimal coder vs strongest lua user |
05:28:13 | FromDiscord | <charlie3> weakest air breather vs strongest water sucker |
05:28:25 | FromDiscord | <lemon2> SGHUT THE FUCK UP CHARLIE |
05:28:45 | FromDiscord | <charlie3> YOU SHUT THE FUCK UOP LEMONFACE GRAPH HEADASS |
05:28:54 | FromDiscord | <charlie3> baen |
05:28:59 | FromDiscord | <lemon2> ha ha hoo |
05:29:05 | FromDiscord | <charlie3> ho ho hop |
05:30:03 | FromDiscord | <lemon2> stop typing |
05:30:05 | FromDiscord | <charlie3> In reply to @creikey "most java programs I": mf called minecraft bad đ x10^7 |
05:30:13 | FromDiscord | <charlie3> bvaen |
05:30:17 | FromDiscord | <lemon2> In reply to @creikey "most java programs I": CAMERON WHAT ARE YOU DOING |
05:30:27 | FromDiscord | <charlie3> In reply to @creikey "I mean of course": this is false |
05:30:37 | FromDiscord | <lemon2> weakest css user vs strongest c# user |
05:30:54 | FromDiscord | <charlie3> In reply to @creikey "except lua": average roblox alangaguge |
05:38:17 | * | Perryman joined #nim |
05:40:54 | * | vicfred joined #nim |
05:45:19 | * | vicfred quit (Ping timeout: 256 seconds) |
06:10:03 | Perryman | o/ I was wondering if nimble has a way to add required dependencies to <projectname>.nimble ? Or some other process to automatically/semiautomatically do that |
06:12:50 | FromDiscord | <pmunch> Yeah I agree, but apart from extreme hacks I'm not sure if it can be done |
06:14:05 | FromDiscord | <pmunch> Git autobisect is your friend |
06:14:29 | FromDiscord | <Elegantbeef> I mean you cant compile the compiler at some point between 1.4 and 1.6 without having the proper setup compiler |
06:14:48 | FromDiscord | <Elegantbeef> And i've been too lazy to do that |
06:18:22 | * | PMunch joined #nim |
06:18:31 | * | jjido joined #nim |
06:19:15 | PMunch | Ah yeah that's annoying. I had a script once which built Nim from C sources, ran a small test, and returned the proper error codes for git bisect to work |
06:19:36 | PMunch | We really should've had something like that in the repo |
06:27:01 | FromDiscord | <Rika> In reply to @Perryman "o/ I was wondering": What do you mean? |
06:27:07 | PMunch | Hmm, I can't think of a way to do this without annotations @Elegantbeef. I mean Nim doesn't have any mechanism to get a list of procedures which returns a type or anything like that. You can't really get code outside your own blocks.. I mean it's easy to extend to a block syntax so you don't have to attach the pragma everywhere |
06:27:20 | FromDiscord | <Rika> Like importing something in your code then nimble resolving the package? No |
06:27:44 | PMunch | But short of big hacks like reading the file statically and parsing it again in a macro I don't really know how I'd do it.. |
06:28:09 | FromDiscord | <Elegantbeef> Yea you cannot do it that way, i can only think of doing it with an interface of a fixed name and then do a bunch of when statements |
06:28:51 | PMunch | Yeah that would potentially work, but you might end up needing quite a lot of when statements |
06:32:02 | FromDiscord | <Perryman> In reply to @Rika "Like importing something in": yeah, this is what I was thinking |
06:33:33 | FromDiscord | <Rika> No I donât think it exists |
06:33:44 | FromDiscord | <Rika> Package name and module name arenât correlated so |
06:33:51 | FromDiscord | <Perryman> ohhh |
06:34:55 | PMunch | I guess it could look through installed packages and just file search for the module |
06:35:07 | FromDiscord | <Rika> Would be slow Iâd assume |
06:35:14 | FromDiscord | <Perryman> nim just does it |
06:35:41 | FromDiscord | <Perryman> like if I use nim to compile it it doesn't care that it has a dependency |
06:35:53 | PMunch | I'm not sure what you're using this for, but if it's just like a "fix my imports"-kind of editor feature then it should be fast enough |
06:36:02 | FromDiscord | <Rika> I guess |
06:36:09 | FromDiscord | <Perryman> In reply to @PMunch "I'm not sure what": yeah, i don't know if this belongs in vscode or nimble |
06:36:16 | PMunch | Well Nim sets the nimble directory by default |
06:36:38 | PMunch | When you use nimble it unsets the nimble directory and passes paths to the imported packages explicitly |
06:37:00 | PMunch | I guess you could set the import path back, but that kind of breaks the concept behind making a package out of it |
06:37:25 | PMunch | Nimble could certainly have some kind of "build project and list dependencies" |
06:39:08 | FromDiscord | <Rika> I use Nimph so I donât get this problem đ |
06:39:53 | FromDiscord | <Elegantbeef> Shit rika uses fancy software |
06:41:02 | PMunch | How does Nimph handle this` |
06:42:49 | FromDiscord | <Perryman> So... maybe the better question is, if this works:â”`nim c -d:release -d:releaseMain -d:tinyc src/ctfocr.nim`â”would it make sense for nimble to figure out the dependencies too? |
06:42:59 | FromDiscord | <Perryman> (edit) "src/ctfocr.nim`â”would" => "src/main.nim`â”would" |
06:43:05 | FromDiscord | <Rika> Sets âpath in projectâs Nim config when you install packages |
06:43:31 | FromDiscord | <Rika> So I believe dependencies are effectively project local |
06:44:57 | PMunch | Are they installed into the working tree of the package? |
06:45:12 | PMunch | Perryman, well it would kind of defeat the purpose of Nimble |
06:46:00 | FromDiscord | <Rika> I believe it doesnât, it still installs into the nimble directory, but I donât recall what else it does because I donât remember being able to access other packages within my module |
06:46:20 | FromDiscord | <Perryman> In reply to @PMunch "Perryman, well it would": what is the purpose of nimble vs. compiling with nim directly? |
06:46:49 | PMunch | Nimble, amongst many of it's other uses, serves to fetch dependencies automatically. This works by looking in the .nimble file, seeing if all the packages are installed, and then installing them if they don't. If Nimble would grab locally installed packages automatically it would mean that it would be easier to forget to add a dependency while developing, breaking the downloading of packages for the users. |
06:48:09 | PMunch | Say if you make a small program that I want to run, I would clone your package repo and run `nimble build`. If it was configured to be a binary output nimble would now check that I have a new enough compiler, check that all the packages are present, and build the program. |
06:48:37 | FromDiscord | <Perryman> In reply to @PMunch "Nimble, amongst many of": ahhh thank you! that is a really good answer. found the config file eventually but I didn't really follow the documentation fully |
06:48:45 | PMunch | You could also write more tasks into the Nimble file so if it required some extra sources or some system stuff to happen then that could be run as well. |
06:59:18 | FromDiscord | <Phil> There are nimble commands to compile and run my project?â”Huh... I'll look into that |
06:59:34 | FromDiscord | <Elegantbeef> Yea they're for "reproducible builds" |
06:59:43 | FromDiscord | <Elegantbeef> Though they're not always so reproducible until we get lock files |
06:59:47 | FromDiscord | <Phil> I was aware of nimble install and kind of ignored the rest |
07:00:14 | FromDiscord | <Elegantbeef> Yea `nimble build` builds the project only with dependencies in your .nimble |
07:00:20 | FromDiscord | <Perryman> I couldn't get vscode bindings automatically |
07:00:26 | FromDiscord | <Perryman> so i was just using the console |
07:00:27 | FromDiscord | <Elegantbeef> `nimble run` will run the binary if your project is a binary release |
07:00:34 | FromDiscord | <Perryman> (edit) "I couldn't get vscode bindings automatically ... " added "(working) yet" |
07:00:47 | FromDiscord | <Elegantbeef> People use other things than the console to build code? |
07:00:53 | FromDiscord | <Elegantbeef> Even in vscode i only used the terminal |
07:00:55 | FromDiscord | <Phil> In reply to @Perryman "I couldn't get vscode": Huh, the normal tasks json worked flawless for me |
07:01:14 | FromDiscord | <Perryman> In reply to @Isofruit "Huh, the normal tasks": yeah i think i screwed something up with it somehow |
07:01:28 | FromDiscord | <Perryman> c and python don't work either |
07:01:46 | FromDiscord | <Phil> I can't be arsed beef, I just execute a task on save that runs a compile and run command |
07:02:14 | FromDiscord | <Elegantbeef> Uhhh ok |
07:02:15 | FromDiscord | <Perryman> yeah, like I want to just smash F5 to compile build run |
07:02:23 | PMunch | Kids today with their fancy tools.. |
07:02:30 | FromDiscord | <Elegantbeef> Indeed pmunch |
07:02:54 | FromDiscord | <Elegantbeef> So i've accidently made a sokoban clone |
07:03:15 | PMunch | Haha, well Sokoban is fun |
07:03:21 | PMunch | Not the worst thing you could've cloned |
07:03:21 | FromDiscord | <Rika> What is that |
07:03:27 | FromDiscord | <Elegantbeef> simplescreenrecorder-2022-04-26\_00.38.56.mp4 https://media.discordapp.net/attachments/371759389889003532/968406937370755102/simplescreenrecorder-2022-04-26_00.38.56.mp4 |
07:03:30 | FromDiscord | <Elegantbeef> It's the block pushing game rika |
07:03:34 | FromDiscord | <Phil> Get with the times old timer, nobody manually writes compile commands anymore đ |
07:03:37 | FromDiscord | <Elegantbeef> Where you have to push blocks to get to the end |
07:03:37 | FromDiscord | <Rika> Oh itâs Japanese |
07:04:06 | FromDiscord | <Rika> Never knew this game originated from Japan lmao |
07:04:34 | PMunch | @Phil, I do :( Honestly `nim c -r myfile` isn't a great inconvenience |
07:04:47 | FromDiscord | <Elegantbeef> As do i |
07:04:50 | PMunch | And once I've typed it once I just hit up in the terminal to run it again |
07:04:53 | FromDiscord | <Elegantbeef> It's easier and i can be more explicit without modifying a file |
07:05:04 | FromDiscord | <Rika> But think about :make |
07:05:15 | FromDiscord | <Elegantbeef> Also i recently swapped to fish and oh boy is that a good shell |
07:05:15 | FromDiscord | <Elegantbeef> The autocomplete is lovely |
07:05:45 | FromDiscord | <Rika> Fish is nice, too bad no one uses it so I canât get workarounds/solutions for things that I could do on bash |
07:06:07 | FromDiscord | <Solitude> no way no one uses it |
07:06:33 | FromDiscord | <Rika> I think itâs less of no one using it more of âfish shellâ is fucked for search engines |
07:06:41 | FromDiscord | <Solitude> probably |
07:06:59 | FromDiscord | <Rika> Just get a lot of fishing equipment results |
07:07:01 | FromDiscord | <Phil> Be the search results you want to see in the world? |
07:07:13 | FromDiscord | <Phil> Ohhh that problem |
07:07:32 | PMunch | Haha, yeah fish shell is a tough thing to search for |
07:07:47 | PMunch | I use zsh, pretty good |
07:08:36 | FromDiscord | <Rika> Iâm not a fan of posix shell syntax so I like how fish did away with it |
07:15:06 | * | gsalazar joined #nim |
07:15:58 | FromDiscord | <untoreh> a `ptr uint8` buffer which length is know at runtime is an `openarray` ? can I cast it into a string or do I have to perform a copy? |
07:17:15 | * | xet7 quit (Ping timeout: 272 seconds) |
07:18:03 | FromDiscord | <Elegantbeef> you could do `cast[ptr UncheckedArray[char]](myBuffer).toOpenArray(0, myBufflen)` |
07:18:12 | FromDiscord | <Elegantbeef> But no you cannot get a `string` or `cstring` safely |
07:18:18 | FromDiscord | <Elegantbeef> Only `openArray[cha]` |
07:20:13 | FromDiscord | <Rika> You have to copy |
07:20:16 | FromDiscord | <Rika> Essentially |
07:20:49 | FromDiscord | <Rika> There really has to be an abstraction over sequences that is âmore unsafe than seq but less unsafe than uncheckedâ |
07:21:15 | FromDiscord | <Elegantbeef> `openArray` is that abstraction when view types are here |
07:21:20 | FromDiscord | <Rika> Thatâs more specific than open Iâd say |
07:21:30 | PMunch | @Rika, wait it doesn't work like a normal shell? |
07:21:34 | FromDiscord | <Rika> Does open store lengths of any sorts |
07:21:36 | FromDiscord | <Rika> ? |
07:21:40 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, wait it doesn't": Fish? |
07:21:42 | FromDiscord | <Elegantbeef> it stores the length of the slice |
07:21:44 | FromDiscord | <Rika> No the syntax is different |
07:21:53 | FromDiscord | <Rika> In reply to @Elegantbeef "it stores the length": Then I guess thatâs good enough for me |
07:22:01 | FromDiscord | <Solitude> In reply to @PMunch "<@259277943275126785>, wait it doesn't": garbage shell |
07:22:34 | FromDiscord | <Rika> Honestly POSIX shells are literally impossible to remember the syntax of, personally |
07:22:39 | FromDiscord | <Rika> Too many inconsistencies |
07:23:37 | PMunch | Hmm, that would probably take me ages to learn though.. |
07:23:42 | FromDiscord | <Elegantbeef> `strutils` really needs a rewrite to use `openArray[char]` for many procedures đ |
07:23:59 | FromDiscord | <Rika> Fish? Not really, blocks always end with âendâ and thatâs pretty much it |
07:24:22 | FromDiscord | <Rika> For file in (pretty much literally anything); something; end |
07:24:25 | FromDiscord | <Solitude> In reply to @Elegantbeef "`strutils` really needs a": this, its so annoying, i frequently copy paste strutils code jsut to change the signature |
07:24:37 | PMunch | Hmm, I bought some doorbell switches yesterday which doesn't require a battery. The act of pushing the button generates enough power to send a radio signal |
07:24:37 | FromDiscord | <Rika> If condition; something; end |
07:24:40 | FromDiscord | <Rika> Not too hard to learn |
07:24:54 | PMunch | Now I just wonder if I could hook it up to an Attiny85 and do something else useful with it |
07:24:55 | FromDiscord | <Rika> In reply to @Elegantbeef "`strutils` really needs a": openarrayutils lol |
07:25:09 | FromDiscord | <Rika> Iâm joking |
07:25:45 | FromDiscord | <Elegantbeef> anything that works with a static buffer should use `openarray[char]`, guess i should be the change i want to be |
07:29:22 | FromDiscord | <Elegantbeef> Yea i might get annoyed enough to change itâ”(@Solitude) |
07:29:35 | FromDiscord | <Elegantbeef> Atleast write an RFC for it |
07:32:10 | PMunch | That change would be very welcome indeed |
07:40:38 | * | duuude joined #nim |
07:58:01 | FromDiscord | <deadmeme77> Hey I tried compiling a nim file (thank you @demotomohiro) into a nimpy module, and got this error |
07:58:13 | FromDiscord | <deadmeme77> c++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/deadmeme/Documents/Programming/Python/texttospeech.so) |
07:58:32 | * | emery quit (Ping timeout: 250 seconds) |
08:02:29 | FromDiscord | <deadmeme77> libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/deadmeme/Documents/Programming/Python/texttospeech.so) |
08:03:00 | FromDiscord | <deadmeme77> even though I have already installed gxx_linux-64 in the anaconda environment. đ€ |
08:03:23 | * | ehmry joined #nim |
08:05:08 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] â I don't check my email often since it's full of crap, but in any case, [email protected]) |
08:08:57 | * | crem joined #nim |
08:09:19 | FromDiscord | <jmgomez> hey guys, how one can access to a value of an enum by index? |
08:09:38 | FromDiscord | <Elegantbeef> `MyEnum(myInt)` |
08:11:34 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
08:12:32 | * | jjido joined #nim |
08:14:37 | FromDiscord | <Elegantbeef> If that doesnt work be more explicit in what you want đ |
08:15:42 | FromDiscord | <jmgomez> Oh that did work, I thumb up your comment but I think you cant see it |
08:16:03 | FromDiscord | <Elegantbeef> Reactions do not propagate across the bridge for some odd reason |
08:16:14 | FromDiscord | <Elegantbeef> custom emojis do though đ |
08:17:05 | FromDiscord | <Rika> :flUshe: |
08:17:16 | FromDiscord | <jmgomez> xD |
08:17:54 | FromDiscord | <Elegantbeef> The bridge is weird |
08:18:10 | FromDiscord | <Elegantbeef> Our polls dont go through of course đ |
08:18:33 | madprops | i see yellow faces here |
08:18:39 | madprops | and :flUshe: |
08:18:50 | FromDiscord | <Elegantbeef> Yea matrix is fancier |
08:20:47 | madprops | in what ways apart from that? |
08:21:20 | FromDiscord | <Elegantbeef> It has built in multimedia support |
08:22:02 | FromDiscord | <Rika> In reply to @madprops "and :flUshe:": Itâs just âđłâ but with fish eye zoom |
08:24:11 | FromDiscord | <Zoom> s/zoom/lensâ”(@Rika) |
08:24:43 | FromDiscord | <Elegantbeef> Appreciate the pedantry |
08:25:26 | FromDiscord | <Zoom> Had to write something to not feel I was summoned for nothing |
08:25:33 | FromDiscord | <Elegantbeef> Oh right Zoom đ |
08:25:53 | FromDiscord | <Elegantbeef> No one writes elegantbeef except to insult me so i never get the accidental ping |
08:27:33 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
08:27:35 | FromDiscord | <Zoom> I rarely get those nowadays, not like previous couple of years. Probably it's because of enormous Jitsi success and growth. /s |
08:28:31 | FromDiscord | <Elegantbeef> I almost missed the joke |
08:28:57 | FromDiscord | <Elegantbeef> But hey element has their own jitsi-like now so who knows maybe it'll stop happening đ |
08:30:06 | FromDiscord | <Zoom> I always aim for "almost". Mostly hit "completely". |
08:30:43 | FromDiscord | <Elegantbeef> To be fair i've never touched Zoom, i've read more about jitsi than it đ |
08:33:41 | * | duuude quit (Ping timeout: 246 seconds) |
08:34:48 | FromDiscord | <Rika> In reply to @Zoom "s/zoom/lens (<@259277943275126785>)": Ok |
08:34:55 | FromDiscord | <Rika> I forgot xd even if Iâm into photography |
08:41:15 | FromDiscord | <Zoom> I'm not surprised, I'm not very popular. And I can live with "it" - how would you now I'm not a bot or an alien, right? |
08:55:03 | FromDiscord | <2F42BBA1> Nim is comfy to work with |
08:56:33 | FromDiscord | <Rika> Thatâs nice to hear |
09:02:23 | * | jmdaemon quit (Ping timeout: 246 seconds) |
09:05:53 | * | duuude joined #nim |
09:08:09 | * | lumo_e joined #nim |
09:15:40 | * | jjido joined #nim |
09:38:43 | FromDiscord | <dom96> ooh yay, a new job post |
09:53:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
09:56:50 | FromDiscord | <Zoom> Where?â”(@dom96) |
09:58:13 | FromDiscord | <Rika> #jobs in the discord |
09:58:17 | FromDiscord | <Rika> I donât think it is bridged |
09:58:55 | FromDiscord | <hmmm> broooooooskis long time no see! What is the cleanest way to check that a 0kb file is empty |
10:00:39 | FromDiscord | <dom96> read it to check the contents I guess |
10:00:48 | FromDiscord | <Rika> Get the stat and check the size via that |
10:00:52 | FromDiscord | <Zoom> Wow, discriminating access to jobs by IM network. That's new \:Dâ”(@Rika) |
10:01:03 | FromDiscord | <Rika> Itâs not intentional |
10:01:09 | FromDiscord | <hmmm> how do I check the stat rika |
10:01:27 | FromDiscord | <Rika> POSIX only |
10:01:32 | FromDiscord | <Rika> Itâs more complicated |
10:01:36 | FromDiscord | <Rika> Not sure if there are benefits |
10:01:38 | FromDiscord | <dom96> In reply to @Zoom "Wow, discriminating access to": With the amount of issues Matrix has I'd say you're discrimating against yourself by not simply using Discord đ |
10:01:40 | FromDiscord | <hmmm> dom if I read it I should expect to find like zero characters in it? |
10:01:40 | FromDiscord | <Rika> If you want simple just read the file |
10:01:43 | FromDiscord | <dom96> (edit) "discrimating" => "discriminating" |
10:01:50 | FromDiscord | <hmmm> or len something == zero? |
10:01:53 | FromDiscord | <Rika> The length of the string will be zero |
10:01:59 | FromDiscord | <dom96> readFile("file.txt").len == 0 |
10:02:07 | FromDiscord | <hmmm> I love u both â€ïž |
10:02:30 | FromDiscord | <Zoom> I don't have any issues đ€·â”(@dom96) |
10:02:45 | FromDiscord | <Rika> Letâs not argue about IM networks |
10:08:43 | FromDiscord | <d4rckh> i have a small program, its using the net library, its just a socket library, but it complains about not having the libwinpthread dll |
10:08:58 | FromDiscord | <d4rckh> i can easily get it from the mingw website, but i want it to not be dependent on it |
10:09:13 | FromDiscord | <d4rckh> im not actually using threads in my code, but i assume `net` does use it in its library |
10:09:27 | FromDiscord | <Rika> You arenât going to have fun static linking for windows, I personally donât know how itâs done |
10:10:32 | FromDiscord | <dom96> In reply to @d4rckh "i have a small": do you pass `--thread:on`? |
10:10:38 | FromDiscord | <dom96> (edit) "`--thread:on`?" => "`--threads:on`?" |
10:10:56 | FromDiscord | <d4rckh> no i dont |
10:11:25 | FromDiscord | <dom96> hm, maybe it's on by default these days? try with `--threads:off` |
10:12:30 | FromDiscord | <Rika> Itâs not |
10:13:12 | FromDiscord | <dom96> I cannot find anything in the Nim repo referring to libwinpthread.dll |
10:13:31 | FromDiscord | <dom96> maybe one of your dependencies links to it? |
10:13:50 | FromDiscord | <d4rckh> im also using `nativesockets` |
10:13:53 | FromDiscord | <d4rckh> and `winim` |
10:14:15 | FromDiscord | <d4rckh> `os`, `strformat`, `strutils`, `osproc`, `os`, `base64` |
10:14:21 | FromDiscord | <d4rckh> there are all of my dependencies |
10:14:26 | FromDiscord | <d4rckh> (edit) removed "of" |
10:14:42 | FromDiscord | <d4rckh> even if i compile it with --threads:on, it still compains |
10:14:45 | FromDiscord | <d4rckh> (edit) "compains" => "complains" |
10:15:33 | FromDiscord | <dom96> what's the exact error you're getting? |
10:15:59 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/968455390004146226/unknown.png |
10:16:18 | FromDiscord | <d4rckh> if i get the dll and put it next to the binary it works fine |
10:16:22 | FromDiscord | <d4rckh> but i dont wanna have to do that |
10:16:38 | FromDiscord | <Tyrone Wiggums> In reply to @d4rckh "but i dont wanna": try using pointers |
10:17:26 | FromDiscord | <dom96> In reply to @Tyrone Wiggums "try using pointers": Strike 1 |
10:17:32 | FromDiscord | <dom96> Don't troll here đ |
10:17:35 | FromDiscord | <Tyrone Wiggums> or if you're on windows put it in system32 |
10:17:56 | FromDiscord | <Tyrone Wiggums> basically acts as path for windows |
10:18:15 | FromDiscord | <dom96> In reply to @d4rckh "": that looks like it's not Nim loading it, another one of the DLLs your program depends on must also need this DLL |
10:18:33 | FromDiscord | <dom96> do you have other DLLs beside your .exe? |
10:18:57 | FromDiscord | <d4rckh> Nope |
10:19:27 | FromDiscord | <dom96> hm, then I would say your best bet is to selectively remove code until that error is gone |
10:19:34 | FromDiscord | <dom96> that way you can identify which library is the cause |
10:19:46 | FromDiscord | <d4rckh> hmm okay |
10:19:52 | FromDiscord | <d4rckh> how can I static link it tho? |
10:19:57 | FromDiscord | <d4rckh> it shouldn't be too hard? Right đ
|
10:21:24 | FromDiscord | <dom96> it likely is, I would instead focus on getting rid of this dependency |
10:22:29 | FromDiscord | <dom96> first check if a simple hello world also needs this to rule out MINGW weirdness (maybe you've got some flag enabled that makes it add that as a dependency) |
10:28:49 | FromDiscord | <d4rckh> and... you are right |
10:28:54 | FromDiscord | <d4rckh> i had nim.cfg with --threads:on |
10:29:03 | FromDiscord | <Rika> How |
10:29:42 | FromDiscord | <d4rckh> i had that flag enabled every time i ran nim in my `nim.cfg` file |
10:29:43 | FromDiscord | <dom96> hah |
10:29:56 | FromDiscord | <d4rckh> because i have a client (which doesnt require threads) and a server (which does) |
10:36:38 | FromDiscord | <Solitude> you can have modulename.nim.cfg for more specific configs |
10:38:42 | FromDiscord | <Elias> Do I understand this correctly? I can safely cast `float32` to `float`, but not `float` to `float32`. Because float generally means `float64`? Think I have hard about potential problems casting downwards in size (which makes sense) |
10:38:59 | FromDiscord | <Elias> (edit) "hard" => "heard" |
10:39:23 | FromDiscord | <Rika> You can convert either safely but you lose information downwards |
10:39:28 | FromDiscord | <Rika> Casting either is unsafe |
10:39:49 | FromDiscord | <Rika> Unsafe in the sense that the values will not be correlated |
10:41:26 | FromDiscord | <Elias> Will there be a huge difference? Have done little floating point math when it comes to binary yet... |
10:42:00 | * | lumo_e quit (Ping timeout: 276 seconds) |
10:42:14 | FromDiscord | <Rika> Difference in terms of what |
10:42:29 | FromDiscord | <Rika> Precision yes |
10:42:31 | FromDiscord | <Rika> Speed depends |
10:42:56 | FromDiscord | <Rika> Iâm not even sure about your concern |
10:44:45 | FromDiscord | <Elias> glm returns a `Mat4[float32]`, and I (at least for now) have written `Mat4[float]` as my return type. |
10:45:02 | FromDiscord | <Elias> in a proc |
10:45:35 | FromDiscord | <Rika> Okay, then whatâs your concern |
10:45:37 | FromDiscord | <Rika> Iâm still not sure |
10:46:35 | FromDiscord | <Elias> Aaah, ok. I wonder if it can be a problem or if I just get a float64 with "reduced" precision |
10:47:14 | FromDiscord | <Elias> (no real loss of precision) |
10:47:50 | FromDiscord | <Rika> Problem in what sense? |
10:50:15 | FromDiscord | <Elias> Becoming something else than the number I pass in. But, it seems according to your answer that it only is a problem downwards in size. Me (thinking integers in my head) wondered if there is a equivalent to a overflow in float types or if there is just loss of precision |
10:50:22 | PMunch | Huh, cool to see a new job listing. Especially that they want to have it written in Nim when they have one in Node and don't seem to have a dev already |
10:50:35 | FromDiscord | <Rika> Floats have an âoverflowâ which is when you hit infinity |
10:50:40 | PMunch | Too bad I just got hired for a new job :P |
10:50:47 | FromDiscord | <Rika> But itâs no problem since you canât go under |
10:51:17 | FromDiscord | <Rika> Something else than the number only happens if you donât convert the bits properly, which wonât happen if you use conversion |
10:51:20 | FromDiscord | <Rika> But will if you use cast |
10:51:57 | FromDiscord | <Rika> In reply to @Rika "Something else than the": Actually I guess if the 64 float value is larger than the max of the 32 float, it might become infinity |
10:52:08 | FromDiscord | <Rika> But once something is infinity it stays infinity I believe |
10:53:06 | FromDiscord | <dom96> In reply to @PMunch "Huh, cool to see": What I'm curious is what's the salary range, if it wasn't for the low amount of job postings we have already I would require that to be mentioned up-front |
10:53:21 | FromDiscord | <Elias> In reply to @Rika "Something else than the": What is the difference between conversion and casting? |
10:53:28 | PMunch | dom96, oh that's a good point |
10:53:41 | FromDiscord | <Rika> In reply to @Elias "What is the difference": float(value) vs cast[float](value) |
10:53:52 | PMunch | @Elias, casting just treats a series of bytes as a different type, converting actually converts one value to another |
10:55:12 | PMunch | converting a float32 to a float shouldn't lose any precision, but you won't magically get better precision either, so there's not really a point in doing it unless you actually need them to be floats |
10:56:09 | FromDiscord | <Elias> In reply to @PMunch "<@390570241903689728>, casting just treats": Must say I have never heard about conversion before. Will conversion be the same as `variable.float` or is that a cast? |
10:56:14 | FromDiscord | <Rika> Yes |
10:56:17 | FromDiscord | <Rika> Itâs conversion |
10:56:20 | FromDiscord | <Rika> MCS |
10:56:35 | FromDiscord | <Rika> If thereâs cast itâs a cast |
10:56:40 | FromDiscord | <Rika> Otherwise itâs conversion |
10:56:41 | FromDiscord | <Elias> In reply to @Rika "Yes": Thought that was casting too đ |
10:56:42 | FromDiscord | <Rika> Pretty much |
10:56:58 | FromDiscord | <Rika> Casting is an overloaded word because of C |
10:57:12 | FromDiscord | <Rika> Cast here means reinterpret cast if you know C++ I believe |
10:57:50 | FromDiscord | <Elias> In reply to @Rika "Otherwise itâs conversion": Do you mean it will cast if possible, else convert? |
10:57:56 | FromDiscord | <Elias> is conversion slower? |
10:58:18 | FromDiscord | <Rika> What? |
10:58:23 | FromDiscord | <Rika> Okay wait |
10:58:25 | PMunch | It's slow-er, but typically not very slow |
10:59:01 | PMunch | Casting doesn't require any work at runtime, it's just a matter of treating a type as something else |
10:59:17 | * | lumo_e joined #nim |
10:59:32 | PMunch | Conversion have to actually do something to the data |
11:00:29 | FromDiscord | <Elias> In reply to @PMunch "converting a float32 to": The point is not a precision thing. Just using generic types as a starting point. Maybe it is stupid, but another example is that I use normal int instead of GL equivalent types for simplicity if I ever were to change backend api |
11:00:50 | FromDiscord | <Elias> (edit) "GL" => "OpenGL" |
11:01:30 | FromDiscord | <Elias> In reply to @PMunch "Casting doesn't require any": Ok |
11:02:04 | PMunch | (of course casting a float32 to a float64 doesn't work, as @Rika already pointed out) |
11:02:23 | FromDiscord | <Rika> it works but its not what you expect |
11:03:45 | PMunch | Does it work? |
11:03:48 | FromDiscord | <Tyrone Wiggums> In reply to @PMunch "(of course casting a": doesnt make sense |
11:03:51 | PMunch | I mean they are different sizes.. |
11:03:57 | FromDiscord | <Elias> In reply to @PMunch "(of course casting a": So if I understand it will compile, but my numbers dont make sense anymore? |
11:04:03 | FromDiscord | <Tyrone Wiggums> i should be able to convert anything to anything |
11:04:17 | FromDiscord | <Tyrone Wiggums> like string to array of characters |
11:04:21 | FromDiscord | <Elias> (edit) "In reply to @PMunch "(of course casting a": So if I understand it will compile, but my numbers dont make sense anymore? ... " added "(If I cast)" |
11:04:27 | FromDiscord | <Rika> In reply to @PMunch "Does it work?": it would probably just consume the next 32 bits after the float32 |
11:04:33 | FromDiscord | <Rika> "consume" |
11:04:35 | PMunch | Okay, so it does actually work.. |
11:04:50 | FromDiscord | <Rika> In reply to @Elias "So if I understand": yes |
11:04:58 | FromDiscord | <Rika> you're reinterpreting memory as it is |
11:05:05 | FromDiscord | <Rika> "fooling the compiler's type system" |
11:05:07 | FromDiscord | <Elias> In reply to @Rika "it would probably just": Haha, that will be some fun numbers |
11:06:35 | FromDiscord | <Rika> hmm, i wanna know if you cast a literal |
11:06:47 | FromDiscord | <Rika> !eval echo cast[float64](0'f32) |
11:06:49 | NimBot | 8.358285837067407e+266 |
11:06:56 | FromDiscord | <Rika> đ |
11:07:17 | FromDiscord | <Rika> just dont use cast |
11:07:25 | FromDiscord | <exelotl> In reply to @Tyrone Wiggums "doesnt make sense": read the convo again - cast is not the same as conversion |
11:08:19 | FromDiscord | <Elias> But, now when I am abstracting OpenGL and glm. Would you recommend to convert specific types from OpenGL and glm to generic types so that "internally" I dont need conversions or only to convert when something will not play together? |
11:08:37 | FromDiscord | <Rika> example? |
11:11:14 | FromDiscord | <Elias> such as getting float32 from glm. I do not know how I am going to use it yet because I am in the process of abstracting stuff should I then just pass on the float32 into the higher abstraction levels or just convert it to float before returning to keep things generic? |
11:11:39 | FromDiscord | <Elias> Am new to the level of control you have with nim |
11:12:08 | FromDiscord | <Rika> i have no idea what you mean |
11:12:12 | FromDiscord | <Elias> Hehe |
11:12:29 | * | Arrrrrrr joined #nim |
11:12:41 | PMunch | @Elias, hopefully this will help: https://play.nim-lang.org/#ix=3WhZ |
11:12:48 | PMunch | Or maybe it just confuses you further :P |
11:14:06 | PMunch | @Elias, what you could do is pass it along as a generic |
11:14:44 | PMunch | Define that it returns a Vec4[float32] but that you require a Vec4[SomeFloat] |
11:15:03 | PMunch | That way if you later change to float64 it will just propagate |
11:15:41 | PMunch | And assuming you don't do any bit-twiddling or manually specify the size of it anywhere it should all just work or throw an error telling you where floats aren't supported |
11:18:42 | FromDiscord | <Rika> woo my rpi pico arrived today xd |
11:18:50 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/SdN |
11:18:56 | PMunch | Oh nice, got any plans for it? |
11:19:51 | FromDiscord | <Elias> The problem here is that I am used to not having to specify bit width of my variables. Then I wonder what to do when the modules I use gives me stuff with specific bit widths back when I call their procs (such as float32). Should I just convert it to float straight away so that internally in my engine everything uses generic float (as a example) or just convert as needed and return whatever I get? All I want is the one that avoids too many |
11:20:28 | FromDiscord | <Elias> its perhaps a detail, just wonder how you work with this |
11:20:38 | PMunch | @Elias, generally I handle it with generics |
11:20:53 | PMunch | If I don't care about the specific bit-ness then use a generic or typeclass |
11:21:14 | PMunch | @d4rckh, does indeed sound like you're doing something wrong |
11:22:51 | FromDiscord | <Rika> In reply to @d4rckh "I think I am": are you able to compile them |
11:23:02 | FromDiscord | <Rika> you're showing an editor error but is compiling working |
11:23:15 | FromDiscord | <d4rckh> nope |
11:23:22 | FromDiscord | <d4rckh> the editor uses `nim check` |
11:23:22 | FromDiscord | <Elias> sent a code paste, see https://paste.rs/7PP |
11:23:54 | PMunch | @Elias, I wouldn't |
11:24:15 | PMunch | As I said, return the types you have, but accept multiple types |
11:24:50 | * | jjido joined #nim |
11:25:25 | FromDiscord | <Rika> `DDDTransform` is what specifically |
11:25:29 | FromDiscord | <Rika> maybe you can make that generic |
11:26:39 | FromDiscord | <Elias> That one is not the problem |
11:27:08 | FromDiscord | <Elias> sent a code paste, see https://play.nim-lang.org/#ix=3Wi1 |
11:27:27 | FromDiscord | <Elias> forgot the .get |
11:27:50 | FromDiscord | <Rika> I mean to make it generic so you can use it to determine the return type |
11:28:30 | FromDiscord | <Elias> That sounds interesting. How would that work? |
11:29:29 | FromDiscord | <Elias> can the output return type be determined by the input? |
11:30:39 | FromDiscord | <Rika> Yes |
11:32:23 | FromDiscord | <Elias> could i then automatically convert "that one" to the correct type? |
11:32:36 | FromDiscord | <Rika> If needed sure |
11:32:42 | FromDiscord | <Phil> @Elias You can basically say "the input parameter will have type A, the output parameter will have the same type as the input parameter" |
11:32:43 | FromDiscord | <Rika> Usually it isnât |
11:33:38 | FromDiscord | <Elias> Well my return type "something" does not nescessarily match the Mat4[float32] that I get from the .translate)( |
11:33:41 | FromDiscord | <Elias> (edit) ".translate)(" => ".translate()" |
11:33:55 | FromDiscord | <Rika> Why |
11:34:09 | FromDiscord | <Rika> Why canât it? |
11:34:21 | FromDiscord | <Rika> Make translate generic too đ |
11:34:24 | FromDiscord | <Phil> Does the translate() not always return the same type? |
11:34:35 | FromDiscord | <Phil> You may want to play around with object variants in that case |
11:34:47 | FromDiscord | <Phil> Another approach would be as Rika stated, generics in generics |
11:34:54 | FromDiscord | <Elias> translate comes from glm |
11:35:05 | FromDiscord | <Phil> What does glm give you? |
11:35:14 | FromDiscord | <Elias> Mat4[float32] |
11:35:14 | FromDiscord | <Rika> And is it generic in some way, be it overloaded, implicit, or explicit? |
11:35:25 | FromDiscord | <Elias> In reply to @Rika "And is it generic": ? |
11:35:33 | FromDiscord | <Rika> Are there overloads |
11:35:43 | FromDiscord | <Phil> In reply to @Elias "Mat4[float32]": In what scenario could it then return you a value that doesn't match the output of Mat4[float32] of your own proc? |
11:36:07 | FromDiscord | <Elias> I specify Mat4[float] I get Mat4[float32] |
11:36:22 | FromDiscord | <Phil> Ohhhhhhh |
11:36:28 | FromDiscord | <Elias> (edit) "I specify Mat4[float] ... I(need" added "as return type" | "as return typeI get Mat4[float32] ... " added "(need conversion unless generics)" |
11:36:34 | FromDiscord | <Phil> Basically there's an explicit mapping from type A to type B |
11:36:39 | FromDiscord | <Rika> Why? |
11:36:42 | FromDiscord | <Phil> float to float32, int to int32 I assume |
11:36:49 | FromDiscord | <Elias> the other way |
11:37:36 | FromDiscord | <Phil> Hmm how performance critical is this? are you fighting for every millisecond? Do you very much care that it HAS to be float vs float32? |
11:37:45 | FromDiscord | <deadmeme77> How do you refer to an enum? |
11:38:12 | FromDiscord | <deadmeme77> I want to use std/jsfetch, but it complains that newFetchOptions(metod = "POST") is of wrong type, string instead of HttpMethod |
11:38:40 | FromDiscord | <Phil> In reply to @deadmeme77 "How do you refer": HttpMethod.POST or Post or hmPost or however they name their enums |
11:38:53 | FromDiscord | <frobnicate> No quotations |
11:39:11 | FromDiscord | <Phil> (edit) "enums" => "enum-values" |
11:39:26 | FromDiscord | <deadmeme77> In reply to @frobnicate "No quotations": metod = POST got undeclared identifier error |
11:39:27 | FromDiscord | <Rika> In reply to @deadmeme77 "I want to use": `HttpPost` |
11:39:48 | FromDiscord | <frobnicate> https://nim-by-example.github.io/types/enums/ |
11:39:56 | FromDiscord | <frobnicate> Then it's the wrong identifier |
11:39:57 | FromDiscord | <Rika> you might need to import `httpcore` as well |
11:39:59 | FromDiscord | <deadmeme77> In reply to @Rika "`HttpPost`": undeclared variable as well |
11:40:02 | FromDiscord | <deadmeme77> Ah, that might be |
11:40:04 | FromDiscord | <deadmeme77> Yeah thats the issue |
11:40:05 | FromDiscord | <deadmeme77> thanks Rika |
11:40:08 | FromDiscord | <deadmeme77> thanks All đ |
11:40:10 | FromDiscord | <Elias> In reply to @Isofruit "Hmm how performance critical": No I just use generic float. glm https://github.com/stavenko/nim-glm/ has a funciton translate that takes in a matrix and some coordinates to represent as a matrix which ill pass on to a uniform. It returns a Mat4[float32] and I just wondered if best practice is to convert to Mat4[float], but then we got started on generics... |
11:40:49 | FromDiscord | <Phil> In reply to @Elias "No I just use": Ahhh check. So you wanted to stick with float in order to not have to think about bit-size? |
11:40:57 | FromDiscord | <Elias> yepp |
11:41:21 | FromDiscord | <Elias> But then generics was something that could make everything even less specific as far I understand |
11:42:06 | FromDiscord | <Phil> generics are basically a template that is used to build explicit procs at the places that call the generics |
11:42:27 | FromDiscord | <Phil> (edit) "generics are basically a template that is used to build explicit procs at the places that call the generics ... " added "with the specified types" |
11:42:30 | FromDiscord | <frobnicate> I would imagine you would want it to be specific? I mean OpenGL uses f32â”So yeah I was gonna suggest templates |
11:43:16 | FromDiscord | <Phil> Either way, I think the two ways I see there are either: Accept to live with f32, or convert from f32 to float manually, which isn't hard, but might not be what you want if it's performance critical |
11:43:24 | FromDiscord | <Elias> In reply to @frobnicate "I would imagine you": at the lower levels of my engine yes, but else I dont care and would rather not think about bit size. |
11:43:44 | FromDiscord | <frobnicate> Is your engine just for you? |
11:44:38 | FromDiscord | <Phil> I'm really surprised they enforce the swap to f32 though, got to say |
11:45:09 | FromDiscord | <frobnicate> Well OpenGL uses f32 so |
11:45:12 | FromDiscord | <Elias> Currently its only for me. if it becomes any good Ill perhaps make it a nimble package. Easy enough to just convert just wondered if there are other (better) ways to do it I can learn from |
11:45:15 | FromDiscord | <Phil> Wait, they give generics |
11:46:04 | FromDiscord | <frobnicate> I've tried using the wrong float on accident, so I personally don't mind enforcing it |
11:46:26 | FromDiscord | <Phil> We're takling about the translate proc in `mat_transform.nim`, right? |
11:47:11 | FromDiscord | <Elias> In reply to @Elias "Currently its only for": I am not in a rush to finish it. Want to learn as much as possible from designing it in a good way. Hence the discussion |
11:48:35 | FromDiscord | <frobnicate> What's the consequences of converting an f64 to f32 exactly? Just dropping precision or can you end up with entirely different numbers? |
11:49:01 | FromDiscord | <Yardanico> dropping precision |
11:49:10 | FromDiscord | <Elias> I think the conclusion was conversion is completely fine but cast not |
11:49:18 | FromDiscord | <frobnicate> Then I guess it isn't that bad |
11:49:26 | FromDiscord | <Yardanico> In reply to @Elias "I think the conclusion": you shouldn't cast if you want to convert |
11:49:26 | FromDiscord | <Elias> since I am moving up in bit size there is theoretically no loss |
11:49:28 | * | Zectbumo quit (Remote host closed the connection) |
11:49:40 | FromDiscord | <Elias> yep, rika explained |
11:49:41 | FromDiscord | <Yardanico> yeah, but @frobnicate asked about f64 -> f32 |
11:49:46 | FromDiscord | <Elias> aah |
11:49:48 | FromDiscord | <Yardanico> f32 -> f64 should have no accuracy loss |
11:49:50 | FromDiscord | <Yardanico> i think |
11:49:57 | FromDiscord | <frobnicate> In reply to @Elias "since I am moving": At some point it needs to go back to f32 is my point |
11:50:10 | FromDiscord | <Elias> yep |
11:50:15 | FromDiscord | <Rika> you might get inf if you exceed f32 limits |
11:50:22 | FromDiscord | <Elias> In reply to @frobnicate "At some point it": aaah, now I get it |
11:50:40 | FromDiscord | <Yardanico> but if you convert from/to f32->f64 all the time you might also lose performance |
11:51:09 | FromDiscord | <frobnicate> That's also my worry but I'd have to see a benchmark |
11:51:12 | * | xet7 joined #nim |
11:51:17 | FromDiscord | <Elias> In reply to @frobnicate "At some point it": so it could be a problem with float64 math for physics and then converting to float32 when passing on to OpenGL? |
11:51:23 | FromDiscord | <frobnicate> Yeah |
11:51:27 | FromDiscord | <Rika> !eval echo float32(4.4028234664e38) |
11:51:29 | NimBot | inf |
11:51:36 | FromDiscord | <Elias> fun |
11:51:57 | FromDiscord | <Rika> not an issue of course if you're not dealing with astronomy level sizes |
11:52:05 | FromDiscord | <Rika> just something to be wary of |
11:52:08 | FromDiscord | <Elias> who knows... |
11:52:25 | FromDiscord | <frobnicate> It might make sense to use high precision in some cases, but you need to make sure it's converted back nicely at some point |
11:53:09 | FromDiscord | <Elias> Ok, then as a starting point it may be simpler to just use float32 and take the problem with higher precision if it arises? |
11:53:19 | FromDiscord | <frobnicate> Yes |
11:53:23 | FromDiscord | <Rika> doubtful it ever will though |
11:53:40 | FromDiscord | <frobnicate> F32 is enough for the unreal guys, so |
11:53:46 | FromDiscord | <Elias> Think ill be fine đ |
11:53:48 | FromDiscord | <frobnicate> They seem to set the standard |
11:54:11 | FromDiscord | <frobnicate> I blame marketing đž |
11:55:10 | FromDiscord | <Elias> It's settled then |
12:00:23 | FromDiscord | <Elias> But this however. Most are GLuints originally and some are ints, use int as standard or generics? https://media.discordapp.net/attachments/371759389889003532/968481663246032917/unknown.png |
12:00:40 | * | xet7 quit (Remote host closed the connection) |
12:01:11 | FromDiscord | <frobnicate> Personally I use gluints in my math |
12:01:26 | FromDiscord | <frobnicate> Or uint |
12:01:50 | FromDiscord | <frobnicate> Since signed to unsigned can be fucky wucky |
12:02:10 | FromDiscord | <Elias> Thats a thing too. (forgot) |
12:02:17 | FromDiscord | <frobnicate> The places that can have negative values i just use int |
12:02:30 | FromDiscord | <frobnicate> But most of those are actually floats |
12:03:03 | FromDiscord | <frobnicate> It's usually uints for object IDs in OpenGL |
12:03:10 | FromDiscord | <frobnicate> The rest is floats |
12:04:14 | FromDiscord | <Elias> Ok, then ill go with uint as a standard |
12:04:34 | FromDiscord | <Elias> Thanks everyone |
12:21:52 | FromDiscord | <deadmeme77> @Yardanico thank you! Let's move here |
12:22:21 | FromDiscord | <deadmeme77> is there a way to make echo able to show hiragana/kanji in terminal instead of unicode chars? |
12:22:45 | FromDiscord | <Yardanico> can you show the current output? |
12:22:47 | FromDiscord | <deadmeme77> I see, input.convert(), thanks |
12:22:50 | FromDiscord | <deadmeme77> its this |
12:22:50 | FromDiscord | <Yardanico> nonono |
12:22:58 | FromDiscord | <Yardanico> just show what it currently outputs |
12:23:05 | FromDiscord | <deadmeme77> https://media.discordapp.net/attachments/371759389889003532/968487378782154812/unknown.png |
12:23:08 | FromDiscord | <Yardanico> you basically just need to take the json field and get the string out of it |
12:23:28 | FromDiscord | <deadmeme77> I used echo response.body and get that |
12:23:32 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wib |
12:23:40 | FromDiscord | <deadmeme77> I see, thanks. So char --> string conversion |
12:23:51 | FromDiscord | <Yardanico> well, not exactly, this isn't a conversion |
12:24:14 | FromDiscord | <Yardanico> it's just that in JSON you generally escape unicode strings so they are written with hex codes of unicode characters |
12:24:21 | FromDiscord | <Yardanico> it's the same string, just encoded differently |
12:24:34 | FromDiscord | <deadmeme77> I see, I understand now |
12:24:43 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wic |
12:24:46 | FromDiscord | <deadmeme77> yep it works, thank you! |
12:24:59 | FromDiscord | <Yardanico> but you maybe also need to make it handle failures, because I guess if an error happens "translatedText" field won't exist |
12:25:34 | FromDiscord | <deadmeme77> should I use assert or try, catch? |
12:25:43 | FromDiscord | <deadmeme77> I think I see both used in examples |
12:25:55 | FromDiscord | <Yardanico> in this case you can just check if a field exists |
12:26:10 | FromDiscord | <Yardanico> or rather, use getStr's optional second argument |
12:26:43 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wif |
12:26:57 | FromDiscord | <Yardanico> {} is different from [] in the sense that it'll return an nil JsonNode instead of erroring if that field doesn't exist |
12:27:30 | * | slowButPresent joined #nim |
12:31:01 | FromDiscord | <deadmeme77> Is that because {} is used for sets and [] for arrays? Or different concept? |
12:31:13 | FromDiscord | <Yardanico> no, that's not related |
12:31:26 | FromDiscord | <Yardanico> @deadmeme77 in Nim you can redefine operators easily, so JsonNode has both [] and {} defined for it that have different behaviour |
12:31:37 | FromDiscord | <deadmeme77> Ah, I see. Library overloading |
12:31:40 | FromDiscord | <Yardanico> well, rather not redefine but overload |
12:31:50 | FromDiscord | <deadmeme77> (edit) "Ah, I see. Library ... overloading" added "operator" |
12:31:57 | FromDiscord | <Yardanico> this is the specific overload that is used in my code example - https://nim-lang.org/docs/json.html#%7B%7D%2CJsonNode%2Cstring |
12:32:28 | FromDiscord | <Yardanico> and normal [] that raises an exception if the field doesn't exist - https://nim-lang.org/docs/json.html#%5B%5D%2CJsonNode%2Cstring |
12:33:31 | * | zeus-supreme joined #nim |
12:34:36 | * | zeus-supreme quit (Client Quit) |
12:49:05 | FromDiscord | <untoreh> sent a code paste, see https://paste.rs/9KO |
12:49:15 | * | rockcavera joined #nim |
12:49:16 | * | rockcavera quit (Changing host) |
12:49:16 | * | rockcavera joined #nim |
12:50:51 | FromDiscord | <untoreh> mmh nothing I think it works đ |
12:59:04 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
13:00:36 | FromDiscord | <ph4qd> sent a code paste, see https://play.nim-lang.org/#ix=3Win |
13:03:03 | FromDiscord | <Rika> same as `HOOKPROC(HookCallback)` |
13:03:14 | FromDiscord | <Rika> side effect of command call syntax |
13:03:19 | PMunch | @ph4qd, it's just an alternative way of converting types |
13:05:16 | * | arkurious joined #nim |
13:05:27 | FromDiscord | <ph4qd> oh ok that's really helpful thank you |
13:07:09 | FromDiscord | <ph4qd> is this alternative style for type conversion in the docs? i had been searching around without much luck |
13:09:40 | PMunch | Well it's not specific to type conversion |
13:09:46 | PMunch | As @Rika said it's just command call syntax |
13:10:13 | PMunch | !eval (echo) "Hello world" |
13:10:15 | NimBot | Hello world |
13:10:41 | PMunch | The parenthesis are obviously not required |
13:11:27 | FromDiscord | <ph4qd> ah got it makes more sense now |
13:11:57 | PMunch | It could just read `Hookproc HookCallback` or `HookCallback.HOOKPROC` or `HookProc(HookCallback)` |
13:14:00 | PMunch | Really those procedure names should be camelCase instead of PascalCase, and the indentation isn't NEP-1. If you're trying to learn Nim I'd recommend looking at some better sources |
13:21:17 | FromDiscord | <dom96> PMunch: I'm trying to get us some more DO credit to expand the playground server |
13:21:53 | FromDiscord | <Rika> is playground on DO? |
13:22:25 | PMunch | Hopefully, otherwise those DO credits probably wouldn't help |
13:23:06 | FromDiscord | <ph4qd> any recommendations for repos implementing the `winim` library that have well-written idiomatic code? |
13:24:01 | FromDiscord | <dom96> In reply to @Rika "is playground on DO?": yep |
13:24:37 | PMunch | @ph4qd, hmm it seems like winim has copied the naming convention from the underlying library, so they will all have the weird names.. |
13:25:31 | PMunch | But the examples in the repo seems to be written in decently styled Nim |
13:32:26 | * | duuude quit (Remote host closed the connection) |
13:53:46 | FromDiscord | <deadmeme77> In reply to @PMunch "!eval (echo) "Hello world"": huh nim has !eval() as well? |
13:54:07 | PMunch | @deadmeme77, no the !eval is just a command to the NimBot |
13:54:23 | PMunch | It will execute the snippet using the playground and output the result here in the chat |
13:54:31 | PMunch | !eval echo "Hello @deadmeme77" |
13:54:33 | NimBot | Hello @deadmeme77 |
13:54:38 | PMunch | Like that |
13:54:52 | FromDiscord | <deadmeme77> ahh wkwk I see, thanks |
13:57:34 | * | PMunch quit (Quit: Leaving) |
14:07:12 | * | LuxuryMode joined #nim |
14:13:41 | FromDiscord | <Zodey> helloâ”Can somebody tell me what is the difference between "let" and "const" |
14:13:53 | FromDiscord | <Tyrone Wiggums> const is immutable and cant be changed |
14:14:04 | FromDiscord | <Tyrone Wiggums> variables initialized with let can be changed |
14:14:18 | FromDiscord | <Tyrone Wiggums> for example an unchanging api key would be declared with const |
14:14:40 | FromDiscord | <Tyrone Wiggums> a token variable that refreshes every 15 minutes would be declared with let |
14:14:47 | FromDiscord | <Zodey> https://media.discordapp.net/attachments/371759389889003532/968515492232953916/unknown.png |
14:15:18 | FromDiscord | <Tyrone Wiggums> what |
14:16:12 | FromDiscord | <Zodey> <https://learnxinyminutes.com/docs/nim/> |
14:17:18 | FromDiscord | <Tyrone Wiggums> guess i was wrong |
14:19:00 | FromDiscord | <aph> const is for those who can be set at compile time, let is for those who can't |
14:19:09 | FromDiscord | <aph> idk if im right though |
14:19:12 | FromDiscord | <Tyrone Wiggums> so |
14:19:17 | FromDiscord | <Tyrone Wiggums> all variables are immutable? |
14:19:22 | FromDiscord | <aph> no |
14:19:26 | FromDiscord | <Zodey> var is mutable |
14:19:27 | FromDiscord | <aph> you can use `var` |
14:19:31 | FromDiscord | <Zodey> ye |
14:19:47 | FromDiscord | <Tyrone Wiggums> this language is a menace to society |
14:19:48 | FromDiscord | <Zodey> and does --mm:arc is the default now? |
14:19:50 | FromDiscord | <aph> (edit) "const is for those who can be set at compile time, let is for those who can't ... " added "be set at compile time (immutable)" |
14:20:04 | FromDiscord | <aph> not sure about reference counting |
14:20:28 | FromDiscord | <Zodey> In reply to @Tyrone Wiggums "this language is a": lol noâ”rust works almost the same |
14:20:45 | FromDiscord | <Tyrone Wiggums> In reply to @Zodey "lol no rust works": guess what language im an advocate against |
14:21:54 | FromDiscord | <Zodey> rust isnt that badâ”i would learn that, but i dont like the syntax for it |
14:22:06 | FromDiscord | <Zodey> (come from java btw) |
14:22:17 | FromDiscord | <Tyrone Wiggums> java is great |
14:22:24 | FromDiscord | <Tyrone Wiggums> really similar to my favorite language, c |
14:22:59 | FromDiscord | <Zodey> In reply to @Tyrone Wiggums "java is great": but really slow |
14:23:06 | FromDiscord | <Zodey> i mean |
14:23:08 | FromDiscord | <Tyrone Wiggums> i think its fast |
14:23:17 | FromDiscord | <Zodey> for most of the tasks its fast enough |
14:23:30 | FromDiscord | <Zodey> but i dont like the runtime |
14:23:53 | FromDiscord | <Tyrone Wiggums> i just had an idea |
14:24:18 | FromDiscord | <Tyrone Wiggums> nim on the jvm |
14:24:33 | FromDiscord | <Zodey> please dont |
14:25:03 | FromDiscord | <Zodey> well, you can translate it to js, then run on vm |
14:25:10 | FromDiscord | <Zodey> (edit) "vm" => "the jvm" |
14:25:13 | FromDiscord | <Tyrone Wiggums> oh no, |
14:25:20 | FromDiscord | <Tyrone Wiggums> i meant the java virtual machine |
14:25:40 | FromDiscord | <Tyrone Wiggums> and java bytecode |
14:26:07 | FromDiscord | <Generic> java is nothing like C besides the syntax |
14:26:40 | FromDiscord | <Tyrone Wiggums> In reply to @Generic "java is nothing like": it has semicolons |
14:26:43 | FromDiscord | <Tyrone Wiggums> close enough for me |
14:26:51 | FromDiscord | <Zodey> keksad |
14:27:30 | * | duuude joined #nim |
14:27:46 | FromDiscord | <Zodey> command line(1, 2) Error: invalid command line option: '--mm' https://media.discordapp.net/attachments/371759389889003532/968518756563316756/unknown.png |
14:27:49 | FromDiscord | <Zodey> bruh |
14:28:05 | FromDiscord | <Tyrone Wiggums> i think its from the fact that you're using gnu nano |
14:29:20 | FromDiscord | <aph> not sure why you used `mm`, but if you're choosing between arc or orc the correct argument should be `gc` instead probably |
14:29:32 | FromDiscord | <aph> like `--gc:orc` |
14:29:35 | FromDiscord | <aph> not sure though |
14:29:39 | FromDiscord | <aph> since idk what are you doing |
14:30:09 | FromDiscord | <Zodey> its good with gc |
14:30:26 | FromDiscord | <Zodey> https://media.discordapp.net/attachments/371759389889003532/968519429392568340/unknown.png |
14:30:33 | FromDiscord | <aph> ah |
14:30:34 | FromDiscord | <Yardanico> In reply to @aph "not sure why you": `mm` is the new way |
14:30:38 | FromDiscord | <aph> then idk that |
14:30:39 | FromDiscord | <aph> lol |
14:30:48 | FromDiscord | <Yardanico> In reply to @Zodey "command line(1, 2) Error:": your nim is too old |
14:30:55 | FromDiscord | <Yardanico> `mm` has only been added recently |
14:30:59 | FromDiscord | <Yardanico> on older nim versions you need to use `gc`, yes |
14:31:09 | FromDiscord | <Yardanico> nim docs are made for the latest Nim release |
14:31:12 | FromDiscord | <Yardanico> can you show `nim -v` ? |
14:31:13 | FromDiscord | <Rika> In reply to @aph "not sure why you": mm is the new argument |
14:31:23 | FromDiscord | <aph> roger |
14:31:27 | FromDiscord | <Rika> both work |
14:31:36 | FromDiscord | <Zodey> In reply to @Yardanico "can you show `nim": https://media.discordapp.net/attachments/371759389889003532/968519716777893938/unknown.png |
14:31:40 | * | vicfred joined #nim |
14:31:41 | FromDiscord | <Yardanico> yeah that's outdated :P |
14:31:45 | FromDiscord | <spoon> is mm just an alias for gc? |
14:31:47 | FromDiscord | <Yardanico> the latest is 1.6.4 (after 1.6.0 and 1.6.2) |
14:31:57 | FromDiscord | <Rika> technically gc is the alias to mm |
14:32:00 | FromDiscord | <Yardanico> yeah :) |
14:32:10 | FromDiscord | <Zodey> In reply to @Yardanico "the latest is 1.6.4": hmm, then arch repo isnt updated |
14:32:13 | FromDiscord | <Yardanico> yes it's not |
14:32:14 | FromDiscord | <Zodey> sad |
14:32:27 | FromDiscord | <Yardanico> install nim via choosenim or manually (it's pretty easy) |
14:32:38 | FromDiscord | <Zodey> is there auto updater for it btw? |
14:32:44 | FromDiscord | <Zodey> or i need to manually update every time? |
14:32:52 | FromDiscord | <Yardanico> choosenim makes updating a 1-command task |
14:32:57 | FromDiscord | <Yardanico> and nim releases aren't made that frequently |
14:33:20 | FromDiscord | <aph> In reply to @Zodey "is there auto updater": can probably make one, install a new nim every new git commit |
14:33:23 | FromDiscord | <aph> >:) |
14:35:58 | FromDiscord | <Zodey> In reply to @aph "can probably make one,": maybe someday |
14:36:27 | FromDiscord | <Zodey> but i will definitely use this language, cuz its seems fast and easy to read |
14:38:39 | * | kayabaNerve quit (Remote host closed the connection) |
14:39:48 | FromDiscord | <huantian> +1 for using choosenim (including on arch) |
14:40:19 | FromDiscord | <Zodey> In reply to @huantian "+1 for using choosenim": can you help me a bit? im a new user, i followed that path stupp, but didnt worked |
14:40:22 | FromDiscord | <Yardanico> i always use the manual way though, since it makes it easier to tinker with the stdlib and the compiler :) |
14:40:51 | FromDiscord | <Zodey> https://media.discordapp.net/attachments/371759389889003532/968522049242947584/unknown.png |
14:41:06 | * | lumo_e quit (Ping timeout: 250 seconds) |
14:41:13 | FromDiscord | <huantian> You installed choosenim via pacman right? |
14:41:42 | FromDiscord | <Zodey> i used this command |
14:41:43 | FromDiscord | <Zodey> sent a code paste, see https://play.nim-lang.org/#ix=3WiD |
14:42:05 | FromDiscord | <Yardanico> you don't need a newline here |
14:42:11 | FromDiscord | <Yardanico> `curl https://nim-lang.org/choosenim/init.sh -sSf | sh` |
14:42:20 | FromDiscord | <huantian> Or just use pacman |
14:42:23 | FromDiscord | <Zodey> it was just a paste mistake |
14:42:23 | FromDiscord | <Yardanico> execute this and it'll automatically install itself into ~/.nimble/bin |
14:42:25 | FromDiscord | <Yardanico> In reply to @huantian "Or just use pacman": 1.4.8 |
14:42:34 | FromDiscord | <Zodey> In reply to @Yardanico "execute this and it'll": yeah, done |
14:42:38 | FromDiscord | <huantian> No install choosenim with pacman |
14:42:39 | FromDiscord | <Zodey> but i cant set the path for it |
14:42:40 | FromDiscord | <huantian> Not Iâm |
14:42:44 | FromDiscord | <Yardanico> In reply to @Zodey "yeah, done": so do you have anything in ~/.nimble/bin ? |
14:42:44 | FromDiscord | <huantian> (edit) "Iâm" => "Nim" |
14:42:57 | FromDiscord | <huantian> Also did you restart your terminal after making the changes |
14:43:02 | FromDiscord | <Zodey> In reply to @Yardanico "so do you have": https://media.discordapp.net/attachments/371759389889003532/968522598298292344/unknown.png |
14:43:14 | FromDiscord | <Yardanico> yeah, so what happens if you edit your profile and restart the terminal? |
14:43:34 | FromDiscord | <Zodey> https://media.discordapp.net/attachments/371759389889003532/968522735179399228/unknown.png |
14:43:35 | FromDiscord | <Yardanico> ah right @Zodey |
14:43:43 | FromDiscord | <Yardanico> did you remove the nim installation? oh you did |
14:44:01 | FromDiscord | <Yardanico> In reply to @Zodey "": ~/.profile requires a log-out and then a log-in again maybe? |
14:44:08 | FromDiscord | <huantian> Oh choosenim isnât on the mainline arch repos I got it from the AUR <https://aur.archlinux.org/packages/choosenim> |
14:44:22 | FromDiscord | <huantian> If profile doesnât work try your .zshrc |
14:44:30 | FromDiscord | <Zodey> In reply to @Yardanico "~/.profile requires a log-out": could be |
14:44:36 | FromDiscord | <Zodey> 1 sec, i reboot |
14:45:21 | FromDiscord | <Yardanico> uhh, you don't need to rebootr |
14:45:22 | FromDiscord | <Yardanico> (edit) "rebootr" => "reboot" |
14:45:27 | FromDiscord | <Yardanico> you can log out and log in without rebooting :P |
14:45:58 | FromDiscord | <Solitude> he isnt in a rush |
14:47:42 | FromDiscord | <Zodey> same đŠ |
14:47:59 | * | kayabaNerve joined #nim |
14:48:10 | FromDiscord | <Alea> Is there any wrapper for windows Timeapi that has this function?â”https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod?redirectedfrom=MSDN |
14:48:11 | FromDiscord | <Zodey> one thing which is better in win is path setting |
14:48:32 | FromDiscord | <Yardanico> In reply to @Alea "Is there any wrapper": winim does |
14:48:36 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/968523998440869958/unknown.png |
14:49:07 | FromDiscord | <Alea> hmm :EmotiHmmm: I literally just searched that repo and it didn't come upâ”thanks github |
14:49:36 | FromDiscord | <Yardanico> In reply to @Zodey "same đŠ": are you sure setting ~/.profile for path variables works on your system? |
14:50:19 | FromDiscord | <Zodey> i dont know, sorry |
14:50:29 | FromDiscord | <Zodey> just switched from windows to arch |
14:50:30 | FromDiscord | <Yardanico> @Zodey if you're using X, try ~/.xprofile instead |
14:50:34 | FromDiscord | <Zodey> (edit) "just switched from windows to arch ... " added "(manjaro)" |
14:50:45 | FromDiscord | <Yardanico> put your `export` there, log out, and then log in (no need to reboot) |
15:23:15 | * | PMunch joined #nim |
15:35:32 | * | vicfred quit (Quit: Leaving) |
15:38:15 | FromDiscord | <dom96> In reply to @huantian "Oh choosenim isnât on": fun to see my software that was specifically made not to be packaged in Linux distro's get packaged in Linux distros đ |
15:39:38 | * | duuude quit (Ping timeout: 246 seconds) |
15:40:17 | FromDiscord | <Yardanico> well that's AUR |
15:40:23 | FromDiscord | <Yardanico> it has everything one can dream of :P |
15:43:09 | FromDiscord | <huantian> Thatâs what you get for making something useful! |
15:48:02 | FromDiscord | <huantian> People will package anything they see in the aur |
15:49:11 | FromDiscord | <dom96> yeah, it is pretty cool actually, really happy to see it even if it makes helping troubleshoot choosenim problems harder (cannot trust most of these packagers unfortunately) |
15:51:23 | * | duuude joined #nim |
16:02:29 | FromDiscord | <Tyrone Wiggums> In reply to @dom96 "fun to see my": :) |
16:12:03 | FromDiscord | <Tyrone Wiggums> In reply to @Yardanico "it has everything one": not my software |
16:12:25 | FromDiscord | <Tyrone Wiggums> to be fair |
16:12:29 | FromDiscord | <Tyrone Wiggums> its all malware |
16:12:48 | FromDiscord | <Tyrone Wiggums> and the fact that its open source doesnt help my detection chances |
16:16:50 | FromDiscord | <Rika> okay |
16:17:05 | FromDiscord | <Rika> if you dont trust software why do you trust hardware? đ |
16:18:29 | FromDiscord | <Phil> Intel would neeeeeeeeever do anything to screw you over! /s |
16:18:57 | PMunch | dom96, imo having choosenim in AUR makes sense. Better than having a super outdated Nim version.. |
16:21:01 | FromDiscord | <Phil> How else would you get up to date nim versions on Linux? Was the intended workflow to wait for distro repos to catch up? |
16:21:56 | FromDiscord | <Yardanico> In reply to @Isofruit "How else would you": huh? |
16:22:00 | FromDiscord | <Yardanico> just install it yourself |
16:22:16 | FromDiscord | <Phil> Ah no, I'm blind and dumb, forgot the were tear balls |
16:22:24 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wjt |
16:22:27 | FromDiscord | <Yardanico> well this is for the devel version |
16:22:31 | FromDiscord | <Phil> Tar |
16:22:33 | FromDiscord | <Yardanico> for stable you can either use tarballs or checkout a stable version |
16:25:56 | * | Chaul-Jhin-Kim joined #nim |
16:25:58 | * | duuude quit (Ping timeout: 250 seconds) |
16:26:06 | Chaul-Jhin-Kim | Howdy |
16:28:15 | FromDiscord | <deadmeme77> I should take a look at packaging nim builds into guix, cause they are now stuck in a version from 2020 IIRC |
16:28:20 | FromDiscord | <deadmeme77> well, weekend is far |
16:28:58 | Chaul-Jhin-Kim | Dear GOD/GODS and/or anyone else who can HELP ME (e.g. TIME TRAVELERS or MEMBERS OF SUPER-INTELLIGENT ALIEN CIVILIZATIONS): The next time I wake up, please change my physical form to that of FINN MCMILLAN formerly of SOUTH NEW BRIGHTON at 8 YEARS OLD and keep it that way FOREVER. I am so sick of this chubby Asian man body! Thank you! - CHAUL JHIN |
16:28:58 | Chaul-Jhin-Kim | KIM (a.k.a. A DESPERATE SOUL) |
16:29:00 | * | Chaul-Jhin-Kim left #nim (#nim) |
16:29:52 | FromDiscord | <Knedlik> Hey guys, is there a way to find the number of non-whitespace-only lines either using the compiler and/or VSC? Would be a nice statistic to look at |
16:30:54 | FromDiscord | <Knedlik> (edit) "Hey guys, is there a way to find the number of non-whitespace-only lines ... either" added "in either a file or the entire project," |
16:38:42 | * | duuude joined #nim |
17:15:42 | * | Gustavo6046 joined #nim |
17:16:48 | * | Gustavo6046 quit (Max SendQ exceeded) |
17:17:19 | * | Gustavo6046 joined #nim |
17:18:51 | * | PMunch quit (Quit: leaving) |
17:30:53 | * | lumo_e joined #nim |
17:37:34 | FromDiscord | <Rika> Tool âCLOCâ |
17:38:02 | FromDiscord | <Rika> https://github.com/AlDanial/cloc |
17:47:22 | FromDiscord | <Phil> erm... who the hell was that |
17:58:09 | * | lumo_e quit (Ping timeout: 276 seconds) |
18:01:47 | * | Zectbumo joined #nim |
18:04:31 | * | vicfred joined #nim |
18:21:00 | FromDiscord | <hmmm> never trust anyone that starts anything with howdy đ§ đ€ |
18:25:36 | * | jjido joined #nim |
18:26:28 | FromDiscord | <Tyrone Wiggums> In reply to @hmmm "never trust anyone that": howdy partner |
18:31:35 | * | duuude quit (Ping timeout: 260 seconds) |
18:35:18 | FromDiscord | <adokitkat> Hi, how can I pass null/nil to a function which has a var argument? I just don't need it. It's `waitpid(a1: Pid, a2: var cint, a3: cint) : Pid` from std/posix. |
18:35:43 | FromDiscord | <Yardanico> In reply to @adokitkat "Hi, how can I": you can't, you have to pass it anyway |
18:35:48 | FromDiscord | <Yardanico> just don't use it afterwards if you don't care about it |
18:36:00 | FromDiscord | <Yardanico> ah actually, in this case you can pass `nil` probably |
18:36:12 | FromDiscord | <Yardanico> waitpid supports that, but I don't know if Nim will let you do that |
18:36:21 | FromDiscord | <Solitude> In reply to @adokitkat "Hi, how can I": std/posix has some questionable signatures |
18:36:23 | FromDiscord | <Yardanico> yeah |
18:36:26 | FromDiscord | <Yardanico> it should be "ptr cint" |
18:36:55 | FromDiscord | <Solitude> In reply to @adokitkat "Hi, how can I": you can just copy the definition in your code and change var to ptr |
18:39:15 | FromDiscord | <adokitkat> Good idea, thank you both |
18:45:59 | * | duuude joined #nim |
18:50:44 | * | lumo_e joined #nim |
18:51:59 | * | Gustavo6046 quit (Remote host closed the connection) |
18:52:18 | * | Gustavo6046 joined #nim |
18:56:04 | * | Arrrrrrr quit (Quit: Arrrrrrr) |
19:00:53 | * | lumo_e quit (Ping timeout: 272 seconds) |
19:01:43 | * | jmdaemon joined #nim |
19:04:15 | * | averell quit (Quit: .) |
19:09:13 | * | averell joined #nim |
19:10:27 | NimEventer | New question by Philipp Doerner: How do I access an object field via its field name in string form?, see https://stackoverflow.com/questions/72019297/how-do-i-access-an-object-field-via-its-field-name-in-string-form |
19:19:02 | FromDiscord | <Phil> This is one of those "I wanted to document a thing I already know to google myself later" king of questions, don't worry |
19:19:13 | FromDiscord | <Phil> (edit) "king" => "kind" | "questions," => "questions from myself," |
19:19:26 | FromDiscord | <Yardanico> In reply to @Isofruit "This is one of": yeah i know stackoverflow allows and even encourages self-answers, it's just a little weird :) |
19:19:32 | FromDiscord | <Yardanico> maybe i can check for self-answers somehow in nimeventer |
19:19:45 | FromDiscord | <Yardanico> although it's still beneficial to show them |
19:19:54 | FromDiscord | <Yardanico> so guess the current way works fine |
19:19:56 | FromDiscord | <Phil> Basically, if it's in SO and from me you're near guaranteed for it to be a self-answer |
19:20:24 | FromDiscord | <Yardanico> maybe I should spam SO a bit with basic nim stuff related to stdlib modules as well |
19:20:33 | FromDiscord | <Yardanico> to help people and my so rep maybe :D |
19:21:23 | FromDiscord | <Phil> I mean, if it's the kind of thing that you yourself have to google decently often or would be something a beginner absolutely wouldn't know, that works fine. |
19:35:03 | FromDiscord | <Yardanico> https://news.ycombinator.com/item?id=31160234 |
19:35:05 | FromDiscord | <Yardanico> "Compile time evaluation in Nim, Zig, Rust and C++" |
19:35:43 | * | duuude quit (Ping timeout: 260 seconds) |
19:36:50 | FromDiscord | <Gengyuu> hoi people, im kind of a language hopper cuz i program for fun but i keep gettin drawn to nim, im torn between using vscode or neovim for nim but what kind of setup do you all use? |
19:37:09 | FromDiscord | <dom96> Super cool visualiation https://forum.nim-lang.org/t/9121#59537 |
19:37:16 | FromDiscord | <huantian> In reply to @Yardanico "https://news.ycombinator.com/item?id=31160234": Wait Iâve always been confused do hackernews posts have like a post body? |
19:37:19 | FromDiscord | <huantian> Or just a title |
19:37:33 | FromDiscord | <huantian> Oh itâs a link |
19:37:33 | FromDiscord | <Yardanico> In reply to @huantian "Wait Iâve always been": they either have a link to something or a post body |
19:37:50 | FromDiscord | <Yardanico> yeah it links to https://castillodel.github.io/compile-time-evaluation/ |
19:37:53 | FromDiscord | <Yardanico> just simple fizzbuzz |
19:42:30 | FromDiscord | <Yardanico> In reply to @dom96 "Super cool visualiation https://forum.nim-lang.org/": I wonder if they scraped the irclogs website or used my irc logs sqlite dump |
19:42:38 | FromDiscord | <Yardanico> I guess I should update it anyway since it's pretty outdated by now |
19:45:20 | FromDiscord | <d4rckh> when i pass an object to a proc, does nim pass it by reference or just copy it? |
19:45:51 | FromDiscord | <Yardanico> In reply to @d4rckh "when i pass an": by default nim will pass small objects by copy, large enough objects by reference |
19:46:01 | FromDiscord | <Yardanico> you can override that behaviour for your type by using `byref` and `bycopy` pragmas |
19:46:13 | FromDiscord | <Yardanico> which is needed for C interop usually |
19:47:36 | FromDiscord | <0000> farded |
19:48:49 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Wkm |
19:49:07 | FromDiscord | <dom96> In reply to @Yardanico "https://news.ycombinator.com/item?id=31160234": This really shows just why Nim is so awesome |
19:49:50 | FromDiscord | <dom96> Zig/Rust/C++ are just a little too low-level when looking at that Fizz buzz example |
19:52:14 | FromDiscord | <Yardanico> In reply to @d4rckh "hm, right, so i": but is your server object a `ref` ? |
19:52:42 | FromDiscord | <Tyrone Wiggums> sent a code paste, see https://play.nim-lang.org/#ix=3Wko |
19:52:51 | FromDiscord | <Yardanico> In reply to @d4rckh "hm, right, so i": also what about timeouts - maybe acceptAddr hangs forever when there's no connection? |
19:52:53 | FromDiscord | <d4rckh> yes, it is a ref of object |
19:52:56 | FromDiscord | <Yardanico> maybe you should also use something like `withTimeout` |
19:53:59 | FromDiscord | <d4rckh> In reply to @Yardanico "also what about timeouts": oh yeah it hang |
19:54:00 | FromDiscord | <d4rckh> (edit) "hang" => "hangs" |
19:54:08 | FromDiscord | <d4rckh> wait, let me try something |
19:54:13 | FromDiscord | <d4rckh> stop it, and then try to connect |
19:54:16 | FromDiscord | <d4rckh> it should then truly stop |
19:54:31 | FromDiscord | <Yardanico> https://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint if you want to add timeouts to async calls |
19:54:59 | FromDiscord | <d4rckh> yup, you are right |
19:55:08 | FromDiscord | <d4rckh> it actually works |
19:55:19 | FromDiscord | <d4rckh> but .acceptAdr() blocks everything |
19:55:26 | FromDiscord | <Yardanico> yeah, that's why withTimeout will be useful |
19:55:57 | FromDiscord | <d4rckh> wait, how do i actually use it? |
19:55:59 | nrds | <Prestige99> What's wrong with this concept? https://play.nim-lang.org/#ix=3Wkq |
19:56:39 | FromDiscord | <Yardanico> In reply to @d4rckh "wait, how do i": one moment |
19:56:52 | FromDiscord | <dom96> In reply to @Yardanico "yeah, that's why withTimeout": I don't think you want this on accept |
19:57:02 | FromDiscord | <dom96> What are you trying to do @d4rckh ? |
19:57:13 | FromDiscord | <d4rckh> In reply to @dom96 "What are you trying": stop my listeners when i set running to false |
19:57:16 | FromDiscord | <d4rckh> (edit) "listeners" => "listener" |
19:57:27 | FromDiscord | <d4rckh> but they wont stop, until a client connects to it |
19:57:38 | FromDiscord | <dom96> you want to stop accepting new connections with a command? |
19:57:42 | FromDiscord | <d4rckh> yes |
19:57:46 | FromDiscord | <d4rckh> just by setting running to false |
19:57:49 | FromDiscord | <d4rckh> or something else |
19:57:53 | FromDiscord | <d4rckh> it can be a function too đ€ |
19:57:56 | FromDiscord | <dom96> just close the server socket when `running` is false |
19:58:08 | FromDiscord | <dom96> should kill any in-progress `accept` |
19:58:09 | FromDiscord | <d4rckh> i think i can just use a function? |
19:58:14 | FromDiscord | <d4rckh> i didnt check the docs |
19:58:15 | FromDiscord | <d4rckh> one sec |
19:58:20 | FromDiscord | <dom96> (they might raise an exception, but you can catch it) |
19:58:57 | FromDiscord | <d4rckh> okay, should i set running to false and use .close? |
19:59:43 | FromDiscord | <d4rckh> `Error: unhandled exception: The I/O operation has been aborted because of either a thread exit or an application request.` |
19:59:44 | FromDiscord | <d4rckh> wow thats mean |
19:59:47 | FromDiscord | <d4rckh> when i use .close() |
20:29:01 | FromDiscord | <kunitoki> Hello there, anybody could help me understand a compiler error ? |
20:29:04 | * | ehmry quit (Ping timeout: 250 seconds) |
20:29:35 | * | ehmry joined #nim |
20:30:13 | FromDiscord | <kunitoki> sent a code paste, see https://play.nim-lang.org/#ix=3Wkw |
20:30:34 | FromDiscord | <kunitoki> everything works, except the `bindClosure` calling with argNoResult |
20:31:00 | FromDiscord | <kunitoki> sent a code paste, see https://play.nim-lang.org/#ix=3Wkx |
20:31:54 | FromDiscord | <kunitoki> it seems that `proc(arg: T)` with no explicit return type (or void for the matter) cannot be deduced with a generic type R |
20:33:37 | FromDiscord | <kunitoki> if i explicitly specialize the generic call it works, but it's annoying to have to do it while it works for the others `var y = bindClosure[void, int](argNoResult)` |
20:34:19 | * | ehmry quit (Ping timeout: 260 seconds) |
20:34:37 | * | ehmry joined #nim |
20:41:18 | * | ehmry quit (Ping timeout: 276 seconds) |
20:41:41 | FromDiscord | <iffy (Matt Haggard)> I've often wanted a way to conditionally do something if a key is defined in JSON and finally came up with this\: https://play.nim-lang.org/#ix=3Wkz Gosh, I love Nim. In summary, you can do\: `if somejson.extract("foo"): echo $foo.getInt()` |
20:43:17 | FromDiscord | <deech> In reply to @dom96 "This really shows just": I covered this exact example in my Nim Nuggets talk. I've been talking about static intro for years. |
20:54:39 | FromDiscord | <Yardanico> In reply to @iffy (Matt Haggard) "I've often wanted a": why not do it the much easier way with quote do? :) |
20:54:57 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WkE |
20:56:00 | FromDiscord | <iffy (Matt Haggard)> Because it's late in the day \:)â”(@Yardanico) |
20:56:02 | FromDiscord | <Yardanico> also you probably want `key` to be a static string or evaluate it separately |
20:56:07 | FromDiscord | <iffy (Matt Haggard)> That's a much better solution |
20:56:24 | FromDiscord | <Elegantbeef> Why are we using quote do like it's 2003 |
20:56:26 | FromDiscord | <Elegantbeef> Use genasts or go home |
20:56:30 | FromDiscord | <Yardanico> yeah yeah genasts blablabla |
20:56:31 | FromDiscord | <Elegantbeef> And if you're already home go homer |
20:56:32 | FromDiscord | <Yardanico> go sleep beef |
20:56:47 | FromDiscord | <Yardanico> you can't teach an old dog new tricks :PP |
20:56:54 | FromDiscord | <Elegantbeef> Hey i'm useless and just got up a couple hours ago |
20:57:02 | FromDiscord | <Elegantbeef> So dont tell me to go to sleep! |
20:57:05 | FromDiscord | <iffy (Matt Haggard)> Elegantbeef, show me the genast version |
20:57:13 | FromDiscord | <Yardanico> it'll be almost the same |
20:57:14 | FromDiscord | <Elegantbeef> It's the same thing just nicer |
20:57:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WkG |
20:58:38 | FromDiscord | <iffy (Matt Haggard)> okay, no backticks, more nimmy |
20:58:58 | FromDiscord | <Elegantbeef> Yep also no need to manually declare variables |
20:59:06 | FromDiscord | <Elegantbeef> Just alias expressions or pass in values by name |
21:00:23 | FromDiscord | <Elegantbeef> You do also need `import std/genasts` |
21:03:23 | FromDiscord | <Yardanico> message count since this day from last year (might be inaccurate for people who like to change nicknames often) |
21:03:25 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/968618321400463440/unknown.png |
21:03:51 | FromDiscord | <Elegantbeef> Fuck yea look at that useless bastard |
21:04:40 | FromDiscord | <Elegantbeef> Now do one without me |
21:05:01 | FromDiscord | <Yardanico> top 30 in text form https://media.discordapp.net/attachments/371759389889003532/968618727283249203/unknown.png |
21:05:36 | FromDiscord | <Yardanico> need to add a isofruit = phil alias in my irc log parsing code |
21:05:43 | FromDiscord | <Elegantbeef> Ah was going to say |
21:06:10 | FromDiscord | <Elegantbeef> Quite surprised you're so high given i almost never seen you đ |
21:06:15 | * | lumo_e joined #nim |
21:06:19 | FromDiscord | <Yardanico> xd |
21:06:33 | FromDiscord | <Yardanico> in total 1351 users chatted in #main since last year |
21:06:45 | FromDiscord | <Yardanico> rough values, since the code probably missed some, and some people changed nicknames |
21:07:04 | FromDiscord | <Yardanico> half of all people left <= 10 messages |
21:09:32 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
21:12:56 | FromDiscord | <Elegantbeef> Yea many people just ding dong ditch with a single question or two |
21:13:03 | FromDiscord | <Elegantbeef> They dont like my hospitality methinks |
21:13:32 | * | flynn joined #nim |
21:16:16 | FromDiscord | <dom96> In reply to @d4rckh "okay, should i set": yes, do it. Is it working after you handle that error? đ |
21:17:35 | FromDiscord | <dom96> In reply to @Elegantbeef "Why are we using": I think you got that the wrong way around, genast is actually the 2003 tech. That said, I still wish the do notation would be gotten rid of. |
21:17:49 | FromDiscord | <Elegantbeef> The hell are you talking about? |
21:18:09 | FromDiscord | <Yardanico> In reply to @dom96 "I think you got": beef is talking about std/genasts |
21:18:10 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/17426 |
21:18:16 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/968622060052054046/image.png |
21:18:18 | * | flynn quit (Read error: Connection reset by peer) |
21:18:20 | FromDiscord | <Yardanico> but yeah it's a bit more explicit than quote do |
21:18:20 | FromDiscord | <dom96> oh, I misread as getAst |
21:18:24 | FromDiscord | <dom96> lol |
21:18:46 | FromDiscord | <dom96> damn, genAst is much cooler than do |
21:18:54 | FromDiscord | <dom96> another reason to kill the do notation |
21:19:20 | FromDiscord | <Elegantbeef> Am i the only one that likes the do notation |
21:19:30 | * | flynn joined #nim |
21:19:33 | * | jjido joined #nim |
21:19:56 | FromDiscord | <dom96> yes |
21:21:08 | FromDiscord | <Generic> no I like it too |
21:21:12 | FromDiscord | <Generic> you're not alone |
21:21:20 | FromDiscord | <Elegantbeef> Well fuck you all i'll make my own Nim with blackjack and do notation |
21:22:16 | FromDiscord | <dom96> I'm willing to die on this hill even if it turns out I am the only one on it |
21:22:21 | FromDiscord | <dom96> do notation should have been removed long ago |
21:22:30 | FromDiscord | <Elegantbeef> It's so lovely |
21:22:44 | FromDiscord | <Elegantbeef> Doesnt rely on some uppity `=>` syntax |
21:22:51 | FromDiscord | <Elegantbeef> Could you imagine writing `=>` unironically |
21:23:02 | FromDiscord | <exelotl> nah do notation is pretty stupid |
21:23:10 | FromDiscord | <dom96> haha |
21:23:15 | FromDiscord | <dom96> exelotl with the cold hard truth |
21:23:17 | FromDiscord | <Elegantbeef> Pretty stupid cool |
21:23:45 | * | ehmry joined #nim |
21:23:47 | FromDiscord | <dom96> `=>` for single line lambdas and `proc` for multi-line works perfectly |
21:23:53 | * | flynn quit (Read error: Connection reset by peer) |
21:24:03 | FromDiscord | <dom96> "do notation" is just a vestigial organ |
21:24:07 | FromDiscord | <dom96> just like the appendix |
21:24:18 | FromDiscord | <Elegantbeef> No it doesnt cause `=>` fucking sucks |
21:24:18 | FromDiscord | <dom96> đ |
21:24:26 | FromDiscord | <golova> What about multiple untyped blocks? |
21:24:28 | FromDiscord | <Elegantbeef> The appendix is actually apart of the immune system |
21:24:35 | FromDiscord | <Elegantbeef> Look at this guy saying "I dont want a part of my immune system" |
21:25:05 | FromDiscord | <Generic> I don't want to spread out the parameters so much |
21:25:06 | * | flynn joined #nim |
21:25:11 | FromDiscord | <Yardanico> yeah, @golova makes a valid point |
21:25:20 | FromDiscord | <dom96> I'd rather not live in fear of needing to get major surgery because my appendix gets inflamed, but this is getting too off-topic hah |
21:25:24 | FromDiscord | <Yardanico> what will you replace `do` with for templates and macros |
21:25:38 | FromDiscord | <Elegantbeef> I think the solution is named blocks |
21:25:38 | FromDiscord | <Elegantbeef> Which i also like |
21:25:52 | FromDiscord | <Yardanico> hmm |
21:25:54 | FromDiscord | <dom96> yep |
21:26:02 | FromDiscord | <dom96> do notation for templates/macros is a whole other discussion |
21:26:09 | FromDiscord | <Yardanico> @ElegantBeef can you show an example? |
21:26:20 | FromDiscord | <Elegantbeef> you use the parameter name with `:` |
21:26:45 | FromDiscord | <d4rckh> In reply to @dom96 "yes, do it. Is": I think so? I can't try it now, is there any bool the socket has which tells me wether the socket is closed or not, so i don't have to make my own |
21:27:29 | FromDiscord | <dom96> In reply to @deech "I covered this exact": We need you to talk more. We need more blog posts highlighting this fact đ |
21:27:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WkN |
21:27:56 | FromDiscord | <dom96> sent a code paste, see https://play.nim-lang.org/#ix=3WkO |
21:28:31 | FromDiscord | <dom96> In reply to @d4rckh "I think so? I": don't think so |
21:28:38 | FromDiscord | <dom96> but check the docs đ |
21:29:57 | FromDiscord | <exelotl> if `do` for anonymous procedures was actually shorter it would be decent. but it saves like 2 characters over writing the exact same thing with `proc`, yet introduces an entirely different syntax that looks like functions from python (`def foo(a: sometype) -> rettype: ...`) |
21:30:18 | FromDiscord | <Elegantbeef> I mean the same argument can be made for `=>` no? |
21:30:41 | * | flynn quit (Read error: Connection reset by peer) |
21:30:45 | FromDiscord | <dom96> In reply to @exelotl "if `do` for anonymous": Yes! Exactly. The very custom non-Nim syntax is what bothers me the most |
21:30:53 | FromDiscord | <dom96> In reply to @Elegantbeef "I mean the same": `=>` is a macro |
21:31:02 | FromDiscord | <Elegantbeef> I'm not daft dom |
21:31:22 | FromDiscord | <dom96> Bro. I'm not saying you don't know this fact |
21:31:30 | FromDiscord | <dom96> I'm using this as the reason for why the same argument doesn't apply |
21:31:33 | FromDiscord | <exelotl> adds 1 to bro counter |
21:31:55 | * | flynn joined #nim |
21:32:05 | FromDiscord | <dom96> Can't say I wasn't influenced by that post |
21:32:36 | FromDiscord | <exelotl> `=>` does type inference all over which is enough to justify its existence right? |
21:33:22 | FromDiscord | <dom96> tbh I'll admit that `=>` is a bit of a hack. It just generates a `proc` with `auto` types đ |
21:34:24 | FromDiscord | <Yardanico> yes, which breaks from time to time |
21:34:34 | FromDiscord | <Elegantbeef> If only the compiler could go "oh this is the do notation and we know it's a procedure, let's infer the parameters"â”(@exelotl) |
21:34:43 | FromDiscord | <Yardanico> like this - https://github.com/nim-lang/Nim/issues/19736 duplicate of https://github.com/nim-lang/Nim/issues/16906 |
21:35:09 | FromDiscord | <dom96> the nice thing about `=>` is that you can give it types too |
21:35:27 | FromDiscord | <Elegantbeef> I think the do notation is a very useful utillity that if made smarter is better than what a macro is going to do |
21:35:33 | FromDiscord | <dom96> the fact that this works as a macro is as usual a true demonstration of Nim's power |
21:35:52 | FromDiscord | <dom96> and goes with Nim's original goal: small core with great extensibility |
21:36:07 | FromDiscord | <Elegantbeef> Sure except for the fact it often breaks đ |
21:36:10 | FromDiscord | <dom96> another reason why the `do` notation is just guff IMO |
21:36:29 | FromDiscord | <dom96> that's more to do with Nim's type inference than with the macro's implementation though |
21:36:33 | FromDiscord | <Elegantbeef> Well the do notation is a concrete user written construct which means you could explictly use it for inferring procedure types |
21:37:13 | FromDiscord | <dom96> not sure what you mean by that tbh |
21:37:29 | FromDiscord | <Elegantbeef> So if it was made with a bit more umph you wouldnt need parameter types or return types where the type was explicit |
21:37:49 | * | flynn quit (Read error: Connection reset by peer) |
21:38:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WkS |
21:39:02 | * | flynn joined #nim |
21:39:41 | FromDiscord | <Elegantbeef> In the case there is no ambiguity the above can work and doesnt require changing how `proc` is reasoned |
21:40:58 | FromDiscord | <dom96> sent a code paste, see https://play.nim-lang.org/#ix=3WkT |
21:41:06 | FromDiscord | <dom96> if you improve the handling of your example then you'll also improve the handling of this |
21:41:34 | FromDiscord | <Elegantbeef> You dont have to annotate types since it can be inferred? |
21:41:46 | FromDiscord | <Elegantbeef> to have it work with proc you need to make `proc(a,b)` valid |
21:42:39 | FromDiscord | <dom96> does `do` already allow that? |
21:42:44 | * | rawrrr joined #nim |
21:42:51 | FromDiscord | <Elegantbeef> > So if it was made with a bit more umph you wouldnt need parameter types or return types where the type was explicit |
21:43:07 | FromDiscord | <Elegantbeef> Since `nnkDo` is apart of the AST it can be done |
21:43:43 | FromDiscord | <dom96> oh, you mean it could be done without breaking the nnkDo AST? but doing the same for nnkProc would break its AST? |
21:43:58 | FromDiscord | <dom96> (I don't recall the details of the AST representation of these) |
21:44:02 | FromDiscord | <Elegantbeef> Well yea you need to allow `proc(a,b)` which is invalid |
21:44:12 | FromDiscord | <Elegantbeef> proc's parameters are `identdefs` not `ident`s |
21:44:16 | * | flynn quit (Read error: Connection reset by peer) |
21:45:01 | FromDiscord | <Elegantbeef> And you'd only allow `proc(a,b)` inside a proc call otherwise it's invalid |
21:45:20 | FromDiscord | <Elegantbeef> We already have a construct that's only allow inside a proc call that can be expanded to be more flexible |
21:45:29 | * | flynn joined #nim |
21:46:25 | FromDiscord | <dom96> https://play.nim-lang.org/#ix=3WkV |
21:46:41 | FromDiscord | <dom96> Looks to me like they have very similar ASTs |
21:46:53 | FromDiscord | <dom96> and that `proc` parses fine with no parameter types |
21:48:33 | FromDiscord | <Elegantbeef> Guess who didnt expect the proc to parse |
21:49:05 | FromDiscord | <dom96> I wasn't certain myself |
21:49:32 | FromDiscord | <dom96> But does that mean I've won you over on the do notation front? đ |
21:49:39 | FromDiscord | <Elegantbeef> Not really |
21:50:18 | * | flynn quit (Read error: Connection reset by peer) |
21:50:57 | FromDiscord | <dom96> Is there another objective reason you favour it or is it more of a subjective "I just like it a lot" |
21:51:31 | * | flynn joined #nim |
21:55:29 | * | flynn quit (Read error: Connection reset by peer) |
21:55:56 | FromDiscord | <Elegantbeef> Nope |
21:56:04 | FromDiscord | <Elegantbeef> I just think it's a better solution than chopping of the name of a proc and using it there |
21:56:33 | FromDiscord | <Elegantbeef> I'm very much in the minority |
21:56:42 | * | flynn joined #nim |
21:57:05 | FromDiscord | <dom96> not necessarily |
21:57:12 | FromDiscord | <Elegantbeef> Nah i am |
21:58:42 | FromDiscord | <dom96> I can see an alternate reality where Nim only allows named procs and then has a separate keyword for unnamed procs. But that's not how Nim evolved, unnamed procs have been around for far longer than `do` so from my perspective the `do` notation just felt like an addition without much purpose. |
22:02:41 | FromDiscord | <Elegantbeef> Way to be a luddite |
22:04:13 | * | flynn quit (Read error: Connection reset by peer) |
22:04:40 | FromDiscord | <dom96> what? |
22:05:26 | * | flynn joined #nim |
22:06:50 | FromDiscord | <dom96> I think it's a stretch to call the `do` notation a new technology lol |
22:07:16 | FromDiscord | <dom96> That's like calling me a luddite for being opposed to chocolate ice cream because I prefer vanilla |
22:11:53 | * | flynn quit (Read error: Connection reset by peer) |
22:13:06 | * | flynn joined #nim |
22:17:56 | FromDiscord | <Elegantbeef> You must be new here |
22:18:44 | * | flynn quit (Read error: Connection reset by peer) |
22:19:57 | * | flynn joined #nim |
22:25:31 | * | flynn quit (Read error: Connection reset by peer) |
22:26:43 | * | flynn joined #nim |
22:27:40 | nrds | <Prestige99> Elegantbeef do you know what I'm doing incorrectly here? https://play.nim-lang.org/#ix=3Wkq |
22:28:07 | nrds | <Prestige99> Do concepts only work with functions but not members of a type maybe? |
22:28:26 | FromDiscord | <Elegantbeef> Concepts are constraints |
22:28:33 | FromDiscord | <Elegantbeef> `Foo[T]` and `position: T` |
22:28:43 | nrds | <Prestige99> oh I need p.position not position(p) |
22:31:52 | * | flynn quit (Read error: Connection reset by peer) |
22:33:05 | * | flynn joined #nim |
22:39:25 | * | flynn quit (Read error: Connection reset by peer) |
22:40:17 | nrds | <Prestige99> I'm just going to pretend that makes sense and move on |
22:40:37 | * | flynn joined #nim |
22:40:51 | FromDiscord | <dom96> In reply to @Elegantbeef "You must be new": What do you mean? Can you elaborate/clarify? |
22:45:18 | * | flynn quit (Read error: Connection reset by peer) |
22:46:32 | * | flynn joined #nim |
22:51:24 | * | flynn quit (Read error: Connection reset by peer) |
22:52:37 | * | flynn joined #nim |
22:52:48 | * | lumo_e quit (Read error: Connection reset by peer) |
22:57:27 | FromDiscord | <Elegantbeef> I generally say hyperbolic things in jestâ”(@dom96) |
22:57:34 | * | flynn quit (Read error: Connection reset by peer) |
22:58:47 | * | flynn joined #nim |
22:59:50 | FromDiscord | <Elegantbeef> Ah prestige i misread |
22:59:51 | FromDiscord | <Elegantbeef> Yea you want field access not method call as such `foo` doesnt match `position(p)` |
23:00:09 | FromDiscord | <Elegantbeef> Properties do pass for `p.position` |
23:00:35 | nrds | <Prestige99> Is that documented somewhere? I found the solution by randomly guessing for a while |
23:01:18 | FromDiscord | <Elegantbeef> I mean it's just `compiles(position(p))` |
23:01:25 | FromDiscord | <Elegantbeef> If all predicates return true it matches |
23:01:59 | nrds | <Prestige99> Was unaware of compiles as well |
23:02:17 | FromDiscord | <Elegantbeef> Lol |
23:02:26 | FromDiscord | <dom96> In reply to @Elegantbeef "I generally say hyperbolic": Good to know, but not everyone will. Keep that in mind as it wasn't clear to me whether you were just straight up insulting me đ |
23:02:36 | FromDiscord | <Elegantbeef> It basically checks if the statement compiles and if it's a bool that it's true |
23:02:47 | FromDiscord | <Elegantbeef> lol |
23:03:26 | nrds | <Prestige99> Concepts make a lot more sense now that you said that |
23:03:47 | * | flynn quit (Remote host closed the connection) |
23:03:48 | FromDiscord | <Elegantbeef> Congrats |
23:03:49 | FromDiscord | <Elegantbeef> Welcome to the feature |
23:04:04 | FromDiscord | <Elegantbeef> I mean future |
23:04:16 | nrds | <Prestige99> Har do |
23:04:33 | FromDiscord | <Elegantbeef> V2 concepts are different and do not support things such as fields |
23:04:38 | FromDiscord | <dom96> a future that may be short lived |
23:04:46 | FromDiscord | <dom96> yeah, v2 concepts are on the horizon |
23:04:48 | FromDiscord | <Elegantbeef> Eh concepts v2 suck |
23:05:00 | * | flynn joined #nim |
23:05:11 | FromDiscord | <Elegantbeef> Work ok for traits, but other than that they just dont work and need more |
23:05:20 | FromDiscord | <dom96> I haven't used them so I don't have an opinion here |
23:05:39 | nrds | <Prestige99> Shoot they won't work for fields? That's not good... |
23:05:51 | FromDiscord | <Elegantbeef> They presently only support a list of procedures required for a type |
23:05:51 | FromDiscord | <Elegantbeef> So if you do anything like `a.field is int` you're SOL |
23:06:08 | FromDiscord | <Elegantbeef> Well they may in the future, they presently dont |
23:06:13 | FromDiscord | <dom96> can't you just do: `proc field(): int`? |
23:06:37 | nrds | <Prestige99> Yeah but uh, why not just support fields? |
23:06:37 | FromDiscord | <dom96> that sounds like it would be consistent with how Nim already handles fields/procs |
23:06:41 | FromDiscord | <Elegantbeef> Not if i recall |
23:06:52 | FromDiscord | <dom96> because you'd need a separate keyword |
23:06:54 | nrds | <Prestige99> It sounds like it wouldn't be too easy to add |
23:06:57 | FromDiscord | <Elegantbeef> Cause it presently doesnt |
23:07:13 | nrds | <Prestige99> too hard to add* |
23:07:31 | FromDiscord | <dom96> current concepts eval Nim code |
23:07:40 | * | crem quit (Ping timeout: 250 seconds) |
23:07:44 | FromDiscord | <dom96> so you can just write Nim code which evaluates whether a field exists |
23:07:47 | FromDiscord | <Elegantbeef> Really it could support `field: int` |
23:07:48 | FromDiscord | <Elegantbeef> You dont |
23:08:01 | FromDiscord | <dom96> hm true |
23:08:16 | FromDiscord | <Elegantbeef> You just use ident defs |
23:08:43 | FromDiscord | <Elegantbeef> Ugh |
23:08:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Wlf |
23:08:59 | FromDiscord | <Elegantbeef> `myField: int` would work just fine and could check if there was a proc named `myField` |
23:09:15 | FromDiscord | <Elegantbeef> Takes a single parameter that is `Self` and returns `int` |
23:09:29 | FromDiscord | <Elegantbeef> Not using a bunch of `trySemExpr` is better but not having field support is awful |
23:09:37 | FromDiscord | <Elegantbeef> It means it's just a trait system presently |
23:09:43 | FromDiscord | <Elegantbeef> Which to be fair i've used it as such |
23:10:04 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor goes brrr |
23:10:32 | nrds | <Prestige99> I'm surprised lenientops isn't on by default |
23:10:43 | FromDiscord | <Elegantbeef> Nim is a statically typed language |
23:10:54 | FromDiscord | <Elegantbeef> lenientops has implicit converters |
23:11:01 | FromDiscord | <Elegantbeef> You dont do that in a statically typed language by default |
23:11:06 | * | flynn quit (Read error: Connection reset by peer) |
23:11:10 | FromDiscord | <dom96> to be fair, you could |
23:11:17 | nrds | <Prestige99> Yeah I'm aware but I'd still enable it my default |
23:11:18 | FromDiscord | <Elegantbeef> Of course you could |
23:11:21 | FromDiscord | <Elegantbeef> Doesnt change my stance |
23:11:29 | FromDiscord | <dom96> Nim's integer operations are much more anal than other language's, including many static language's |
23:11:30 | nrds | <Prestige99> by* |
23:11:38 | FromDiscord | <dom96> (edit) "language's," => "languages," | "language's" => "languages" |
23:12:19 | * | flynn joined #nim |
23:12:39 | FromDiscord | <dom96> There is no easy way to have a module that makes operations stricter though |
23:12:45 | nrds | <Prestige99> Like `let foo: float = 2.3 * 5` should compile imo |
23:12:51 | nrds | <Prestige99> True |
23:12:53 | FromDiscord | <dom96> at least with the constructs that Nim provides |
23:12:54 | FromDiscord | <Elegantbeef> It does |
23:13:08 | FromDiscord | <dom96> !eval let foo: float = 2.3 5; echo(foo) |
23:13:10 | NimBot | Compile failed: /usercode/in.nim(1, 22) Error: invalid token: (\29) |
23:13:13 | FromDiscord | <Elegantbeef> Cmon prestige use actual examples that dont compile |
23:13:27 | FromDiscord | <dom96> huh |
23:13:34 | nrds | <Prestige99> It compiles? Eh I'm on my phone atm |
23:13:45 | FromDiscord | <Elegantbeef> discord -\> irc adds a weird symbol for `` |
23:13:50 | FromDiscord | <Elegantbeef> Of course it compiles |
23:13:53 | nrds | <Prestige99> I swear I was doing stuff like that yesterday and it wouldn't compile |
23:13:53 | FromDiscord | <Elegantbeef> they're both literals |
23:14:02 | FromDiscord | <dom96> ugh Discord |
23:14:03 | FromDiscord | <Elegantbeef> Therefore the `5` is converted to a float |
23:14:21 | FromDiscord | <Elegantbeef> and you get 11.5 into fo |
23:14:21 | FromDiscord | <dom96> Could be a good time to move NimBot to Discord |
23:14:23 | FromDiscord | <Elegantbeef> foo |
23:14:49 | nrds | <Prestige99> Hmm I'll try the playground on my phone 1 min |
23:15:09 | FromDiscord | <dom96> it does work, I checked |
23:15:24 | nrds | <Prestige99> Ok the playground not doing well on my phone |
23:15:30 | FromDiscord | <ElegantBeef> Matrix bridge down đŠ |
23:15:41 | FromDiscord | <Elegantbeef> Uh oh i killed the matrix bridge |
23:15:43 | FromDiscord | <ElegantBeef> Anyway like i said it raises the literal to the right type |
23:15:47 | nrds | <Prestige99> What else is new, matrix sucking |
23:15:56 | FromDiscord | <dom96> you killed it? how? lol |
23:15:59 | FromDiscord | <ElegantBeef> Not really matrix as much as the bridge being dumb |
23:16:01 | FromDiscord | <huantian> I think itâs the bridgeâs fault |
23:16:07 | * | flynn quit (Read error: Connection reset by peer) |
23:16:09 | nrds | <Prestige99> What if they were saved to variables first |
23:16:09 | FromDiscord | <huantian> Itâs cus itâs not in Nim! |
23:16:24 | FromDiscord | <ElegantBeef> It'd not compile cause nim doesnt do backwards inference |
23:16:31 | FromDiscord | <ElegantBeef> It'd infer the one as int and the other as float |
23:16:36 | nrds | <Prestige99> I'll have to test this out when I'm on my computer in like 10 minutes |
23:16:45 | FromDiscord | <ElegantBeef> And then not compile cause there is no `int float` or `float int` in system |
23:16:51 | FromDiscord | <ElegantBeef> You dont really need to test this |
23:17:02 | FromDiscord | <ElegantBeef> Any untyped literal will convert to a type if it needs to |
23:17:13 | FromDiscord | <dom96> right, I should head to bed. Night all |
23:17:14 | FromDiscord | <ElegantBeef> As soon as you add a variable you add typing |
23:17:20 | nrds | <Prestige99> Gn dom |
23:17:20 | * | flynn joined #nim |
23:17:20 | FromDiscord | <ElegantBeef> Buh bye |
23:17:25 | nrds | <Prestige99> That just sounds backwards to be honest |
23:17:33 | FromDiscord | <ElegantBeef> I mean it works fine |
23:17:56 | FromDiscord | <ElegantBeef> It gets bad when you have overloads |
23:18:08 | FromDiscord | <ElegantBeef> But generally it works fine if you ask me |
23:18:31 | FromDiscord | <huantian> Not me adding f to every float literal out of paranoia in C% |
23:18:32 | * | megaman1237 joined #nim |
23:18:34 | FromDiscord | <huantian> (edit) "C%" => "C#" |
23:18:41 | * | megaman1237 left #nim (Leaving) |
23:18:42 | nrds | <Prestige99> Lol |
23:19:03 | FromDiscord | <ElegantBeef> Exactly in most cases literals can be inferred due to their surroundings unless we're talking about backwards inference |
23:19:15 | FromDiscord | <ElegantBeef> The funny part is in rust where they have backwards inference it doesnt work on floats |
23:19:46 | FromDiscord | <ElegantBeef> So if you have a literal of `1` and attempt to use it as a float it doesnt type it properly but if you attempt to use it as a `u8` it does |
23:19:57 | nrds | <Prestige99> Weird |
23:19:57 | FromDiscord | <ElegantBeef> have a variable assigned to a literal of 1 |
23:20:59 | FromDiscord | <ElegantBeef> Inferred literals that nim have are relatively nice given a lot of the time literals are used as default parameters |
23:21:19 | FromDiscord | <ElegantBeef> `proc doThing(a: float)` means you can do `doThing(32)` |
23:21:53 | FromDiscord | <ElegantBeef> In other languages you may have to do `32d` or similar |
23:23:16 | * | flynn quit (Read error: Connection reset by peer) |
23:24:28 | * | flynn joined #nim |
23:27:09 | nrds | <Prestige99> Yeah, I just wish I could add a float and and int together without casting |
23:27:26 | nrds | <Prestige99> when they are variables and not literals |
23:27:51 | FromDiscord | <Elegantbeef> It's ambiguous what's correct imo đ |
23:28:12 | nrds | <Prestige99> What, the result of the addition? |
23:28:24 | nrds | <Prestige99> You can already do it with literals, it would just follow suit |
23:28:49 | FromDiscord | <Elegantbeef> Yes what is the correct type |
23:29:00 | FromDiscord | <Elegantbeef> Literals isnt equivlent |
23:29:24 | nrds | <Prestige99> I think it is? It's the same equation |
23:29:37 | * | flynn quit (Read error: Connection reset by peer) |
23:29:41 | nrds | <Prestige99> this for example https://play.nim-lang.org/#ix=3Wli |
23:29:49 | nrds | <Prestige99> 1 + 2.4 in both cases |
23:30:20 | FromDiscord | <Elegantbeef> I see it as different since in literal expressions there is only one solution |
23:30:46 | nrds | <Prestige99> What's the one solution? |
23:30:48 | FromDiscord | <Elegantbeef> All types in a literal expression need to match to be sensible |
23:30:49 | * | flynn joined #nim |
23:31:14 | FromDiscord | <Elegantbeef> But in a symbol expression types have been bound and the resultant type is ambiguous |
23:31:50 | FromDiscord | <Elegantbeef> You can argue for an `int` result as much as a `float` result |
23:32:00 | nrds | <Prestige99> leneintops handles it fine, I think that should just be the default for (int, float) operations |
23:32:09 | nrds | <Prestige99> I don't think you can |
23:32:14 | FromDiscord | <Elegantbeef> Fine in your books |
23:32:26 | nrds | <Prestige99> otherwise, why not cast 2.4 to an int in the literal expression? |
23:32:59 | FromDiscord | <Elegantbeef> Consider `255u8 range[0f..1f]` |
23:33:28 | nrds | <Prestige99> you can multiply ranges? |
23:33:45 | FromDiscord | <Elegantbeef> I could argue that in the above case a vast majority of the time you want the byte result |
23:33:48 | FromDiscord | <Elegantbeef> Well yea it's a subrange type |
23:34:12 | FromDiscord | <Elegantbeef> It doesnt dispatch specially it just dispatches all floats and ensures they're in `0f..1f` |
23:34:21 | nrds | <Prestige99> I don't understand how you do an operation on a range so this is kind of lost on me |
23:34:35 | nrds | <Prestige99> is the result supposed to be a new range? |
23:34:55 | FromDiscord | <Elegantbeef> Ranges are checked values not slices |
23:35:07 | FromDiscord | <Elegantbeef> The result i'd argue in the above should always be a u8 |
23:35:22 | * | flynn quit (Read error: Connection reset by peer) |
23:35:27 | nrds | <Prestige99> oh so the range is a type? uh |
23:35:34 | FromDiscord | <Elegantbeef> Simply cause in most cases you multiply a uint8 by a float it's related to colour or other conversion |
23:35:36 | nrds | <Prestige99> I'd argue float if it's an int * a float |
23:35:39 | FromDiscord | <Elegantbeef> Yes range is a checked value |
23:36:09 | FromDiscord | <Elegantbeef> And i'd say that's wrong cause in most cases with `uint8 0f..1f` you want a uint8 back đ |
23:36:22 | nrds | <Prestige99> That's kind of subjective |
23:36:35 | * | flynn joined #nim |
23:36:36 | nrds | <Prestige99> from a languge design standpoint I'd just always have int * float return a float |
23:36:43 | FromDiscord | <Elegantbeef> As is this entire exercise |
23:37:55 | nrds | <Prestige99> Any operation with a decimal should result in a decimal imo |
23:38:08 | nrds | <Prestige99> And if you want to do something against the grain you can just cast, floor, etc |
23:40:16 | * | flynn quit (Remote host closed the connection) |
23:41:29 | * | flynn joined #nim |
23:44:05 | nrds | <Prestige99> hm you can't have like, a method iterator can you? |
23:44:18 | FromDiscord | <Elegantbeef> Like i said have a closure iteratorr |
23:44:51 | nrds | <Prestige99> a method that returns an iterator? |
23:44:57 | FromDiscord | <Elegantbeef> Yes |
23:46:04 | * | flynn quit (Read error: Connection reset by peer) |
23:47:18 | * | flynn joined #nim |
23:47:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
23:48:56 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Wll |
23:49:34 | nrds | <Prestige99> neat |
23:52:01 | * | crem joined #nim |
23:53:29 | FromDiscord | <Elegantbeef> And of course you can make it an `iterator` that calls it |
23:53:51 | * | flynn quit (Read error: Connection reset by peer) |
23:54:15 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Wln |
23:55:04 | * | flynn joined #nim |
23:57:57 | FromDiscord | <Elegantbeef> Soon enough prestige you'll be the one answering these questions for others! đ |