<< 15-08-2021 >>

00:04:02FromDiscord<Yardanico> In reply to @System64 "and how was it": depends on which standard C library your OS/compiler uses :)
00:04:53FromDiscord<System64 ~ Flandre Scarlet> gcc
00:05:07FromDiscord<System64 ~ Flandre Scarlet> the one included with Nim
00:05:20FromDiscord<Yardanico> what OS?
00:06:31*pch joined #nim
00:07:07FromDiscord<Yardanico> @System64 ~ Flandre Scarlet this is the generic sin impl for x86_64 linux in glibc I think
00:07:08FromDiscord<Yardanico> https://github.com/bminor/glibc/blob/master/sysdeps/ieee754/dbl-64/s_sin.c
00:07:10FromDiscord<Yardanico> contributed by IBM
00:07:18FromDiscord<Yardanico> there are also optimized versions written in assembly
00:08:34FromDiscord<Yardanico> e.g sse2 https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/svml_d_sin2_core.S
00:08:48FromDiscord<Yardanico> avx2 https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86_64/fpu/svml_d_sin4_core.S
00:09:15FromDiscord<Yardanico> ah right this is not the file where the implementation actually is
00:09:38FromDiscord<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:51FromDiscord<Yardanico> argh
00:10:56FromDiscord<System64 ~ Flandre Scarlet> I will check that↵But what is the best for performances? That or lookup table?
00:11:18FromDiscord<Yardanico> i honestly don't know, but glibc generally cares a lot for performance :)
00:11:39FromDiscord<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:49FromDiscord<Yardanico> https://git.musl-libc.org/cgit/musl/tree/src/math/sin.c
00:13:45FromDiscord<Yardanico> ah right this calls libm
00:14:23FromDiscord<Yardanico> https://github.com/esmil/musl/blob/master/src/math/sin.c
00:14:34FromDiscord<Yardanico> oops
00:14:44FromDiscord<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:14FromDiscord<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:29FromDiscord<ChikinNug> Why is Nim 1.0.6 installed when running 'apt install nim' instead of 1.4.8?
07:36:47FromDiscord<Rika> Because that is what is on the repositories
07:36:59FromDiscord<Elegantbeef> it's also a LTS
07:37:16FromDiscord<Rika> Ubuntu is known for stability and not cutting edge
07:38:09FromDiscord<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:32FromDiscord<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:20FromDiscord<Beck> Morning y’all, any good learning resources on async code in Nim?
10:48:25FromDiscord<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:22FromDiscord<hamidb80> In reply to @Beck "I always install choosenim": https://xmonader.github.io/nimdays/day13_redisclient.html↵that can be helpful
11:15:04FromDiscord<hamidb80> https://xmonader.github.io/nimdays/day04_asynclinkschecker.html
11:19:55FromDiscord<lantos> hmmm is windows being over protective here, windows defender just complained about me unzipping nim
11:21:13FromDiscord<Rika> Yes
11:22:00FromDiscord<lantos> zpevdo.b
11:24:18FromDiscord<Rika> False positive from bad heuristic scanner
11:24:33FromDiscord<Gabryx86_64> Btw why is nimble init crashing on windows without administratot permission?
11:24:45FromDiscord<Gabryx86_64> (edit) "administratot permission?" => "administrator permissions?"
11:24:58FromDiscord<Gabryx86_64> On linux it doesn't need permissions iirc
11:24:59FromDiscord<demotomohiro> https://forum.nim-lang.org/t/8196
11:27:17FromDiscord<demotomohiro> nimble init just creates files you need to use nimble in cwd and should not require admin permissions.
11:28:28FromDiscord<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:49FromDiscord<dom96> I swear these antiviruses
12:12:50*beshr quit (Remote host closed the connection)
12:38:26*arkurious joined #nim
12:46:35FromDiscord<Gabryx86_64> In reply to @demotomohiro "I think it is": The fact is that i don't have any antivirus
12:46:47FromDiscord<Gabryx86_64> And got no thing from win defender
13:32:05FromDiscord<PsychoClay> for some reason `nre.findIter` is alot slower than `re.findAll`, anyone know why?
13:32:23FromDiscord<System64 ~ Flandre Scarlet> I have a question↵Can a 64-bits nim program interop with a 32-bits C library?
13:32:43FromDiscord<xflywind> In reply to @PsychoClay "for some reason `nre.findIter`": Are you on latest devel?
13:32:58FromDiscord<PsychoClay> not sure
13:33:21FromDiscord<PsychoClay> im on nim 1.4.8
13:33:53FromDiscord<xflywind> see https://github.com/nim-lang/Nim/pull/18632
13:34:10FromDiscord<xflywind> and https://github.com/nim-lang/Nim/issues/17129
13:34:23FromDiscord<xflywind> It should be fixed at nightlies
13:34:43FromDiscord<xflywind> https://github.com/nim-lang/nightlies/releases
13:41:36FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w55
13:41:49FromDiscord<haxscramper> Basically I want a no-op block with `{.pragma.}` syntax
13:42:03FromDiscord<haxscramper> Is it possible to do with templates and `{.pragma.}`, or something similar?
13:43:01FromDiscord<Rika> not with pragma i believe but just call it like a command?
13:43:02FromDiscord<haxscramper> `template nohcov(body: untyped): untyped {.pragma.} = body` fails with `Error: implementation of 'nohcov' is not allowed`
13:46:07FromDiscord<haxscramper> That is annoying, but alright
14:11:39FromDiscord<TechnoRazor> Is there anything comparable to C++'s `static_assert` in Nim?
14:11:55FromDiscord<TechnoRazor> (edit) "Is there anything ... comparable`static_assert`?" added "in Nim" | "`static_assert` in Nim?" => "`static_assert`?"
14:14:42FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3w5e
14:14:47FromDiscord<planetis> static\: assert ?
14:14:59FromDiscord<TechnoRazor> Right, I forgot you could do that, thanks.
14:36:52arkanoidError: invalid type: 'UncheckedArray[char]' for var
14:37:00arkanoidwhy?
14:39:17*max22- joined #nim
14:40:04FromDiscord<Rika> ref UncheckedArray
14:57:23arkanoidwell, is was a c2nim decision to use var
15:00:49*beshr joined #nim
15:19:40FromDiscord<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:08FromDiscord<treeform> In reply to @krisppurg "Hey guys, I was": You can use variant objects like this.
15:27:31FromDiscord<treeform> Only unique names can exist in each case
15:28:27FromDiscord<treeform> I would use variant object if they could do this, but it's their big limitation.
15:28:43FromDiscord<treeform> (edit) "can" => "can't"
15:34:32*Onionhammer quit (Read error: Connection reset by peer)
15:36:24*Onionhammer joined #nim
15:56:02FromDiscord<System64 ~ Flandre Scarlet> I have a 32-bits DLL, can a 64-bits Nim program interop with it?
15:58:41FromDiscord<gerwy> okay so i also have problem
15:59:00FromDiscord<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:54FromDiscord<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:08FromDiscord<Rika> context please? why are you using pointers
16:01:08FromDiscord<gerwy> i know its 4 ints because sizeof outputs 32 bytes
16:01:46FromDiscord<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:15FromDiscord<Rika> probably `let ints = cast[ptr UncheckedArray[int32]](thePointer)` then treat ints like an array
16:02:18FromDiscord<Rika> i think
16:04:12FromDiscord<gerwy> yeah well i do something like this
16:04:14FromDiscord<gerwy> i have
16:04:25FromDiscord<gerwy> `let ptr_results : ptr = cast[ptr int64](n.addr)`
16:04:33FromDiscord<gerwy> oh array
16:04:58FromDiscord<gerwy> so use that ptr_results and make unchecked array of type int64?
16:05:30FromDiscord<gerwy> In reply to @Life Sucks "`let ptr_results : ptr": n is this m256i register
16:07:24FromDiscord<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:25FromDiscord<Rika> you can just use n.addr directly
16:07:50FromDiscord<Rika> you said 32 bits so i put int32 but your code says int64
16:07:53FromDiscord<Rika> oh
16:07:54FromDiscord<Rika> i misread
16:07:58FromDiscord<Rika> 32 bytes, my bad
16:08:09FromDiscord<Rika> change the inner type from int32 to int64
16:08:31FromDiscord<gerwy> In reply to @Rika "you can just use": oh right hah
16:09:40FromDiscord<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:07FromDiscord<gerwy> is there a way to display bits of that variable?
16:22:20arkanoidif C ffi in nim is "easy" I don't wan't to know how it would be in other languages
16:22:40arkanoidi've been spending days on the topic without success
16:27:30NimEventerNew 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:44FromDiscord<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:34FromDiscord<zidsal> (edit) "java?" => "java (from what I can see the `set` module won't work due to size limitations)?"
17:12:13FromDiscord<demotomohiro> built in set type has type limitation but sets module don't.
17:13:29FromDiscord<Rika> Sets module is not bitset I believe so if you strictly need bitsets…
17:20:15FromDiscord<Rika> Nim integers aren’t big ints either, how does the Java one work?
17:25:57FromDiscord<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:34FromDiscord<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:35FromDiscord<konsumlamm> In reply to @Rika "Nim integers aren’t big": using an array
17:32:48madpropswhy does: from sugar import collect as col
17:32:49madpropsdoesn't work?
17:33:47FromDiscord<proud linux user> (why is it named sugar)
17:33:49madpropsor, how can I import something without polluting the namespace
17:34:03FromDiscord<proud linux user> we have namescape in nim?
17:34:11FromDiscord<proud linux user> (edit) "namescape" => "namespace"
17:36:09FromDiscord<haxscramper> some people really care about writing `package.proc` everywhere
17:36:24FromDiscord<haxscramper> And being able to just `proc` considered polluting namespace
17:36:36FromDiscord<haxscramper> something like that
17:37:04FromDiscord<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:06FromDiscord<haxscramper> `s.collect`
17:37:07FromDiscord<konsumlamm> In reply to @richard stallmen(crazy GNU guy) "we have namespace in": it's called modules
17:37:55FromDiscord<haxscramper> Though `from std/sugar import collect as c` would be also nice to have, at least for the purpose of consistency
17:38:02FromDiscord<haxscramper> I think I've seen RFC/PR that enables it
17:38:24madpropsbut 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:34madpropsor is that not possible
17:38:37madpropsim reading https://forum.nim-lang.org/t/2738
17:38:48FromDiscord<konsumlamm> `from std/sugar umport nil`
17:39:04FromDiscord<konsumlamm> (edit) "umport" => "import"
17:39:11madpropsi see
18:25:30*sagax quit (Ping timeout: 240 seconds)
18:30:28FromDiscord<Chiggy> In reply to @enthus1ast "Yes, but i do": enthus1asm?
18:30:35FromDiscord<Chiggy> (edit) "In reply to @enthus1ast "Yes, but i do": enthus1asm? ... " added "you there?"
18:35:01NimEventerNew 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:13FromDiscord<dom96> In reply to @arkanoid "if C ffi in": what have you been getting stuck on?
19:48:00arkanoiddom96: 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:45arkanoidI have many "tree-sitter parse error" and error on Error: unhandled exception: getters.nim(189, 12) `name.nBl` Blank identifier error [AssertionDefect]
19:53:27FromDiscord<PsychoClay> what does the magic pragma do?
19:58:24madpropsi 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:10FromDiscord<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:59arkanoiddom96: 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:53FromDiscord<exelotl> @PsychoClay magic means "this is implemented in the compiler"
20:47:34FromDiscord<tandy> is it possible to log the output of comands run with \`osproc.execProcesses\` ?
20:48:50FromDiscord<Elegantbeef> after it runs you can use the `afterRunEvent` to read the process' stdout/stderr
20:57:02*Vladar quit (Quit: Leaving)
21:01:40FromDiscord<tandy> hmm, how do i access the processes stdout?
21:02:02FromDiscord<tandy> \`proc logOutput(idx\: int; p\: Process) =\` i call this on the afterRunEvent
21:02:27FromDiscord<Elegantbeef> the after run proc gives you a process so you can do `process.outputStream`
21:07:46*vicfred joined #nim
21:08:43FromDiscord<tandy> ahh
21:09:11FromDiscord<Elegantbeef> also `errorStream` ofc
21:10:26*xet7 quit (Read error: Connection reset by peer)
21:10:30FromDiscord<tandy> but how do I pass that to the logger
21:10:44*xet7 joined #nim
21:14:01FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/6zb
21:34:58FromDiscord<tandy> says there is a type mismatch in that for loop
21:35:27FromDiscord<Elegantbeef> Ah i left out `lines`
21:35:38FromDiscord<Elegantbeef> should be `for line in rpocess.outputStream.lines`
21:40:01FromDiscord<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:20NimEventerNew thread by Col: % operator but for OrderedTable, see https://forum.nim-lang.org/t/8328
23:31:53madpropsis there a generic int || float type?
23:32:08FromDiscord<Elegantbeef> SomeNumber?
23:32:19*krux02 quit (Remote host closed the connection)
23:32:22madpropsoh hm
23:32:34FromDiscord<Elegantbeef> Or do you just want `int or float`?
23:33:06madpropsSomeNumber works
23:33:59madpropsi did google about it
23:34:07madpropsbut apparently I queried "nime SomeNumber"
23:34:22madpropswhich made me think it didn't exist but it's because of 'nime'
23:40:43arkanoidif I pass the header I want to ffi with "gcc -E -P -C", nimterop fails successfully: it creates file made of just pragmas