00:00:13 | * | wallabra_ is now known as wallabra |
00:05:30 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:07:40 | * | krux02 quit (Remote host closed the connection) |
01:10:42 | FromDiscord | <Iliketwertles> my nim project to learn shi↵https://github.com/iliketwertles/DPKD |
01:11:57 | FromDiscord | <Elegantbeef> So many returns |
01:19:08 | FromDiscord | <Iliketwertles> true, i could prob just not use the procs but idk enough yet |
01:19:23 | FromDiscord | <huantian> I think beef is suggesting using the procs without returns |
01:19:34 | FromDiscord | <huantian> since nim will automatically use the last value you have in your proc as the return value |
01:20:21 | FromDiscord | <huantian> sent a code paste, see https://paste.rs/fVn |
01:20:24 | FromDiscord | <Elegantbeef> We can even do better |
01:20:25 | FromDiscord | <huantian> (edit) "https://play.nim-lang.org/#ix=4aMG" => "https://play.nim-lang.org/#ix=4aMH" |
01:20:33 | FromDiscord | <Elegantbeef> https://gdl.space/detubaliba.py is a bit more idiomatic minus me using `colour` instead of the inferior `color` |
01:20:53 | FromDiscord | <Elegantbeef> In me eh? |
01:24:17 | * | LuxuryMode joined #nim |
02:02:43 | * | arkurious quit (Quit: Leaving) |
03:28:53 | * | CyberTailor joined #nim |
03:54:03 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
04:52:12 | * | CyberTailor quit (Quit: Konversation terminated!) |
04:52:59 | * | CyberTailor joined #nim |
05:05:01 | FromDiscord | <Rainbow Asteroids> what is the difference between `std/strbasics` and `std/strutils` |
05:11:15 | FromDiscord | <Elegantbeef> strbasics works on `openarray[char]` |
05:11:33 | FromDiscord | <Elegantbeef> It's also a small package to not bring many dependencies where simple operations are needed iirc |
05:16:59 | FromDiscord | <Rainbow Asteroids> interesting |
05:21:40 | * | CyberTailor left #nim (Konversation terminated!) |
05:31:08 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/pull/20379/checks?check_run_id=8412100779 should I fix the tests or something wrong with my PR ? |
05:33:05 | FromDiscord | <Elegantbeef> The errors might be related |
05:34:58 | FromDiscord | <Bung> yeah, I know that but dunno whether I should fix the expected output or correct my code |
05:38:25 | FromDiscord | <Elegantbeef> Seems the tests might have been wrong? |
05:39:40 | FromDiscord | <Elegantbeef> Yea my logic might've been off |
05:40:59 | FromDiscord | <Bung> I think I may introduce another branch, seems like sometimes the first error line already show the calling convention |
05:41:05 | FromDiscord | <Elegantbeef> omitted calling convention should accept closure or nimcall iirc |
05:42:08 | FromDiscord | <Elegantbeef> So inside tproc\_mismatch lines 52, 61, 69, 70, 74 shouldnt error the mismatch on calling conventions |
05:42:43 | FromDiscord | <Bung> the existed code shows nimcall -> closure can pass |
05:43:02 | FromDiscord | <Elegantbeef> What it errros ` Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.` |
05:45:02 | FromDiscord | <Elegantbeef> I think \`\`getProcConvMismatch\` needs a check of https://github.com/nim-lang/Nim/blob/b6bfe38ff5283f77d5e5e78da06d2710bc16afb6/compiler/ast.nim#L574 |
05:46:39 | FromDiscord | <Bung> I agree , so looks like the code and expected output both need fix |
05:46:59 | FromDiscord | <Elegantbeef> No expected seems fine |
05:47:39 | FromDiscord | <Elegantbeef> Actually wait... those are correct |
05:47:42 | FromDiscord | <Elegantbeef> I misread the code |
05:48:09 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1020934233314828339/image.png |
05:48:48 | FromDiscord | <Elegantbeef> I mean yes it should check if it has an explicitCallingConv |
05:49:09 | FromDiscord | <Elegantbeef> And also yes it should error that there is a mismatch of calling convention |
05:49:29 | FromDiscord | <Elegantbeef> I dont know how this has hidden for so long but i guess good job accidently revealing my fuckup |
05:49:48 | FromDiscord | <Elegantbeef> Luckily it's a minor fuckup |
05:50:19 | FromDiscord | <Elegantbeef> and an easy fix of `tfExplicitCallConv in f.flags and f.kind == ccClosure....` |
05:50:50 | FromDiscord | <Bung> I guess because tests only covered the first error line, so others are hidden |
05:51:04 | FromDiscord | <Elegantbeef> Perhaps? |
05:51:29 | FromDiscord | <Elegantbeef> I dont get testament so i dont really know |
05:52:47 | FromDiscord | <flywind> In reply to @Bung "I guess because tests": Use `nim check` to get verbose error messages. |
05:53:18 | FromDiscord | <Elegantbeef> The test uses nimcheck |
05:53:26 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/836b061ae30bb471dc7deef41bb454e1d047bab7/tests/errmsgs/tproc_mismatch.nim test in question |
05:54:14 | FromDiscord | <Elegantbeef> Bungs changes somehow suddenly revealed and issue with my code |
05:54:18 | FromDiscord | <Bung> yeah , it's not about log level. |
05:54:47 | FromDiscord | <Bung> I'll fix these |
05:54:55 | FromDiscord | <Elegantbeef> Sorry |
05:59:09 | FromDiscord | <Bung> no worry |
06:03:19 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4aNi |
06:03:20 | FromDiscord | <ravinder387> invalid indentation |
06:04:50 | FromDiscord | <Rika> After the string, you indented one too much |
06:06:04 | FromDiscord | <ravinder387> so how to fix it then |
06:06:14 | FromDiscord | <Bung> @ElegantBeef `tproc_mismatch.nim(64, 9) Error: type mismatch: got <proc (a: int){.locks: 0.}> but expected 'proc (a: int){.closure, gcsafe.}'↵ Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.` does this right ? |
06:06:17 | FromDiscord | <Elegantbeef> Dont use strings |
06:06:29 | FromDiscord | <Elegantbeef> Yea |
06:07:04 | FromDiscord | <Rika> In reply to @ravinder387 "so how to fix": Dedent the line... |
06:08:20 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNj |
06:08:35 | FromDiscord | <Elegantbeef> should be `notin f.flags` |
06:08:53 | FromDiscord | <Elegantbeef> that logic only should apply if you dont have an explicit call convention |
06:09:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aNk |
06:09:43 | FromDiscord | <Elegantbeef> I might be misremembering the intention of that code but i think it's above |
06:10:20 | FromDiscord | <Elegantbeef> basically in cases the type system or user didnt say `{.nimcall.}` both are accepted |
06:12:42 | FromDiscord | <Bung> okay, get it |
06:19:39 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNp |
06:19:49 | FromDiscord | <Bung> these don't have nimcall still not pass ? |
06:27:28 | FromDiscord | <Bung> oh they have explicit call convention |
06:29:51 | FromDiscord | <Elegantbeef> Yea they get an explicit calling convention when the `proc()` is reified into a variable |
06:30:04 | FromDiscord | <Elegantbeef> Hmm did i use 'reified' properly rika knows 😛 |
06:30:51 | FromDiscord | <Elegantbeef> As a parameter `proc()` is really a typeclass of `proc(){.closure.} or proc(){.nimcall.}` as a variable it has to be concrete so choses the default convention of closure |
06:31:45 | FromDiscord | <Elegantbeef> The reason it choses closure by default is that in many cases you'll be making a closure when you use anonymous procedures |
06:32:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aNr |
06:34:26 | FromDiscord | <Bung> `teffects1.nim(35, 21) Error: type mismatch: got <proc (x: int): string{.noSideEffect, gcsafe, locks: 0.}> but expected 'MyProcType = proc (x: int): string{.closure.}'↵ Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.` |
06:35:04 | FromDiscord | <Bung> what about this case `type↵ MyProcType = proc(x: int): string #{.raises: [ValueError, Defect].}` |
06:35:37 | FromDiscord | <Elegantbeef> It's a closure |
06:35:54 | FromDiscord | <Elegantbeef> `proc` type definitions default to closure |
06:36:45 | FromDiscord | <Elegantbeef> You need to do `proc(x: int): string {.nimcall.}` to force it to nim call |
06:37:02 | FromDiscord | <Elegantbeef> You changing the code the way you did seemed to have awaken my changes, which didnt catch this one |
06:40:09 | FromDiscord | <Bung> I understand , so only care effect here |
06:45:41 | FromDiscord | <Bung> `.\koch.exe temp r .\testament\testament.nim --nim:compiler/nim.exe r .\tests\effects\teffects1.nim` |
06:46:00 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNv |
06:46:15 | FromDiscord | <Bung> something wrong test it locally ? |
06:46:32 | FromDiscord | <Elegantbeef> `teffects1.nim(17, 28) template/generic instantiation from here` |
06:46:39 | FromDiscord | <Elegantbeef> `nim check` |
06:49:21 | FromDiscord | <Bung> I can do ` .\koch.exe temp check tests/effects/teffects1.nim` and compare the output by eye, but how to work with testament |
06:49:45 | FromDiscord | <Elegantbeef> `.\koch.exe temp r .\testament\testament.nim --nim:compiler/nim.exe check .\tests\effects\teffects1.nim`? |
06:51:21 | FromDiscord | <Elegantbeef> Like i said i dont know testament |
06:52:13 | FromDiscord | <Bung> hmm, doesn't work , has no check command |
07:03:10 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNC |
07:20:49 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNF |
07:31:57 | * | krux02 joined #nim |
07:39:49 | FromDiscord | <Bung> @ElegantBeef saddly , now it break vm https://github.com/nim-lang/Nim/actions/runs/3076295829/jobs/4970351341 |
07:42:16 | FromDiscord | <Elegantbeef> Hmm is `else: result[0].incl pcmDifferentCallConv` right? |
07:43:16 | FromDiscord | <Elegantbeef> If it enters that if statement the call conventions are not a mismatch |
07:43:35 | FromDiscord | <Bung> I change `tfExplicitCallConv notin a.flags` to `tfExplicitCallConv notin f.flags` now |
07:43:52 | FromDiscord | <Elegantbeef> Ah |
07:44:02 | FromDiscord | <Elegantbeef> I didnt even see that, probably the issue |
07:44:17 | FromDiscord | <Elegantbeef> Though i still think that else isnt needed, but if it doesnt harm it i guess leave it |
07:44:51 | FromDiscord | <Bung> okay, but why there is that error message order issue |
07:46:50 | FromDiscord | <Elegantbeef> What order issue |
07:47:51 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNI |
07:48:08 | FromDiscord | <Elegantbeef> Ah not a clue |
07:48:54 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aNJ |
07:49:17 | FromDiscord | <Bung> seems like `tfExplicitCallConv notin f.flags` should remove |
07:51:43 | FromDiscord | <Elegantbeef> I mean i think it's right |
07:52:11 | FromDiscord | <Elegantbeef> This might be an araq question but i'm like 90% certain a parameter marked closure shouldnt accept a nimcall |
07:52:52 | FromDiscord | <Bung> what's the side effect if it accpet a nimcall |
07:53:29 | * | jmdaemon quit (Ping timeout: 250 seconds) |
07:53:38 | FromDiscord | <Bung> since old code allow automatically convert |
07:54:13 | FromDiscord | <Elegantbeef> `proc (x: T, y: K): int {.closure.}` is the parameter type afterall |
07:54:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/8zo |
07:54:37 | FromDiscord | <Elegantbeef> I'm going to shush here since i dont know what's supposed to happen |
07:54:37 | FromDiscord | <Elegantbeef> The code explicitly states the call convention then you pass the wrong oen |
07:54:39 | FromDiscord | <Elegantbeef> one\ |
07:54:48 | FromDiscord | <Elegantbeef> That seems like a compile time error, but i guess Nim might create an intermediate closure? |
07:55:38 | FromDiscord | <Elegantbeef> > As a special extension, a procedure of the calling convention nimcall can be passed to a parameter that expects a proc of the calling convention closure↵Ah the manual says it's supposed to happen |
07:56:29 | FromDiscord | <Elegantbeef> So yes indeed you can just remove the check if it has an explicit calling convention |
07:56:35 | FromDiscord | <Elegantbeef> My bad yet again |
07:56:42 | FromDiscord | <Bung> so it's definatly should remove, as the manual said |
08:00:04 | NimEventer | New thread by elcritch: Fidgetty Widget System: Rewrite, see https://forum.nim-lang.org/t/9476 |
08:02:10 | FromDiscord | <Elegantbeef> @elcritch cmon i'm a simple man i need images 😛 |
08:12:07 | FromDiscord | <elcritch> haha sorry -- the UI looks the same alas. Though it'll be much better to use now. 😛 |
08:14:26 | FromDiscord | <elcritch> I'm planning to start writing more widgets soon though. Figuring out this rewrite was a big blocker, but now it's time to actually implement widgets! |
08:15:31 | FromDiscord | <Elegantbeef> Dont forget styling! |
08:18:46 | FromDiscord | <Elegantbeef> Went to look at your examples and `/tmp/fidgetty/src/fidgetty/themes.nim(38, 64) Error: type mismatch: got <Color, float64>` |
08:21:22 | FromDiscord | <elcritch> that's odd, you may need to update the fidget fork? also https://forum.nim-lang.org/t/9476#62228 |
08:21:56 | FromDiscord | <elcritch> and which example did you run? |
08:22:09 | FromDiscord | <Elegantbeef> your choosenim example and testdemo |
08:22:13 | FromDiscord | <Elegantbeef> Both have the same error |
08:24:12 | FromDiscord | <Elegantbeef> Yea i have fidget\_dev#head |
08:30:52 | FromDiscord | <elcritch> Ok, let me bump some dependency versions |
08:32:16 | FromDiscord | <elcritch> ok just pushed, could you update and try again? |
08:36:05 | FromDiscord | <Elegantbeef> You really broke your nimble file now 😛 |
08:36:24 | FromDiscord | <Elegantbeef> https://github.com/elcritch/fidgetty/blob/main/fidgetty.nimble#L13↵Should be either `@#head` or `>= 1.7.9` |
08:36:36 | FromDiscord | <elcritch> 😭 |
08:37:57 | FromDiscord | <elcritch> Ok, reverted that one. The original problem was not requiring the latest pixie |
08:57:57 | FromDiscord | <Elegantbeef> Also you're echoing out the macro |
08:58:27 | FromDiscord | <Elegantbeef> Also you're on a mac arent you? |
08:59:17 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1020982332741656597/image.png |
08:59:18 | FromDiscord | <Elegantbeef> The test demo looks a lot like a non HDPI aware program being ran on a low dpi screen |
08:59:45 | FromDiscord | <Elegantbeef> For reference that's larger than 1080 pixels tall |
09:02:33 | FromDiscord | <Elegantbeef> Ah `uiScale = 2.0` arguably should be inferred by the DPI scaling on the OS I imagine |
09:04:31 | FromDiscord | <Elegantbeef> Using https://www.glfw.org/docs/latest/monitor_guide.html#monitor_scale i'd reason |
09:04:46 | FromDiscord | <Elegantbeef> @elcritch just pinging to ensure you see the above |
09:04:52 | FromDiscord | <Elegantbeef> I'm off now! |
09:46:54 | FromDiscord | <kenran> In a project using Nix, and Nim/Nimble from `nixpkgs`, can I also get a development environment provided by `pkgs.nimPackages`? That is, I'd like `nimble build` to use the same dependencies that I get from `nixpkgs`. |
10:20:02 | * | genpaku quit (Remote host closed the connection) |
10:20:43 | * | genpaku joined #nim |
11:10:43 | NimEventer | New thread by oyster: Turns Nim into a build once run anywhere language, see https://forum.nim-lang.org/t/9477 |
11:15:02 | * | xet7 joined #nim |
11:42:19 | FromDiscord | <retkid> https://github.com/nimgl/opengl |
11:42:32 | FromDiscord | <retkid> this is the cool gl package right @ElegantBeef |
11:43:02 | FromDiscord | <retkid> oh beef has his own |
11:43:03 | FromDiscord | <retkid> https://github.com/beef331/truss3d |
11:43:13 | FromDiscord | <retkid> no readme |
11:43:16 | FromDiscord | <retkid> beef stop slacking |
11:54:53 | * | arkurious joined #nim |
12:02:40 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=4aOR |
12:04:15 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=4aOR" => "https://play.nim-lang.org/#ix=4aOS" |
12:09:58 | FromDiscord | <Yardanico> In reply to @Goel "So to escape a": just do `\\` ? |
12:10:27 | FromDiscord | <Goel> But i need to check the single char '\' |
12:10:39 | FromDiscord | <Goel> (edit) "'\'" => "`'\'`" |
12:10:43 | FromDiscord | <Yardanico> `\\` is a single char |
12:10:45 | FromDiscord | <Yardanico> without `r` |
12:10:48 | FromDiscord | <Yardanico> because you escape the `\` |
12:11:12 | FromDiscord | <Goel> This also works i think, i need to try: `'\''` |
12:11:21 | FromDiscord | <Yardanico> yes that'll work as well |
12:11:30 | FromDiscord | <Yardanico> `\` is used for escaping stuff by default unless you use `r` |
12:11:41 | FromDiscord | <Yardanico> so to write `\` you have to write `\\` in strings |
12:11:45 | * | wallabra joined #nim |
12:30:40 | * | wallabra quit (Ping timeout: 268 seconds) |
12:36:11 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=4aP2 |
12:36:21 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=4aP2" => "https://play.nim-lang.org/#ix=4aP3" |
12:40:00 | FromDiscord | <Forest [She/Her]> is `readVarInt` an idiomatic name for a proc in Nim? Or is there a better way to read it? |
12:40:10 | FromDiscord | <Forest [She/Her]> name |
12:40:38 | FromDiscord | <Rika> In reply to @Goel "Why this doesn't output": Because the second character is the escape code \b, you didn’t make it raw with r |
12:40:54 | FromDiscord | <Rika> R is for raw strings and characters aren’t strings so |
12:41:08 | FromDiscord | <Rika> You can’t use it on characters |
12:44:03 | FromDiscord | <Goel> Even if i change str to be `= r"a\b"` still don't work, that sucks. So i simply can't check for the occurce of `\` char inside my string? |
12:44:39 | FromDiscord | <Rika> Oh no |
12:44:44 | FromDiscord | <Rika> You’re checking for ' |
12:44:44 | FromDiscord | <Goel> (edit) "occurce" => "occurence" |
12:44:46 | FromDiscord | <Rika> Not \ |
12:44:52 | FromDiscord | <Rika> I misread too |
12:44:57 | FromDiscord | <Goel> How? |
12:45:50 | FromDiscord | <Rika> `'\''` should be `'\\'` |
13:00:34 | FromDiscord | <Forest [She/Her]> Hey so i'm doing bit operation related stuff rn, and i have some feedback for improving the page for it, is there a specific place or should i dump it here? |
13:04:56 | FromDiscord | <jan0809> if its a page maybe #webdev |
13:12:17 | FromDiscord | <Rika> If it’s the docs here prolly is okay |
13:17:41 | * | wallabra joined #nim |
13:52:00 | FromDiscord | <Forest [She/Her]> Alright then |
13:54:23 | FromDiscord | <Forest [She/Her]> When porting examples or pseudocode to Nim, i was a bit confused since Nim doesn't have bitwise operators and instead just uses method names, what confused me the most in the example i was reading from wiki.vg (I'm implementing an MC Java Edition server) was `val |= a`, since the equivalent in Nim is `val = bitor[int](val, a)` |
13:55:20 | FromDiscord | <Forest [She/Her]> It would be useful to have the equivalent operator symbols just named in the docs, so examples become a bit easier to follow |
13:55:38 | FromDiscord | <Yardanico> but it is there |
13:55:39 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#system-module-numbers |
13:55:51 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1021056961233563709/unknown.png |
13:59:55 | FromDiscord | <Forest [She/Her]> Oh i must of missed that then |
14:00:04 | FromDiscord | <Forest [She/Her]> I was using the `bitops` module |
14:09:24 | * | krux02 quit (Remote host closed the connection) |
14:28:38 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4aPx |
14:28:59 | FromDiscord | <Forest [She/Her]> Could just do `else` maybe? |
14:29:09 | FromDiscord | <Forest [She/Her]> `else: discard` |
14:29:15 | FromDiscord | <Forest [She/Her]> Tho it might be a big, idk |
14:30:51 | FromDiscord | <techroot> How do I get path of current script? I want to pass it to `staticRead`. |
14:30:52 | FromDiscord | <auxym> yes, I can. just that the completeness check should normally pass, I think. |
14:33:15 | FromDiscord | <techroot> In reply to @techroot "How do I get": Ah, found at last: https://nim-lang.org/docs/system.html#currentSourcePath.t |
14:34:49 | FromDiscord | <Forest [She/Her]> In reply to @auxym "yes, I can. just": Fair |
15:03:42 | * | kenran joined #nim |
15:03:43 | * | kenran quit (Read error: Connection reset by peer) |
15:15:45 | FromDiscord | <Iliketwertles> can you cross compile for macos on linux? |
15:16:09 | FromDiscord | <Iliketwertles> like↵`nim c --os:macos example.nim`? |
15:20:40 | FromDiscord | <Iliketwertles> cause i get this ↵`/usr/lib/nim/system/dyncalls.nim(198, 10) Error: no implementation for dyncalls` |
15:25:05 | FromDiscord | <Forest [She/Her]> Can i even use `asyncnet` to reimplement an MC server? Idk why but for some reason it keeps returning an empty string? I'm requesting 1 byte, and i'm trying to get parse the VarInt from the Minecraft client packet |
15:25:29 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4aQ4 |
15:25:50 | FromDiscord | <Forest [She/Her]> It doesn't seem to raise an error but it does stop |
15:26:03 | FromDiscord | <Forest [She/Her]> (Tho the error may not be working properly because of async) |
15:40:55 | FromDiscord | <Forest [She/Her]> I am dying ngl |
15:42:00 | FromDiscord | <Forest [She/Her]> Why is there no way to just read bytes from the websocket? Instead of getting a string? |
16:37:08 | FromDiscord | <huantian> Strings are kinda just a seq of bytes |
16:37:33 | FromDiscord | <huantian> Ooh Nim mc server seems neat tho |
16:42:33 | FromDiscord | <Forest [She/Her]> In reply to @huantian "Strings are kinda just": Trying to figure out how to get the bytes from it tho, that's my issue |
16:43:05 | FromDiscord | <Rika> Get them then what? |
16:43:08 | FromDiscord | <sOkam!> is the lsp being silly here, or is this correct? 🤔 https://media.discordapp.net/attachments/371759389889003532/1021099063149613086/unknown.png |
16:43:47 | FromDiscord | <Rika> In reply to @sOkam! "is the lsp being": Unchecked arrays must be coupled with ptr |
16:44:00 | FromDiscord | <Rika> You can’t have them as is, they have to be ptr I believe? |
16:44:01 | FromDiscord | <sOkam!> oh, always? kk |
16:44:03 | FromDiscord | <Forest [She/Her]> In reply to @Rika "Get them then what?": i mean turn the string into a list of bytes |
16:44:44 | FromDiscord | <Rika> In reply to @Forest "i mean turn the": Either iterate and convert to seq bytes or unsafe cast |
16:46:27 | * | jmdaemon joined #nim |
16:46:31 | FromDiscord | <Forest [She/Her]> Hm i think i'll do unsafe casting here |
16:50:14 | FromDiscord | <huantian> Can you unsafe cast string to seq[byres] the same way on arc as on refc? |
16:53:57 | FromDiscord | <Rika> I don’t know |
16:56:18 | FromDiscord | <sOkam!> what's the difference between a bycopy type, and a normal one, in practical terms? |
16:56:48 | FromDiscord | <huantian> I think yeah just a cast should work for both refc and arc |
16:57:02 | FromDiscord | <sOkam!> c2nim added it to my C struct definitions, but don't know why that is |
16:57:15 | FromDiscord | <sOkam!> (edit) "terms?" => "terms?↵c2nim added it to my C struct definitions, but don't know why that is" |
16:58:11 | FromDiscord | <Goel> When i `proc close(f: File)` a file, the cursor get reset too at the beginning of file if i later open it again? |
16:58:18 | FromDiscord | <Goel> (edit) "`proc close(f:" => "`close(f:" |
16:58:52 | * | FromDiscord quit (Remote host closed the connection) |
16:59:06 | * | FromDiscord joined #nim |
16:59:23 | FromDiscord | <Rika> In reply to @Goel "When i `close(f: File)`": Cursors are per File instance, yes |
17:00:37 | FromDiscord | <huantian> In reply to @sOkam! "what's the difference between": I think it only matters if you use addr? |
17:01:03 | FromDiscord | <huantian> If the type is passed transparently via ref to a proc, that’s just my guess tho |
17:07:21 | FromDiscord | <sOkam!> In reply to @huantian "I think it only": its for gc:none, so i think it could be relevant then |
17:11:16 | FromDiscord | <sOkam!> any clue about this lsp error? 🤔 https://media.discordapp.net/attachments/371759389889003532/1021106145705861120/unknown.png |
17:14:07 | FromDiscord | <Yardanico> In reply to @sOkam! "any clue about this": try to compile it and you'll get an answer immediately |
17:14:26 | FromDiscord | <Yardanico> maybe you're missing parentheses |
17:21:50 | FromDiscord | <techroot> When should I use ref object vs plain object? I have global `Game` object and wonder whether I should write methods which accept just `var Game`, or should I make it `ref object` from the start |
17:22:04 | FromDiscord | <techroot> (edit) "methods" => "procs" |
17:34:11 | * | krux02 joined #nim |
17:34:47 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4aQx |
17:35:26 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4aQx" => "https://play.nim-lang.org/#ix=4aQy" |
17:35:44 | FromDiscord | <jmgomez> Is that expected? |
17:36:13 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4aQz |
17:36:49 | FromDiscord | <Rika> In reply to @sOkam! "How do you do": What does that even do? |
17:37:44 | FromDiscord | <sOkam!> In reply to @Rika "What does that even": 🤷♂️ im translating from C, no clue tbh |
17:37:57 | FromDiscord | <sOkam!> never done assertions much |
17:38:20 | FromDiscord | <Rika> What is the C code |
17:40:53 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4aQB |
17:41:12 | FromDiscord | <Yardanico> In reply to @sOkam! "literal same, just changed": you're translating some very low level code |
17:41:18 | FromDiscord | <sOkam!> yep |
17:41:20 | FromDiscord | <Yardanico> can you mind sharing the project you're traslating? |
17:41:23 | FromDiscord | <Yardanico> (edit) "traslating?" => "translating?" |
17:41:41 | FromDiscord | <sOkam!> In reply to @Yardanico "can you mind sharing": https://www.gingerbill.org/article/2019/02/08/memory-allocation-strategies-002/ |
17:42:02 | FromDiscord | <Yardanico> ah, then just use `doAssert false, "message"` in nim instead |
17:43:25 | FromDiscord | <sOkam!> whats different between assert and doAssert? 🤔 |
17:44:03 | FromDiscord | <huantian> There a compiler flag to turn off assert |
17:44:14 | FromDiscord | <huantian> There is no way to turn off doAssert |
17:47:08 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4aQD |
17:51:38 | FromDiscord | <Iliketwertles> how can i have quotes in quotes like this `execProcess("somecommand:"foo"")` and it not act like foo isnt in quotes? |
17:52:39 | FromDiscord | <jmgomez> In reply to @Iliketwertles "how can i have": You can use triple quotes for the outer, or r in front of them or scape the inner ones |
17:52:49 | FromDiscord | <jmgomez> (edit) "scape" => "escape" |
17:53:32 | FromDiscord | <Rika> R will not allow double quotes “in” strings, since they are the delimiters |
17:55:02 | FromDiscord | <jmgomez> You are right |
18:03:04 | FromDiscord | <Forest [She/Her]> How would i wrap my object in a future? Is that even doable? |
18:03:33 | FromDiscord | <Patitotective> `Future[MyObj]` |
18:04:29 | FromDiscord | <Forest [She/Her]> I get an error |
18:04:38 | FromDiscord | <Forest [She/Her]> https://hastebin.com/ujewumibuh.typescript |
18:05:14 | FromDiscord | <Patitotective> futures are not printable |
18:05:56 | FromDiscord | <Patitotective> if you want to print future's result you need to wait and then `read` it |
18:06:06 | FromDiscord | <Patitotective> (edit) "if you want to print ... future'sfor" added "the" | "thefuture's result you need to wait ... and" added "for it" |
18:07:00 | FromDiscord | <Forest [She/Her]> Wait oooh that explains it |
18:07:55 | FromDiscord | <Patitotective> In reply to @Patitotective "if you want to": you also have to check that it didnt fail |
18:08:19 | FromDiscord | <Forest [She/Her]> Ah yeah i was making a mistake |
18:08:25 | FromDiscord | <Forest [She/Her]> Wasn't even a custom future lmao |
18:08:29 | FromDiscord | <Forest [She/Her]> I forgot to await it |
18:21:11 | FromDiscord | <techroot> What's the best way to add to the head of a sequence? `[element] & sequence`? |
18:21:17 | FromDiscord | <techroot> (edit) "`[element]" => "`@[element]" |
18:22:50 | FromDiscord | <techroot> Ah, it's `sequence.insert(element, 0)`. Why do I find required doc only after posting a question |
18:22:54 | FromDiscord | <Rika> There’s also insert but best depends on what you desire |
18:32:45 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4aR0 |
18:33:31 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4aR0" => "https://paste.rs/fai" |
18:34:33 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4aR4" => "https://play.nim-lang.org/#ix=4aR3" |
18:37:48 | FromDiscord | <Forest [She/Her]> Would turning my sequence to an array have any benefits to me? Since I'm just handling packets in a Nim object |
18:43:46 | FromDiscord | <Dfy> Wtf did i join into |
18:44:15 | FromDiscord | <Dfy> coding? |
18:45:12 | FromDiscord | <Phil> ... well, yeah, this is a discord server about coding in the nim language |
18:50:32 | FromDiscord | <Forest [She/Her]> In reply to @Dfy "coding?": It's a programming server for the Nim programming language :p |
18:51:23 | FromDiscord | <Phil> In reply to @Forest "Would turning my sequence": Do you know the maximum length of your sequence ahead of time in order to be able to make the seq and array? |
18:51:31 | FromDiscord | <Phil> (edit) "and" => "an" |
18:51:55 | FromDiscord | <Patitotective> In reply to @sOkam! "how do you do": you can't echo a pointer, you need to `[]` it↵also it will error since you never set a value to them |
18:52:47 | FromDiscord | <huantian> You can print the `repr`of the pointer for a similar result |
18:53:05 | FromDiscord | <huantian> (edit) "`repr`of" => "`repr` of" |
18:53:08 | FromDiscord | <Patitotective> !eval var x = 0; echo repr x.addr |
18:53:19 | FromDiscord | <huantian> Or if you want a even nicer result use treeforms `print` |
18:53:48 | FromDiscord | <Patitotective> In reply to @Patitotective "!eval var x =": ptr 0x55de2a829500 --> 0 |
18:54:09 | NimBot | Compile failed: <no output> |
18:55:01 | FromDiscord | <Patitotective> huh |
18:56:13 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "Do you know the": I get the length just before i make the sequence so |
18:56:21 | FromDiscord | <Forest [She/Her]> But i need to convert a string into an array so |
18:56:28 | FromDiscord | <Forest [She/Her]> Actually it's probably not the most feasible |
18:56:42 | FromDiscord | <Forest [She/Her]> It's doable but wouldn't be practical to me |
18:57:02 | FromDiscord | <Phil> In reply to @Forest "I get the length": Wait, I think I'm not getting something.↵"Just before" means you only know the size at runtime? |
18:57:08 | FromDiscord | <Phil> Or do you know it at compiletime? |
18:57:13 | FromDiscord | <Forest [She/Her]> At runtime, yeah |
18:57:30 | FromDiscord | <Forest [She/Her]> I'm reading Minecraft packets sent from the client, to my server |
18:57:30 | FromDiscord | <Phil> Wouldn't that make it impossible to create an array which afaik relies on size being known at compiletime? |
18:57:42 | FromDiscord | <Forest [She/Her]> Oh probably not lmao |
18:59:33 | FromDiscord | <Phil> Like, array size is something that is part of the type annotation, thus it needs defined size at compiletime.↵So I think you're stuck with seq |
19:01:39 | FromDiscord | <Forest [She/Her]> Eh fair enough, that's fine for me |
19:01:49 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4aRk |
19:02:23 | FromDiscord | <Forest [She/Her]> I have the bytes now but idk how i'm supposed to make it read existing bytes without them suddenly stopping? |
19:02:40 | FromDiscord | <Forest [She/Her]> Actually i have an idea |
19:03:24 | FromDiscord | <Patitotective> tryRecv? |
19:03:33 | FromDiscord | <Patitotective> something like that |
19:12:09 | FromDiscord | <Forest [She/Her]> tryRecv? |
19:12:20 | FromDiscord | <Patitotective> nah nvm i was thinking about channles |
19:12:23 | FromDiscord | <Forest [She/Her]> I mean that i already have the bytes in memory |
19:12:28 | FromDiscord | <Patitotective> since its already async no need for that |
19:12:37 | FromDiscord | <Forest [She/Her]> I need to pass it to the function but i need to know the length |
19:12:40 | FromDiscord | <Forest [She/Her]> But I'm figuring that out |
19:19:43 | FromDiscord | <Iliketwertles> pov you try to port anything from unix-based to windows https://media.discordapp.net/attachments/371759389889003532/1021138468623097869/unknown.png |
19:20:05 | FromDiscord | <Phil> All I see is a Dalek trying to murder you |
19:21:58 | FromDiscord | <Iliketwertles> colored text ❌↵system command ❓ |
19:50:02 | FromDiscord | <huantian> Does it work in powershell or windows terminal? |
19:57:06 | FromDiscord | <Forest [She/Her]> Does casting between objects only work with ref objects? |
19:57:17 | FromDiscord | <Patitotective> nope |
19:57:19 | FromDiscord | <Forest [She/Her]> So casting between a parent and a child object |
19:57:26 | FromDiscord | <Forest [She/Her]> Does it lose data? |
20:07:08 | FromDiscord | <huantian> If they’re not refs it does lose data yes |
20:10:03 | FromDiscord | <Forest [She/Her]> Ah alright then, thanks |
20:15:12 | FromDiscord | <Forest [She/Her]> Does Nim have a method to get a sequence from a sequence with a start and end argument? |
20:15:41 | FromDiscord | <Forest [She/Her]> So like `mySeq.sub(4, 8)` to get a sequence of the values from index 4 to index 8? |
20:16:21 | FromDiscord | <Forest [She/Her]> Ah figured it out nvm |
20:16:23 | FromDiscord | <Forest [She/Her]> It's slicing |
20:17:05 | FromDiscord | <Patitotective> consider `toOpenArray`↵since slices do deep copy |
20:19:25 | FromDiscord | <Elegantbeef> It's literally just for me and if anyone wants to use it they can↵(@retkid) |
20:20:17 | FromDiscord | <Patitotective> beef stop slacking |
20:21:06 | FromDiscord | <Elegantbeef> PRs welcome |
20:21:07 | FromDiscord | <retkid> gotta stop beef |
20:21:08 | FromDiscord | <Iliketwertles> In reply to @huantian "Does it work in": the command im trying to run works in both but the fetch works in neither |
20:21:34 | FromDiscord | <Patitotective> In reply to @Elegantbeef "PRs welcome": haha |
20:22:46 | FromDiscord | <retkid> does anyone wanna run a harddrive test |
20:22:56 | FromDiscord | <retkid> specificly for hdds |
20:23:01 | FromDiscord | <retkid> (edit) "specificly" => "specifically" |
20:29:46 | FromDiscord | <Elegantbeef> Slices dont deepcopy, they just copy↵(@Patitotective) |
20:34:19 | FromDiscord | <Patitotective> :P |
20:34:22 | FromDiscord | <Patitotective> (edit) ":P" => ":p" |
20:35:36 | FromDiscord | <Elegantbeef> I mean those are vastly different semantics so it's worth being precise there |
20:41:25 | * | rockcavera quit (Remote host closed the connection) |
20:49:35 | * | wallabra quit (Ping timeout: 250 seconds) |
20:50:03 | * | wallabra joined #nim |
21:03:35 | FromDiscord | <Patitotective> !eval import std/strformat; assert &"{2.5e10:E}" == "2.500000E+10" |
21:04:28 | FromDiscord | <Patitotective> i expect `2.5E+10` |
21:04:35 | NimBot | Compile failed: <no output> |
21:05:00 | FromDiscord | <Elegantbeef> I dont get why you're using strformat |
21:05:13 | FromDiscord | <elcritch> In reply to @Elegantbeef "Using https://www.glfw.org/docs/latest/monitor_guid": yep, the scaling is hardcoded. thanks I've been meaning to lookup how to lookup the correct dpi scaling! |
21:05:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#formatFloat%2Cfloat%2CFloatFormatMode%2Crange%5B%5D%2Cchar |
21:05:57 | FromDiscord | <Rainbow Asteroids> In reply to @aruZeta "my same question": I found the answer https://media.discordapp.net/attachments/371759389889003532/1021165198746341416/PXL_20220918_210518458.jpg |
21:06:24 | FromDiscord | <Patitotective> In reply to @Elegantbeef "I dont get why": :p |
21:06:48 | FromDiscord | <Elegantbeef> Jesus christ is that the entire linux source code in a qr code?! |
21:07:25 | FromDiscord | <Elegantbeef> I dont get your inane reactions but ok |
21:08:50 | FromDiscord | <Patitotective> !eval import std/strutils; assert formatFloat(2.5e10, ffScientific, -1) == "2.500000e+10" |
21:09:10 | FromDiscord | <Patitotective> i thought -1 precision would just remove zeroes but it doesn |
21:09:13 | FromDiscord | <Patitotective> (edit) "doesn" => "doesnt" |
21:09:39 | FromDiscord | <Patitotective> In reply to @Elegantbeef "I dont get your": translate it to "oh im dumb nvm" |
21:09:50 | NimBot | Compile failed: <no output> |
21:10:27 | FromDiscord | <Elegantbeef> > If precision == -1, it tries to format it nicely. |
21:10:39 | FromDiscord | <Elegantbeef> I dont know why you're attempting to print out a float in scientific notation |
21:10:42 | FromDiscord | <Elegantbeef> You only need to be able to import these, output a normal float literal |
21:10:59 | FromDiscord | <Patitotective> remember KDL translation rules |
21:11:10 | FromDiscord | <Patitotective> i need to output it in scientific notation |
21:12:37 | FromDiscord | <Elegantbeef> What? |
21:12:38 | FromDiscord | <Elegantbeef> How the hell do you output an accurate float automatically using significant figures |
21:12:39 | FromDiscord | <Elegantbeef> Are you sure you read that properly? |
21:13:34 | FromDiscord | <Patitotective> i think https://github.com/kdl-org/kdl/tree/main/tests#translation-rules↵they also tell you that the tests are not mandatory and that the tests are probably wrong, not your parser |
21:16:01 | FromDiscord | <Elegantbeef> Atleast i dont understand why you're attempting to format floats to scientific notation |
21:16:02 | FromDiscord | <Elegantbeef> Unless you provide a `precision` integer for formatting them it's pointless |
21:17:10 | FromDiscord | <Patitotective> let me open a discussion |
21:19:39 | FromDiscord | <Forest [She/Her]> In reply to @Patitotective "consider `toOpenArray` since slices": Hm alright |
21:20:17 | FromDiscord | <Elegantbeef> Dont listen to patito he says terms he doesnt understand! |
21:20:43 | FromDiscord | <Patitotective> :p |
21:21:37 | * | rockcavera joined #nim |
21:21:38 | * | rockcavera quit (Changing host) |
21:21:38 | * | rockcavera joined #nim |
21:21:48 | * | dv^_^6 joined #nim |
21:22:36 | FromDiscord | <Elegantbeef> For context |
21:22:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aRT |
21:24:06 | * | dv^_^ quit (Ping timeout: 268 seconds) |
21:24:06 | * | dv^_^6 is now known as dv^_^ |
21:30:45 | FromDiscord | <Forest [She/Her]> Lmao |
21:31:05 | FromDiscord | <Forest [She/Her]> 0..0? That's just empty right? |
21:31:22 | FromDiscord | <Elegantbeef> No |
21:31:23 | FromDiscord | <Elegantbeef> that's inclusive |
21:32:32 | FromDiscord | <Elegantbeef> So it's `@[a[0]]` |
21:38:19 | * | wallabra_ joined #nim |
21:39:55 | FromDiscord | <Forest [She/Her]> Ah |
21:40:17 | * | wallabra quit (Ping timeout: 250 seconds) |
21:40:19 | * | wallabra_ is now known as wallabra |
22:02:55 | * | krux02 quit (Remote host closed the connection) |
22:10:04 | FromDiscord | <retkid> you know what feature i want |
22:10:23 | FromDiscord | <huantian> no |
22:10:31 | FromDiscord | <retkid> a way to separate blocks of code in a disassembly somehow |
22:17:19 | * | attah quit (Ping timeout: 252 seconds) |
22:19:33 | FromDiscord | <retkid> are bitwise ops faster than math sometimes in nim? |
22:21:33 | FromDiscord | <jmgomez> Does dynamic dispatching works with type classes or auto? Im getting an issue where there is no override if the signature of the method contains either of those. If I use a concrete type it does work though |
22:43:14 | FromDiscord | <Generic> In reply to @retkid "are bitwise ops faster": math as in operations from math.nim or math as in arithmetic operations? |
22:43:24 | FromDiscord | <Generic> because bitwise operations are fast |
22:44:17 | FromDiscord | <Generic> arithmetic depends on which one (integer add subtract is as fast, multiply and fp add/sub/mul is a bit slower, division is obviously slowest) |
23:20:32 | * | arkurious quit (Quit: Leaving) |
23:20:40 | FromDiscord | <Patitotective> In reply to @retkid "a way to separate": huh |
23:22:17 | FromDiscord | <retkid> In reply to @Generic "arithmetic depends on which": im trying to figure a fast way to implement some math that uses division |
23:22:39 | FromDiscord | <Generic> floating point or integer? |
23:24:03 | FromDiscord | <Elegantbeef> Depending what you're doing perhaps simd might be what you need |
23:24:23 | FromDiscord | <Generic> most SIMD instruction sets don't have integer division instructions |
23:24:40 | FromDiscord | <Generic> only AVX 512 and SVE iirc have got those |
23:25:54 | FromDiscord | <Elegantbeef> Ah I only roughly know how simd works so no clue what extensions actually provide 😄 |
23:26:28 | FromDiscord | <Generic> ok apparently not even AVX 512 has it |
23:26:36 | FromDiscord | <Elegantbeef> Ah shame |
23:27:43 | FromDiscord | <Generic> though double precision integers can hold all values 32-bit integer can |
23:27:55 | FromDiscord | <Generic> (edit) "integers" => "floats" |
23:28:09 | FromDiscord | <Generic> so you can covert to that and use fp division |
23:28:53 | FromDiscord | <Generic> not ideal, but probably the fastest way to do it |
23:31:14 | * | hochata joined #nim |