<< 26-12-2019 >>

00:23:36madpropshttps://pi-dns.com/
01:22:06*luis_ joined #nim
01:35:37*Tongir joined #nim
01:35:42*endragor quit (Remote host closed the connection)
01:35:54FromDiscord<snluu> @mratsim https://gist.github.com/snluu/7a95ead2ced436034eaf7270b4f4ed33
01:36:03FromDiscord<snluu> Seems to work fine. Cross check to make sure I'm not "cheating"
01:38:48FromDiscord<snluu> At input = 30, got a "GC Warning: Repeated allocation of very large block (appr. size 2101248)", probably because I'm allocating a new channel everytime
01:38:54FromDiscord<snluu> But other than that, seems to work fine
01:41:14FromDiscord<snluu> This was with just 1 thread. Let me try multiple threads
01:49:23FromDiscord<snluu> with 4 threads, 34 started getting heap warning. the program still finished
02:02:07FromGitter<deech> Dumb question but is `gc:destructors` viral? So if I depend on a library that uses it do I have to?
02:15:07*luis_ quit (Quit: luis_)
02:35:14*dwdv quit (Ping timeout: 240 seconds)
03:12:25*muffindrake quit (Ping timeout: 252 seconds)
03:14:53*muffindrake joined #nim
03:42:13*sammich quit (Ping timeout: 268 seconds)
03:43:18FromDiscord<Xydium> Another dumb question, how do I use system.swap to swap values stored in a sequence inside a ref object passed to a function
03:43:43FromDiscord<snluu> does swap(s[i], s[j]) not work?
03:43:58FromDiscord<Xydium> Type mismatch, expected var T got T
03:44:37FromDiscord<Xydium> `swap(pset.values[i], pset.values[dec partition])`
03:44:53FromDiscord<snluu> is the sequence a var?
03:45:05FromDiscord<Xydium> that would help
03:45:18FromDiscord<snluu> no i mean, can you show me your function signature?
03:45:49FromDiscord<Xydium> the sequence is part of a ref object, so it's not the function signature that matters, it's the type declaration
03:46:03FromDiscord<snluu> where do you get that ref object from?
03:46:10FromDiscord<snluu> var x : ref MyObject?
03:46:15FromDiscord<snluu> or from a function parameter?
03:46:21FromDiscord<Xydium> Function parameter
03:46:27FromDiscord<snluu> is it a var?
03:46:34FromDiscord<Xydium> no
03:46:35FromDiscord<snluu> proc x(y: var ref MyObject)
03:46:37FromDiscord<snluu> you need that
03:47:59FromDiscord<Xydium> `PartSet*[T] = ref object; values: seq[T]; parts: seq[int]`
03:48:08FromDiscord<Xydium> `proc restrict*[T](pset: var PartSet[T], predicate: proc(v: T): bool) =`
03:48:29FromDiscord<Xydium> Just making the param a var doesn't help, the sequence within the type needs to be a var too
03:49:39FromDiscord<Xydium> But that breaks the PartSet constructor, which takes a non-var seq. So I need to convert the passed seq to a var seq
03:50:14FromDiscord<Xydium> `invalid type: 'var seq[int]' in this context: 'PartSet[system.int]' for var`
03:50:53FromDiscord<Xydium> Unless that error is complaining about trying to have a var field in an object
03:51:02FromDiscord<Xydium> But it's in a completely different part of the code
03:52:07FromDiscord<snluu> > Just making the param a var doesn't help, the sequence within the type needs to be a var too
03:52:10FromDiscord<snluu> theres no such thing
03:52:19FromDiscord<Xydium> that explains that
03:54:12FromDiscord<Xydium> `expected <int, int> ... expression 'pset.values[dec partition, 1]' is of type: T`
03:54:18FromDiscord<Xydium> for the swap function
03:54:36FromDiscord<snluu> can you just post your code in a paste?
03:54:40FromDiscord<snluu> how are you calling it?
03:54:50FromDiscord<Xydium> `swap(pset.values[i], pset.values[dec partition])`
03:55:15FromDiscord<Xydium> oh, wait,
03:55:24FromDiscord<Xydium> can't do anything fancy with the dec operator
03:55:30FromDiscord<Xydium> have to move it before the array access
03:55:48FromDiscord<Xydium> `dec partition; swap(..., pset.values[partition])`
03:56:19FromDiscord<Xydium> gone are the days of `while(*s++ != '\0')`
03:56:40FromDiscord<snluu> dec doesn't return anything
03:56:45FromDiscord<snluu> it's a "void"
03:57:21FromDiscord<snluu> > gone are the days of while(*s++ != '\0')
03:57:22FromDiscord<snluu> good
03:57:25FromDiscord<Xydium> true
04:00:28*Hideki joined #nim
04:00:51*Hideki is now known as Guest3208
04:05:43*altarrel joined #nim
04:06:39*altarrel quit (Quit: leaving)
04:15:31*dddddd quit (Remote host closed the connection)
04:19:48*sealmove joined #nim
04:20:03sealmoveHi folks! Merry Xmas!!
04:21:40FromDiscord<snluu> Merry Christmas!!
04:23:37*lbart_ joined #nim
04:23:52*voltist joined #nim
04:24:39*lbart quit (Read error: Connection reset by peer)
04:34:23*endragor joined #nim
04:45:28sealmovecan I pass a string in a template and produce an enum value based on it?
04:49:42*chemist69 quit (Ping timeout: 260 seconds)
04:51:24*chemist69 joined #nim
04:55:06FromDiscord<Rika> Macro would be easier to make for that
04:58:57FromDiscord<slymilano> @sealmove: Like this? https://play.nim-lang.org/#ix=25vg
05:01:27sealmoveslymilano: yes, but I don't want to use a long case
05:01:55FromDiscord<slymilano> So you want someone to pass in `"banned"` and have it return `Status.banned`?
05:02:43sealmovehttps://play.nim-lang.org/#ix=25vh
05:02:54sealmoveyup
05:02:58sealmoveexactly
05:03:18sealmovemore specifically in my senario i want to also add a prefix
05:03:27sealmovebecause my enums are not pure
05:03:41FromDiscord<slymilano> Look into ordinals to find the int of your key? ttps://nim-by-example.github.io/types/enums/
05:04:05FromDiscord<slymilano> There's not `Status[myKey]` to my knowledge in Nim, this would be trivial in Javascript
05:04:08FromDiscord<slymilano> There's no `Status[myKey]` to my knowledge in Nim, this would be trivial in Javascript
05:05:21sealmovei just want to make a helper template/macro that accepts strings and add corresponding enums to an array
05:07:18sealmovelike this: https://play.nim-lang.org/#ix=25vi
05:07:52sealmovehttps://play.nim-lang.org/#ix=25vj
05:08:37sealmoveohh
05:08:39sealmovethere is strutils.parseEnum
05:09:11sealmoveawesome
05:11:24FromDiscord<slymilano> Try this? https://play.nim-lang.org/#ix=25vk
05:12:08FromDiscord<slymilano> No need for the template at all: https://play.nim-lang.org/#ix=25vl
05:16:49sealmoveparseEnum solves the problem, yes no need for template: https://play.nim-lang.org/#ix=25vn
05:18:43sealmovegenerics do the trick here
05:23:50*Guest3208 quit (Remote host closed the connection)
05:24:27*Hideki joined #nim
05:24:50*Hideki is now known as Guest36220
05:29:03*Guest36220 quit (Ping timeout: 260 seconds)
06:00:39*Hideki joined #nim
06:01:03*Hideki is now known as Guest65085
06:10:31FromGitter<bung87> dymatic import possible?
06:15:52*Guest65085 quit (Ping timeout: 258 seconds)
06:16:38*voltist quit (Ping timeout: 258 seconds)
06:20:09*Tongir quit (Remote host closed the connection)
06:38:15*solitudesf joined #nim
07:39:55*dddddd joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:26*Jjp137 quit (Ping timeout: 240 seconds)
08:05:02*gmpreussner joined #nim
08:05:09*Jjp137 joined #nim
08:10:09*nsf joined #nim
08:13:10*Hideki joined #nim
08:13:32*Hideki is now known as Guest64148
08:13:58*lbart_ is now known as lbart
08:22:08*ng0 joined #nim
08:22:08*ng0 quit (Changing host)
08:22:08*ng0 joined #nim
08:33:33sealmoveis it possible to define subsets of enum types?
08:38:07FromDiscord<Rika> bung87, on compile
08:46:40*Guest64148 quit (Ping timeout: 265 seconds)
08:51:14FromGitter<Varriount> sealmove: ranges?
08:51:35sealmoveoh ranges on enums, didn't cross my mind, nice
08:52:39FromGitter<Varriount> sealmove: or you can use a set literal, if your use-case is narrow enough
08:52:52sealmoveI need it to be a type
08:53:00sealmoveranges should work
08:53:06*ng0 quit (Quit: leaving)
09:00:38*Hideki joined #nim
09:01:02*Hideki is now known as Guest5665
09:15:11*Vladar joined #nim
09:19:25*letto quit (Quit: Konversation terminated!)
09:20:03*letto joined #nim
09:36:42*chemist69 quit (Ping timeout: 260 seconds)
09:37:37*chemist69 joined #nim
09:41:33*sealmove quit (Ping timeout: 268 seconds)
09:41:56*dwdv joined #nim
09:43:38*luis_ joined #nim
09:46:07*luis_ quit (Client Quit)
09:48:38*Guest5665 quit (Remote host closed the connection)
09:49:15*Hideki joined #nim
09:49:40*Hideki is now known as Guest92976
09:54:26*Guest92976 quit (Ping timeout: 240 seconds)
09:56:52*NimBot joined #nim
10:04:27*luis_ joined #nim
10:07:11FromDiscord<mratsim> @snluu thanks, trying now
10:08:03FromDiscord<mratsim> I'm also allocating a channel, Weave Future/Flowvar are channels
10:08:41FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/weave/datatypes/flowvars.nim#L27-L47
10:09:26*Vladar quit (Quit: Leaving)
10:10:49*luis_ quit (Quit: luis_)
10:12:33FromDiscord<kodkuce> just saw arc went live, gj i personally will w8 a month to try it guessing there are zilion bugs still πŸ™‚
10:13:23FromDiscord<kodkuce> and i want async anyway, async rewrite will be created to support newruntime too i guess, right?
10:14:27FromDiscord<mratsim> It dies on fib 40, they probably choose some stckless fiber implementation but that cannot handle deep recursion
10:15:07FromDiscord<mratsim> it deadlocks on fib 20 as well
10:15:34FromDiscord<mratsim> with 36 threads
10:16:20dwdvJust tried, dlang works fine, but is 6-7x slower than tbb on clang. Mutex is killing the perf I guess. :(
10:17:02FromDiscord<mratsim> AFAIK D only has a threadpool and no load-balancing/scheduler
10:17:16FromDiscord<mratsim> just like Nim and Crystal
10:17:21dwdvYes. Simple task queue.
10:17:58FromDiscord<mratsim> Crystal also deadlocks with fib(10) and 36 threads :/
10:19:01FromDiscord<mratsim> mmm, even with their default of 4 workers it get stucks
10:19:50FromDiscord<mratsim> maybe I'm msising a release option
10:21:02FromDiscord<kodkuce> make nim greate again
10:21:13FromDiscord<mratsim> ah no, I forgot that it blocked waiting for my input lol
10:22:19*Trustable joined #nim
10:23:49FromDiscord<Rika> But nim is pretty good
10:24:06dwdvThe nim example chokes even at `fibnim 9` on 4 threads on my machine, hm.
10:25:39FromDiscord<Rika> Nim compiler complains about a missing symbol when I try using rlocks
10:25:40FromDiscord<kodkuce> i like nim, just i sounds nice to say it πŸ™‚
10:25:42FromDiscord<Rika> BTW I use arch
10:25:58FromDiscord<kodkuce> arch sux use void
10:26:16FromDiscord<Rika> Meh, let's not get into distro wars
10:26:49FromDiscord<kodkuce> am just troling
10:27:23*Hideki joined #nim
10:27:47*Hideki is now known as Guest45985
10:28:53FromDiscord<kodkuce> only thing i dont like about nim is Araq cant clone himself to work faster xD
10:29:29FromDiscord<Rika> Someone pay him more to work on nim :P
10:33:58*Guest45985 quit (Ping timeout: 268 seconds)
10:40:22FromDiscord<mratsim> @dwdv to be fair, GCC also chokes on fib(16) or something :p
11:14:22FromDiscord<Milerius> https://github.com/mattgodbolt/compiler-explorer/pull/1753
11:14:22FromDiscord<Milerius>
11:14:22FromDiscord<Milerius> Some support from the team would be appreciate
11:14:22disbotβž₯ Add support for Nim language
11:14:25FromDiscord<Milerius> Raise your hand please
11:38:16*chenhq2005 joined #nim
12:01:22FromDiscord<mfiano> Hmm nimpng is pretty slow, and libpng bindings no longer compile
12:07:24FromDiscord<Generic> try stb image
12:08:03solitudesfstb image is pretty slow too
12:08:49lqdev[m]lodepng?
12:08:54FromDiscord<mfiano> I was actualy trying to find a pure solution. My Common Lisp PNG parser can load a 4096x4096 texture in 0.4s. nimPNG takes 2s.
12:09:14FromDiscord<mfiano> I was actually trying to find a pure solution. My Common Lisp PNG parser can load a 4096x4096 texture in 0.4s. nimPNG takes 2s.
12:09:48FromDiscord<Generic> that sounds quite slow, do you make release builds?
12:10:18FromDiscord<mfiano> Yes
12:12:16solitudesffor some reason it uses inheritance and methods, that could be one source of slowness.
12:13:10FromDiscord<mfiano> I see it also doesn't parallelize scanline decoding. No wonder it's slow
12:13:53FromDiscord<mfiano> Well, I'll add it to the list of things I have to yak shave to port my engine over to Nim
12:16:24*luis_ joined #nim
12:27:14federico3@Milerius want to open an issue for it or post on https://forum.nim-lang.org/ perhaps?
12:37:11*endragor quit (Remote host closed the connection)
12:38:44*chenhq2005 quit (Read error: Connection reset by peer)
12:51:23skrylar[m]why don't the libpng bindings compile anymore o_o
12:57:40FromGitter<sheerluck> Hi, I am new to Nim and I have decided to create new datetime library called "sustained" with both https://github.com/google/cctz and https://pendulum.eustace.io in mind. So wish me luck ^_^
12:59:09*nsf quit (Quit: WeeChat 2.6)
13:03:14FromDiscord<Rika> Hope you're fully able to utilize your sheerlucj
13:03:25FromGitter<sheerluck> )))
13:03:27FromDiscord<Rika> Fuck, *sheerluck
13:05:32*luis_ quit (Ping timeout: 260 seconds)
13:09:06*luis_ joined #nim
13:21:44*luis_ quit (Remote host closed the connection)
13:23:04*luis_ joined #nim
13:33:25dom96so many trying to submit the ARC forum thread to HN :)
13:34:36*narimiran joined #nim
13:41:12federico3dom96: huh?
13:42:00dom96well, 2, maybe I'm exaggerating a little
13:52:04*chemist69 quit (Ping timeout: 248 seconds)
13:52:51*chemist69 joined #nim
14:09:08*Vladar joined #nim
14:11:24*Chioque joined #nim
14:12:29*Chioque quit (Client Quit)
14:21:25FromDiscord<kodkuce> is nim realy slower ten crystal at json and base64 or this dude just wrote it slow https://embark.status.im/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/index.html
14:23:27*fanta1 joined #nim
14:30:15*luis_ quit (Quit: luis_)
14:30:47*Hideki joined #nim
14:30:50*luis_ joined #nim
14:31:10*Hideki is now known as Guest71720
14:33:38FromDiscord<Rika> araq's gonna say smth about nim json implementation being different again
14:35:38*Guest71720 quit (Ping timeout: 260 seconds)
14:37:02FromDiscord<kodkuce> its base64 too
14:37:17FromDiscord<kodkuce> i gona use Nim anyway just thinked Nim faster then crystal
14:38:11madpropsis it possible to install a binary with nimble, that places a file in ~/.config ?
14:38:42madpropsa config file i mean, for the program to use
14:46:21kungtotteI think you'd have to profile both languages to track down the difference. It would also be interesting to see how they scale (double and triple the size of the json for example, or increase the complexity of it). Maybe Nim has some initial overhead that goes away as the dataset grows, or it's not great at relatively simple json but handles complex structures better.
14:47:06kungtotteIn the real world, I've had zero performance issues parsing actual JSON with Nim.
14:48:12FromDiscord<mratsim> Nim default json is slow because it allocated a Table at each tree node
14:48:23FromDiscord<mratsim> allocates*
14:48:50FromDiscord<mratsim> both are slow anyway compared to simdjson
14:56:21skrylar[m]isn't that how json is typically processed
14:57:46FromDiscord<mratsim> I don't know but it's costly
14:59:26*endragor joined #nim
15:02:32*luis_ quit (Quit: luis_)
15:03:09skrylar[m]:
15:03:09*krux02 joined #nim
15:03:14skrylar[m]* :\
15:03:36*luis_ joined #nim
15:03:39federico3it's a pity tho - we should do better :-/
15:03:39FromDiscord<Rika> anyone here who can explain the difference between await and asyncCheck? does asyncCheck really only add an exception checking callback?
15:04:42*oculux quit (Quit: blah)
15:05:02*oculux joined #nim
15:06:01skrylar[m]i wasn't aware that tables had issues.
15:07:17kungtotteI don't think there's issues really. Allocations are just costly. Maybe it could be rewritten to use fewer allocations. There's bigger fish to fry though I feel :)
15:07:24*luis_ quit (Client Quit)
15:08:18*fanta1 quit (Quit: fanta1)
15:19:54*endragor quit (Remote host closed the connection)
15:23:06FromDiscord<mratsim> it's a tradeoff between maintenance, ergonomics and speed
15:23:35FromDiscord<mratsim> the table way is easier to implement, and maintain
15:24:14FromDiscord<mratsim> I think araq's packedjson which only allocates a single heap datastructure AFAIK does not provide the same API as std/json
15:24:57FromDiscord<mratsim> The fastest json parser of the world currently is: https://github.com/lemire/simdjson
15:27:10*drewr joined #nim
15:30:26FromDiscord<Milerius> @mratsim It's not the fatest.
15:30:59FromDiscord<Milerius> https://github.com/mleise/fast this one is the fastest.
15:30:59*endragor joined #nim
15:32:19FromDiscord<Milerius>
15:32:19FromDiscord<Milerius> https://cdn.discordapp.com/attachments/371759389889003532/659780537883295744/Capture_decran_2019-12-26_a_16.32.08.png
15:33:01FromDiscord<Milerius> Fun fact, his library is much more easy to use than simdjson
15:33:12FromDiscord<Milerius> When FFI with D in nim ? :p
15:33:22FromDiscord<mratsim> ask timotheecour
15:33:28FromDiscord<Rika> FFI everything with nim
15:33:46FromDiscord<mratsim> There was the NimBorg probject: https://github.com/micklat/NimBorg
15:33:49FromDiscord<Milerius> Just the fastjson is incrediblefor me
15:33:50FromDiscord<Rika> nim will be known as the language that can easily FFI with all the languages!
15:34:03FromDiscord<Rika> i love that name
15:34:27FromGitter<deech> If I use `gc:destructors` for a library are all users of my API obligated to use it as well?
15:34:32FromDiscord<Milerius> Fastjson should be possible to implement in nim
15:35:08FromDiscord<mratsim> @deech destructors only care about stack objects though
15:35:47FromDiscord<mratsim> so there is no compat issue since all stack objects will eventually follow gc:destructors rules
15:36:11FromGitter<deech> Oh ok, then I don't understand destructors at all. Is this the best documentation? https://nim-lang.org/docs/destructors.html
15:36:28FromDiscord<mratsim> right now it's only seq/strings that change behaviour between nothing and destructors
15:36:38*endragor quit (Remote host closed the connection)
15:36:57FromDiscord<mratsim> yes it's the latest
15:37:09FromDiscord<mratsim> but it doesn't talk to library compat and "in practice"
15:37:30FromDiscord<mratsim> but in short, a library that works under gc:destructors will work under all Nim GCs
15:37:45FromDiscord<mratsim> and you can't use ref objects with just gc:destructors
15:37:46FromGitter<deech> It doesn't seem to directly mention that it's stack-only either.
15:38:00FromDiscord<mratsim> it's stack + seq + strings + pointers
15:38:16FromDiscord<mratsim> gc:none was stack + pointers
15:38:25FromDiscord<mratsim> you can see that as a refinment over gc:none
15:38:46*endragor joined #nim
15:41:26*krux02 quit (Remote host closed the connection)
15:55:57skrylar[m]suppose i'll add spookyhash to my (still quite small) pile of hash ports
15:57:56*endragor quit (Remote host closed the connection)
16:00:03*endragor joined #nim
16:03:54*Vladar quit (Quit: Leaving)
16:05:34*endragor quit (Remote host closed the connection)
16:10:51*luis_ joined #nim
16:13:45dom96@kodkuce: https://news.ycombinator.com/item?id=21884749
16:15:21*couven92 joined #nim
16:16:09*Hideki joined #nim
16:16:33*Hideki is now known as Guest93870
16:16:48luis_Hi everyone, is there a module to print well formatted tables on the command line, like pythons tabulate?
16:20:46*Guest93870 quit (Ping timeout: 258 seconds)
16:22:45FromDiscord<kodkuce> ty dom96 πŸ™‚
16:23:46*endragor joined #nim
16:25:21FromDiscord<mratsim> @luis_ AFAIK there is none, I just use strformat: https://github.com/status-im/nim-beacon-chain/blob/devel/nbench/reports.nim#L34-L50
16:37:53*endragor quit (Remote host closed the connection)
16:39:51*casaca quit (Ping timeout: 265 seconds)
16:41:29*casaca joined #nim
16:54:17*Trustable quit (Remote host closed the connection)
17:09:25*nsf joined #nim
17:11:18*nixfreak_ is now known as nixfreak
17:16:22*koltrast quit (Quit: ZNC - http://znc.in)
17:20:32*koltrast joined #nim
17:20:42FromGitter<iffy> I'm trying to use libsecret with Nim. I'm trying c2nim on some of the headers, w/o success. For instance, c2nim on https://github.com/GNOME/libsecret/blob/mainline/libsecret/secret-attributes.h fails w/ this error: `(29, 13) Error: token expected: ;`. Any tips?
17:20:44FromDiscord<treeform> I remember some one had a lib or just a set of macros that would parse json into objects directly - without creating intermedia json nodes? Does any one have a link to that? I search forums but nothing...
17:21:06FromDiscord<mratsim> nim-json-serialization
17:21:31FromDiscord<mratsim> https://github.com/status-im/nim-json-serialization
17:21:36FromDiscord<treeform> thanks!
17:22:12FromDiscord<mratsim> usage: https://github.com/status-im/nim-beacon-chain/blob/1597f0c943370c1e2ed51f2727c6cd42a199ae53/tests/official/fixtures_utils.nim#L41-L49
17:22:27skrylar[m]@iffy you can manually bind functions with `...` by leaving the `...` out of the params and adding a {.vararg.} pragma; i have no idea about `va_args` (i always assumed those didn't work, although they might with emitcs /shrug)
17:22:33FromDiscord<mratsim> it's a plugin for nim-serialization
17:23:35FromDiscord<treeform> Do you know if it wins at JSON benchmark games?
17:24:21FromGitter<iffy> skrylar: It seems like c2nim is dying before it even gets to `...` on the character right after the first `GHashTable *`
17:26:54FromDiscord<Rika> okay, why do we still have tab usage as a syntax error?
17:27:41skrylar[m]because araq has the wrong opinions wrt. indentation :^)
17:28:02FromDiscord<Rika> nice
17:28:13FromDiscord<Rika> i feel like someone's about to get banned...
17:29:11skrylar[m]i would love if we just had elastic tabstops but.. it was not to be.
17:29:24FromDiscord<Rika> ;; tabs in nim when
17:32:41FromDiscord<snluu> this is precisely what we were talking about the other day, @Rika
17:33:07FromDiscord<snluu> that’s why people bitch about space significant languages πŸ˜›
17:33:51FromDiscord<Rika> yeah; at least allow choice ;;
17:34:51planetis[m]treeform: you can also try https://github.com/b3liever/eminim though it has some limitations
17:34:53FromDiscord<snluu> but meh, nothing a .editconfig file can’t solve
17:40:48YardanicoWait, does `--gc:arc` just leak memory with async or something like that? because my social network bot (which uses async) just compiled successfully
17:41:02Yardanicoand it actually works 0_)
17:41:13skrylar[m]didn't it just get a big update
17:41:25*endragor joined #nim
17:41:36Yardanicodamn we sure are in the future and it's not even 2020 yet
17:42:58luis_How do I strip all characters after the last `/` in a string that looks like "/torrent/10739522/Home_Alone_2_Lost_in_New_York_(1992)_1080p_BrRip_x264_-_YIFY"?
17:43:09luis_I just want the name
17:43:18Yardanicoluis_: you want rsplit from strutils
17:43:34Yardanicoor better use path handling from `os`
17:43:35luis_thanks
17:43:36narimiranluis_: pro tip: don't watch YIFY stuff, it is utter garbage
17:43:43FromDiscord<snluu> Ehh, looks like he should use path handling
17:43:59Yardanicoyeah
17:44:07narimirando yourself a favour and download something not compressed as much
17:44:10luis_ok, will look into it
17:44:14FromDiscord<snluu> https://nim-lang.org/docs/os.html#parentDir%2Cstring
17:44:31FromDiscord<snluu> Luis_, give that a try
17:44:54*nixfreak quit (Ping timeout: 265 seconds)
17:45:03*sealmove joined #nim
17:45:09planetis[m]is there a fixed point library for nim?
17:46:15*endragor quit (Ping timeout: 258 seconds)
17:49:32luis_it worked... I used splitPath().tail
17:49:38luis_thanks
17:52:10FromGitter<deech> planet[m] do you mean recursion scheme fixpoints or a math library?
17:52:50FromDiscord<Fern & Simula (They/Them)> does anyone know if jester has a testclient of some kind?
17:56:47planetis[m]no a math library where a decimal number is represented by a int
17:57:07planetis[m]nvm I am making one
18:01:09*luis_ quit (Quit: luis_)
18:06:36*altarrel joined #nim
18:08:53*pbb joined #nim
18:15:29*altarrel quit (Quit: leaving)
18:17:37*Hideki joined #nim
18:18:00*Hideki is now known as Guest62305
18:19:59*solitudesf quit (Quit: Leaving)
18:20:07Zevvwhy is "nim vs crystal" again on HN frontpage?
18:20:27*solitudesf joined #nim
18:21:58*Guest62305 quit (Ping timeout: 260 seconds)
18:22:22YardanicoZevv: crystal fans desperately trying to prove that crystal is better than nim every year /s
18:23:25Zevvah but it is, right? But the Nim folks are just nicer, thats the win!
18:24:56FromDiscord<Fern & Simula (They/Them)> it feels like python vs ruby 2: compiled boogaloo
18:29:01skrylar[m]unrelatedly, spooky port is done-ish
18:34:05*casaca quit (Quit: leaving)
18:36:59sealmoveHow is Crystal better?
18:38:28FromDiscord<Fern & Simula (They/Them)> I wouldn't say better, just different.
18:38:43FromDiscord<Fern & Simula (They/Them)> it's all preference lol
18:38:46sealmovewhat's the catch for Crystal?
18:38:56FromDiscord<Fern & Simula (They/Them)> but also it doesn't even run on window
18:38:59sealmovefor example for Nim it's native metaprogrammin
18:39:17sealmoveno Windows? eh, that's strange
18:39:38FromDiscord<Fern & Simula (They/Them)> yeah. the main person porting it is now too busy with work to actually port the stdlib to windows
18:40:16FromDiscord<Fern & Simula (They/Them)> crystal also has some decent metaprogramming. i guess the main differences are syntax and OOP
18:43:32*couven92 quit (Read error: Connection reset by peer)
18:43:50madpropsidk crystal just looks weird to me
18:43:50*couven92 joined #nim
18:45:41Yardanicocrystal is compiled ruby :P
18:45:46Yardanicoand nim is not really compiled python :P
18:46:08Yardanicowell, I know crystal is more than compiled ruby too, but they advertise closeness to Ruby syntax as a feature, but nim doesn't really do it a lot
18:46:19sealmoveruby is weird (not necessarily in a bad way)
18:46:36YardanicoRuby code looks too empty for me xD
18:47:08sealmovenim is made with too much love, you can
18:47:11sealmovet pass on that
18:47:20sealmoveevery feature is carefully designed
18:47:37*nsf quit (Quit: WeeChat 2.6)
18:50:15FromDiscord<kodkuce> and https://ballerina.io/ is so gey
18:57:59*sealmove quit (Quit: WeeChat 2.7)
18:58:01FromDiscord<Fern & Simula (They/Them)> let's not please
19:00:29FromDiscord<mratsim> mmm there is no way to count the arity/length of an enum type?
19:01:00skrylar[m]@mratsim more toys https://git.sr.ht/~skrylar/skyhash
19:01:20FromDiscord<Fern & Simula (They/Them)> @mratsim you probably could pretty easily with a macro
19:01:41FromDiscord<mratsim> yeah of course but neither arity or len work out of the box :/
19:01:53FromDiscord<mratsim> @skrylar, your API is called "steaming"
19:02:33skrylar[m]welp.
19:03:02FromGitter<deech> mratsim, I saw something like, `for i in ord(low(MyEnumType)) .. ord(high(MyEnumType)): ...`, not sure if it works for sparse enums though.
19:03:28FromDiscord<mratsim> btw sourcehut is paid only right?
19:03:35Araqmratsim: high(E) - low(E) + 1
19:03:38*narimiran quit (Ping timeout: 240 seconds)
19:03:43FromDiscord<mratsim> my enums are not sparse
19:04:16FromDiscord<mratsim> I guess that's the brute force way :p
19:04:21skrylar[m]@mratsim not quite yet
19:04:57FromGitter<deech> A static iterator like `fieldPairs` would be nice for enums.
19:05:50FromDiscord<Fern & Simula (They/Them)> fieldPairs for enums couldn't be that hard to implement in the stdlib, could it? i feel like that would be extremely useful
19:06:40FromDiscord<mratsim> I only need the length
19:07:18FromDiscord<mratsim> for static you can just do static: for e in low(E) .. high(E):
19:07:26Araqfor i in low(E)..high(E) # close enough IMO
19:07:35FromGitter<deech> Seems do-able, probably just the case that people haven't needed it that much yet ...
19:08:00FromDiscord<mratsim> when I need it I just roll my own
19:08:41FromGitter<deech> Araq, wouldn't work with enums generated from C APIs which often don't go in order.
19:09:41FromDiscord<mratsim> we can't really save them though
19:10:04FromDiscord<mratsim> supporting them would make the iterator have a lot of special cases
19:10:30FromDiscord<mratsim> though we could detect enums with holes at compile-time
19:10:59Araqenums with holes must die
19:11:09Araqsuch an expensive feature
19:12:51FromDiscord<Milerius> Please araq we need help
19:12:54FromDiscord<Milerius> @araq https://github.com/mattgodbolt/compiler-explorer/pull/1753#discussion_r361474012
19:12:55disbotβž₯ Add support for Nim language
19:13:10FromDiscord<Milerius> or someone that have experience with the nim compiler
19:13:27FromDiscord<Milerius> Your help will be highly appreciated in this thread
19:15:54FromDiscord<Milerius> thanks ! ❀️
19:18:24*luis_ joined #nim
19:18:41FromDiscord<Milerius> do we have a nice demangler for nim function @araq ?
19:18:47FromDiscord<Milerius> Such as c++filt but for nim
19:19:23Yardanico@Milerius why is default target set to C++ though? well, I think it doesn't really matter, but Nim itself still uses C backend as a default
19:19:29Yardanico(that's just a questions though)
19:19:30Araqit's simply .replace("__.*", "")
19:20:03FromDiscord<Milerius> @Yardanico It's not my PR but you can comment if you want
19:20:22FromDiscord<Milerius> any advice will be great
19:21:27AraqC++ generates better code for --gc:arc for the time being
19:21:29FromDiscord<Milerius> anyway we need this pr to be merged it"s will help a lot to compare the assembly generated
19:21:41FromDiscord<Milerius> with other langage
19:22:00*Trustable joined #nim
19:23:20skrylar[m]i was always partial to d's name mangling back in the day
19:23:55skrylar[m]altho if i remember custom type names could make the names long
19:28:35AraqI don't care about name mangling, I've used Turbo Pascal and C#
19:30:17FromDiscord<Milerius> xD
19:38:13FromDiscord<mratsim> The worse thing about cross-platform development is having to reboot under WIndows :/
19:38:40Yardanicowhy not a VM?
19:38:59AraqI solved it by stopping using Linux
19:39:09FromDiscord<mratsim> because VM don't have access to GPUs
19:39:19FromDiscord<mratsim> Try using Cuda on Windows ...
19:39:48FromDiscord<mratsim> Windows has no package management
19:39:52Yardanicowell, you can always passthrough :P
19:40:07Yardanicoand for package management there is chocolatey, although mostly for desktop packages
19:40:09FromDiscord<mratsim> passthrough is a bit of pain
19:40:24Araqthat's the best thing about it, download it from the official vendor, no middle men
19:40:39FromDiscord<mratsim> there is this Nvidia error 41 iirc
19:40:44luis_Which os method can be used to open a link on the systems default handler for links?
19:40:54Araqbrowsers.nim
19:40:56Yardanicoluis_: https://nim-lang.org/docs/browsers.html
19:41:12luis_thanks,
19:41:15FromDiscord<mratsim> lots of the stuff I do need recompilation from source to use either AVX or some corner feature
19:41:43luis_Yardanico: will this open a magnet: link?
19:41:56luis_probably, right?
19:41:59luis_will try
19:42:00Yardanicoluis_: it might work on *nix, not sure about windows
19:42:11*donpdonp joined #nim
19:42:29FromDiscord<mratsim> Configuring OpenCV on Windows manually to support what I do here would be very painful for example: https://github.com/mratsim/Arch-Data-Science/blob/master/vision/opencv-cuda-mkl-ffmpeg-git/PKGBUILD#L90-L166
19:42:36donpdonphow can I echo &"{object.unsafeAddr.repr}" and just get the memory address instead of a dump of the whole structure?
19:42:49*nixfreak joined #nim
19:43:47Yardanicodonpdonp: echo cast[uint64](object.unsafeAddr) ?
19:44:05Yardaniconot sure if this is the best way to do it though
19:44:13Yardanico!eval var a = 5; echo cast[uint64](a.unsafeAddr)
19:44:16NimBot93972187339776
19:44:33FromDiscord<mratsim> @donpdonp, I use c_printf + 0x%.08x
19:44:36FromDiscord<mratsim> see: https://github.com/mratsim/weave/blob/bd87a4fac04a31f499fc0c178e7e3d3d0ffa92e0/weave/scheduler.nim#L112-L113
19:44:51Yardanico!eval var a = 5; echo uint64(a.unsafeAddr)
19:44:52FromGitter<deech> I'm doing some Windows work and is choosenim currently the easiest way to get going with nim/nimble?
19:44:53NimBotCompile failed: /usercode/in.nim(1, 23) Error: type mismatch: got <ptr int> but expected 'uint64'
19:45:50donpdonpok thx for the pointers.
19:46:20*ng0 joined #nim
19:46:22FromDiscord<mratsim> @donpdonp: example https://play.nim-lang.org/
19:46:27FromDiscord<mratsim> arg
19:46:33FromDiscord<mratsim> https://play.nim-lang.org/#ix=25yS
19:47:14donpdonpnod. &"{cast[uint64](askbooks.unsafeAddr):x}" looks ok too
19:47:22lqdev[m]@deech as long as you're on 32-bit, otherwise, you'll need to install manually
19:47:41lqdev[m]because choosenim supports 32-bit windows only
19:47:48lqdev[m]for some reason
19:47:59FromGitter<deech> Oh ick. Had no idea.
19:49:03Yardanicolqdev[m]: does it? hrm
19:49:05disruptekluis: see terminaltables package.
19:49:16luis_thanks, will do
19:49:19disruptek!repo terminaltables
19:49:20disbothttps://github.com/xmonader/nim-terminaltables -- 9nim-terminaltables: 11terminal tables for nim 15 18⭐ 1🍴
19:49:37luis_awesome!
19:50:04FromGitter<deech> lqdev, not saying you're wrong, but do you know this from experience because it doesn't mention the limitation in the README.
19:50:24FromGitter<deech> https://github.com/dom96/choosenim/releases
19:50:49Yardanicoas far as I know win 64bit always was one of the main targets for choosenim
19:50:58FromDiscord<mratsim> nop
19:51:16FromDiscord<mratsim> it only downloads 32-bit nim which is extremly annoying
19:51:29Yardanicowow
19:51:54FromGitter<deech> Is this due to some 32-bit dependency issue? The archive seems to have a lot of bundled DLLs.
19:52:41FromDiscord<mratsim> pretty sure it's just that no-one added win64
19:53:14FromGitter<deech> Huh, the website has it: https://nim-lang.org/install_windows.html
19:53:51FromDiscord<mratsim> in my case I just git clone devel, build_all.bat
19:53:55disruptekshashlick will know what's up with that.
19:53:59Araqshashlick added 64 bit support iirc
19:54:01FromDiscord<mratsim> and update the env variable to point to bin
19:54:20Araqfinish.exe can update the environment for you
19:54:27FromDiscord<mratsim> it still download 32-bit, I complained last week wheen I was porting weave to windows
19:54:42FromDiscord<mratsim> from git clone?
19:55:46luis_I dont know if any of you remember a smaill python tool for listing torrents from piratebay called torrench? I just re did it in a simple form in Nim... not sure it is ok to share over github.... I may share using gist, perhaps...
19:55:59Yardanicoluis_: it's totally okay to create a github repo for it :)
19:56:22disruptekmaybe it's a nimarchive build limitation, but i doubt it.
19:56:25YardanicoIt's not like you're actually distributing pirate content, you're just creating a frontend for searching it
19:56:39Yardanico(qbittorrent is open source too, but no one complains that it's used for downloading pirate content :D )
19:57:01luis_yeah, you right... wait a minute.... will upload soonish
19:57:39FromGitter<mratsim> well listing from piratebay is a bit different from listing from a "compatible-torrent website"
19:58:30FromGitter<deech> Oh weird, apparently choosenim hard-codes a 32 bit mingw and uses that to determine the architecture so it will always be 32. Seems like simply changing the url to point to 64-bit mingw should just fix it unless there is a reason to support 32 bit.
19:58:34FromGitter<deech> https://github.com/dom96/choosenim/blob/master/src/choosenim/download.nim#L17
19:58:54*donpdonp left #nim ("WeeChat 2.6")
19:59:34FromGitter<deech> dom96, maybe there's some other reason?
20:06:29*kungtotte quit (Quit: WeeChat 2.7)
20:09:33*kungtotte joined #nim
20:12:06*rockcavera joined #nim
20:13:25luis_Here you go: https://github.com/lf-araujo/nimBay this was a cool holiday project.
20:23:43*luis_ quit (Quit: luis_)
20:23:43*kungtotte quit (Read error: Connection reset by peer)
20:25:43shashlickIf you have a gcc installed, the nim install will match that arch
20:25:58shashlickElse right now choosenim only installs 32-bit
20:26:52shashlickAdding support is just to install 64 bit by default and fall back to to 32bit if a flag is specified
20:27:23shashlickFurther, we need to add support to enable both archs to coexist but that's some ways
20:50:08*luis_ joined #nim
20:59:16*gangstacat quit (Ping timeout: 248 seconds)
21:11:01deepend!help
21:11:29deependis disbot running different code than NimBot ?
21:11:50deependlooking for some example irc bot stuff to read
21:12:26Yardanicodeepend: not really a bot - https://github.com/Yardanico/twitchrelay
21:13:06deependthanks that looks helpful anyhow
21:13:52*letto_ joined #nim
21:14:00*FromGitter quit (Read error: Connection reset by peer)
21:14:38*letto quit (Ping timeout: 260 seconds)
21:15:12*luis_ left #nim (#nim)
21:17:33*luis_ joined #nim
21:25:39*deech joined #nim
21:26:12FromDiscord<snluu> I think someone told me this a few days ago, but I forgot
21:26:17FromDiscord<snluu> is `getGlobalDispatcher` thread local?
21:26:33FromDiscord<snluu> couldn't find documentation anywhere for what "global" means in get and set global dispatcher
21:32:02*deech quit (Ping timeout: 258 seconds)
21:41:00FromDiscord<treeform> planetis, exactly what was looking for. Thanks!
21:41:28*luis_ quit (Quit: luis_)
21:41:47*bozaloshtsh_ quit (Quit: ZNC 1.7.5 - https://znc.in)
21:41:57*luis_ joined #nim
21:42:01*bozaloshtsh joined #nim
21:42:01*bozaloshtsh quit (Changing host)
21:42:01*bozaloshtsh joined #nim
21:44:05*luis_ quit (Client Quit)
21:50:32Araqsnluu: it's thread local
21:55:21*uu91 quit (Remote host closed the connection)
22:01:04planetis[m]glad I could help :)
22:07:43*Mister_Magister quit (Excess Flood)
22:10:31*Mister_Magister joined #nim
22:19:00*Hideki joined #nim
22:19:24*Hideki is now known as Guest94048
22:23:14*Guest94048 quit (Ping timeout: 240 seconds)
22:25:45*nsf joined #nim
22:33:02FromDiscord<snluu> thanks Araq!
22:42:06*kungtotte joined #nim
22:51:19*nsf quit (Quit: WeeChat 2.6)
22:54:23*solitudesf quit (Ping timeout: 260 seconds)
23:05:19*krux02 joined #nim
23:11:51*krux02 quit (Remote host closed the connection)
23:35:10disruptekshadhlick: https://research.swtch.com/vgo-principles#latest-feature
23:35:23disruptekshashlick ^
23:36:58disrupteki cant remember if i wrote disbot from scratch or not, but i have a simple irc bot in this repo:
23:37:08disruptek!repo disruptek/xs
23:37:09disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 1⭐ 0🍴
23:44:38disruptekdeepend ^
23:45:46*couven92 quit (Ping timeout: 268 seconds)
23:45:46Araqdisruptek: interesting read
23:46:54disruptekhe and i argued about defaulting to minimal version (me) or maximal (him).
23:48:05disrupteki conceded ultimately that max makes the most sense simply because it's the only possible default interpretation of what is essentially the only possible nimble requirement operator.
23:48:42disruptekbut i'm sad about it. 😁
23:49:18deependthanks disruptek
23:49:56disrupteklemme know if you have any questions. also, later irc supports ssl.
23:51:34Araqminimal vs maximal versions is the wrong question.
23:51:49Araqthe problem is the "version number" itself
23:52:17Araqit has no place ever since we got commit hashes
23:52:22disruptekwell, i takr hickey's view.
23:52:30disrupteksemver is stupid.
23:52:40Araqhickey's right, yes
23:53:42disruptekwe can use tags now which are automatic against nimble and commits.
23:54:02disruptek'nimph tag'
23:55:14FromDiscord<Fern & Simula (They/Them)> how does one use commit hashes in a nimble file?
23:55:28disruptekfoo#bar
23:55:39FromDiscord<Fern & Simula (They/Them)> oh nice, ty
23:58:38disruptek!issue require releases
23:58:39disbothttps://github.com/nim-lang/Nim/issues/10801 -- 3distros.nim regression on ArchLinux 7& 15 more...
23:58:42disrupteknope
23:58:52disruptek!issue require release tags
23:58:54disbothttps://github.com/nim-lang/Nim/issues/11454 -- 5bootstrapping fails on master 7& 2 more...
23:59:08*disruptek sighs.
23:59:19disruptekmy thumbs arent up for this shit.