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:08 | FromDiscord | <wiga> I have several questions https://media.discordapp.net/attachments/371759389889003532/1084674475909460049/image.png |
03:09:13 | FromDiscord | <wiga> what even is that error |
03:12:13 | FromDiscord | <demotomohiro> @wiga `std/re` is probably not supported to be used at compile. |
03:12:28 | FromDiscord | <Elegantbeef> It's not |
03:12:36 | FromDiscord | <wiga> ah maybe |
03:12:46 | FromDiscord | <ringabout> Using `let` instead. |
03:13:26 | FromDiscord | <wiga> it works đ |
03:13:27 | FromDiscord | <ringabout> `nim-regex` works at compile time. |
03:13:46 | FromDiscord | <wiga> is it faster at compile time? |
03:14:08 | FromDiscord | <wiga> cuz im making a program that searches for potential webhooks in executable files |
03:14:21 | FromDiscord | <wiga> and sometimes malwares are 700mb |
03:14:32 | FromDiscord | <wiga> mich is kinda big |
03:14:36 | FromDiscord | <wiga> (edit) "mich" => "which" |
03:26:56 | * | ltriant joined #nim |
03:28:35 | FromDiscord | <sOkam!> compile time is slower, but gets interpreted onceâ”runtime is faster, but is interpreted every run |
03:28:54 | FromDiscord | <sOkam!> so, it depends on your definition of "faster" |
03:29:28 | NimEventer | New 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:02 | FromDiscord | <firasuke> Is there a list documenting the types of raised exception errors like OSError and such? |
06:47:01 | FromDiscord | <Elegantbeef> You can see them inside the system module |
06:47:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html |
06:47:37 | FromDiscord | <Elegantbeef> Use your browser's search and search for "of CatchableError" or just "Error" |
07:05:17 | FromDiscord | <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:57 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4qHg |
08:12:54 | FromDiscord | <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:27 | FromDiscord | <Rika> I canât even understand what itâs supposed to mean |
08:28:48 | FromDiscord | <Elegantbeef> It's a pattern match with injection of a symbol |
08:29:22 | FromDiscord | <Elegantbeef> `(list.kind == NodeKind and (let node = Node(list); true)` |
08:30:11 | FromDiscord | <Elegantbeef> I say pattern match but it's not really a pattern |
08:31:01 | FromDiscord | <Elegantbeef> It's `as` or some other odd operator |
08:38:21 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qHo |
08:38:38 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qHp |
08:38:51 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tables.html#basic-usage-hashing |
08:39:18 | FromDiscord | <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:01 | FromDiscord | <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:38 | NimEventer | New thread by alexeypetrushin: Example of simple parser?, see https://forum.nim-lang.org/t/9990 |
10:38:39 | FromDiscord | <4zv4l> is that normal that when I do `conn.close()` from the server in Nimâ”the netcat client doesn't automatically quit ? |
10:40:05 | FromDiscord | <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:38 | FromDiscord | <sOkam!> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4qHg": what is `adtEnum`? |
13:40:09 | FromDiscord | <4zv4l> I have an `uint8` I tried to access the `[1111]0000` first 4 bits |
13:40:26 | FromDiscord | <4zv4l> I tried with `op: uint8 = ins.bitSliced(0..3)` |
13:40:34 | FromDiscord | <4zv4l> but it doesn't work as expected, I don't get how the slice is done |
13:42:59 | FromDiscord | <Rika> âFirst fourâ meaning? Most significant or least significant? |
13:43:22 | FromDiscord | <Rika> 0..3 is least significant to 4th least |
13:43:35 | FromDiscord | <4zv4l> most significant |
13:43:48 | FromDiscord | <Rika> Then do 4..7 |
13:44:10 | FromDiscord | <4zv4l> oh |
13:44:21 | FromDiscord | <4zv4l> it doesn't slice the bytesâ”it gives the slice we asked |
13:44:26 | FromDiscord | <4zv4l> (edit) "slice" => "slide" |
13:44:36 | FromDiscord | <4zv4l> makes sense now |
13:45:24 | FromDiscord | <Rika> Yes it doesnât consume/modify anything in the original |
14:08:27 | FromDiscord | <auxym> IIRC bitslice mutates the input, bitsliced gives you a sliced copy |
14:10:23 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qIz |
14:10:26 | FromDiscord | <4zv4l> but it will be only once there, just the type change |
14:20:46 | FromDiscord | <Rika> You cannot have the field name be the same across variants |
14:24:34 | FromDiscord | <4zv4l> any thing I can do about that ? |
14:26:23 | FromDiscord | <Rika> Name the fields differently |
14:26:56 | FromDiscord | <4zv4l> something like this ? |
14:26:58 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qIC |
14:27:01 | FromDiscord | <4zv4l> In reply to @Rika "Name the fields differently": I can't |
14:27:14 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4qID |
14:27:15 | FromDiscord | <4zv4l> why ? |
14:27:19 | FromDiscord | <Rika> In reply to @4zv4l "I can't": Why so? |
14:27:30 | FromDiscord | <4zv4l> it has to be the same so I can easily call it |
14:27:32 | FromDiscord | <Rika> In reply to @4zv4l "why ?": Itâs not valid code? |
14:28:15 | FromDiscord | <4zv4l> alright, I'll try with different fields names |
14:32:48 | FromDiscord | <kfdvh> What is `cps:count() env` |
14:33:02 | FromDiscord | <kfdvh> I can't use `recover(c: Count)` |
14:37:18 | FromDiscord | <Rika> I donât understand the question |
14:38:18 | FromDiscord | <kfdvh> sent a code paste, see https://play.nim-lang.org/#ix=4qII |
14:38:29 | FromDiscord | <kfdvh> What's the type of `whelp count(1_000)`? |
14:38:47 | FromDiscord | <kfdvh> (edit) "https://play.nim-lang.org/#ix=4qII" => "https://play.nim-lang.org/#ix=4qIJ" |
14:38:59 | FromDiscord | <kfdvh> If I add `: Count` then `later.recover()` doesn't work |
14:40:34 | FromDiscord | <kfdvh> That doesn't make any sense |
15:16:43 | NimEventer | New 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:32 | FromDiscord | <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:12 | FromDiscord | <Ayy Lmao> What is the equivalent of `const char name[] = "nim";` in nim? Would it be cstring? |
15:46:49 | FromDiscord | <Rika> yes |
15:47:17 | FromDiscord | <Ayy Lmao> Cool, thanks! |
15:59:38 | FromDiscord | <Airbus5717> how do i check if a string is in this table https://media.discordapp.net/attachments/371759389889003532/1084868380026216611/image.png |
15:59:57 | FromDiscord | <Airbus5717> for example a s: stringâ”if s in rtype: â”something like this |
16:05:29 | FromDiscord | <Nerve> `if s in rtype:` should work, did you try it? |
16:06:40 | FromDiscord | <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:15 | FromDiscord | <caravaggio> Can someone link me a guide or an example of interfacing js with nim? |
16:09:02 | FromDiscord | <Kaz> sent a code paste, see https://play.nim-lang.org/#ix=4qJ9 |
16:09:39 | FromDiscord | <Kaz> I got it that it tells me it got a some kind of mismatch? But still clueless |
16:10:37 | FromDiscord | <Rika> https://nim-lang.org/docs/json.html#getOrDefault%2CJsonNode%2Cstringâ”you're dealing with JSON, right? |
16:10:42 | FromDiscord | <Kaz> Correct |
16:10:45 | FromDiscord | <Kaz> Using one from std |
16:10:46 | FromDiscord | <Rika> there is no three argument get or default for jsonnodes |
16:11:54 | PMunch | `let interval = try: configJson["interval"].str except: "3600"` |
16:12:21 | FromDiscord | <Rika> not a fan of that exception handling style, was writing a different way |
16:12:38 | PMunch | You could do it with hasKey of course |
16:12:52 | PMunch | But then you need to write "interval" twice |
16:14:51 | FromDiscord | <Kaz> sent a code paste, see https://play.nim-lang.org/#ix=4qJc |
16:22:20 | FromDiscord | <Hourglass [She/Her]> There's the `to` macro in std/json, why didn't you just use that? |
16:22:53 | FromDiscord | <Hourglass [She/Her]> (Genuine question, by the way) |
16:23:20 | FromDiscord | <Kaz> In reply to @Hourglass, When the Hour Strikes "There's the `to` macro": Blindness xD |
16:23:26 | FromDiscord | <Hourglass [She/Her]> Ah fair lol |
16:26:38 | FromDiscord | <Kaz> I am curious will it be possible when compiling Nim app report all issues with the code? |
16:27:07 | FromDiscord | <Kaz> It looks like Nim's compiler only shows one error, and then you fix it, it will show another |
16:30:02 | FromDiscord | <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:17 | FromDiscord | <Rika> i believe there is a setting though to do so |
16:31:38 | FromDiscord | <Rika> but also be warned of spurious ("false positive") errors |
16:32:43 | * | genpaku joined #nim |
16:33:42 | FromDiscord | <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:36 | PMunch | Did you read the instructions? |
16:36:11 | FromDiscord | <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:47 | FromDiscord | <Rika> is clang in your system path |
16:36:55 | PMunch | Well 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:51 | PMunch | This should hopefully be easier after I merge https://github.com/PMunch/futhark/pull/59 |
16:37:54 | FromDiscord | <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:10 | PMunch | Yes, the clang binary, but not the clang library |
16:38:24 | PMunch | Easy to get them mixed up |
16:39:43 | FromDiscord | <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:03 | PMunch | Oh yeah, you probably have it, just not in your build path |
16:40:29 | PMunch | I believe it should be in Program Files\LLVM\lib |
16:40:47 | FromDiscord | <Ayy Lmao> I'll see if I can find it |
16:42:54 | FromDiscord | <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:21 | PMunch | Wrap it in a string? |
16:44:01 | FromDiscord | <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:27 | PMunch | Single quotes maybe? |
16:44:37 | PMunch | Honestly I have no idea how shells on Windows work.. |
16:44:53 | FromDiscord | <Ayy Lmao> Unfortunately single quotes doesn't work |
16:45:31 | PMunch | This should help: https://www.howtogeek.com/694949/how-to-escape-spaces-in-file-paths-on-the-windows-command-line/ |
16:46:17 | FromDiscord | <Rika> maybe put a ` before the space |
16:46:28 | FromDiscord | <Rika> that's the escape char for cmd usually |
16:47:13 | FromDiscord | <Ayy Lmao> In reply to @Rika "maybe put a `": For some reason it's not working. I have tried `^` as well. |
16:47:29 | FromDiscord | <Rika> not sure what else t osuggest then |
16:50:51 | * | arkurious joined #nim |
16:57:32 | FromDiscord | <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:19 | FromDiscord | <Ayy Lmao> Although when I try to run it it says `futhark: clang include path not found` and it aborts. |
17:13:56 | FromDiscord | <Phil> Can testament execute tests in parallel? |
17:15:42 | FromDiscord | <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:44 | FromDiscord | <Phil> (edit) "tests" => "tests?" |
17:16:39 | * | dv^_^ quit (Remote host closed the connection) |
17:17:44 | PMunch | @Ayy_Lmao, what does `clang -print-resource-dir` return? |
17:17:52 | PMunch | Oh wait, that would probably be clang.exe on Windows.. |
17:18:32 | PMunch | Just do `-d:syspaths:<path to LLVM/include> |
17:18:37 | Amun-Ra | spaces in windows path look more like an afterthought |
17:23:14 | FromDiscord | <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:03 | PMunch | That colon is causing it |
17:25:08 | PMunch | syspaths is split on colons |
17:26:06 | FromDiscord | <Ayy Lmao> The colon after C? Do I need to escape it somehow? |
17:27:55 | FromDiscord | <Ayy Lmao> Windows is such a pain sometimes |
17:42:12 | PMunch | Windows is such a pain always* |
17:43:02 | PMunch | You can add a syspath in your Futhark block |
17:43:10 | PMunch | That should work with the colon |
17:46:45 | * | rockcavera joined #nim |
18:03:24 | FromDiscord | <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:40 | FromDiscord | <firasuke> I am using testament for testing, how do I clean the resulting built test files? |
20:07:10 | FromDiscord | <Elegantbeef> It's a generator for rust like enum'sâ”(@sOkam!) |
20:07:11 | FromDiscord | <Elegantbeef> They're often called ADTs even though that's a meaningless description |
20:15:39 | FromDiscord | <Elegantbeef> Do not want to use some arbitrary operator for that |
20:15:57 | FromDiscord | <ElegantBeef> Oh matrix is really having a fit right now |
20:16:12 | FromDiscord | <ElegantBeef> @Rika is `while (node: Node) from list:` any more readable? đ |
20:16:34 | FromDiscord | <Elegantbeef> @Rika is `while (node: Node) from list:` any more readable đ |
20:16:47 | FromDiscord | <ElegantBeef> Jeez i deleted that message |
20:16:52 | FromDiscord | <ElegantBeef> Matrix going to spam probably here |
20:17:42 | FromDiscord | <djazz> and now you pinged Rika twice on discord đ |
20:17:50 | FromDiscord | <ElegantBeef> Oh i know |
20:18:18 | FromDiscord | <ElegantBeef> I deleted the message when it couldnt resend, but apparently it's not on my end the problem resided |
20:22:14 | FromDiscord | <Elegantbeef> Ping |
20:27:10 | FromDiscord | <halc> is it possible install 2.0 with choosenim? |
20:29:10 | FromDiscord | <ElegantBeef> You might be able to install the RC but otherwise you can install devel |
20:31:23 | FromDiscord | <halc> devel seems to be 1.9 though |
20:31:30 | FromDiscord | <ElegantBeef> Yes |
20:31:47 | FromDiscord | <ElegantBeef> 1.9 is the development branch for 2.0 or 1.10 |
20:31:54 | FromDiscord | <ElegantBeef> But since a major release is soon it's for 2.0 |
20:31:55 | FromDiscord | <halc> I see then |
20:31:57 | FromDiscord | <halc> thank you |
20:57:12 | FromDiscord | <halc> am I correct to assume that orc is the default gc in devel/1.9? |
21:00:49 | FromDiscord | <huantian> mhm |
21:07:37 | FromDiscord | <auxym> yes |
21:14:29 | FromDiscord | <Elegantbeef> The future is now |
21:16:00 | FromDiscord | <djazz> The time of the orcs has come? |
21:20:14 | FromDiscord | <Elegantbeef> Personally i'm waiting for the dwarf period |
21:20:21 | FromDiscord | <Elegantbeef> Those graveleaters are pretty cool |
21:20:33 | * | derpydoo quit (Quit: derpydoo) |
21:53:17 | Amun-Ra | same here, I use ELF already |
21:57:55 | FromDiscord | <basilajith> sent a code paste, see https://play.nim-lang.org/#ix=4qKH |
21:58:33 | FromDiscord | <Elegantbeef> Recursive Fibonacci destroys the stack |
21:58:50 | FromDiscord | <Elegantbeef> By that i mean it's absolutely bonkers to calculate without memoization |
21:59:14 | FromDiscord | <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:33 | Amun-Ra | fib(100) is 0x13_33db_76a7_c594_bfc3 |
22:00:53 | Amun-Ra | 80-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:06 | FromDiscord | <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:33 | FromDiscord | <etra> what, TIL nim has concepts?? |
23:31:53 | FromDiscord | <etra> (edit) "what, TIL nim has concepts?? ... " added "(<https://forum.nim-lang.org/t/9992>)" |
23:34:03 | FromDiscord | <etra> oh, it's an experimental feature |
23:36:58 | FromDiscord | <Elegantbeef> You still can use them and I do |
23:44:18 | FromDiscord | <etra> lol, I cannot post in nim forums and the confirmation link already expired, welp |
23:47:06 | FromDiscord | <halc> In reply to @Elegantbeef "Recursive Fibonacci destroys the": but it looks cool |
23:47:56 | FromDiscord | <Rika> well your rust code doesnt use recursion |
23:49:23 | FromDiscord | <Elegantbeef> What is equivalency between chaps |
23:49:33 | FromDiscord | <halc> Actually, I take that back, coolest way to calculate fibbonaci is using the golden ratio |
23:50:04 | FromDiscord | <Elegantbeef> I thought it was breaking sticks and using them as a tally system |
23:51:15 | * | Notxor quit (Remote host closed the connection) |