00:04:02 | FromDiscord | <Yardanico> In reply to @System64 "and how was it": depends on which standard C library your OS/compiler uses :) |
00:04:53 | FromDiscord | <System64 ~ Flandre Scarlet> gcc |
00:05:07 | FromDiscord | <System64 ~ Flandre Scarlet> the one included with Nim |
00:05:20 | FromDiscord | <Yardanico> what OS? |
00:06:31 | * | pch joined #nim |
00:07:07 | FromDiscord | <Yardanico> @System64 ~ Flandre Scarlet this is the generic sin impl for x86_64 linux in glibc I think |
00:07:08 | FromDiscord | <Yardanico> https://github.com/bminor/glibc/blob/master/sysdeps/ieee754/dbl-64/s_sin.c |
00:07:10 | FromDiscord | <Yardanico> contributed by IBM |
00:07:18 | FromDiscord | <Yardanico> there are also optimized versions written in assembly |
00:08:34 | FromDiscord | <Yardanico> e.g sse2 https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/svml_d_sin2_core.S |
00:08:48 | FromDiscord | <Yardanico> avx2 https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/svml_d_sin4_core.S |
00:09:15 | FromDiscord | <Yardanico> ah right this is not the file where the implementation actually is |
00:09:38 | FromDiscord | <Yardanico> https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c↵https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c |
00:09:51 | FromDiscord | <Yardanico> argh |
00:10:56 | FromDiscord | <System64 ~ Flandre Scarlet> I will check that↵But what is the best for performances? That or lookup table? |
00:11:18 | FromDiscord | <Yardanico> i honestly don't know, but glibc generally cares a lot for performance :) |
00:11:39 | FromDiscord | <Yardanico> you can also check musl, sometimes they have faster, sometimes slower implementations than glibc, but they're usually quite simpler as they don't optimize with assembly for every possible architecture |
00:11:49 | FromDiscord | <Yardanico> https://git.musl-libc.org/cgit/musl/tree/src/math/sin.c |
00:13:45 | FromDiscord | <Yardanico> ah right this calls libm |
00:14:23 | FromDiscord | <Yardanico> https://github.com/esmil/musl/blob/master/src/math/sin.c |
00:14:34 | FromDiscord | <Yardanico> oops |
00:14:44 | FromDiscord | <Yardanico> https://git.musl-libc.org/cgit/musl/tree/src/math/sin.c |
00:48:01 | * | dsrw joined #nim |
01:04:17 | * | bkay joined #nim |
01:04:49 | * | beshr quit (Ping timeout: 258 seconds) |
01:17:57 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:35:29 | * | arkurious quit (Quit: Leaving) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:32 | * | supakeen joined #nim |
04:35:29 | * | vicfred quit (Quit: Leaving) |
05:43:14 | FromDiscord | <Chiggy> In reply to @enthus1ast "Yes, but i do": I would love to know how to do this inside of a database, but i dont think its possible with my db. Let me know when you are there by mentioning me |
07:24:01 | * | max22- joined #nim |
07:35:29 | FromDiscord | <ChikinNug> Why is Nim 1.0.6 installed when running 'apt install nim' instead of 1.4.8? |
07:36:47 | FromDiscord | <Rika> Because that is what is on the repositories |
07:36:59 | FromDiscord | <Elegantbeef> it's also a LTS |
07:37:16 | FromDiscord | <Rika> Ubuntu is known for stability and not cutting edge |
07:38:09 | FromDiscord | <Elegantbeef> Generally better to use choosenim or tools like it so you can easily change the version |
07:41:14 | * | Vladar joined #nim |
07:48:30 | * | xet7 quit (Remote host closed the connection) |
08:18:49 | * | xet7 joined #nim |
08:26:32 | FromDiscord | <ChikinNug> I understand, thank you guys |
08:45:22 | * | bkay quit (Quit: Leaving) |
08:45:41 | * | beshr joined #nim |
09:15:25 | * | tdc joined #nim |
09:21:37 | * | Hdka joined #nim |
09:21:51 | * | Hdka left #nim (#nim) |
09:27:17 | * | Vladar quit (Quit: Leaving) |
09:30:58 | * | Vladar joined #nim |
09:49:31 | * | krux02 joined #nim |
10:04:49 | * | keutoi joined #nim |
10:11:45 | * | keutoi left #nim (#nim) |
10:32:09 | * | tdc quit (Ping timeout: 258 seconds) |
10:38:56 | * | Vladar quit (Ping timeout: 256 seconds) |
10:39:20 | * | Vladar joined #nim |
10:43:20 | FromDiscord | <Beck> Morning y’all, any good learning resources on async code in Nim? |
10:48:25 | FromDiscord | <Beck> In reply to @ChikinNug "Why is Nim 1.0.6": I always install choosenim and set up nim that way, I imagine a lot of nim developers do also |
11:14:22 | FromDiscord | <hamidb80> In reply to @Beck "I always install choosenim": https://xmonader.github.io/nimdays/day13_redisclient.html↵that can be helpful |
11:15:04 | FromDiscord | <hamidb80> https://xmonader.github.io/nimdays/day04_asynclinkschecker.html |
11:19:55 | FromDiscord | <lantos> hmmm is windows being over protective here, windows defender just complained about me unzipping nim |
11:21:13 | FromDiscord | <Rika> Yes |
11:22:00 | FromDiscord | <lantos> zpevdo.b |
11:24:18 | FromDiscord | <Rika> False positive from bad heuristic scanner |
11:24:33 | FromDiscord | <Gabryx86_64> Btw why is nimble init crashing on windows without administratot permission? |
11:24:45 | FromDiscord | <Gabryx86_64> (edit) "administratot permission?" => "administrator permissions?" |
11:24:58 | FromDiscord | <Gabryx86_64> On linux it doesn't need permissions iirc |
11:24:59 | FromDiscord | <demotomohiro> https://forum.nim-lang.org/t/8196 |
11:27:17 | FromDiscord | <demotomohiro> nimble init just creates files you need to use nimble in cwd and should not require admin permissions. |
11:28:28 | FromDiscord | <demotomohiro> I think it is just Anti virus software preventing nimble |
12:04:38 | * | max22- quit (Ping timeout: 252 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:32 | * | supakeen joined #nim |
12:12:49 | FromDiscord | <dom96> I swear these antiviruses |
12:12:50 | * | beshr quit (Remote host closed the connection) |
12:38:26 | * | arkurious joined #nim |
12:46:35 | FromDiscord | <Gabryx86_64> In reply to @demotomohiro "I think it is": The fact is that i don't have any antivirus |
12:46:47 | FromDiscord | <Gabryx86_64> And got no thing from win defender |
13:32:05 | FromDiscord | <PsychoClay> for some reason `nre.findIter` is alot slower than `re.findAll`, anyone know why? |
13:32:23 | FromDiscord | <System64 ~ Flandre Scarlet> I have a question↵Can a 64-bits nim program interop with a 32-bits C library? |
13:32:43 | FromDiscord | <xflywind> In reply to @PsychoClay "for some reason `nre.findIter`": Are you on latest devel? |
13:32:58 | FromDiscord | <PsychoClay> not sure |
13:33:21 | FromDiscord | <PsychoClay> im on nim 1.4.8 |
13:33:53 | FromDiscord | <xflywind> see https://github.com/nim-lang/Nim/pull/18632 |
13:34:10 | FromDiscord | <xflywind> and https://github.com/nim-lang/Nim/issues/17129 |
13:34:23 | FromDiscord | <xflywind> It should be fixed at nightlies |
13:34:43 | FromDiscord | <xflywind> https://github.com/nim-lang/nightlies/releases |
13:41:36 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w55 |
13:41:49 | FromDiscord | <haxscramper> Basically I want a no-op block with `{.pragma.}` syntax |
13:42:03 | FromDiscord | <haxscramper> Is it possible to do with templates and `{.pragma.}`, or something similar? |
13:43:01 | FromDiscord | <Rika> not with pragma i believe but just call it like a command? |
13:43:02 | FromDiscord | <haxscramper> `template nohcov(body: untyped): untyped {.pragma.} = body` fails with `Error: implementation of 'nohcov' is not allowed` |
13:46:07 | FromDiscord | <haxscramper> That is annoying, but alright |
14:11:39 | FromDiscord | <TechnoRazor> Is there anything comparable to C++'s `static_assert` in Nim? |
14:11:55 | FromDiscord | <TechnoRazor> (edit) "Is there anything ... comparable`static_assert`?" added "in Nim" | "`static_assert` in Nim?" => "`static_assert`?" |
14:14:42 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3w5e |
14:14:47 | FromDiscord | <planetis> static\: assert ? |
14:14:59 | FromDiscord | <TechnoRazor> Right, I forgot you could do that, thanks. |
14:36:52 | arkanoid | Error: invalid type: 'UncheckedArray[char]' for var |
14:37:00 | arkanoid | why? |
14:39:17 | * | max22- joined #nim |
14:40:04 | FromDiscord | <Rika> ref UncheckedArray |
14:57:23 | arkanoid | well, is was a c2nim decision to use var |
15:00:49 | * | beshr joined #nim |
15:19:40 | FromDiscord | <krisppurg> Hey guys, I was using case statement on my library however I seem to get errors which basically say `attempt to redefine 'X'`, `attempt to redefine 'Y'`, `attempt to redefine 'Z'` is there other ways I could actually fix this? I want the code to look like the link below (also is the code that produces the errors).↵↵https://play.nim-lang.org/#ix=3w5v |
15:27:08 | FromDiscord | <treeform> In reply to @krisppurg "Hey guys, I was": You can use variant objects like this. |
15:27:31 | FromDiscord | <treeform> Only unique names can exist in each case |
15:28:27 | FromDiscord | <treeform> I would use variant object if they could do this, but it's their big limitation. |
15:28:43 | FromDiscord | <treeform> (edit) "can" => "can't" |
15:34:32 | * | Onionhammer quit (Read error: Connection reset by peer) |
15:36:24 | * | Onionhammer joined #nim |
15:56:02 | FromDiscord | <System64 ~ Flandre Scarlet> I have a 32-bits DLL, can a 64-bits Nim program interop with it? |
15:58:41 | FromDiscord | <gerwy> okay so i also have problem |
15:59:00 | FromDiscord | <gerwy> okay so lets say i have 4 ints right after another↵0000...0000...0000...0000 |
15:59:08 | * | Onionhammer quit (Ping timeout: 258 seconds) |
15:59:54 | FromDiscord | <gerwy> how to get their values?↵its obvious how to get the first one, the pointer to this variable and dereference but what about the others? i tried adding to the pointer but it doesn't work |
16:01:08 | FromDiscord | <Rika> context please? why are you using pointers |
16:01:08 | FromDiscord | <gerwy> i know its 4 ints because sizeof outputs 32 bytes |
16:01:46 | FromDiscord | <gerwy> In reply to @Rika "context please? why are": im working with simd, avx to be precise and there is no way for me to extract int64 from m256i (register containing 4 ints) |
16:02:15 | FromDiscord | <Rika> probably `let ints = cast[ptr UncheckedArray[int32]](thePointer)` then treat ints like an array |
16:02:18 | FromDiscord | <Rika> i think |
16:04:12 | FromDiscord | <gerwy> yeah well i do something like this |
16:04:14 | FromDiscord | <gerwy> i have |
16:04:25 | FromDiscord | <gerwy> `let ptr_results : ptr = cast[ptr int64](n.addr)` |
16:04:33 | FromDiscord | <gerwy> oh array |
16:04:58 | FromDiscord | <gerwy> so use that ptr_results and make unchecked array of type int64? |
16:05:30 | FromDiscord | <gerwy> In reply to @Life Sucks "`let ptr_results : ptr": n is this m256i register |
16:07:24 | FromDiscord | <gerwy> so well, i tried it and doesn't output error, but it also doesn't output correct stuff from what i see hmm |
16:07:25 | FromDiscord | <Rika> you can just use n.addr directly |
16:07:50 | FromDiscord | <Rika> you said 32 bits so i put int32 but your code says int64 |
16:07:53 | FromDiscord | <Rika> oh |
16:07:54 | FromDiscord | <Rika> i misread |
16:07:58 | FromDiscord | <Rika> 32 bytes, my bad |
16:08:09 | FromDiscord | <Rika> change the inner type from int32 to int64 |
16:08:31 | FromDiscord | <gerwy> In reply to @Rika "you can just use": oh right hah |
16:09:40 | FromDiscord | <gerwy> still something wrong hmm, i mean it works, the output is kinda what i expected, must be something in calcs↵thank you for help! |
16:13:07 | FromDiscord | <gerwy> is there a way to display bits of that variable? |
16:22:20 | arkanoid | if C ffi in nim is "easy" I don't wan't to know how it would be in other languages |
16:22:40 | arkanoid | i've been spending days on the topic without success |
16:27:30 | NimEventer | New thread by Chaemon: Forward declaration of static arg with macro, see https://forum.nim-lang.org/t/8326 |
16:36:12 | * | krux02 quit (Remote host closed the connection) |
16:36:51 | * | krux02 joined #nim |
17:01:44 | FromDiscord | <zidsal> just to check before I reinvent the wheel, I need a bit set > 1 uint64 does nim have a bitset library like java? or do I need to make my own with a sequence of ints? |
17:02:34 | FromDiscord | <zidsal> (edit) "java?" => "java (from what I can see the `set` module won't work due to size limitations)?" |
17:12:13 | FromDiscord | <demotomohiro> built in set type has type limitation but sets module don't. |
17:13:29 | FromDiscord | <Rika> Sets module is not bitset I believe so if you strictly need bitsets… |
17:20:15 | FromDiscord | <Rika> Nim integers aren’t big ints either, how does the Java one work? |
17:25:57 | FromDiscord | <haxscramper> In reply to @arkanoid "i've been spending days": Do you mean to "Error: invalid type: 'UncheckedArray[char]' for var". What was the original procedure/field/variable definition? |
17:26:34 | FromDiscord | <haxscramper> c2nim does not make very smart choices sometimes, so it is important to know the context |
17:28:45 | * | KurtGodel quit (Read error: Connection reset by peer) |
17:29:04 | * | KurtGodel joined #nim |
17:31:35 | FromDiscord | <konsumlamm> In reply to @Rika "Nim integers aren’t big": using an array |
17:32:48 | madprops | why does: from sugar import collect as col |
17:32:49 | madprops | doesn't work? |
17:33:47 | FromDiscord | <proud linux user> (why is it named sugar) |
17:33:49 | madprops | or, how can I import something without polluting the namespace |
17:34:03 | FromDiscord | <proud linux user> we have namescape in nim? |
17:34:11 | FromDiscord | <proud linux user> (edit) "namescape" => "namespace" |
17:36:09 | FromDiscord | <haxscramper> some people really care about writing `package.proc` everywhere |
17:36:24 | FromDiscord | <haxscramper> And being able to just `proc` considered polluting namespace |
17:36:36 | FromDiscord | <haxscramper> something like that |
17:37:04 | FromDiscord | <haxscramper> In reply to @madprops "why does: from sugar": and no, IIRC you can rename package on import, but not identifier from it. So `from sugar as s imprt collect` |
17:37:06 | FromDiscord | <haxscramper> `s.collect` |
17:37:07 | FromDiscord | <konsumlamm> In reply to @richard stallmen(crazy GNU guy) "we have namespace in": it's called modules |
17:37:55 | FromDiscord | <haxscramper> Though `from std/sugar import collect as c` would be also nice to have, at least for the purpose of consistency |
17:38:02 | FromDiscord | <haxscramper> I think I've seen RFC/PR that enables it |
17:38:24 | madprops | but what if I want to import the sugar stuff but have to use it with "sugar.something" instead of all on the namespace? |
17:38:34 | madprops | or is that not possible |
17:38:37 | madprops | im reading https://forum.nim-lang.org/t/2738 |
17:38:48 | FromDiscord | <konsumlamm> `from std/sugar umport nil` |
17:39:04 | FromDiscord | <konsumlamm> (edit) "umport" => "import" |
17:39:11 | madprops | i see |
18:25:30 | * | sagax quit (Ping timeout: 240 seconds) |
18:30:28 | FromDiscord | <Chiggy> In reply to @enthus1ast "Yes, but i do": enthus1asm? |
18:30:35 | FromDiscord | <Chiggy> (edit) "In reply to @enthus1ast "Yes, but i do": enthus1asm? ... " added "you there?" |
18:35:01 | NimEventer | New thread by Rforcen: Weird error message, see https://forum.nim-lang.org/t/8327 |
18:41:29 | * | supakeen quit (Remote host closed the connection) |
18:41:52 | * | supakeen joined #nim |
19:14:13 | FromDiscord | <dom96> In reply to @arkanoid "if C ffi in": what have you been getting stuck on? |
19:48:00 | arkanoid | dom96: I'm parsing a very large header file, now I'm trying the nimterop way, but i'm still at the mangling phase |
19:48:45 | arkanoid | I have many "tree-sitter parse error" and error on Error: unhandled exception: getters.nim(189, 12) `name.nBl` Blank identifier error [AssertionDefect] |
19:53:27 | FromDiscord | <PsychoClay> what does the magic pragma do? |
19:58:24 | madprops | i like how I can define an object in one file, and implement it in another one. Though I tried conditional implementations like if true, use this impl, else, use this impl, but don't know how i'd do that |
19:59:49 | * | pch_ joined #nim |
20:01:10 | FromDiscord | <dom96> In reply to @arkanoid "<@132595483838251008>: I'm parsing a": you might be better off just wrapping what you need, instead of everything |
20:02:33 | * | pch quit (Ping timeout: 258 seconds) |
20:03:59 | arkanoid | dom96: probably, but it also a perfect storm, as the .h I'm wrapping is generated from an xml file that is an api definition, so an automated tool perfectly fits |
20:09:53 | FromDiscord | <exelotl> @PsychoClay magic means "this is implemented in the compiler" |
20:47:34 | FromDiscord | <tandy> is it possible to log the output of comands run with \`osproc.execProcesses\` ? |
20:48:50 | FromDiscord | <Elegantbeef> after it runs you can use the `afterRunEvent` to read the process' stdout/stderr |
20:57:02 | * | Vladar quit (Quit: Leaving) |
21:01:40 | FromDiscord | <tandy> hmm, how do i access the processes stdout? |
21:02:02 | FromDiscord | <tandy> \`proc logOutput(idx\: int; p\: Process) =\` i call this on the afterRunEvent |
21:02:27 | FromDiscord | <Elegantbeef> the after run proc gives you a process so you can do `process.outputStream` |
21:07:46 | * | vicfred joined #nim |
21:08:43 | FromDiscord | <tandy> ahh |
21:09:11 | FromDiscord | <Elegantbeef> also `errorStream` ofc |
21:10:26 | * | xet7 quit (Read error: Connection reset by peer) |
21:10:30 | FromDiscord | <tandy> but how do I pass that to the logger |
21:10:44 | * | xet7 joined #nim |
21:14:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/6zb |
21:34:58 | FromDiscord | <tandy> says there is a type mismatch in that for loop |
21:35:27 | FromDiscord | <Elegantbeef> Ah i left out `lines` |
21:35:38 | FromDiscord | <Elegantbeef> should be `for line in rpocess.outputStream.lines` |
21:40:01 | FromDiscord | <tandy> that works, thank you |
21:56:54 | * | max22- quit (Quit: Leaving) |
22:50:17 | * | flynn quit (Remote host closed the connection) |
22:51:27 | * | flynn joined #nim |
22:57:58 | * | stkrdknmibalz joined #nim |
23:13:20 | NimEventer | New thread by Col: % operator but for OrderedTable, see https://forum.nim-lang.org/t/8328 |
23:31:53 | madprops | is there a generic int || float type? |
23:32:08 | FromDiscord | <Elegantbeef> SomeNumber? |
23:32:19 | * | krux02 quit (Remote host closed the connection) |
23:32:22 | madprops | oh hm |
23:32:34 | FromDiscord | <Elegantbeef> Or do you just want `int or float`? |
23:33:06 | madprops | SomeNumber works |
23:33:59 | madprops | i did google about it |
23:34:07 | madprops | but apparently I queried "nime SomeNumber" |
23:34:22 | madprops | which made me think it didn't exist but it's because of 'nime' |
23:40:43 | arkanoid | if I pass the header I want to ffi with "gcc -E -P -C", nimterop fails successfully: it creates file made of just pragmas |