<< 18-09-2022 >>

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