<< 13-03-2023 >>

00:03:39*azimut quit (Remote host closed the connection)
00:04:12*azimut joined #nim
00:24:31*lumo_e joined #nim
02:24:47*lumo_e quit (Ping timeout: 246 seconds)
03:09:08FromDiscord<wiga> I have several questions https://media.discordapp.net/attachments/371759389889003532/1084674475909460049/image.png
03:09:13FromDiscord<wiga> what even is that error
03:12:13FromDiscord<demotomohiro> @wiga `std/re` is probably not supported to be used at compile.
03:12:28FromDiscord<Elegantbeef> It's not
03:12:36FromDiscord<wiga> ah maybe
03:12:46FromDiscord<ringabout> Using `let` instead.
03:13:26FromDiscord<wiga> it works 😄
03:13:27FromDiscord<ringabout> `nim-regex` works at compile time.
03:13:46FromDiscord<wiga> is it faster at compile time?
03:14:08FromDiscord<wiga> cuz im making a program that searches for potential webhooks in executable files
03:14:21FromDiscord<wiga> and sometimes malwares are 700mb
03:14:32FromDiscord<wiga> mich is kinda big
03:14:36FromDiscord<wiga> (edit) "mich" => "which"
03:26:56*ltriant joined #nim
03:28:35FromDiscord<sOkam!> compile time is slower, but gets interpreted once↔runtime is faster, but is interpreted every run
03:28:54FromDiscord<sOkam!> so, it depends on your definition of "faster"
03:29:28NimEventerNew thread by ringabout: My Nim Development Weekly Report (3/12), see https://forum.nim-lang.org/t/9989
04:19:43*derpydoo joined #nim
04:30:58*lumo_e joined #nim
05:00:37*lumo_e quit (Quit: Quit)
05:23:35*azimut quit (Ping timeout: 255 seconds)
05:28:53*arkurious quit (Quit: Leaving)
06:05:27*ltriant quit (Ping timeout: 255 seconds)
06:18:57*ltriant joined #nim
06:38:02FromDiscord<firasuke> Is there a list documenting the types of raised exception errors like OSError and such?
06:47:01FromDiscord<Elegantbeef> You can see them inside the system module
06:47:04FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html
06:47:37FromDiscord<Elegantbeef> Use your browser's search and search for "of CatchableError" or just "Error"
07:05:17FromDiscord<firasuke> Oh ok thanks
07:16:48*kenran joined #nim
07:17:29*kenran quit (Remote host closed the connection)
07:24:13*junaid_ joined #nim
07:34:20*Notxor joined #nim
08:02:24*rmt joined #nim
08:10:57FromDiscord<Elegantbeef> Copied the rust example of a 'linked list' using their enum's with my ADT library and oh boy is it certainly code 😄
08:10:57FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4qHg
08:12:54FromDiscord<Elegantbeef> ` while list as (node: Node):` certainly does not read as well as it writes
08:14:25*junaid_ quit (Remote host closed the connection)
08:28:27FromDiscord<Rika> I can’t even understand what it’s supposed to mean
08:28:48FromDiscord<Elegantbeef> It's a pattern match with injection of a symbol
08:29:22FromDiscord<Elegantbeef> `(list.kind == NodeKind and (let node = Node(list); true)`
08:30:11FromDiscord<Elegantbeef> I say pattern match but it's not really a pattern
08:31:01FromDiscord<Elegantbeef> It's `as` or some other odd operator
08:38:21FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qHo
08:38:38FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qHp
08:38:51FromDiscord<Elegantbeef> https://nim-lang.org/docs/tables.html#basic-usage-hashing
08:39:18FromDiscord<Elegantbeef> > Use -d\:nimPreviewHashRef to enable hashing refs. It is expected that this behavior becomes the new default in upcoming versions.
08:39:52*randomuser464876 joined #nim
08:40:01FromDiscord<4zv4l> oh thanks ! xD
08:48:34*PMunch joined #nim
08:55:19*azimut joined #nim
09:43:05*Nick62 joined #nim
09:43:47*Nick62 left #nim (#nim)
10:15:38NimEventerNew thread by alexeypetrushin: Example of simple parser?, see https://forum.nim-lang.org/t/9990
10:38:39FromDiscord<4zv4l> is that normal that when I do `conn.close()` from the server in Nim↔the netcat client doesn't automatically quit ?
10:40:05FromDiscord<4zv4l> I get the same behavior with a netcat server, just find it weird that it doesn't quit after getting the FIN tcp packet
11:47:55*randomuser464876 quit (Quit: Client closed)
12:04:25*junaid_ joined #nim
12:16:40*junaid_ quit (Remote host closed the connection)
12:30:38FromDiscord<sOkam!> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4qHg": what is `adtEnum`?
13:40:09FromDiscord<4zv4l> I have an `uint8` I tried to access the `[1111]0000` first 4 bits
13:40:26FromDiscord<4zv4l> I tried with `op: uint8 = ins.bitSliced(0..3)`
13:40:34FromDiscord<4zv4l> but it doesn't work as expected, I don't get how the slice is done
13:42:59FromDiscord<Rika> “First four” meaning? Most significant or least significant?
13:43:22FromDiscord<Rika> 0..3 is least significant to 4th least
13:43:35FromDiscord<4zv4l> most significant
13:43:48FromDiscord<Rika> Then do 4..7
13:44:10FromDiscord<4zv4l> oh
13:44:21FromDiscord<4zv4l> it doesn't slice the bytes↔it gives the slice we asked
13:44:26FromDiscord<4zv4l> (edit) "slice" => "slide"
13:44:36FromDiscord<4zv4l> makes sense now
13:45:24FromDiscord<Rika> Yes it doesn’t consume/modify anything in the original
14:08:27FromDiscord<auxym> IIRC bitslice mutates the input, bitsliced gives you a sliced copy
14:10:23FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qIz
14:10:26FromDiscord<4zv4l> but it will be only once there, just the type change
14:20:46FromDiscord<Rika> You cannot have the field name be the same across variants
14:24:34FromDiscord<4zv4l> any thing I can do about that ?
14:26:23FromDiscord<Rika> Name the fields differently
14:26:56FromDiscord<4zv4l> something like this ?
14:26:58FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qIC
14:27:01FromDiscord<4zv4l> In reply to @Rika "Name the fields differently": I can't
14:27:14FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4qID
14:27:15FromDiscord<4zv4l> why ?
14:27:19FromDiscord<Rika> In reply to @4zv4l "I can't": Why so?
14:27:30FromDiscord<4zv4l> it has to be the same so I can easily call it
14:27:32FromDiscord<Rika> In reply to @4zv4l "why ?": It’s not valid code?
14:28:15FromDiscord<4zv4l> alright, I'll try with different fields names
14:32:48FromDiscord<kfdvh> What is `cps:count() env`
14:33:02FromDiscord<kfdvh> I can't use `recover(c: Count)`
14:37:18FromDiscord<Rika> I don’t understand the question
14:38:18FromDiscord<kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qII
14:38:29FromDiscord<kfdvh> What's the type of `whelp count(1_000)`?
14:38:47FromDiscord<kfdvh> (edit) "https://play.nim-lang.org/#ix=4qII" => "https://play.nim-lang.org/#ix=4qIJ"
14:38:59FromDiscord<kfdvh> If I add `: Count` then `later.recover()` doesn't work
14:40:34FromDiscord<kfdvh> That doesn't make any sense
15:16:43NimEventerNew post on r/nim by garf-lasagna: Plan 9 (and 9front) support, see https://reddit.com/r/nim/comments/11qcf76/plan_9_and_9front_support/
15:21:07*attah quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
15:21:28*attah joined #nim
15:24:41*arkurious joined #nim
15:27:32FromDiscord<auxym> In reply to @kfdvh "That doesn't make any": I'm not super familiar with CPS. The authors do have a matrix channel specifically for the lib, you might have more luck there (#cps on matrix.org)
15:46:12FromDiscord<Ayy Lmao> What is the equivalent of `const char name[] = "nim";` in nim? Would it be cstring?
15:46:49FromDiscord<Rika> yes
15:47:17FromDiscord<Ayy Lmao> Cool, thanks!
15:59:38FromDiscord<Airbus5717> how do i check if a string is in this table https://media.discordapp.net/attachments/371759389889003532/1084868380026216611/image.png
15:59:57FromDiscord<Airbus5717> for example a s: string↔if s in rtype: ↔something like this
16:05:29FromDiscord<Nerve> `if s in rtype:` should work, did you try it?
16:06:40FromDiscord<apahl> In addition to `in` you can also use `hasKey("add")` or `contains("add")`:↔https://nim-lang.github.io/Nim/tables.html#hasKey,Table[A,B],A
16:08:15FromDiscord<caravaggio> Can someone link me a guide or an example of interfacing js with nim?
16:09:02FromDiscord<Kaz> sent a code paste, see https://play.nim-lang.org/#ix=4qJ9
16:09:39FromDiscord<Kaz> I got it that it tells me it got a some kind of mismatch? But still clueless
16:10:37FromDiscord<Rika> https://nim-lang.org/docs/json.html#getOrDefault%2CJsonNode%2Cstring↔you're dealing with JSON, right?
16:10:42FromDiscord<Kaz> Correct
16:10:45FromDiscord<Kaz> Using one from std
16:10:46FromDiscord<Rika> there is no three argument get or default for jsonnodes
16:11:54PMunch`let interval = try: configJson["interval"].str except: "3600"`
16:12:21FromDiscord<Rika> not a fan of that exception handling style, was writing a different way
16:12:38PMunchYou could do it with hasKey of course
16:12:52PMunchBut then you need to write "interval" twice
16:14:51FromDiscord<Kaz> sent a code paste, see https://play.nim-lang.org/#ix=4qJc
16:22:20FromDiscord<Hourglass [She/Her]> There's the `to` macro in std/json, why didn't you just use that?
16:22:53FromDiscord<Hourglass [She/Her]> (Genuine question, by the way)
16:23:20FromDiscord<Kaz> In reply to @Hourglass, When the Hour Strikes "There's the `to` macro": Blindness xD
16:23:26FromDiscord<Hourglass [She/Her]> Ah fair lol
16:26:38FromDiscord<Kaz> I am curious will it be possible when compiling Nim app report all issues with the code?
16:27:07FromDiscord<Kaz> It looks like Nim's compiler only shows one error, and then you fix it, it will show another
16:30:02FromDiscord<Rika> showing all issues isnt really possible as one error can affect the rest of the code
16:30:12*genpaku quit (Read error: Connection reset by peer)
16:31:17FromDiscord<Rika> i believe there is a setting though to do so
16:31:38FromDiscord<Rika> but also be warned of spurious ("false positive") errors
16:32:43*genpaku joined #nim
16:33:42FromDiscord<Ayy Lmao> I'm having trouble running `nimble install futhark` on windows 10. It tells me `cannot find -lclang`, but I installed clang and added it to the path.
16:34:36PMunchDid you read the instructions?
16:36:11FromDiscord<Ayy Lmao> Yeah, `To install clang on Windows you need to install LLVM (you probably want to grab the LLVM-15.0.6-win64.exe version).` I did that. `If you have Clang installed in your system path you can now simply run: nimble install futhark` and I did that.
16:36:47FromDiscord<Rika> is clang in your system path
16:36:55PMunchWell if it can't find -lclang then you don't have clang properly set up in your library path
16:37:26*arkurious quit (Ping timeout: 250 seconds)
16:37:51PMunchThis should hopefully be easier after I merge https://github.com/PMunch/futhark/pull/59
16:37:54FromDiscord<Ayy Lmao> if I type `clang` in the command prompt that I am running `nimble install futhark` from, it says `clang: error: no input files`, which I am assuming means it is installed and added to the path.
16:38:10PMunchYes, the clang binary, but not the clang library
16:38:24PMunchEasy to get them mixed up
16:39:43FromDiscord<Ayy Lmao> I'm not too familiar with all of this. Shouldn't I have the clang library if I installed LLVM or do I need to get it elsewhere?
16:40:03PMunchOh yeah, you probably have it, just not in your build path
16:40:29PMunchI believe it should be in Program Files\LLVM\lib
16:40:47FromDiscord<Ayy Lmao> I'll see if I can find it
16:42:54FromDiscord<Ayy Lmao> It's there. Now I just need to figure out how to pass it correctly to nimble. The space in `Program Files` is throwing it off.
16:43:21PMunchWrap it in a string?
16:44:01FromDiscord<Ayy Lmao> `nimble install --passL:"-LC:\Program Files\LLVM\lib" futhark` the problem is it's already wrapped in quotes and I'm not sure how to escape them
16:44:27PMunchSingle quotes maybe?
16:44:37PMunchHonestly I have no idea how shells on Windows work..
16:44:53FromDiscord<Ayy Lmao> Unfortunately single quotes doesn't work
16:45:31PMunchThis should help: https://www.howtogeek.com/694949/how-to-escape-spaces-in-file-paths-on-the-windows-command-line/
16:46:17FromDiscord<Rika> maybe put a ` before the space
16:46:28FromDiscord<Rika> that's the escape char for cmd usually
16:47:13FromDiscord<Ayy Lmao> In reply to @Rika "maybe put a `": For some reason it's not working. I have tried `^` as well.
16:47:29FromDiscord<Rika> not sure what else t osuggest then
16:50:51*arkurious joined #nim
16:57:32FromDiscord<Ayy Lmao> I just moved LLVM to somewhere that doesn't have a space in the directory and it seems to have installed correctly now.
17:10:19FromDiscord<Ayy Lmao> Although when I try to run it it says `futhark: clang include path not found` and it aborts.
17:13:56FromDiscord<Phil> Can testament execute tests in parallel?
17:15:42FromDiscord<Phil> Actually, different question:↔What killer feature does testament have that would make me want to use it over simply writing std/unittest - tests
17:15:44FromDiscord<Phil> (edit) "tests" => "tests?"
17:16:39*dv^_^ quit (Remote host closed the connection)
17:17:44PMunch@Ayy_Lmao, what does `clang -print-resource-dir` return?
17:17:52PMunchOh wait, that would probably be clang.exe on Windows..
17:18:32PMunchJust do `-d:syspaths:<path to LLVM/include>
17:18:37Amun-Raspaces in windows path look more like an afterthought
17:23:14FromDiscord<Ayy Lmao> In reply to @PMunch "Just do `-d:syspaths:<path to": Do that when I build? So right now I'm doing `nim c -d:syspaths:C:\LLVM\include plugin.nim` and I'm still getting the same error.
17:25:03PMunchThat colon is causing it
17:25:08PMunchsyspaths is split on colons
17:26:06FromDiscord<Ayy Lmao> The colon after C? Do I need to escape it somehow?
17:27:55FromDiscord<Ayy Lmao> Windows is such a pain sometimes
17:42:12PMunchWindows is such a pain always*
17:43:02PMunchYou can add a syspath in your Futhark block
17:43:10PMunchThat should work with the colon
17:46:45*rockcavera joined #nim
18:03:24FromDiscord<0ffh> In reply to @PMunch "This should help: https://www.howtogeek.com/694949/": IIRC one pair of quotes around the whole path should do the trick, and it's much less work.
18:48:43*arkurious quit (Ping timeout: 248 seconds)
19:01:31*arkurious joined #nim
19:20:36*rmt quit (Ping timeout: 255 seconds)
19:37:40FromDiscord<firasuke> I am using testament for testing, how do I clean the resulting built test files?
20:07:10FromDiscord<Elegantbeef> It's a generator for rust like enum's↔(@sOkam!)
20:07:11FromDiscord<Elegantbeef> They're often called ADTs even though that's a meaningless description
20:15:39FromDiscord<Elegantbeef> Do not want to use some arbitrary operator for that
20:15:57FromDiscord<ElegantBeef> Oh matrix is really having a fit right now
20:16:12FromDiscord<ElegantBeef> @Rika is `while (node: Node) from list:` any more readable? 😄
20:16:34FromDiscord<Elegantbeef> @Rika is `while (node: Node) from list:` any more readable 😄
20:16:47FromDiscord<ElegantBeef> Jeez i deleted that message
20:16:52FromDiscord<ElegantBeef> Matrix going to spam probably here
20:17:42FromDiscord<djazz> and now you pinged Rika twice on discord 😄
20:17:50FromDiscord<ElegantBeef> Oh i know
20:18:18FromDiscord<ElegantBeef> I deleted the message when it couldnt resend, but apparently it's not on my end the problem resided
20:22:14FromDiscord<Elegantbeef> Ping
20:27:10FromDiscord<halc> is it possible install 2.0 with choosenim?
20:29:10FromDiscord<ElegantBeef> You might be able to install the RC but otherwise you can install devel
20:31:23FromDiscord<halc> devel seems to be 1.9 though
20:31:30FromDiscord<ElegantBeef> Yes
20:31:47FromDiscord<ElegantBeef> 1.9 is the development branch for 2.0 or 1.10
20:31:54FromDiscord<ElegantBeef> But since a major release is soon it's for 2.0
20:31:55FromDiscord<halc> I see then
20:31:57FromDiscord<halc> thank you
20:57:12FromDiscord<halc> am I correct to assume that orc is the default gc in devel/1.9?
21:00:49FromDiscord<huantian> mhm
21:07:37FromDiscord<auxym> yes
21:14:29FromDiscord<Elegantbeef> The future is now
21:16:00FromDiscord<djazz> The time of the orcs has come?
21:20:14FromDiscord<Elegantbeef> Personally i'm waiting for the dwarf period
21:20:21FromDiscord<Elegantbeef> Those graveleaters are pretty cool
21:20:33*derpydoo quit (Quit: derpydoo)
21:53:17Amun-Rasame here, I use ELF already
21:57:55FromDiscord<basilajith> sent a code paste, see https://play.nim-lang.org/#ix=4qKH
21:58:33FromDiscord<Elegantbeef> Recursive Fibonacci destroys the stack
21:58:50FromDiscord<Elegantbeef> By that i mean it's absolutely bonkers to calculate without memoization
21:59:14FromDiscord<Elegantbeef> On top of that you also have the issue that fib 100 overflows normal 64bit integers iirc
21:59:59*Guest92 joined #nim
22:00:33Amun-Rafib(100) is 0x13_33db_76a7_c594_bfc3
22:00:53Amun-Ra80-bit number
22:12:02*Guest92 quit (Quit: Client closed)
22:30:36*ltriant quit (Ping timeout: 250 seconds)
22:35:46*PMunch quit (Quit: leaving)
23:08:06FromDiscord<Rika> In reply to @ElegantBeef "<@259277943275126785> is `while (node:": No not really
23:25:34*derpydoo joined #nim
23:25:48*lumo_e joined #nim
23:31:33FromDiscord<etra> what, TIL nim has concepts??
23:31:53FromDiscord<etra> (edit) "what, TIL nim has concepts?? ... " added "(<https://forum.nim-lang.org/t/9992>)"
23:34:03FromDiscord<etra> oh, it's an experimental feature
23:36:58FromDiscord<Elegantbeef> You still can use them and I do
23:44:18FromDiscord<etra> lol, I cannot post in nim forums and the confirmation link already expired, welp
23:47:06FromDiscord<halc> In reply to @Elegantbeef "Recursive Fibonacci destroys the": but it looks cool
23:47:56FromDiscord<Rika> well your rust code doesnt use recursion
23:49:23FromDiscord<Elegantbeef> What is equivalency between chaps
23:49:33FromDiscord<halc> Actually, I take that back, coolest way to calculate fibbonaci is using the golden ratio
23:50:04FromDiscord<Elegantbeef> I thought it was breaking sticks and using them as a tally system
23:51:15*Notxor quit (Remote host closed the connection)