<< 14-01-2020 >>

00:00:30FromDiscord<Recruit_main_70007> It is, I do have the bot, but take this cop tutorial (give me a sec)
00:00:45FromDiscord<Recruit_main_70007> Cpp *
00:01:00rayman22201https://nim-lang.org/docs/tut2.html
00:01:25rayman22201Sounds like you are trying to learn too many things at once.
00:02:03FromDiscord<Recruit_main_70007> https://m.youtube.com/watch?v=ih20l3pJoeU how would I do this in Nim
00:02:14FromDiscord<Recruit_main_70007> That’s basically my question
00:02:32FromDiscord<yewpad> Are we talking about inheritance?
00:03:01FromDiscord<Recruit_main_70007> No, not that
00:03:53FromDiscord<yewpad> If you give these gentlemen are solid example of what you're trying to achieve then they will help you. What exactly is it in the video you're trying to achieve?
00:03:58leorizehttps://github.com/OneLoneCoder/videos/blob/master/OneLoneCoder_olcEngine3D_Part1.cpp
00:04:02leorize^ this you mean?
00:04:24FromDiscord<Recruit_main_70007> Yes
00:05:06FromDiscord<Recruit_main_70007> To Jeep things simple, something like that
00:05:12*lritter quit (Ping timeout: 265 seconds)
00:05:33FromDiscord<Recruit_main_70007> Keep* sorry it’s late and I am on iPad
00:05:52leorizethis is doable in Nim
00:06:05leorizein fact I'm gonna quickly translate this for you
00:06:25leorizealso this is basic oop
00:06:38leorizeshould be doable in most languages, including C
00:07:45leorizethis demo doesn't look like it's supposed to be runable :P
00:08:39leorizeyea it wasn't that the code was short, it's that the heavy lifting has all been done by his engine =="
00:09:13leorizetranslating this is kinda out of scope :P
00:09:20leorizebut I'll try to draft you something that looks like that
00:09:36FromDiscord<Recruit_main_70007> Ok
00:10:51FromDiscord<treeform> This is surprising, I was making some benchmarks and node-js backend beats the exception benchmark:
00:10:53FromDiscord<treeform>
00:10:53FromDiscord<treeform> https://cdn.discordapp.com/attachments/371759389889003532/666434024398520340/unknown.png
00:11:31leorize@Recruit_main_70007: found one: https://github.com/nim-lang/ui/blob/master/examples/controllgallery2.nim
00:12:12leorizein Nim we don't do a ton of inheritance and overrides like C++
00:12:19leorizewe usually do something like the above
00:12:55leorizecreate an object, then change the callbacks to whatever you want it to do
00:13:17leorizewant to do something a lot? create a proc for it :)
00:14:45FromDiscord<Recruit_main_70007> And what about using a class in header file and overwriting its functions, is that doable?
00:16:52leorizehttps://play.nim-lang.org/#ix=27lm
00:17:00leorizesomething like that you mean?
00:18:36FromDiscord<Recruit_main_70007> No, take the cpp example, it uses a header file that holds a class and the functions it then writes over
00:19:03leorizethat's exactly what I did
00:19:15leorizethe playground can only do one file though
00:19:33leorizeimagine A is in an another module
00:19:48leorizethen you create your B in your module that inherits from A
00:19:56leorizesame way, just with two files
00:20:32FromDiscord<Recruit_main_70007> And the first hello is in the header file?
00:20:47*martinium joined #nim
00:20:53leorizeyea?
00:21:01leorizenote that we don't have the concept of header files
00:21:05leorizewe only have modules
00:21:32leorizeand they are not header files or even close to them
00:21:54leorizeI think repl.it let you do multiple files, so wait
00:22:35FromDiscord<Recruit_main_70007> But we can import header files, I literally mean to do that
00:24:55leorizehttps://repl.it/repls/LoyalUnevenAtoms
00:25:18leorizeyou'll need to learn more about Nim's concept, but that repl should be enough to show you that it's possible
00:29:58FromDiscord<Recruit_main_70007> I think you didn’t understand what I meant to say, I was taking of defining classes in cpp/c, in a header file, importing that header and importing the functions to override them (I think it’s called that way) just like if I was making a wrapper
00:30:03*Hideki_ joined #nim
00:30:40leorizeah, that cleared things up :P
00:31:34leorizethat one is possible, though I'm not an expert in it
00:32:24FromDiscord<Recruit_main_70007> I guess that’s possible, but is it really “practical” (at least a bit) way of extending the capabilities of Nim classes?
00:32:59FromDiscord<Recruit_main_70007> / OOP
00:33:10leorizewait, are you trying to do cpp interop?
00:33:42FromDiscord<Recruit_main_70007> No, that’s a question for another day
00:34:10leorizethen isn't that repl showed exactly that?
00:34:22leorizeI got A in module, then I import it and override hello
00:34:29leorizewith type B
00:34:37leorizeor are you looking for something else?
00:35:10FromDiscord<Recruit_main_70007> If the A module is a header that has a c/cpp class yes
00:35:29leorizeI still don't get it
00:35:42leorizewhat's the expected behavior you're looking for?
00:35:56leorizecan you uh, write a pseudocode or some python to describe that?
00:36:16leorizebecause "C/CPP class" are meaningless in Nim :/
00:36:43*ng0 quit (Quit: leaving)
00:36:47rayman22201he does want cpp interop. That's what that means
00:37:05leorizehe said no when I asked :/
00:37:29rayman22201I think he doesn't understand.
00:37:42rayman22201"taking of defining classes in cpp/c, in a header file, importing that header and importing the functions to override them (I think it’s called that way) just like if I was making a wrapper" <--- that is the exact definition of cpp interop
00:38:07FromDiscord<Recruit_main_70007> Ok, I see what the question meant, yes, I do want to take a cpp class and work with it in Nim, sorry
00:39:18FromDiscord<Recruit_main_70007> It’s just that I associate cpp interop to wrapping whole modules
00:39:54FromDiscord<Recruit_main_70007> (And it’s 1:39 am)
00:40:48rayman22201sleep is an important part of preventing bugs :-P
00:41:37FromDiscord<Recruit_main_70007> We might retake this conversation in the future, goodnight
00:41:50leorizeo/ sleep well
00:42:33rayman22201gn
00:46:20skrylar[m]yeh we don't have classes :b
00:48:03donpdonpim trying to sort a list of (float, object) by the float value. let s = j.sorted(proc (x,y: (float, Offer)): int = cmp(x[0],y[0]))
00:48:52donpdonpthat looks right but there is a type error andI cant figure out what the error is trying to say. mismatch at position 2 = required type for cmp: proc (x: T, y: T): int{.closure.}
00:49:08donpdonplooks to me that I have two params of the same type and return an int
00:49:09nisstyredonpdonp: T = T
00:49:14nisstyreis that true?
00:49:24donpdonpi dont konw what you're asking
00:49:31nisstyreyou have a float and an Offer object
00:49:35nisstyreare they both the same type?
00:49:51donpdonpthe type of tuple[float,object] is the same for x and y, yes
00:51:12leorizehttps://play.nim-lang.org/#ix=27ls
00:51:12leorizeno error here
00:52:21donpdonpthe rest of the error is 'expression is of type: proc (x: tuple of (float, Offer), y: tuple of (float, Offer)): int{.noSideEffect, gcsafe, locks: 0.}
00:52:30donpdonpleorize: hmm well thats encouraging.
00:52:42nisstyreyeah I'm not sure what the issue was there
00:56:22*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:57:08donpdonpis there a seq.flatten()?
00:57:27leorizewhat would that do?
00:57:41*Hideki_ quit (Remote host closed the connection)
01:00:12donpdonp@[["hi","there"],["george"]] => @["hi", "there", "george"]
01:02:22leorizenope, shouldn't be hard to implement though, as we have fold functions
01:03:13donpdonpnod. thx.
01:03:18leorizehave you figured out your sorting issues?
01:04:25nisstyredonpdonp: https://play.nim-lang.org/#ix=27lw
01:05:16donpdonpleorize: it has something to do with the array to be sorted had nested arrays (hence the flatten)
01:05:47donpdonpim not sure why the error message didnt look different, since the types would be wrong. so i cant say for sure what the fix was
01:05:57donpdonpbut its happy now :)
01:06:16donpdonpnisstyre: thats interesting thx.
01:06:17*martinium joined #nim
01:06:22*muffindrake quit (Ping timeout: 260 seconds)
01:08:29*muffindrake joined #nim
01:20:32*ltriant joined #nim
01:21:28*ltriant quit (Client Quit)
01:22:43*NimBot joined #nim
01:33:16*Hideki_ joined #nim
01:34:09*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:53:09*Hideki_ quit (Ping timeout: 268 seconds)
02:03:43*onionhammer joined #nim
02:11:21*abm quit (Quit: Leaving)
02:36:37*chenhq2005 joined #nim
02:46:51FromDiscord<Rika> is there smth similar to python's `yield from`?
02:53:14leorizeclosure iterators?
03:03:28FromDiscord<Rika> uh no, an iterator that just passes what another iterator generates
03:04:03disruptekwe have for loops, yes.
03:04:49leorizejust use for loops, they are inlined anyway
03:08:14FromDiscord<Rika> eeeeeeeeeeeeeeeeeee
03:08:21FromDiscord<Rika> okay i guess
03:08:39disruptekyou can usually get by with a few less Es.
03:10:12leorizesince you are lazy:
03:10:41leorizetemplate yieldFrom(i: untyped): untyped = for x in i: yield x
03:10:41fysWhat's wrong with being lazy?
03:11:17*NimBot joined #nim
03:11:39leorizefys: because it's one line less than if you just type the for out? :P
03:11:55fys;)
03:17:34*rockcavera quit (Remote host closed the connection)
03:29:33*arecaceae quit (Remote host closed the connection)
03:29:56*arecaceae joined #nim
03:30:21disrupteki may not be understanding this, but it seems like we could change allocators not just at the type level, but even according to scope.
03:39:07leorizethe scope part seems unsafe
03:39:54disruptekwe need to use the cfg anyway, so it's not like we cannot establish some guarantees.
03:40:05disruptekor error if it's unsolvable.
03:42:29disruptekAraq: would you refuse a pr for while/else and for/else? block/else?
03:43:04leorizeblock/else?
03:44:25disruptekexecutes else: clause if the block falls through. helps me create for/else and while/else.
04:00:24*muffindrake quit (Ping timeout: 252 seconds)
04:02:42*muffindrake joined #nim
04:19:01*dddddd quit (Remote host closed the connection)
04:45:34*nsf joined #nim
04:52:22*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
05:02:52*marmotini_ joined #nim
05:03:43*marmotini_ quit (Remote host closed the connection)
05:09:38*theelous3 quit (Ping timeout: 240 seconds)
05:10:28*narimiran joined #nim
05:18:18*gmpreussner quit (Read error: Connection reset by peer)
05:18:24*chenhq2005 quit (Ping timeout: 265 seconds)
05:18:46*gmpreussner joined #nim
05:33:20*cyraxjoe joined #nim
05:36:23*MightyJoe quit (Ping timeout: 268 seconds)
05:50:08*Hideki_ joined #nim
05:54:32*Hideki_ quit (Ping timeout: 260 seconds)
06:10:08*marmotini_ joined #nim
06:35:25disruptekone of my arc bugs is that only ref objects sink params during construction. an object can have a ref field that it frees in its destructor; as long as they must own all their contents, they must own refs, too.
06:46:12*livcd joined #nim
07:08:13*ng0 joined #nim
07:12:13*ng0 quit (Client Quit)
07:13:28*ng0 joined #nim
07:21:33*ng0_ joined #nim
07:23:25FromDiscord<Clyybber> disruptek: mornin fella
07:23:35*ng0 quit (Ping timeout: 265 seconds)
07:25:53FromDiscord<Clyybber> disruptek: Wait, so you are saying discard ObjWithRefField(refField: RefObj()) causes a leak?
07:26:01Araqdisruptek: yeah, I would have to refuse
07:27:40FromDiscord<Clyybber> Araq Sup
07:29:08FromDiscord<Clyybber> I was expecting the finalizer stuff to be much more difficult, but I also wasnt aware that newFinalize permanently overwrites the finalizer
07:29:19*marmotini_ quit (Read error: Connection reset by peer)
07:29:37*marmotini_ joined #nim
07:30:02*chenhq2005 joined #nim
07:39:58TangerWhat's the difference between genSym/bindSym and building a let/var definition with NimNodes/idents?
07:40:27TangerDoes it just affect the scope of the var?
07:41:01*another-user joined #nim
07:47:46*arecaceae quit (Remote host closed the connection)
07:48:10*arecaceae joined #nim
07:53:16*rokups joined #nim
07:55:19Zevvmorning people, nigtienight disruptek
07:55:25Tangero7
07:59:30*solitudesf- joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:09*gmpreussner joined #nim
08:26:36*JustASlacker joined #nim
08:31:44*ng0_ is now known as ng0
08:38:26*solitudesf- quit (Quit: Leaving)
08:38:47*solitudesf joined #nim
08:42:17*luis_ joined #nim
08:44:55*PMunch joined #nim
08:46:57*luis_ quit (Client Quit)
08:47:44*luis_ joined #nim
08:53:42*floppydh joined #nim
09:00:23*lxbarbos` quit (Remote host closed the connection)
09:01:22*lxbarbosa joined #nim
09:03:00*ng0 quit (Quit: leaving)
09:07:28*Vladar joined #nim
09:09:43*chenhq2005 quit (Ping timeout: 265 seconds)
09:11:44*Hideki_ joined #nim
09:16:43*Hideki_ quit (Ping timeout: 268 seconds)
09:27:17*luis_ quit (Quit: luis_)
09:38:05PMunchAh, AsyncHttpClient can only handle on request at a time.. That should probably be made more obvious from the documentation
09:38:47Araqnope, it's async
09:38:54Araqit can handle more than one
09:39:38PMunchYeah, you can have multiple AsyncHttpClients each creating their own requests that works asynchronously. But one client seems to only be able to handle a single request at a time.
09:40:29*krux02 joined #nim
09:40:47PMunchThis crashes horribly: http://ix.io/27my/nim. But this works fine: http://ix.io/27mz/nim
09:44:03PMunchHmm, it seems like it should be able to handle multiple, although in series: https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/httpclient.nim#L870-L874
09:57:13*lxbarbosa quit (Remote host closed the connection)
09:57:56*JustASlacker quit (Ping timeout: 248 seconds)
10:03:45PMunchSo it should be able to handle that case Araq? Or am I using it wrong?
10:07:25Araqduno, sory I'm busy
10:09:34*abcdefg joined #nim
10:09:36abcdefghi
10:09:42abcdefgwhich is better C or C++ ?
10:09:56AraqNim.
10:10:00PMunchIn general, or as a target for Nim?
10:10:44FromDiscord<gingerBill> Doesn't it highly depend on what you are using too with regards to external libraries?
10:10:45abcdefgin general
10:11:03FromDiscord<gingerBill> In general as in not related to Nim?
10:11:09*JustASlacker joined #nim
10:11:13abcdefgyes
10:11:58FromDiscord<gingerBill> Well it depends on loads of factors. "is a hammer better than screwdriver?"
10:12:09FromDiscord<gingerBill> "better" is ill-defined here.
10:12:15FromDiscord<gingerBill> Better for what?
10:12:20FromDiscord<gingerBill> Better compared to what?
10:12:40AraqC++ is better because it offers much more compile-time checking.
10:13:27abcdefgSome people said C is better for system development (kernel, compiler, and driver), but why ?
10:13:44AraqThese things have been discussed to death elsewhere and in the end, most CVEs are caused by C code or C-like code inside C++.
10:13:53FromDiscord<gingerBill> It's a complicated reason. C has less baggage by default.
10:14:15AraqNothing "complicated" in here, welcome to the age of science.
10:15:04FromDiscord<gingerBill> Hahaha
10:16:11abcdefgThere is also a language called "Rust"
10:16:12FromDiscord<gingerBill> I personally prefer C11 to C++ and actually would prefer using C to C++ on a large team. But culturally (and not just security reasons) C++ is more popular and preferred.
10:16:50abcdefgFromDiscord why C on a large team ?
10:17:53FromDiscord<Clyybber> disruptek: https://github.com/nim-lang/Nim/issues/13102 might be fixed
10:17:54disbotdouble free bug with arc, Result type, object refs, and iterators ; snippet at 12https://play.nim-lang.org/#ix=27kh
10:18:02FromDiscord<gingerBill> _For me personally_, if C++ was to be used, I would have to ban a lot of the features.
10:18:33abcdefgsuch as OOP
10:18:41FromDiscord<gingerBill> No.
10:19:03abcdefgOk
10:19:47FromDiscord<gingerBill> Ban list: C++ exceptions, RTTI, any of the stream stuff, most of the STL (I have custom stuff any way), multiple inheritance, most uses of single inheritance, `public/private`, minimize template use, minimize `constexpr` use, minimize operator overloading.
10:19:52FromDiscord<gingerBill> It's a longer list than that 😛
10:20:11FromDiscord<gingerBill> And the custom stuff is well tested but not public.
10:21:15FromDiscord<gingerBill> C++ is an old language with so many things in it that cannot go away.
10:21:24FromDiscord<gingerBill> Newer languages don't have these issues.
10:22:36abcdefgDo you think Rust will replace him ?
10:22:45*abm joined #nim
10:22:52FromDiscord<gingerBill> Replace? No. Alternative to? Maybe.
10:23:10FromDiscord<gingerBill> But I prefer Nim over Rust if I had to choose between those two.
10:23:24Araqthis is #nim btw
10:23:25FromDiscord<gingerBill> Otherwise I'd pick Odin 😛
10:23:36FromDiscord<gingerBill> Exactly.
10:23:41Araqnot "Odin's creator prefers C11", we know that.
10:23:49FromDiscord<gingerBill> Sorry about that.
10:23:57FromDiscord<gingerBill> I do have a question about Nim at any rate.
10:24:55abcdefgpleace stop
10:25:02abcdefgi'm not gingerbill
10:25:06abcdefgi'm abcdefg
10:25:17abcdefgI don't know who is gingerbill
10:25:20*voltist quit (Remote host closed the connection)
10:25:27FromDiscord<gingerBill> That would be me replying.
10:25:33FromDiscord<gingerBill> Does the discord bot not show names?
10:27:11FromDiscord<gingerBill> Araq: regarding the coro library, I know it is unstable but is it planned to be worked on more?
10:34:05FromDiscord<gingerBill> `coro` is really nice for its small size. But maybe I am wrong in that `{.async.}` is probably more of a better approach than the raw primitives
10:34:06abcdefgwhat are the best tips to make a program with zero vulnerabilties ?
10:35:57AraqgingerBill: with --gc:arc coro should be way more stable than it used to be
10:36:10FromDiscord<gingerBill> That's good to know!
10:36:18FromDiscord<gingerBill> I haven't toyed with the arc stuff yet.
10:36:19Araqbut the current plan is to delegate this feature to Nimble packages and only keep async+threadpool
10:36:46FromDiscord<Clyybber> abcdefg: Not have input :p
10:37:50abcdefgIs it true that some placed a backdoor inside Discord server ?
10:38:12Araqis it true that you're the one exploiting it?
10:38:44FromDiscord<gingerBill> Is it true that Discord is actually ran by a pixie in a yellow leotard orbiting around Jupiter?
10:39:46lqdev[m] what
10:40:49FromDiscord<Clyybber>  what
10:41:06*luis_ joined #nim
10:41:13FromDiscord<kodkuce> your CPU has backdoor
10:43:13FromDiscord<Clyybber> my house has a backdoor
10:43:57abcdefgat least you have a house
10:43:59FromDiscord<kodkuce> i dont have a house xD
10:45:11abcdefgwelcome to the club
10:46:32*marmotini_ quit (Remote host closed the connection)
10:49:28*marmotini_ joined #nim
10:49:48*abcdefg left #nim (#nim)
10:49:51FromDiscord<gingerBill> Araq: the reason for my original question what I was playing with `{.async.}`, `await`, `spawn` and `parallel`.
10:50:01FromDiscord<gingerBill> I'm liking the approaches.
10:53:05FromDiscord<mratsim> The `^` is a bit hard to search though, I use `sync` in my multithreading runtime
10:54:57FromDiscord<Clyybber> @timotheecour Did you read https://github.com/nim-lang/Nim/blob/devel/doc/destructors.rst ?
10:55:17FromDiscord<Clyybber> that might clear up the confusions in your issue
11:02:42lqdev[m]@Clyybber ah sorry, inserted a full-width space and that discord bridge can't handle that. lol
11:02:58FromDiscord<Clyybber> haha np, I just found the output kinda funny
11:04:04*luis_ quit (Quit: luis_)
11:04:33*luis_ joined #nim
11:09:02*JustASlacker quit (Ping timeout: 252 seconds)
11:09:04*luis_ quit (Client Quit)
11:12:01*another-user quit (Quit: WeeChat 2.7)
11:15:25*dddddd joined #nim
11:15:49*chenhq2005 joined #nim
11:19:42*theelous3 joined #nim
11:19:42*rockcavera joined #nim
11:21:57AraqClyybber: this idiom
11:22:20*NimBot joined #nim
11:22:25Araqis not handled well
11:22:30Araqand still produces =sink
11:23:21Araqand I've looked at much more code now, wasMoved+destroy is not as important to optimize as enforced inlining for trivial destructors
11:38:18*chenhq2005 quit (Ping timeout: 265 seconds)
11:40:08FromDiscord<mratsim> @Araq: thoughts - https://forum.nim-lang.org/t/5810 ?
11:40:08FromDiscord<mratsim> I do a lot of things between VM and runtime and I never was able to benefits from {.compileTime.} being usable at runtime because it has so many bugs. I always had to reassign.
11:40:08FromDiscord<mratsim> I'd rather have an {.addressable.} pragma or even something specialized like {.loc: rodata.} or {.loc: bss.} for the actual use case (taking addresses of const at runtime).
11:47:59Araqbugs are bugs, the design is the result of the older bugs
11:51:31FromDiscord<exelotl> @mratsim yes, we're very much in need of something like this
11:55:22FromDiscord<exelotl> in devel branch, the implicit constness of top-level `let` variables under certain conditions is neat for sure! But it's not enough, I still have to use {.emit.} for my constant data in the majority of cases.
12:03:18*ng0 joined #nim
12:04:16*NimBot joined #nim
12:07:47*chenhq2005 joined #nim
12:09:54*kungtotte quit (Read error: Connection reset by peer)
12:10:30*kahiru quit (Ping timeout: 260 seconds)
12:11:52*kahiru joined #nim
12:13:47*kungtotte joined #nim
12:14:36Araqhttps://www.youtube.com/watch?v=r76ZjdzFExg offtopic but very interesting
12:29:47Zevvwhy the sunglasses though
12:45:46*chenhq2005 quit (Ping timeout: 265 seconds)
12:47:50Araqcould be for medical reasons
12:48:08*NimBot joined #nim
12:53:00*rokups quit (Quit: Connection closed for inactivity)
12:53:27*krux02 quit (Remote host closed the connection)
12:58:31Zevvtrue
13:03:33FromDiscord<gingerBill> Or maybe he wants to look cool?
13:03:34FromDiscord<gingerBill> And why not?!
13:06:50PMunchMet a girl once who was walking around with sunglasses inside. No-one wanted to ask her why, because they thought she might just be a bit eccentric. But after a couple of days I decided I'd ask, and it turns out she had just lost her regular glasses and these were prescription sunglasses :P
13:12:33*Vladar quit (Quit: Leaving)
13:16:30*lritter joined #nim
13:22:52*krux02 joined #nim
13:24:15*chenhq2005 joined #nim
13:33:17*Hideki_ joined #nim
13:38:10*chenhq2005 quit (Ping timeout: 265 seconds)
13:40:22PMunchHmm, interesting limitation of nimsuggest/nimlsp. It doesn't handle case/underscore insensitivity..
13:40:47Araq:-) nimsuggest does understand it, I think
13:41:04PMunchI'm using a library that's in snake_case in the customary Nim camelCase and trying to get suggestions doesn't work if I don't use snake_case
13:41:05AraqI mean, it's just the compiler as a library and the compiler understands it
13:41:28Araqmaybe it's in some filtering step
13:45:00PMunchOh interesting, I see it in the LSP logs
13:45:12PMunchSo it seems like it is the vim LSP plug-in that stops it..
13:49:11*chenhq2005 joined #nim
13:49:38FromGitter<alehander92> wow i worked in one office with this guy
13:49:44FromGitter<alehander92> he was in the dart team
13:50:28AraqI met him at Strange Loop once iirc
13:50:28FromGitter<alehander92> iirc he did seem as a vm expert
13:50:30shashlickPMunch I've noticed that with nvim.nim
13:54:48*nsf quit (Quit: WeeChat 2.7)
13:56:20FromGitter<alehander92> interesting.
13:56:28FromGitter<alehander92> did you guys finish your fosdem talks
13:57:10FromGitter<alehander92> or you gonna start preparing them on feb 2 22:35
13:57:30Araqer
13:57:41Araqis fosdem earlier than I remember?
13:58:13Araquh oh
13:58:13FromGitter<alehander92> it seems its earlier than i do
13:58:16FromGitter<alehander92> 1 2 feb
13:58:21Araqindeed
13:58:53FromGitter<alehander92> dont you have a ticket or something Araq :P
13:59:24Araqtime to book a hotel...
14:00:07*WilhelmVonWeiner quit (Ping timeout: 258 seconds)
14:00:08FromGitter<alehander92> ah i miss eating very expensive hamburgers with you guys and listening about bojack horseman
14:00:20*chenhq2005 quit (Quit: No Ping reply in 180 seconds.)
14:00:35Araqlol yeah it was nice
14:00:44krux02let
14:00:53krux02ups
14:01:15FromGitter<alehander92> see you on nimconf tho
14:01:38PMunchVery expensive hamburgers?
14:01:44*chenhq2005 joined #nim
14:01:58PMunchAnd yeah, FOSDEM is first weekend of February
14:02:12PMunchAnd no, I haven't started writing my talk yet
14:02:25PMunchI have a plan for what I'm going to talk about though
14:02:33krux02PMunch: what are you going to talk about?
14:02:42FromGitter<alehander92> well, they were just a bit expensive, i am used to 2 eur hamburgers in bulgaria :P
14:03:13PMunchTha talk is on how Nim can be compiled to run on anything, from tiny Arduino boards, to web-browsers and supercomputers
14:03:17FromGitter<alehander92> yeah PMunch from you i remember only very high level lobster cuisine
14:03:29krux02Brussel is expensive
14:03:47PMunchHaha, coming from Norway nothing is expensive :P
14:03:48krux02I ate Crocodile last year
14:03:58PMunchBecause everything here is so expensive :(
14:03:58FromGitter<alehander92> and african adventures good enough for a louis de finesse comedy
14:04:17krux02PMunch, have you been to Zürich?
14:04:26PMunchOnly briefly
14:04:33krux02that is expensive.
14:04:54FromGitter<alehander92> i think norway is even more expensive
14:04:57PMunchYeah, I remember none of us wanting to buy anything there because the prices were about the same as back home :P
14:05:14krux02I think I paid around 3 Francs for a small single non special ball of ice cream
14:05:14FromGitter<alehander92> what is crocodile
14:05:56livcdexpensive countries are becoming kinda repulsive to me
14:06:00livcdeven considering the benefits
14:06:08krux02this reptiloid thing that normally eats other animals
14:06:11livcd(infrastructure,healthcare,opportunities etc)
14:06:12PMunchAccording to the big mac index it's about the same price in Norway and Switzerland: https://upload.wikimedia.org/wikipedia/commons/9/9b/Big_Mac_index_50USD_2columns.png
14:06:27PMunchalehander92, an animal?
14:06:40PMunchlivcd, how so?
14:06:42Araqshashlick, https://github.com/nim-lang/Nim/pull/13142
14:06:42FromGitter<alehander92> you literally ate crocodile
14:06:43disbotfixes #13104 [backport]
14:06:50FromGitter<alehander92> ugh
14:06:54Araqdo I merge this and then we check the nightly builds?
14:07:00*floppydh quit (Quit: WeeChat 2.7)
14:07:09FromGitter<alehander92> i guess it should be ok
14:07:12PMunchHmm, is the colour of the "fixes #" text the same as the highlight for anyone else?
14:07:24krux02yea, it was an experience, I don't need it again (to eat crocodile)
14:07:38livcdPMunch: -> offtopic
14:08:35FromGitter<alehander92> good thing i overate on the waffle thing
14:08:38FromGitter<alehander92> instead
14:08:47krux02PMunch, I don't have a talk on Nim, but if you need help or feedback, i am very open to help.
14:09:01krux02I mean with the talk
14:10:14PMunchThanks, I'll let you know when I have something written down :)
14:12:48shashlickAraq: I'll check the zip and let you know how it goes
14:13:01*krux02_ joined #nim
14:13:11Araqshashlick, can you check the zip before I merged it though?
14:13:24AraqI think we have no nightlies for PRs
14:14:10shashlickyes I checked various zips across multiple releases
14:14:20shashlicklatest 1.0.4 to 0.20.2 and 0.19.6
14:15:03FromGitter<alehander92> when 1.0.6
14:16:43*Araq merged the PR
14:17:08disruptekclyybber: now that i finally understand it, you fixed it?
14:18:45FromDiscord<Clyybber> disruptek: nevermind, false alarm
14:19:15FromDiscord<Clyybber> someone commented on one of araqs prs that it would fix it, but it didn't and I can't find the comment anymore
14:19:23FromDiscord<Clyybber> maybe I was dreaming
14:19:36shashlickAraq: tools/nim-gdb.py is present in the archives, it is bin/nim-gdb that's missing
14:19:37FromDiscord<Clyybber> alehander92: the animal, not the drug :p
14:19:57FromDiscord<Clyybber> I hope
14:20:49narimiran @alehander92 i hope to have 1.0.6-beta ready this week
14:21:05disruptekbug remains. but that just means i may have a shot at fixing it. 😄
14:21:40disruptekarc is way simpler than i expected. it gives me lots of ideas for ways to optimize allocation.
14:22:29disruptekcoffee first, though.
14:23:15*hlavaty joined #nim
14:24:09Araqshashlick, bummer
14:24:16shashlickquestion: is there interest in having musl-gcc as a tested backend for Nim
14:25:03shashlickand is there value in making it the default backend eventually
14:26:21shashlickAraq: sorry, I should have been more accurate in issue description
14:26:34FromDiscord<Clyybber> shashlick: IMO, yes
14:27:22shashlickokay am going to start testing whether Nim can be built and tested with musl-gcc in the first place
14:27:38*Vladar joined #nim
14:27:38FromDiscord<Clyybber> wdym with musl-gcc tho?
14:27:43FromDiscord<Clyybber> do you just mean gcc
14:27:48FromDiscord<Clyybber> and musl instead of glibc?
14:29:36FromDiscord<Clyybber> disregard that
14:29:53shashlickhttp://musl.cc/ is very interesting
14:30:11shashlickhaving built-in cross-compile support would be cool
14:31:45shashlickonly thing is I don't see that they target osx
14:32:28disrupteki think leorize runs a gentoo/musl machine.
14:32:53disruptekAraq: so you say no for/else because it's just sugar, right?
14:33:05*chenhq2005 quit (Ping timeout: 258 seconds)
14:33:12Araqright
14:34:00FromGitter<alehander92> narimiran oh nice
14:34:06disruptekif i showed you a scenario where it resulted in more efficient code, you'd consider it?
14:34:07*Hideki_ quit (Ping timeout: 268 seconds)
14:34:10*floppydh joined #nim
14:34:13FromGitter<alehander92> yeah cross compiling is cool
14:34:41FromGitter<alehander92> i have to try and see my problems .. i found it hard to cross compile nim to i386 because i somehow confused my 386 packages install
14:34:49FromGitter<alehander92> should this be something very simple
14:35:42shashlickwell, all you really need to do is set `export CC=musl-gcc -static`
14:35:57shashlick@kaushalmodi did a bunch of work on this with his config.nims
14:36:15shashlickbut i'm wondering if we can make this the defacto and not depend on libc
14:36:37shashlickbut one problem is that all dependencies also need to be compiled this way
14:37:14FromGitter<alehander92> hmmm
14:37:21FromGitter<alehander92> i actually dont *need* libc
14:37:22disruptekyeah, for good reason.
14:37:35FromGitter<alehander92> as i want to cross compile to bare metal program for qemu
14:37:45FromGitter<alehander92> so i have my own "libc" stub
14:37:54shashlickwell, maybe not - if you link to a dep that uses libc, it should work as long as libc is present right?
14:38:28disruptekneed weak refs
14:38:30shashlickyep csources compiled with musl-gcc
14:38:52FromGitter<alehander92> no idea, my programs should really use only the "standalone" parts
14:43:17*drewr quit (Quit: ERC (IRC client for Emacs 26.3))
14:43:49shashlickokay koch builds
14:44:48shashlickbut koch doesn't have a way to set --gcc.exe, etc.
14:50:50*lesshaste joined #nim
14:50:57lesshastehi all
14:51:58FromDiscord<Clyybber> heh, now that scenario
14:52:04FromDiscord<Clyybber> I wonna see it
14:52:19FromDiscord<Clyybber> since I find while else to be exceptionally ambiguous
14:53:01*vesper quit (Ping timeout: 258 seconds)
14:53:14*vesper11 joined #nim
15:00:11*luis_ joined #nim
15:00:15FromGitter<kaushalmodi> shasklick: ⏎ ⏎ > is there interest in having musl-gcc as a tested backend for Nim ⏎ ⏎ Yes! [https://gitter.im/nim-lang/Nim?at=5e1dd77fdbacf55b3d06f1a8]
15:01:32shashlickokay looks like bootstrap fails
15:02:16shashlickundefined references to `___memcpy_chk_`
15:03:03shashlicksprintf_chk and longjmp_check
15:03:30disruptekclyybber: it's an additional scope, you know.
15:04:16*drewr joined #nim
15:06:59*PMunch quit (Quit: Leaving)
15:10:00lesshastewhat's the status of loop vectorization in nim?
15:11:09FromDiscord<mratsim> what do you want to do/know?
15:11:53FromDiscord<mratsim> it's basically the same as GCC/Clang though you can easily vectorize manually as well
15:13:31*npgm quit (Remote host closed the connection)
15:13:31*LyndsySimon quit (Remote host closed the connection)
15:13:31*d10n-work quit (Remote host closed the connection)
15:14:04*ng0_ joined #nim
15:14:44disruptekclyybber: what was the idea behind having normal/sinkArg modes?
15:15:11FromDiscord<mratsim> I have a vectorization template here: https://github.com/numforge/laser/blob/master/laser/lux_compiler/backend/legacy/lux_codegen_transfo.nim#L244-L281 (and a tentative vectorization pass in a linear algebra/HPC/Deep Learning compiler)
15:15:31disruptekis it just an artifact of refactoring?
15:17:10*ng0 quit (Ping timeout: 258 seconds)
15:18:00*LyndsySimon joined #nim
15:18:20*npgm joined #nim
15:18:36*d10n-work joined #nim
15:20:05*krux02_ quit (Remote host closed the connection)
15:20:06Araqdisruptek, well sinkArg means "passed to a sink parameter"
15:20:14Araqand normal means "normal"
15:20:24shashlickokay got nim compiled but setting `gcc.options.linker = "-static"` doesn't work
15:20:37disruptekyeah, i get it. but this proc could be broken up; it's just if ... else ... iirc
15:20:43shashlickhad to manually `--passL:-static`
15:21:20disruptekwhy aren't obj constructors processed by handleNested?
15:24:36Araqbecause.
15:24:54Araqwhat bug are you trying to fix, disruptek ?
15:26:54disruptekyield foo(discriminator: ..., objref: ...) is destroying objref twice.
15:27:20disruptekobjref is from the enclosing scope.
15:27:46Araqis it a .closure iterator?
15:27:53disrupteknah.
15:28:00Araqhmm ok
15:33:31disruptekmakes sense, right?
15:33:39FromDiscord<Clyybber> disruptek: handleNested handles the boring recursion
15:33:48FromDiscord<Clyybber> in stmtlists and such
15:34:22FromDiscord<Clyybber> disruptek: Does it work when you make the return type lent?
15:35:04disruptekno.
15:36:56FromDiscord<Clyybber> actually destroying objref shouldn't hurt
15:37:02FromDiscord<Clyybber> because its refcounted
15:37:41FromDiscord<Clyybber> It shouldn't double free because of that
15:40:59disruptekbugs begin in the unfortunately state of implemented.
15:42:17disruptekthe way it works is, if we sink foo(), we destroy foo.objref.
15:43:23*krux02 quit (Remote host closed the connection)
15:44:00*Kaivo joined #nim
15:44:16*krux02 joined #nim
15:45:11FromDiscord<Clyybber> what?
15:45:19FromDiscord<Clyybber> only if we sink to foo.objref
15:45:49FromDiscord<Clyybber> is the code to reproduce the same as in your issue?
15:45:59FromDiscord<Clyybber> and if so which snippet, the first or the second?
15:46:46disrupteklet us look at exactly the same code.
15:46:48disruptekone sec.
15:46:53FromDiscord<Clyybber> k thx
15:47:34*Pqzcih5- joined #nim
15:47:37disruptekhttp://ix.io/27o0/nim
15:47:42*ng0_ is now known as ng0
15:48:27*LyndsySimon quit (Remote host closed the connection)
15:48:27*npgm quit (Remote host closed the connection)
15:48:27*d10n-work quit (Remote host closed the connection)
15:50:12disrupteki think the logic re: C(x) in the comment might be flawed.
15:50:32*dcmertens joined #nim
15:52:18*LyndsySimon joined #nim
15:52:34*npgm joined #nim
15:52:46*d10n-work joined #nim
16:02:21leorizeshashlick: to be fair if you wanna test musl just load up an alpine linux docker image
16:02:27leorizecross compiling is never pleasant
16:03:31disruptekclyybber: is it a race?
16:07:23FromDiscord<Clyybber> I don't think so, there is no threading involved
16:07:50FromDiscord<Clyybber> I suspect its got to do with extracting loop vars
16:08:40disrupteki think there's a flaw that loop vars don't demonstrate but it's not because they get an extra sink.
16:08:52disrupteki mean, it is, but that's not the solution.
16:10:48*floppydh quit (Quit: WeeChat 2.7)
16:11:47*luis_ quit (Quit: luis_)
16:14:42FromDiscord<Rika> ok so why do all `var {Table types}` have a ````[]\```` that returns a var K, EXCEPT FOR COUNTTABLE WHICH HAS IT NAMED `mget`???
16:14:52FromDiscord<Rika> ah yes, great discord formatting
16:15:23*xet7 quit (Remote host closed the connection)
16:15:36disruptekmget is the right name, it just should be aliased.
16:16:31*xet7 joined #nim
16:16:40disruptekmaybe it's because you cannot modify the counttable key's value.
16:17:06disruptekdunno why you'd have mget, though.
16:17:58FromDiscord<Rika> > you cannot modify the counttable key's value
16:17:58FromDiscord<Rika> ?
16:18:24FromDiscord<Rika> why would you have mget then?
16:18:58disruptekinsightful question.
16:20:48*Vladar quit (Quit: Leaving)
16:23:29*krux02_ joined #nim
16:24:23*smitop joined #nim
16:24:37lqdev[m]PMunch: could you make it so that the playground's text field is focused when you open the page? right now you have to press tab 6 times to focus it, or use your mouse, which is annoying.
16:25:44FromDiscord<Rika> ~~while you're at it, can you put auto indent, and suggestions, and...~~
16:25:45disbotno footnotes for `~while`. 🙁
16:26:04FromDiscord<Rika> make disbot ignore double tilde when
16:26:23*lxbarbosa joined #nim
16:26:49lqdev[m]Rika: the playground does have auto indentation. it's kinda glitchy when you're declaring types, tho
16:27:18disruptekrika: you're the only person who has ever typed ~~.
16:27:42lqdev[m]disruptek: discord's markdown subset uses ~~ for strikethrough.
16:27:45FromDiscord<Rika> discord and
16:27:46FromDiscord<Rika> yeah
16:28:29*krux02 quit (Remote host closed the connection)
16:29:18*krux02 joined #nim
16:30:12disruptek~~testicles~~
16:30:24disruptek~testes~
16:30:24disbotno footnotes for `testes~`. 🙁
16:30:33disruptek~motd
16:30:34disbotmotd: 11nim isn't winning, and it's not because it's technically inferior. -- disruptek
16:30:39Zevvenjoying yourselves, no?
16:30:53*Hideki_ joined #nim
16:33:57disruptekwe could be.
16:34:27disruptekif you'd let me make nimci.
16:34:49disrupteknimchi
16:35:35*Hideki_ quit (Ping timeout: 272 seconds)
16:37:37shashlick@leorize I'm not sure where I'm going with it honestly - for starters, I think a -d:musl built in would be nice
16:39:09shashlickwhether ther'e's value in carrying various musl binaries in the nim repo is the next question so that it just works
16:39:43shashlickand --os and --cpu flags do what you'd expect
16:41:00*lxbarbosa quit (Remote host closed the connection)
16:48:43FromDiscord<Rika> ah yes, testing in prod
16:50:25disruptekclyybber: you know what it is?
16:51:08disruptekthe eqsink for R() runs the same code twice.
16:51:51disruptekso it decs the ref twice, causing a double free.
16:52:29FromDiscord<Clyybber> hmm, I will debug it later
16:53:13FromDiscord<Clyybber> disruptek: Btw, you can do ./koch temp -d:toDebug=things to see things cfg
16:53:30disruptekyeah, i have a better test setup now.
16:53:38FromDiscord<Clyybber> ~disbot is stupid~
16:53:39disbotdisbot: 11stupid~
16:53:53FromDiscord<Clyybber> apparently I am too
16:53:59disruptekbut, i always look at diffs, so i was missing what wasn't changing -- broken c.
16:54:07*marmotini_ quit (Remote host closed the connection)
16:54:28disruptekprolly just a little c+p buglet.
16:54:43*marmotini_ joined #nim
16:54:51FromDiscord<Clyybber> could be, its probably liftdestructors or injectdestructors
16:55:11FromDiscord<Clyybber> ~~disbot is stupid~~
16:56:04*joshbaptiste quit (Quit: WeeChat 1.6)
16:56:10Pqzcih5-Hello guys
16:56:13*joshbaptiste joined #nim
16:56:22disrupteksup dawg
16:57:42*luis_ joined #nim
16:57:58*Pqzcih5- quit (Quit: ZNC 1.7.5 - https://znc.in)
16:58:12*Pqzcih5 joined #nim
16:58:38disruptek~clyybber
16:58:38disbotclyybber: 11a dick
16:58:39disbotclyybber: 11looks like a fish but smells like a weasel. -- disruptek
17:01:51*marmotini_ quit (Remote host closed the connection)
17:02:08*marmotini_ joined #nim
17:04:55*marmotini_ quit (Remote host closed the connection)
17:05:30*marmotini_ joined #nim
17:11:33*marmotini_ quit (Ping timeout: 268 seconds)
17:12:16*Trustable joined #nim
17:19:03*luis_ quit (Quit: luis_)
17:19:54*luis_ joined #nim
17:21:48*hlavaty quit (Remote host closed the connection)
17:24:19*luis_ quit (Client Quit)
17:41:04Araqdisruptek, can you please stick to a minimum of professional behaviour
17:41:20disruptekhey, i didn't write that.
17:41:53Araqbut you wrote disbot
17:42:26disrupteki have to censor the use of my software?
17:42:48disruptekdisbot: ignore clyybber
17:42:48disboton it. 👍
17:43:32disruptekit's a codegen bug, this thing. amazing.
17:43:33leorizei'm pretty sure clyybber added the first note themselves :P
17:43:43disruptekyou can confirm here:
17:43:44disruptek~data
17:43:44disbotdata: 11disbot databases are at https://github.com/disruptek/disbot -- disruptek
17:44:39disruptekhttps://github.com/disruptek/disbot/blob/master/footnotes.json#L143
17:45:00shashlickwhich is why it should be possible to remove footnotes
17:45:02disrupteki'm still tracking down where we actually compose eqsink calls.
17:45:29Araqok well yes, censor the database
17:45:31disruptekshashlick: you can pr your edits right from the website.
17:45:52leorizemaybe you can implement a command for channel ops to remove footnotes :P
17:47:29shashlickhttp://musl.cc is blocked from work, ugh
17:48:37disruptek~clyybber is [redacted]
17:48:38disbotclyybber: 11[redacted]
17:48:44FromDiscord<Clyybber> nice
17:49:13leorizesince docker exists nowadays people just use it instead of actual cross compiling :P
17:49:28AraqClyybber: what do you think of this idea
17:50:51Araqdef x; *use; def x.field;
17:51:09Araq--> produce nkFastAsgn for x.field and no =sink
17:51:33*marmotini_ joined #nim
17:51:36Araq*use here stands for an arbitrary number of use instructions that do not access 'x'
17:51:56FromDiscord<Clyybber> But then x.field will not get destroyed?
17:52:11disruptekthe problem is that hasDestructed needs to fail, so you need to remove tfHasAsgn
17:52:32AraqClyybber: we know it's empty
17:52:38Araqbecause of the 'def x'
17:52:49FromDiscord<Clyybber> But def x means the opposite no?
17:52:58Araqhuh?
17:53:15FromDiscord<Clyybber> def x could set x.field to some object that needs destruction
17:53:33Araqnah
17:53:36Araqhow so?
17:53:50FromDiscord<Clyybber> x = Obj(field: SomeObj() )
17:53:59FromDiscord<Clyybber> Maybe I'm misunderstanding
17:54:16Araqer yeah
17:54:18disruptekwe can get away with exposing field, we just can't get away with also destroying it.
17:54:28AraqI mean
17:54:32AraqstrongDef x
17:54:47Araqwhich would be new
17:54:55FromDiscord<Clyybber> Ah, what would it entail?
17:55:10Araqx = ObjConstr() # strongDef x
17:55:15Araqnew(x) # strongDef x
17:55:39Araqhmmm
17:55:51FromDiscord<Clyybber> Ah, sure. I don't think we need a new dfa instr for that, but I see what you mean
17:56:07FromDiscord<Clyybber> basically add field level information to object initialization/creation
17:56:18FromDiscord<Clyybber> for the dfa to use
17:56:44disruptekseems easier to just leak by default and then strongdef when required, but i guess that could be confusing for the user.
17:56:51FromDiscord<Clyybber> He
17:56:52FromDiscord<Clyybber> no
17:56:56Araqthat's not what I had in mind
17:57:01Araqbut maybe you're right
17:57:06Araqand it is what we need.
17:57:21disrupteki dunno, i think it will seem magical to the user.
17:57:32disruptekie. too hard to reason about.
17:57:58Araqdon't be silly, let an optimizer do its job
17:58:10Araqeverything an optimizer does can be "hard to reason about"
17:58:27Araqyet I enjoy using optimizers
17:58:32disruptekwhat i mean is, you will be able to get away with a lot until some day you cannot.
17:58:40disruptekand you'll be confused as to why, maybe.
17:59:47disrupteki guess i'm wrong; it's just a matter of perspective.
18:00:32disruptekwe used to have a rule on my MUD: "if you can do it, it's legal." ie. exploits are legal.
18:00:36disruptekthis is just more of that.
18:01:17disruptekzero sum game theory between us and the user. we want to fight them as hard as possible to a draw, with the maximal amount of resources consumed.
18:02:43AraqI'm not following you. I view it this way: It's the compiler's job to make "idiomatic" code as fast as possible, everytime you have to use 'addr' and 'ptr' and it's not for C interop, the Nim compiler failed to do its job
18:03:06Araqof course, it's only a tool and sometimes the rules must be broken
18:03:21Araqbut as a design guideline it's useful
18:03:25disruptekright, but the "rule" is merely that we don't let you shoot yourself in the head.
18:04:04FromDiscord<Clyybber> disruptek: Handwavy general rules don't really apply here, either its right and won't cause issues or its not and will
18:05:11Araqso ... yield, do we have an example to reproduce the problem?
18:05:37disrupteki can show you the bad codegen, or you can start with the nim.
18:05:57disrupteki'm enjoying learning the compiler, though, if you'd prefer me to fix it.
18:06:31disrupteki think there are rules in here that maybe don't need to exist; that's all i'm saying about headshots.
18:07:53FromDiscord<Clyybber> Araq: disruptek sent it previously: http://ix.io/27o0
18:08:03FromDiscord<demotomohiro> I think I found a typo in https://github.com/nim-lang/Nim/blob/devel/doc/destructors.rst#swap
18:08:03FromDiscord<demotomohiro> Isn't it should be "``swap(a, b)`` is **not** implemented as ``let tmp = move(b); b = move(a); a = move(tmp)``"?
18:08:17Araqexactly
18:08:28Araqswap is a primitive not based on moves
18:08:43Araqbecuase the way C++ does it is most silly
18:09:02Araqhey wait
18:09:07Araqthe document says **not**
18:09:19Araqso the document is correct.
18:11:06FromDiscord<demotomohiro> I think you want to say "``let tmp = move(b); b = move(a); a = move(tmp)``, not "``let tmp = move(a); b = move(a); a = move(tmp)``"?
18:11:48Araqoh yeah
18:11:53Araqok
18:12:09FromDiscord<demotomohiro> I will send PR to fix it
18:12:19Araqthanks!
18:13:04disruptekjust look at this generated eqsink: N_LIB_PRIVATE N_NIMCALL(void, eqsink___sP7qTDFBoQf6OcbX1LEeWQ)(tyObject_R__7OQxUuBK120 N_LIB_PRIVATE N_NIMCALL(void, eqsink___sP7qTDFBoQf6OcbX1LEeWQ)(tyObject_R__7OQxUuBK DK7hE0YBjDJ80Q* dest, tyObject_R__7OQxUuBKDK7hE0YBjDJ80Q src)
18:14:22Araqbtw please do not use things like 'defined(crashme)'
18:14:30disruptekvariant object (not a ref) is destroying dest before and after setting the discriminant.
18:14:33disruptekno?
18:14:39Araqit always slows me down, just write the variant that crashes
18:15:00AraqI'll tinker with it on my own
18:15:09disruptekokay; i'm running the same code through two paths and comparing the output, hence the pattern.
18:15:22disruptekie. valgrind with/without.
18:15:41*another-user joined #nim
18:15:45another-userhi
18:15:54disruptekhello
18:17:05disruptekboth versions are broken, btw; it's just that the non-crashme variety covers its tracks better.
18:17:26another-userwhat advantage case object has compared to rust enums where you can have structs in each variant maintaining compile time type safety?
18:18:03disruptekvariant objects achieve compile-time type safety.
18:19:03Araqgood question, another-user. variant objects are more flexible but also more error prone, however there is a warning to get on par with Rust. iirc --warning[ProveFieldAccess]:on
18:20:07Araqcorrection: --warning:proveField:on
18:20:57Zevvis `./testament/tester all` expected to run clean on any system?
18:21:03another-userAraq: oh, didn't know that, thanks for pointing that out!
18:21:48AraqZevv, dunno, it's expected to work on my machines and on the CIs
18:22:30Zevvfair enough
18:22:42FromDiscord<Clyybber> Zevv: Nope
18:22:49FromDiscord<Clyybber> you need nodejs for example
18:22:58FromDiscord<Clyybber> and probably some other stuff too
18:23:06FromDiscord<Clyybber> and some stuff relies on the .cache location I think
18:23:14disrupteksounds awesome.
18:23:39disruptektell me again that you're happy with this. 😁
18:23:44ZevvI get tons of Failure: reNimcCrash
18:23:55Zevvdisruptek: yeah yeah I was on my 'bad idea' chair, remember?
18:24:10disruptekbut seriously, see what's good about testament.
18:24:26disrupteki think we make one tool that consumes unittest and testament tests and then we unify.
18:24:42donpdonp"{repr object}" -> ref 0xabcd -> (object details) is fine but I want to print only the address. "{unsafeAddr object}" is a ptr which doesnt print with {}. how can I get just the address?
18:24:52Zevvat this moment I just wnant to know what I broke and what still works without having to go through CI, I guess
18:25:11disruptekwhat a strange goal.
18:26:01blackbeard420donpdonp cast the ptr to a int to get the address?
18:26:02Zevvaraq, he's doing it again...
18:27:45donpdonpblackbeard420: that works thx
18:27:52lqdev[m]donpdonp: `cast[int](myPointer).toHex`
18:28:38*dcmertens quit (Ping timeout: 268 seconds)
18:30:18disruptekdon't send me to timeout.
18:30:55Zevvbut seariously, I used testament etc some time ago for these vm registers and that was ok, and now I get cruft.
18:30:58*Zevv starts digging
18:31:20AraqZevv, if you are on devel you need to recompile testament
18:31:31Zevvoh right
18:31:35Zevvdidn't realize that
18:31:38Araqreason? testament relies on SuccessX messsages and their format was changed
18:31:54Araqhow do I know? because the same happened to me :P
18:32:23Zevvyeah that was it
18:32:23Zevvthanks
18:41:30another-userAraq: could you please point me at documentation for proveField? can't find in https://nim-lang.org/docs/nimc.html#compiler-usage-list-of-warnings
18:46:37*samuel1 joined #nim
18:46:56*samuel1 left #nim (#nim)
18:48:53Araqapparently it's missing (huH?) so you have to trust my word
18:49:51disruptekwell, it doesn't work with var returns.
18:50:13disruptekhttps://github.com/nim-lang/Nim/issues/13102#issuecomment-574318075
18:50:14disbotdouble free bug with arc, Result type, object refs, and iterators ; snippet at 12https://play.nim-lang.org/#ix=27kh
18:53:11another-userAraq: i see, just wanted to read about its limitations/how does it work/etc
18:53:30Araqdisruptek, I put the top level statement inside a 'main' and compiled it via
18:53:33shashlickmusl is great until you get to ssl support
18:53:51Araqkoch temp -d:toDebug=main c --gc:arc -r temp.nim
18:54:44Araqand sometimes inspecting what -d:toDebug lists is good enough and easier to read than the C code
18:54:56disruptekyeah, i find both helpful.
18:55:36disruptekwhat was the result of your test?
18:56:05disruptekah, that works fine.
18:56:11shashlicki can create a static musl enabled choosenim which will work on any Linux including Alpine but then will have to statically link openssl
18:56:24disruptekfine.
18:56:47shashlickthis can then be extended to arm and others, but now it will carry its own copy of ssl
18:56:48disruptekwho cares? you're already giving them a binary, right?
18:57:46shashlickhttps://news.ycombinator.com/item?id=18055337
18:58:47disruptekirrelevant, to my eye.
18:58:56disruptekmore important to have working software.
18:59:31leorize[m]can't have security issues if it doesn't work :p
18:59:41shashlickstep 0
19:00:17shashlickso is there value in spending more time enabling a musl based choosenim - how many Alpine and other musl based distro customers do we have
19:00:19leorize[m]statically linking openssl is never a good thing :p
19:01:01Araqmore importantly, how many Linux users on fringe distros expect working software? ffs
19:01:19leorize[m]do you want a musl-based choosenim? I can build it for you :p
19:01:32disrupteki just want it to work.
19:01:34Araqwe should charge money for it
19:01:57shashlick@leorize - i need to push some fixes to nimarchive to support it
19:02:02shashlickbut will be great if you can try it out
19:02:14leorize[m]uhmm, no?
19:02:19disruptekhe has a musl system now.
19:02:25disruptekhe'll just email it to you.
19:02:28leorize[m]it works perfectly on native musl system
19:02:38shashlickokay give it a try then
19:02:42disrupteklol
19:02:54disruptekshashlick: put shashlick's sister on.
19:02:58shashlicktry building choosenim@#head
19:05:51another-userAraq: how does it prove field usage correctness? trying to see if it works but in this example https://play.nim-lang.org/#ix=27pe when compiling with --warning:proveField:on it always emits warning
19:05:53leorizeError: cannot open file: nimterop/docs
19:05:59leorizebuilding nimarchive :P
19:06:15disruptekanother new victim to the ecosystem.
19:06:43Araqanother-user, it's tied to 'case' statements
19:07:21FromDiscord<Clyybber> Its also not very smart currently, but I have a PR that improves it
19:07:36leorizeshashlick: lol I can't even build nimterop@#head
19:07:50shashlick@leorize what's the issue
19:07:56AraqClyybber, disruptek what does valgrind say
19:08:07AraqI'm staring at the code and everything looks ok
19:08:08another-userAraq: i thought so too at first but it behaves the same way even with case - https://play.nim-lang.org/#ix=27ph
19:08:17FromDiscord<Clyybber> Didn't yet investigate, I'm about to finish the new analysis thing
19:08:21disruptekAraq: well, take it out of main.
19:08:32disruptekdid you see the c i posted?
19:08:40Araqwhy? it crashes inside main too
19:08:47disruptekoh, not for me.
19:09:05leorizeanother-user: uhmm, your code is correct?
19:09:29Araqanother-user, might be caused by your 'var' parameter, it's been years since I wrote this
19:09:52leorizeshashlick: http://ix.io/27pi
19:09:54disruptekvar params don't work because we cannot prove them yet.
19:10:29another-userdisruptek, Araq: ah, i see
19:10:36*drewr` joined #nim
19:10:41disruptekunproven var returns exist in stdlib, too.
19:11:06leorize Building nimterop/nimterop/toast using c backend
19:11:08leorize Prompt: Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N]
19:11:11leorizereally helpful, nimble
19:11:40*FromGitter quit (Remote host closed the connection)
19:11:41leorizeadded --verbose and I still don't know what is wrong
19:11:43disruptekAraq: you think that c in the issue is okay?
19:11:49disrupteki think it's bogus.
19:11:58*FromGitter joined #nim
19:12:16leorizeshashlick: can I get some help on this? ^
19:12:16shashlick@leorize: do you have the latest regex package?
19:12:57leorizeregex 0.13.0 fwiw
19:13:07*drewr quit (Ping timeout: 260 seconds)
19:13:31leorizehow can I make nimble spew out the build log for me?
19:13:45shashlickjust try `nim c nimterop/toast`
19:13:45Araq--verbose
19:13:56leorize"Build failed" is just like MS's "An error has occured"
19:14:11disruptekjust run the nimph bootstrap. problem solved.
19:14:24Araqnimble hides you from the Nim compiler's complexities
19:14:32Araq*hides from you
19:14:51Araqthat's useful because Nimble's users are not Nim programmers
19:14:55Araqor something like that...
19:15:15leorizeadded verbose and still "Build failed"...
19:15:22leorizefine, I'll clone nimterop repo myself
19:15:23Araq--debug
19:15:28Araqtry --debug
19:15:48shashlicki've never tested on alpine so many bets are off
19:15:55Araqdisruptek, where do you think the bug is in the C code?
19:15:57leorizeI'm on gentoo/musl :P
19:16:08shashlickokay then even more luck
19:16:17disruptekwe are destroying dest field twice.
19:16:20shashlicki remember emerge from a decade ago
19:16:26leorizeshashlick: http://ix.io/27pn
19:16:37disruptekit's just simple duplication of the code.
19:17:15shashlickheh, that's like the issue I opened on windows - https://github.com/nim-lang/Nim/issues/12939
19:17:17disbotstdout cannot be reassigned on some systems ; snippet at 12https://play.nim-lang.org/#ix=253B
19:17:51Araqdisruptek, I'm blind
19:17:53disruptekthe two possibly-relevant qualities: it's a variant object, and it's a variant object that is not a ref.
19:18:43leorizeshashlick: please use reopen...
19:18:47leorizethat's the POSIX way to do it
19:19:04shashlickhow do you recover stdout after that
19:19:46shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/toast.nim#L172
19:20:32disruptekAraq: i overlooked it too many times to admit.
19:20:50disruptekit's just long enough to not fit in my diff context.
19:22:47AraqI don't see the double free
19:23:15*krux02 quit (Remote host closed the connection)
19:23:24another-useris it possible to enable all warnings/hints in nim.cfg without enumerating them all manually?
19:23:27AraqI mean, obviously it must be there, it crashes
19:23:30disruptekwe call devrefislast twice, so we can call the second destroy.
19:23:39disrupteknimDecRefIsLast()
19:23:54Araqwell it does reference counting
19:23:59*krux02_ quit (Remote host closed the connection)
19:24:04Araqso that's not immediately false
19:24:05shashlick@leorize - https://stackoverflow.com/questions/1908687/how-to-redirect-the-output-back-to-the-screen-after-freopenout-txt-a-stdo
19:24:10disruptekyes, but it shouldn't dec the field twice.
19:24:19shashlicklooks like glibc allows reassign but since you are using musl, it might not allow this
19:24:31shashlicksimilar to windows where it probably isn't allowed either
19:24:51leorizeyea looks like you can't
19:25:05leorizeposix don't require stdout to be a valid lvalue :(
19:25:21shashlickwell, it works fine on ubuntu and osx
19:25:38shashlickguess i have to write a template for echo to be redirected everywhere
19:26:10disruptekstdmsg()
19:27:45leorizeAraq: probably stdin/out/err shouldn't be assignable in Nim
19:28:03shashlickanyone has a working template for echo
19:28:28leorizeyou can just replace all echo with stdmsg.writeLine, no?
19:28:42Araqleorize, true.
19:28:50shashlickif flag, redirect to file else print to screen
19:29:38disrupteki do this in several places. works fine.
19:29:55disrupteki thought it was only picked up by android or switch or something, though.
19:30:10leorizeshashlick: template fecho(args: varargs[string, `$`]) =
19:30:17shashlickyep in the manual
19:31:14Araqdisruptek, er
19:31:29Araqnow I see it, easy bug
19:31:42Araqin eqsink___kd0fUYz9cI3tz3C2qfJviHw right?
19:31:46disruptekyeah
19:32:28Araqso that's a logical bug
19:32:34Araqin our liftdestructors.nim
19:35:42Araqcan't be hard to fix :P
19:41:43disrupteksame problem in `yield R(o: true, field: unit); yield R(o: false)`
19:58:33ozfor a moment, I read lifedestructors.nim :>
20:00:21disruptekyou won't like how it ends.
20:03:19*sschwarzer joined #nim
20:04:25sschwarzerYay, I'm coming to FOSDEM :-)
20:04:41sschwarzer(If nothing gets in the way)
20:07:47shashlick@leorize - i have a fix, you able to test?
20:08:23*another-user quit (Quit: WeeChat 2.7)
20:13:29*smitop quit (Quit: Connection closed for inactivity)
20:15:44sschwarzerJust (re)discovered the Nim programming live streams ( https://www.youtube.com/channel/UCAIXKsgiEkRjwlNgduABgmw/videos ). Araq, are you (or others) still interested in doing this? (Just curious, I didn't watch them so far)
20:16:13Yardanicoyou can always do them yourself :P
20:16:23Yardanicoand there are some other people who made youtube videos about Nim
20:16:42sschwarzerAlso noticed that there are two videos for live stream 3, but no parts 1, 2, 4 and 5.
20:17:01sschwarzerYardanico: That's an expected answer. :-) But no, I think I can't. :)
20:17:02YardanicoI think you'll enjoy https://www.youtube.com/playlist?list=PLXIivpcMlfwAevvA4IvLIiYOujqSuyyKY
20:17:16YardanicoIt contains just about all videos about Nim on youtube, maintained by libman
20:17:31Yardanicohe's not really active in nim community, but he still maintains this playlist :)
20:17:38sschwarzerYardanico: Yes, I found this in my search
20:17:57sschwarzerYardanico: He writes in the forum from time to time.
20:18:37sschwarzerMy "problem" is more that I should be writing Nim code instead of writing in the IRC channel. ;-/
20:25:57*Jesin joined #nim
20:32:38*Hideki_ joined #nim
20:35:20*lritter quit (Ping timeout: 258 seconds)
20:37:31*Hideki_ quit (Ping timeout: 268 seconds)
20:39:58*lritter joined #nim
20:42:30Araqsschwarzer, I need to upload the videos...
20:42:34lqdev[m]any reason for `getTypeImpl` not preserving the privacy of object fields? it just returns object fields no matter if they're private or not, without the export marker *
20:42:36Araqremind me again tomorrow please
20:43:13Araqlqdev[m], the getType set of APIs grew and have seen little design
20:43:38Araqlike much other stuff in macros.nim the goal was to see if it can be done at all
20:44:38lqdev[m]dang it. so the way I'd have to do it is to get the original type of the object, and check there?
20:44:51AraqPRs are welcome
20:45:03Araqsomehow expose the fact if it's public or not
20:45:22lqdev[m]I'd love to help, any tips on where can I start?
20:46:09lqdev[m]and, by "somehow" you mean without breaking existing code?
20:46:19Araqyes
20:46:47Araqvmdeps.mapTypeToAstX
20:46:56Araqhas most of the implementation
20:47:17lqdev[m]right
20:48:08Araqmaybe add a macros.isPublic(n)
20:48:53lqdev[m]yeah, I was thinking of something like that
20:49:57*narimiran quit (Ping timeout: 260 seconds)
20:52:23Araqdisruptek, this is harder than it looks
20:52:30disrupteki know.
20:52:32Araqneed to sleep over it
20:53:07Araqif the case branches do not change it's rather easy
20:53:19disruptekyes, well.. 🤣
20:53:30Araqbut if they do, you better destroy the old stuff
20:53:41disruptekthis is why i wanted sentinels.
20:54:38FromGitter<Varriount> Sentinels?
20:55:36disruptekit's a hack to get around a proper cfg.
20:56:00Araqwe have a "proper cfg"
20:56:17disruptekit's a hack to get around empropering an existing cfg.
20:56:55FromGitter<dumjyl> lqdev[m], Araq: isPublic already exists, its called is exported
20:57:03FromGitter<dumjyl> isExported
20:59:07shashlicklooks like no dom96 today
20:59:13Araqah ok
20:59:23Araqdidn't remember, thanks dumjyl
20:59:47Araqdisruptek, ok, have a fix
20:59:53disruptekyeah?
21:00:55Araqyeah but it only works for =sink I think
21:01:01disrupteki don't think the cfg is correct, but maybe that's separate.
21:02:06Araqwhat's the issue number?
21:02:22disruptek!issues author:disruptek
21:02:23disbothttps://github.com/nim-lang/Nim/issues/13105 -- 5codegen bug with arc
21:02:23disbothttps://github.com/nim-lang/Nim/issues/13102 -- 3double free bug with arc, Result type, object refs, and iterators
21:02:23disbothttps://github.com/nim-lang/Nim/issues/12945 -- 5mutable iterator cannot yield named tuples 7& 15 more...
21:04:27lqdev[m]@dumjyl thanks
21:04:51Araqhttps://github.com/nim-lang/Nim/pull/13151 check it for yourself
21:04:52disbotfixes #13102
21:05:02FromDiscord<Clyybber> Araq: This stuff is really tricky but really fun
21:05:09FromDiscord<Clyybber> I am working on making this work:
21:05:21FromDiscord<Clyybber> = n #lastread #justRead{n}
21:05:21FromDiscord<Clyybber> n.f = #firstwrite#justRead{n}, justWrote{n.f}
21:05:21FromDiscord<Clyybber> = n.f #lastread n = #firstwrite
21:05:35FromDiscord<Clyybber> Sorry hit enter too soon
21:05:55lqdev[m]Araq: out of pure curiosity, are the VM magics simply emitting the opcodes defined by the .magic pragma's value?
21:05:55Araqremember that we also need a 'recover' statement
21:06:10FromDiscord<Clyybber> ... = n #lastread
21:06:10FromDiscord<Clyybber> n.f = ... #firstwrite
21:06:10FromDiscord<Clyybber> ... = n.f #lastread
21:06:11FromDiscord<Clyybber> n = ... #firstwrite
21:06:39Araqlqdev[m], it depends on the magic and in general the mapping is not obvious
21:06:42FromDiscord<Clyybber> Araq: I don't think we do. It is equivalent to eliding refcounting for refs on the stack
21:07:00FromDiscord<Clyybber> Though, maybe we could extend the pony approach to runtime
21:07:10Araqno, I mean 'recover' to compute the 'owned ref' property
21:07:16Araqthen we can skip the runtime logic
21:07:21FromDiscord<Clyybber> Yeah, I know.
21:07:33Araqthe runtime logic is fun too though
21:07:43FromDiscord<Clyybber> Yep, maybe as a fallback
21:09:25Araqthis bug is concerning me, does it mean we need a =incRef ?
21:09:46disruptekit's pretty grisly.
21:09:47Araqwe need half of the assignment operation, tricky
21:10:27disruptekhonestly, we need the cfg to be right.
21:10:36FromDiscord<Clyybber> The cfg is probably right
21:10:46FromDiscord<Clyybber> But I didn't look at it yet :p
21:10:51disruptekit cannot tell me which branch we are in, so it's wrong.
21:10:58FromGitter<alehander92> there should be an easy way to visualize it
21:11:02FromGitter<alehander92> i guess there is tho
21:11:14FromDiscord<Clyybber> disruptek: WDYM it cannot tell what branch?
21:11:20FromDiscord<Clyybber> That its missing jumps?
21:11:29FromGitter<alehander92> is there something like dumpCfg (for a certain function)]
21:11:41disruptekcheck it yourself. even with ct constants, it doesn't know how to sever variant branches.
21:11:45Araqyes, there is, use -d:toDebug=procNameHere
21:11:50FromGitter<alehander92> i nice
21:11:52FromGitter<alehander92> ah*
21:12:06Araqdisruptek, the variant branches are inside the '=' and '=sink' operations
21:12:14Araqthe cfg doesn't care
21:12:29Araqand now let me sleep, see you tomorrow
21:12:31disrupteki know, but if the cfg cared, then we would know when we could elide some of that.
21:12:35FromDiscord<inv> Hello, can someone help with criterion package?
21:12:36FromDiscord<inv> I am doing ```nim
21:12:36FromDiscord<inv> import criterion
21:12:36FromDiscord<inv>
21:12:36disruptekgn
21:12:36FromDiscord<inv> var cfg = newDefaultConfig()
21:12:36FromDiscord<inv>
21:12:37FromDiscord<inv> benchmark cfg:
21:12:37FromDiscord<inv>
21:12:38FromDiscord<inv> proc t0() {.measure.} =
21:12:40FromDiscord<inv> var a = "Rust"
21:12:41FromDiscord<inv> var b = "Nim"
21:12:43FromDiscord<inv> doAssert a != b
21:12:44FromDiscord<inv>
21:12:45FromDiscord<inv> proc t1() {.measure.} =
21:12:47FromDiscord<inv> var a = "Rust"
21:12:48FromDiscord<inv> var b = "Nim"
21:12:49FromDiscord<inv> doAssert a > b
21:12:51FromDiscord<inv> ```
21:12:52FromDiscord<inv> compiles ok, but no output at all
21:13:02disruptekinv: submit issues to my criterion branch and i will fix them.
21:13:31disrupteki have some messy cleanup to do there, but it does work iirc.
21:13:47disrupteklemonboy is gone.
21:13:54zedeus:(
21:13:59Yardanicoi've seen him do some commits to Zig :P
21:14:04zedeustraitor
21:14:15FromDiscord<inv> Ah, sorry, someone showed screenshot from irc - it paste looks very bad.
21:14:23FromGitter<alehander92> a guy that loves langdesign <3
21:14:28Yardanicoah wait, lemonboy is already #2 in Zig contributors
21:14:30YardanicoxD
21:14:45FromDiscord<inv> disruptek, I just was not sure if I do it right - everything looks ok, except that I do not have output
21:17:25shashlickam working on https://github.com/dom96/choosenim/issues/28 for Windows
21:17:26disbotAsk the user whether they want Nim added to PATH
21:17:26*inv2004 joined #nim
21:17:35disruptekyou gotta blackBox what you want to measure.
21:17:36shashlickshould we check every time you run choosenim?
21:17:54disrupteki would just warn them if it's not in the path.
21:18:10shashlickor when we switch to another version
21:18:41FromGitter<matrixbot> `grantmwilliams` what is the most appropriate way to get get the tail of an openArray? that is [1,2,3] to just [2,3]?
21:19:08shashlick[1 .. ^1]
21:19:54inv2004dom96, can I force this ? https://github.com/nim-lang/nimble/pull/761
21:19:57disbotRun can work without additional option if only one bin in .nimble
21:22:51inv2004disruptek much better right now - thank you
21:23:01disruptekno problem.
21:26:26inv2004disruptek cannot understand - does it measure blackbox or {.measure.} . output looks like it is {.measure: ... } only
21:27:22disruptekblackBox triggers measurement, measure is the bit measured.
21:28:55inv2004on the main page example I see bench for fibN and fibN1 only, why not fib5 ?
21:29:29disruptekmain page example?
21:29:45inv2004https://github.com/LemonBoy/criterion.nim
21:29:54FromDiscord<Recruit_main_70007> When should I use proc, func or method?
21:30:24inv2004disruptek or this one probably: https://github.com/LemonBoy/criterion.nim/blob/master/tests/tfib.nim
21:30:38FromGitter<alehander92> if you need inheritance, `method`
21:30:46FromGitter<alehander92> otherwise if you can use `func`
21:30:51inv2004FromDiscord func == proc without sideeffects
21:31:15disruptekinv: there's a fib5 bench there..
21:31:15FromGitter<alehander92> but if your function has side effects(as defined by nim, so you can have some "side" effects !!)
21:31:17FromGitter<alehander92> proc
21:31:35FromGitter<alehander92> but i am used to proc so i still use it often
21:31:38FromGitter<alehander92> but its a bit like
21:31:49FromGitter<alehander92> use const if you can, if not let, if not var
21:32:33FromDiscord<Recruit_main_70007> So, func won't be able to have side effects right?
21:32:38FromGitter<alehander92> which is also dont always do
21:32:46FromGitter<alehander92> well .. kinda
21:33:03FromDiscord<Recruit_main_70007> But will give you some kind of advantage
21:33:03FromGitter<alehander92> you cant call functions which have "nim side effects"
21:33:18FromGitter<alehander92> or mutate variables out of args/locals
21:33:36FromGitter<alehander92> but you can e.g. use "debugecho" or escape if you really need i guess
21:33:53*marmotini_ quit (Remote host closed the connection)
21:33:57FromGitter<alehander92> yes its good because it generally means you can expect less surprises from a function
21:34:03Araqdisruptek: it's simple really, =destroy(x); wasMoved(x); field-wise assignments
21:34:19*krux02 joined #nim
21:34:27disruptektrue.
21:35:42disrupteky'know, we can run different destructors depending on where we are in the cfg.
21:36:04inv2004disruptek https://imgur.com/AL5eHP8
21:36:04disruptekie. they don't have to be limited to types.
21:36:08disruptekAraq: ^
21:36:20Araqyeah I know but we put the complexity into the parts that deserve it
21:36:33Araqnobody expects super-fast case object assignments
21:36:43Araqusually they are behind a 'ref' already
21:36:52disruptekfree performance, but yeah.
21:37:05disrupteki'm actually thinking more about 0-1-N assignments.
21:37:18disrupteki have this idea about having custom-scoped allocators.
21:37:19Araqas you can see, it's already complex enough
21:37:34disruptekoh, it's gonna get lots more complex from here.
21:37:36Araqand far longer in development than I'd like to admit
21:38:04disruptekbut this is what's gonna take nim to the next level.
21:38:19disruptekwe could have auto-tune allocators. scoped gc.
21:38:28disrupteksome really crazy shit.
21:38:42krux02disruptek, crazy shit is normally not that great.
21:38:59krux02but yes, I like to have more control over allocation.
21:39:33disrupteki see such potential in this language.
21:39:42disrupteki just want others to see it, too.
21:39:43krux02me, too
21:39:47inv2004Rust has a lot of complexity with the borrow-checker. probably you will have the same.
21:39:58FromDiscord<Clyybber> inv2004: Nope
21:40:01disruptekinv: arc is way simpler.
21:40:11FromDiscord<Clyybber> And if we do its there to help you, not to hinder you
21:40:12disruptekand really not comparable at all when it comes to the user.
21:40:17inv2004I hope so.
21:40:31krux02disruptek, at least that is what you think right now
21:40:33FromDiscord<Clyybber> The problem with attaching allocation and deallocation to scopes is function calls
21:40:34disruptekaraq's branch fixes all my gittup issues, btw.
21:40:43FromDiscord<Clyybber> nice!
21:40:55disrupteksomeone should test it on async.
21:41:06disrupteki have a feeling this is a key fix for that.
21:41:18disruptekjust based on what i know of the async impl.
21:41:18inv2004disruptek probably I did not get: sink and lint - something like Rust, but you are talking about arc - its more about rc/arc.
21:41:22Araqasync doesn't use case objects, so no.
21:41:36disruptekno, but it's the iterator issue.
21:41:45disruptek(fixed)
21:41:46Araqthere is no iterator issue
21:42:05Araqbut yeah, every bug we fix can't be bad for async
21:42:17inv2004disruptek can you check this image ? https://imgur.com/a/MsK62o1 I do not see fib5 here
21:42:44disruptekwhat is that?
21:42:52FromDiscord<Clyybber> ? theres fibN(x=5)
21:42:57FromDiscord<Clyybber> is that not what you are looking for?
21:43:33inv2004Clyybber, but fib5 is also blackboxed
21:43:40inv2004disruptek it is https://github.com/LemonBoy/criterion.nim/blob/master/tests/tfib.nim
21:43:45disruptekkrux02: yeah, i know i'm not seeing the full forest, but i know how big the trees are.
21:46:13krux02disruptek, I think we should have a public document about the construction sites of Nim.
21:46:24krux02Well, it will expose the weaknesses of Nim.
21:46:33disrupteki woulda settled for my stars idea, but yeah.
21:46:40krux02Might turn off beginners. But they will probably not read that document.
21:46:47Araq"construction sites"?
21:46:56disruptek"warning: go around."
21:47:12krux02what I mean with that, weak points of nim that need to be improved on.
21:47:33krux02disruptek, yea sometimes you can't go around.
21:47:34disruptekwe may as well set the narrative.
21:47:42krux02yes
21:47:45krux02that is what I mean.
21:47:52disruptek👍
21:48:10Araqhttps://github.com/nim-lang/RFCs/issues
21:48:31inv2004ok, looks like a bug with criterion, will submit issue. Thank you
21:48:52Araqfeels to me like "I didn't read the RFCs but I propose we write more of them"
21:48:59FromDiscord<Clyybber> inv that repo is archived
21:49:08inv2004ah, just found
21:49:19disruptekinv: submit it to my fork, please.
21:49:21sschwarzerI was away from the channel for a while, and now so many messages.
21:49:32FromDiscord<Clyybber> Araq: #13149
21:49:36krux02The problem with the issues list is, it is too long and it often distracts us from the real important issues.
21:49:39FromDiscord<Clyybber> cooldome found an issue with case objects
21:49:43disruptekAraq: we don't all have the rfcs on speed-dial.
21:49:46sschwarzerAraq: I'll try to remind you of the videos
21:49:50disrupteksometimes it's useful to chat.
21:49:55krux02Sure the important issues are in the issues list, and sure you can say, just read the issues list.
21:50:09Araqdude, it's not the issue list
21:50:09FromDiscord<Clyybber> https://github.com/nim-lang/Nim/issues/13149, not sure if its related, I didn't look into it yet
21:50:12disbotDestructors: case objects have issues ; snippet at 12https://play.nim-lang.org/#ix=27qe
21:50:19Araqit's the list of RFCs
21:52:01inv2004disruptek I do not see issues in fork
21:52:11disruptekdoh!
21:52:20disruptek!repo disruptek/criterion.nim
21:52:21disbotno results 😢
21:52:34krux02aparently you like to work with the issues list. I don't. I just lack the qualification to explain in detail why I don't like the issues list from the issue tracker
21:53:41disruptekinv2004: try now, please, and thank you.
21:54:18FromDiscord<Clyybber> Araq: I think the real solution is weakAsgn and weakSink
21:54:26*icebattle joined #nim
21:54:37Araqclyybber: not buying it
21:54:53AraqC++ has no weakAsgn either
21:54:58FromDiscord<Clyybber> The issue can only occur when we assign to a new location for an case object
21:55:06AraqI mean, I do understand your point
21:55:18Araqbut the fewer =ops we have, the better
21:55:24FromDiscord<Clyybber> Araq: Sorry, I really mean moving destroy(dest) out of sink and asgn
21:55:30FromDiscord<Clyybber> I think thats better
21:56:07Araqbut it isn't. you cannot re-use the memory in seq's '=' then
21:56:41FromDiscord<Clyybber> Hmmm
21:56:55FromDiscord<Clyybber> Thats true
21:57:08Araqor to put it more abstract: you lose information when '=' isn't destructive inside
21:57:13*Trustable quit (Quit: Leaving)
21:57:17FromDiscord<Clyybber> Wait,
21:57:24Araqevery information loss hinders optimization
21:57:36disruptekthis is why i want a sentinel.
21:57:42FromDiscord<Clyybber> I dont want to loose information
21:57:53FromDiscord<Clyybber> I mean instead of `=` generate `=destroy` `=`
21:58:10FromDiscord<Clyybber> well the destroy being in an if case, when it cannot be determined at compile time
21:58:16disruptekwhy don't we just add a bit to keep track?
21:58:35FromDiscord<Clyybber> It is required for init elision
21:58:43FromDiscord<Clyybber> disruptek: Add a bit to what?
22:00:09disruptekhe's saying he wants it inside so it has scope on the destroy/= and you're asking to move it outside.
22:00:19disruptekwhat am i missing?
22:01:12FromDiscord<Clyybber> Nothing, but moving it out allows *more* optimization not less
22:01:25*sschwarzer quit (Quit: leaving)
22:01:29FromDiscord<Clyybber> Since we can then elide it at compile time
22:01:39FromDiscord<Clyybber> We essentially already do that with firstWrite
22:01:44disruptekthere can be three ways for two things.
22:02:11FromDiscord<Clyybber> But only for sink, and I say we should do it for = too
22:02:29FromDiscord<Clyybber> But I'm working on it
22:02:57FromDiscord<Clyybber> but I think i need some sleep 🙂
22:03:01FromDiscord<Clyybber> good night fellas
22:03:06disruptekpeace
22:03:49Araqbye
22:03:55FromGitter<alehander92> nighht
22:06:36*inv2004 quit (Remote host closed the connection)
22:08:27disruptekthe discriminator is limited to 16bit, but that's a vm limitation?
22:10:12lqdev[m]disruptek: no, the compiler uses a lookup table for variants. the exists to limit it from blowing up in memory, if I understand correctly
22:11:23disruptekwe could just make it negative in destroy and then we always know if the variant was destroyed, what its last branch was, or whether it's "live" (and which branch it is, as per usual).
22:12:03disruptek1bit
22:16:19disruptekno one likes my ideas. 😢
22:16:30*abm quit (Quit: Leaving)
22:19:22FromDiscord<inv> Heh, Iam 90% sure it is nim bug: in the tfib.nim - nim does not see fib5() in its block.
22:19:56disruptekokay this i gotta see.
22:20:37FromDiscord<inv> just put echo "DEBUG1: ", repr body into first like of xbenchmark
22:20:47FromDiscord<inv> just put echo "DEBUG1: ", repr body into first like of xbenchmark of sugar.nim
22:21:04FromDiscord<inv> just put echo "DEBUG1: ", repr body into the first like of xbenchmark of sugar.nim
22:21:10FromDiscord<inv> just put echo "DEBUG1: ", repr body into the first line of xbenchmark of sugar.nim
22:23:45FromDiscord<inv> .measure: []. could be workaround, but anyway it is strange
22:24:36disrupteksorry i doubted you!
22:25:37FromDiscord<inv> n.p. It is just my second day in nim 🙂
22:25:51disrupteki think i have a fix.
22:26:11*muffindrake quit (Quit: muffindrake)
22:26:18FromDiscord<inv> could you please explain what is going on there? just interesting to undesratand
22:26:37disruptekwhen i know i'm right... 😉
22:28:37disruptekcompiler crash.
22:34:20disrupteknow if i could only figure that out...
22:47:26disruptekno, it seems i was wrong. now this is interesting.
22:50:30disruptekit's written weird, but it's written right. except where it isn't.
22:52:16FromGitter<alehander92> guyyys
22:52:22FromGitter<alehander92> whats up
22:52:30FromGitter<alehander92> disruptek dont you want to write os-es
22:52:44FromGitter<alehander92> sorry late night brain
22:52:51FromGitter<alehander92> time to night sleep night
22:52:53disruptekdude i can't write my name.
22:55:18FromGitter<zacharycarter> me either
22:57:51disruptekthis is nuts.
22:58:00disruptekniv: this is /totally/ nuts.
22:58:21FromGitter<zacharycarter> ?
22:58:34disruptekthis guy may have stumbled on a huge ast elision bug.
22:59:21disruptekit's also an infinite loop for the compiler, so it takes ages to test.
22:59:27disruptekyou can't make this stuff up.
22:59:33FromGitter<zacharycarter> ooo
23:01:23disruptekit makes me wonder if lemonboy is leaving an easter egg.
23:01:40FromGitter<zacharycarter> :D
23:10:55*solitudesf quit (Ping timeout: 265 seconds)
23:11:07disruptekman, this is bananas.
23:14:09FromGitter<zacharycarter> mmmm bananas....
23:19:17FromGitter<zacharycarter> ugh wrote so many cover letters today... over it
23:19:44disruptekresumes?
23:21:44FromGitter<zacharycarter> yeah - trying to get out of Finland and back to the states
23:22:00disruptekchilly?
23:22:11FromGitter<zacharycarter> I got an offer from Creative Assembly today - the guys that make all the total war games, but it was poop
23:22:34disruptekthat doesn't sound very good.
23:22:45disruptekare you considering it?
23:22:51FromGitter<zacharycarter> eh more has to do with gf being back there and the fact that I've realized games are just like any other software and there's nothing really special about developing them
23:23:08FromGitter<zacharycarter> nah - she wouldn't be able to come over to live with me in the UK and I'd be taking a pay cut
23:23:13FromGitter<zacharycarter> so I'm going to reject it in the morning
23:23:50disruptekmake games programming is something you can age out of gracefully.
23:23:57disruptek^maybe
23:24:24FromGitter<zacharycarter> yeah - I can always do it in my personal time and try to make an indie game and sell it on steam
23:24:48FromGitter<zacharycarter> but I think I'd rather go back to making more money and work less hours like I was before in the states
23:24:49disruptekthat would be awesome.
23:25:05disrupteki need to get a job.
23:25:17disrupteki miss really getting stuck in.
23:26:37*muffindrake joined #nim
23:28:27disrupteki want a workflow where i can make a change in my editor, hit a key, and have it committed. then i want my ci in the gutter telling me it's golden.
23:29:31disruptekwasn't GUTTER, C.I. a TV show in the '80s?
23:30:26disruptekima build that shit.
23:30:49FromGitter<zacharycarter> lol
23:30:58FromGitter<zacharycarter> eh I don't even care if I have a job
23:31:01FromGitter<zacharycarter> I just want some way to make money
23:31:23disruptekis that code for, "i'm down for anything" or what?
23:31:35FromGitter<zacharycarter> no zjs
23:31:53FromGitter<zacharycarter> nah but like - I'd do patreon / freelance / consulting etc if it meant I could earn a comfortable living
23:32:19disruptekright.
23:32:25FromGitter<zacharycarter> something remote would be the tits
23:33:55disrupteki feel like if you're good, that work is easy to come by.
23:35:43disruptekima add for/else while/else to the language, first, though.
23:36:22disrupteki just want it.
23:36:26FromGitter<zacharycarter> I got so many rejections today - but I have a feeling it's because my CV has my address in Finland and I just got screened out by a bunch of robots
23:36:52disruptekwho rejects you?
23:37:05FromGitter<zacharycarter> I know right? how dare they...
23:37:19FromGitter<zacharycarter> to be fair, it was a bunch of places which I lazily applied to via linked in by clicking a few buttons
23:37:26FromGitter<zacharycarter> so they probably spent as much effort as I did in applying
23:37:44disrupteki have no idea how to go about searching.
23:37:55disruptekdo i just go to indeed?
23:38:06FromGitter<zacharycarter> I used linkedin jobs and uh
23:38:29FromGitter<zacharycarter> https://news.ycombinator.com/item?id=21936440 as well as https://findwork.dev/?source=hn or one of the other links in the top of the HN post for searches
23:38:59disruptekoh right, i've seen that thread.
23:40:29disruptekthat codeweavers gig looks up your alley.
23:40:52FromGitter<zacharycarter> mmm let me look
23:42:03FromGitter<zacharycarter> thanks - yeah that does sound cool
23:42:06FromGitter<zacharycarter> I'll shoot them over a copy of my resume
23:42:24disrupteknice.
23:43:20*pbb quit (Remote host closed the connection)
23:44:33*pbb joined #nim