<< 08-02-2020 >>

00:06:27*solitudesf quit (Ping timeout: 240 seconds)
00:32:57*krux02 quit (Remote host closed the connection)
00:34:02FromGitter<deech> How do I write a binding to typedef'd struct pointer? eg. `typedef struct FooImpl *Foo;`
00:47:28*thomasross joined #nim
00:57:08*iranika quit (Remote host closed the connection)
00:58:05*PMunch quit (Quit: Leaving)
01:41:52leorize@deech: `type Foo = ptr object`
01:43:03leorizeof course you won't be able to allocate this object by yourself since the size is not known, but with most "opaque" C libraries, they should provide you functions to create these types that you can access via FFI
01:46:02*tiorock joined #nim
01:46:02*tiorock quit (Changing host)
01:46:02*tiorock joined #nim
01:46:02*rockcavera is now known as Guest42242
01:46:02*tiorock is now known as rockcavera
01:49:29*Guest42242 quit (Ping timeout: 272 seconds)
02:18:31*abm quit (Read error: Connection reset by peer)
02:26:50*chemist69 quit (Ping timeout: 256 seconds)
02:26:57disruptekleorize: man, that really seems like a solvable problem.
02:28:42*chemist69 joined #nim
02:28:43*Hideki_ joined #nim
02:31:56disrupteki can't think of a reason that an emit wouldn't work.
02:35:44disrupteka part of me wishes i could go back to ANSI C-era.
02:36:53disrupteki wonder if girls and guys back then felt like they were building on top of dogshit.
02:37:36*dddddd quit (Ping timeout: 256 seconds)
02:37:36disruptekcan you imagine how powerful computers will be when we finally figure out this software thing?
02:38:08disruptekit'll be like going from running on one cylinder to running on all 40,000.
02:43:07disrupteklet's put ourselves there.
02:53:13disrupteki mean, at this rate, only you young'ins will live to see it, but still... i feel like we should try.
02:54:41disruptekshashlick, i'm sorry man, i didn't mean to summon you to your own beheading on that nimterop whine.
02:55:09disruptekyou just have no idea how many times i ran `docker build` today.
02:55:48disruptekit makes my balls hurt, and i don't say that lightly.
02:56:15disrupteki guess you could say that i'm sensitive about my balls.
02:59:38disruptekor, come to think of it, maybe i just have extraordinarily sensitive balls.
03:00:03disruptekthat's really what offends my balls and i about docker.
03:00:34disruptekhere you've got this amazing cloud and you're going to waste the efficiency of the think with all this shit upon shit upon shit?
03:01:07disrupteknigel is a federated function system.
03:01:32disruptekFFS
03:07:10FromDiscord_<Elegant Beef> Is there a way to use an object constructor without named variables? Where the desired types are just the order of declaration
03:08:14disruptekthe /right/ solution is to create a constructor, because this will likely not be the last time you need one.
03:08:51disrupteki guess you could generate a template using a macro.
03:09:34disruptekyou could maybe impl `()`.
03:10:14disruptekeverything else seems to "manual" to justify, to me.
03:10:20disrupteks/to/too/
03:13:44FromDiscord_<Elegant Beef> Creating a constructor, i assume just means making a TCtr proc?
03:14:02disruptekyeah, name it anything you want.
03:14:21FromDiscord_<Elegant Beef> the impl () im unclear on\
03:14:22FromDiscord_<Elegant Beef> the impl () im unclear on
03:14:22disruptekconvention is newT() though.
03:14:33FromDiscord_<Elegant Beef> Im from C# so fuck that convention πŸ˜„
03:15:04disruptekthere's an experimental support for implementing proc `()`()
03:15:24disruptekthat's call, for a type.
03:15:35FromDiscord_<Elegant Beef> You mean overriding the default constructor?
03:15:41disruptekyeah.
03:15:57disrupteki dunno what they call it in c#. i only did some hax in it.
03:16:11*thomasross quit (Ping timeout: 260 seconds)
03:16:31FromDiscord_<Elegant Beef> I mean in C# you declare your own constructor, and can have as many types as you want, but it's return type and name matches the class you're instantiating
03:16:41disruptekelegant beef, how come you don't come 'round no more?
03:16:48*thomasross joined #nim
03:16:56FromDiscord_<Elegant Beef> huh?
03:17:00disruptekright, i remember that.
03:17:17disrupteki just dunno all the nomenclature because i'm dumb.
03:17:38disruptekhonestly, there's an elegance to c#.
03:17:48disruptekit's very disneyland.
03:17:49FromDiscord_<Elegant Beef> "elegant beef, how come you don't come 'round no more?"
03:17:49FromDiscord_<Elegant Beef> I havent been here for more than like a week, i've been here plenty!
03:18:02FromDiscord_<Elegant Beef> I mean nim has a ton of cool features i like
03:18:17disrupteklet's talk about them.
03:18:20FromDiscord_<Elegant Beef> being able to declare a proc and it will take the left hand in as a variable if it matches the first param
03:18:37FromDiscord_<Elegant Beef> In C# you'd need an extension method and a class method for both
03:18:42disrupteki mean seriously, this is an opportunity for us to learn what brings people to nim. what's working.
03:19:02FromDiscord_<Elegant Beef> It makes it so even floats feel more like objects
03:19:10FromDiscord_<Elegant Beef> Which for an OOP language is important imo
03:19:17disruptekcan you gimme an example?
03:19:31disruptekoh, mutable arguments?
03:20:02disruptekbut you have out vars in c#.
03:20:13disruptekisn't that basically the same?
03:20:28FromDiscord_<Elegant Beef> https://play.nim-lang.org/#ix=2b2B
03:20:29FromDiscord_<Elegant Beef> No
03:21:10disruptekoh, you like the syntax.
03:21:14FromDiscord_<Elegant Beef> In C# you'd need the `Add(int,int)` and extension method `Add(this int, int)`
03:21:25disruptekright.
03:21:44FromDiscord_<Elegant Beef> Sure syntax, i say it allows data types feel more like objects
03:21:55FromDiscord_<Elegant Beef> *I do wish i could use tabs though*
03:22:10disruptekyeah, the hardest thing about it is deciding what you like. just like with the symbol naming convention. yet everyone bitches about it.
03:22:14FromDiscord_<Elegant Beef> I also like that nim doesnt require any special runtimes, so i can just run the built ap
03:22:31FromDiscord_<Elegant Beef> app*
03:22:41disruptekyou can use tabs with a source code filter. i did that for a little while.
03:22:47disruptekbut, it's pointless to resist.
03:22:56FromDiscord_<Elegant Beef> Tabs are superior
03:23:04disruptekagree.
03:23:17disruptekbut, don't care.
03:23:23FromDiscord_<Elegant Beef> The fact the user chooses how deep they are just makes it nicer to work with
03:23:28disruptekagree.
03:23:38disruptekbut, turns out it's not what's important.
03:24:31disruptekand if that's what you're using to govern your language decisions, i feel like nim might be a little to sharp an instrument for a craftsman of your caliber.
03:24:41disrupteks/to/too/
03:25:25disruptek'til then, you can put this at the top of your tabbed source:
03:25:28disruptek#? replace(sub = "\t", by = " ")
03:27:18disruptekthat reads a little more savage than it was intended; sorry!
03:27:38disruptekit wasn't mean to be accusatory.
03:27:42disruptekmeant, rather.
03:27:44FromDiscord_<Elegant Beef> tabbed source, that's uhh, a thing
03:27:44disruptekit was mean.
03:28:13disruptekyeah; you do that thing and you can have tabulators in your .nim.
03:28:40FromDiscord_<Elegant Beef> Dont worry you could say much worse and i'd not be offended
03:28:56disruptekreally?
03:29:04FromDiscord_<Elegant Beef> and what's with the `s/to/too`
03:29:07disruptekyou've got a condition?
03:29:28FromDiscord_<Elegant Beef> Yea it involves not being offended by things on the internet
03:29:30disruptekit's a substitution, sed-style.
03:29:35FromDiscord_<Elegant Beef> Call not giving a *uck*
03:29:44disruptekah, nice.
03:30:07disruptekyou know, you can catch that disease and be cured of it just as quick.
03:30:27disrupteklol
03:30:33FromDiscord_<Elegant Beef> doubtful
03:30:37FromDiscord_<Elegant Beef> I've had it as long as i can recall
03:30:56disruptekanyway, the problem with using tabs is just that no one else does.
03:31:15FromDiscord_<Elegant Beef> Yea i know, even in C# people use "tabs"
03:31:16disruptekso you will fight an uphill battle, especially when publishing.
03:31:44FromDiscord_<Elegant Beef> Only an issue if people are interested in your code
03:31:47*muffindrake quit (Ping timeout: 240 seconds)
03:31:52FromDiscord_<Elegant Beef> Never write useful code, ever have a problem
03:31:55FromDiscord_<Elegant Beef> never*
03:32:11disruptekdat logic.
03:32:51disruptekmy next nimble package will be rewritten in rot-13.
03:34:23*muffindrake joined #nim
03:35:13FromDiscord_<Elegant Beef> kill it with fire
03:35:13FromDiscord_<Elegant Beef> ` return Command(niceName : niceName,name : name,id : id,runner : runner,dir : dir)`
03:35:33disruptekwhat is that?
03:35:43FromDiscord_<Elegant Beef> The return line on, my constructor
03:35:48FromDiscord_<Elegant Beef> On my badly named object
03:36:55disruptekput it on 5 lines.
03:37:05disruptekmove on with your life.
03:37:26disruptekyou are young yet, but it will not last.
03:37:31FromDiscord_<Elegant Beef> What
03:38:09disruptekfive shall be the number of lines, and the number of lines shall not exceed five.
03:38:35disruptekneither shall the number of lines be less than five. in particular, the number of lines need not be one.
03:38:36FromDiscord_<Elegant Beef> Not 3?
03:39:03FromDiscord_<Elegant Beef> I fart in your general direction
03:39:11disruptekfair enough.
03:41:02disrupteki have to watch this right now.
03:41:50disruptekwe were talking at fosdem about how everyone saw it in a different language, first, and later saw it in english.
03:42:20FromDiscord_<Elegant Beef> And just like that another soul was lost to the disease known as nostalgia
03:42:20disrupteksadly, i cannot change the source audio on netflix.
03:42:33FromDiscord_<Elegant Beef> VPN/DNS πŸ˜„
03:42:41FromDiscord_<Elegant Beef> Dont ask why i said DNS
03:42:43FromDiscord_<Elegant Beef> It's cause im daft
03:42:58disruptekoddly, there are foreign subtitles.
03:43:08disruptek😁
03:51:46FromDiscord_<Chiqqum_Ngbata> I come to the conclusion that I want newTuple(arity)
03:51:49FromDiscord_<Chiqqum_Ngbata> What's the workaround
03:52:13FromDiscord_<Chiqqum_Ngbata> Can't use Set; might have duplicates
03:53:07disruptekthat's odd, because objects are pretty lightweight.
03:53:22FromDiscord_<Elegant Beef> cant use a seq either?
03:53:30FromDiscord_<Chiqqum_Ngbata> seqs can only contain the same type right?
03:53:39disruptekyeah.
03:54:16disruptekis the arity arbitrary or is it one of, say, an enum's possible values?
03:54:37FromDiscord_<Chiqqum_Ngbata> The arity is known at runtime
03:55:11disruptekmaybe what you really want is a variant object with arity kinds, each with a variably-sized tuple.
03:55:33FromDiscord_<Chiqqum_Ngbata> Actually, is it possible to get arity of tuple typedesc?
03:55:51disruptekyou could do it with a macro.
03:57:47FromDiscord_<Chiqqum_Ngbata> Eh, I do want this to be runtime. The library I'm interacting with sets arity; I'd rather trust the arity this C function call gives me rather than user-defined arity in nim
03:57:51FromDiscord_<Chiqqum_Ngbata> So impossible?
03:58:03disruptekdid you look at typetraits?
03:58:15disrupteki think there's an arity fetcher in there.
03:58:22FromDiscord_<Chiqqum_Ngbata> I read something about that not working with --gc:arc ?
03:59:21disruptekwhy? does it use repr?
03:59:43disruptekthat seems bizarre.
04:00:46shashlickdisruptek: no worries πŸ™‚
04:02:01disruptek😘
04:08:29FromDiscord_<Chiqqum_Ngbata> It doesn't want me assigning to this new tuple (based on typedesc) at runtime
04:09:01disruptekassigning to it?
04:09:48disruptekdo you have a good reason for not using an object?
04:09:54FromDiscord_<Chiqqum_Ngbata> Yeah, say I have `var t: T` and want to set t[0] = 1
04:10:25disrupteki think you just answered my question.
04:10:58disruptekplease, use an object. that's what they were made for.
04:11:56FromDiscord_<Chiqqum_Ngbata> So not possible to assign to index of tuple at runtime?
04:13:10disrupteknever.
04:14:35FromDiscord_<Winton> que viva Nim πŸ‘‘ Forever
04:20:04FromDiscord_<Chiqqum_Ngbata> Iteration order of object fields guaranteed as defined?
04:22:52disruptekis this really the hill you want to die on, son?
04:23:17FromDiscord_<Chiqqum_Ngbata> Yeah you're right, I'm giving up on solving this in nim. It doesn't look like there's a good way to do this
04:23:23FromDiscord_<Chiqqum_Ngbata> Screws up my entire API but w/e
04:23:58FromDiscord_<Elegant Beef> What is the data you're exactly storing?
04:27:42*dadada quit (Ping timeout: 268 seconds)
04:31:48*sagax quit (Read error: Connection reset by peer)
04:38:47*lritter quit (Ping timeout: 260 seconds)
04:39:01FromDiscord_<Winton> Si hablo espaΓ±ol
04:39:18*lritter joined #nim
04:56:57*gangstacat quit (Ping timeout: 272 seconds)
04:58:41*lritter quit (Quit: Leaving)
06:01:47*rockcavera quit (Remote host closed the connection)
06:22:32*nsf joined #nim
06:37:39*adalricus joined #nim
06:57:02*greenfork joined #nim
07:00:55*narimiran joined #nim
07:11:45*blueberrypie quit (Quit: Ping timeout (120 seconds))
07:12:20*blueberrypie joined #nim
07:13:59rayman22201@disruptek: did you see the daily paper link I sent this morning? Reminds me of your cloud aspirations
07:16:31*thomasross quit (Ping timeout: 260 seconds)
07:21:58*thomasross joined #nim
07:24:48*marmotini_ joined #nim
07:25:13*marmotini_ quit (Read error: Connection reset by peer)
07:25:44*marmotini_ joined #nim
07:33:24*thomasross quit (Ping timeout: 256 seconds)
07:34:18*thomasross joined #nim
07:34:42*dadada joined #nim
07:35:05*dadada is now known as Guest58774
07:38:13*solitudesf joined #nim
07:39:23*thomasross quit (Ping timeout: 260 seconds)
07:42:56*Guest58774 is now known as dadada
07:44:49*thomasross joined #nim
07:46:01*marmotini_ quit (Read error: Connection reset by peer)
07:48:13*hax-scramper joined #nim
07:56:17*Hideki_ quit (Remote host closed the connection)
08:05:56*gmpreussner joined #nim
08:07:07*thomasross quit (Ping timeout: 240 seconds)
08:08:43*thomasross joined #nim
08:12:19FromDiscord_<Rika> make a custom proc for an object `[]`
08:12:21*thomasross is now known as Guest65607
08:12:21*thomasross_ joined #nim
08:12:21*Guest65607 quit (Killed (adams.freenode.net (Nickname regained by services)))
08:12:21*thomasross_ is now known as thomasross
08:12:21FromDiscord_<Rika> what
08:12:27FromDiscord_<Rika> oops, pressed enter early
08:13:33FromDiscord_<Rika> ah
08:17:07*dadada quit (Ping timeout: 240 seconds)
08:19:11*dadada joined #nim
08:19:35*dadada is now known as Guest25567
08:23:25*hax-scramper quit (Read error: Connection reset by peer)
08:24:49*nsf quit (Quit: WeeChat 2.7)
08:28:51*theelous3 quit (Ping timeout: 260 seconds)
08:32:24*Hideki_ joined #nim
08:49:20*hax-scramper joined #nim
09:00:53FromDiscord_<Rika> @Chiqqum_Ngbata i just had a massively idiotic idea that might just fit your specifications
09:01:49FromDiscord_<Rika> make a seq[(string, typedesc)], then when storing, serialize into string and store typedesc, reverse if you're accessing; i dont know if typedesc is limited to compiletime though
09:02:51*Trustable joined #nim
09:05:06FromDiscord_<demotomohiro> !eval var a:seq[(string, typedesc)]; echo a.len
09:05:08NimBotCompile failed: Error: internal error: getTypeDescAux(tyNone)
09:05:31FromDiscord_<Rika> πŸ€”
09:05:39FromDiscord_<Rika> that made me laugh a bit
09:20:21FromGitter<alehander92> <3
09:20:23FromGitter<alehander92> morning
09:20:31FromGitter<alehander92> what is the daily paper
09:20:38FromGitter<alehander92> is it a real service
09:31:36*hax-scramper quit (Read error: Connection reset by peer)
09:31:50*hax-scramper joined #nim
09:38:14*Hideki_ quit (Remote host closed the connection)
09:38:34*Guest25567 is now known as dadada
09:39:24*Hideki_ joined #nim
09:44:29*Hideki_ quit (Ping timeout: 272 seconds)
09:45:33*Hideki_ joined #nim
09:46:51*Hideki_ quit (Remote host closed the connection)
09:47:48*Hideki_ joined #nim
09:55:38*Hideki_ quit (Ping timeout: 240 seconds)
10:08:19FromDiscord_<mratsim> @Pmunch, I didn't receive an email to check my video talk for FOSDEM, is that normal?
10:17:35*sagax joined #nim
10:21:04*gangstacat joined #nim
10:21:49Araqmratsim: happened to me too, join #fosdem-video and ask for a direct link
10:23:39*krux02 joined #nim
10:23:57FromDiscord_<mratsim> So I have to configure this ancient protocol called IRC :/
10:24:07Yardanicolol
10:26:14*Hideki_ joined #nim
10:31:21*narimiran quit (Ping timeout: 272 seconds)
10:34:27*marmotini_ joined #nim
10:35:17FromDiscord_<sveri> I am curious. Nim has a AsyncHttpServer, but no synced http server. Is there a reason for this? Or is it just to show async capabitilities?
10:35:37Yardanicowell, I don't think there's much sense in a synced http server :)
10:35:49Yardanicoand you can just use asynchttpserver with sync code too, nobody stops you from doing that
10:35:53Yardanicobut it will block then
10:37:03FromDiscord_<sveri> That makes sense, thank you. I was just interested in the old way of having a server that spawns threads for each request.
10:37:16Yardanicowell, I just think it wouldn't really be efficient
10:37:25YardanicoIO is slow, so use async for IO-bound stuff :)
10:37:29Yardanicoand you can use threads with async too
10:37:41*marmotini_ quit (Read error: Connection reset by peer)
10:38:02Yardanicojust need to be sure that you don't pass GCed stuff between threads, or use --gc:arc (on devel, has shared heap) or --gc:boehm (boehm gc with shared heap)
10:38:04FromDiscord_<sveri> my 5 TB RAM cluster makes IO super fast πŸ˜„ Just joking.
10:38:04FromDiscord_<sveri> I see.
10:38:29*greenfork quit (Remote host closed the connection)
10:39:50*Hideki_ quit (Ping timeout: 256 seconds)
10:41:44*uu91 joined #nim
10:43:28FromGitter<Varriount> Yardanico: Doesn't arc use a whole "only one thread can own a object graph at a time" thing?
10:43:43YardanicoI don't really know about that, sorry
10:43:57Yardanicobut I remember arc being advertised supporting shared-heap :P
10:44:09FromGitter<Varriount> https://forum.nim-lang.org/t/5734#35571
10:45:16*ng0_ joined #nim
10:48:07*ng0 quit (Ping timeout: 240 seconds)
11:02:43FromGitter<garuse> why is mratsim's fosdem talk not available yet?
11:08:43*thomasross quit (Ping timeout: 272 seconds)
11:09:02*thomasross joined #nim
11:13:00*dddddd joined #nim
11:13:13*filcuc joined #nim
11:16:23*PMunch joined #nim
11:17:13FromDiscord_<mratsim> they didn't send me a mail to verify my video ...
11:19:25FromDiscord_<mratsim> @Araq, some interesting stuff on formal verification:
11:19:25FromDiscord_<mratsim> Formal verification of crypto using Z3: https://saw.galois.com/ https://github.com/GaloisInc/saw-script
11:19:25FromDiscord_<mratsim> And array bound checking, preconditions/postconditions/invariants, null pointer exceptions using a language agnostic CFG: https://github.com/seahorn/crab
11:23:03*hlavaty joined #nim
11:26:14Zevvthanks for the explanation of the sleep thing mratsim1
11:32:27FromGitter<garuse> thanks mratsim. i hope it will be available soon.
11:42:48*Ven`` joined #nim
11:46:02*filcuc quit (Ping timeout: 240 seconds)
11:49:55*NimBot joined #nim
11:54:36*filcuc joined #nim
11:56:48*ng0 joined #nim
11:56:51*ng0 quit (Changing host)
11:56:51*ng0 joined #nim
11:57:11*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:59:27*ng0_ quit (Ping timeout: 240 seconds)
12:08:32*vesper11 joined #nim
12:08:39*vesper quit (Ping timeout: 260 seconds)
12:15:04PMunchHmm, why doesn't single line try/except work? if (try: discard parseEnum[Commands](elem.strVal); true; except: false):
12:18:55PMunchAh, works with another level of brackets: if (try: (discard parseEnum[Commands](elem.strVal); true) except: false):
12:22:20PMunchAre there any pure Nim libraries for creating a REPL?
12:22:44PMunchCurrently I'm using the built in rdstdin, but I'd like to add tab completion and on the fly colouring
12:23:35*dddddd quit (Ping timeout: 260 seconds)
12:23:47ZevvIf there was, Nim would not ship with linenoise, likely
12:29:39PMunchHmm, there is `prompt` which looks promising https://github.com/surf1nb1rd/nim-prompt/blob/master/prompt.nim
12:29:50PMunchBut it doesn't support the live colouring stuff
12:29:54PMunchOnly auto-complete
12:30:38FromDiscord_<Rika> how does live coloring work anyway
12:30:47PMunchI guess for live colouring to work you'd need to have a two way translate function that gets a buffer to display, and can return indices
12:31:00PMunchRike, what do you mean how does it work?
12:31:25FromDiscord_<Rika> terminal coloring is controlled by ansi codes, right
12:31:29PMunchYeah
12:31:34FromDiscord_<Rika> are there other methods? how would coloring work
12:31:48FromDiscord_<Rika> when you're adding color to detected syntax or so
12:35:09PMunchWell I don't know if there are any libraries that support this
12:36:51*Hideki_ joined #nim
12:36:52*theelous3 joined #nim
12:37:23PMunchMy idea was just to have a prompt library that deals with inputs and such, and then have a callback it would call before displaying anything where I could write a procedure that would colour the output
12:41:19*Hideki_ quit (Ping timeout: 260 seconds)
12:44:18*ng0_ joined #nim
12:44:39*nsf joined #nim
12:46:27*dadada quit (Ping timeout: 260 seconds)
12:47:31*ng0 quit (Ping timeout: 272 seconds)
13:07:29*ng0_ is now known as ng0
13:09:53*dadada joined #nim
13:10:17*dadada is now known as Guest53397
13:29:54dom96so that's interesting
13:30:02dom96nim-lang.org's search traffic doubled yesterday
13:30:14dom96more than doubled in fact
13:30:19FromDiscord_<Rika> huh
13:30:22dom96I thought it might be a Google Analytics bug
13:30:28FromDiscord_<Rika> maybe it's the towardsdatascience article
13:30:29dom96but I just confirmed it via Google's search console
13:30:43FromDiscord_<Rika> there was an article in towardsdatascience about nim
13:30:43dom96link?
13:31:01FromDiscord_<Rika> https://towardsdatascience.com/could-nim-replace-python-547145afcfd5
13:31:09FromDiscord_<Rika> was released 2 days ago
13:31:31dom96ahh, this one. I tweeted about it on Nim's twitter
13:31:51dom96The timelines certainly align
13:32:14dom96and there are no links in that article so people are likely to search Nim
13:32:24dom96cool
13:32:29*arecaceae quit (Remote host closed the connection)
13:32:47*arecaceae joined #nim
13:34:33dom96The increase in users shown by analytics is 11x what it usually is (for each day) :O
13:36:41lqdev[m]> Though Nim is technically run with an interpreter, it should be noted that Nim also has its own compiler.
13:36:45lqdev[m]uh?
13:36:56lqdev[m]since when is Nim interpreted?
13:36:57*kungtotte quit (Read error: Connection reset by peer)
13:37:12dom96yeah, someone should ask the author to correct this
13:37:14lqdev[m]yeah it has NimScript, but that's a much more limited version of the actual language
13:38:23*kungtotte joined #nim
13:38:34lqdev[m]> Nim’s code-base is primarily structured on the functional paradigm.
13:38:43lqdev[m]maybe I don't understand what 'functional' means here, but I wouldn't agree with this statement
13:39:03*leorize quit (Ping timeout: 240 seconds)
13:41:13*ng0_ joined #nim
13:44:07*ng0 quit (Ping timeout: 240 seconds)
13:45:29lqdev[m]dom96: seems like treeform_ already commented on the article, 2 days ago.
13:49:13*Guest53397 is now known as dadada
13:53:22dadadait just occurred to me that Nim's logo is pretty cool when seeing it in that article
13:54:22*leorize joined #nim
13:56:06dadadathat article is fraught with errors
14:01:34PMunchYeah, the article is really bad. But it has reached pretty far
14:01:44PMunchA guy at work got it reccomended to him through some algorithm
14:01:53PMunchAnd sent me a message about it :P
14:02:28PMunchAnd dadada I agree that the Nim logo is pretty neat :)
14:03:03PMunchWe should really make some cardboard cut Nim crowns for next years FOSDEM
14:03:24dadadagreat idea
14:03:29PMunchWould probably be pretty easy to get a laser cutter to cut them and slightly colour the edges to make an outline
14:03:50dadadais there nim merchandise so far? shirts?
14:04:44PMunchThere are shirts and a mug at least
14:05:26dadadawhere?
14:05:54dadadaI expected to find a link to the store on the donate page, though there's none
14:06:07PMunchhttps://teespring.com/nimlang1 https://teespring.com/nimlang2 https://teespring.com/nimlang_mug
14:07:37PMunchZevv, do you have the design for the one you created by the way?
14:09:48*Ven`` joined #nim
14:13:23Zevvsorry, design of what?
14:14:20Zevvoh the shirt, sorry
14:14:31Zevvhttp://zevv.nl/div/ni.png
14:14:54Zevvit looks crap as PNG, but on black it is okish
14:15:09Zevvdisruptek: you awake?
14:15:16dadadastuff like that should be available form nim-lang.org, also to collect money for running the servers
14:23:07*narimiran joined #nim
14:29:48FromDiscord_<treeform> Do you guys know what this <//> syntax do?
14:29:48FromDiscord_<treeform>
14:29:49FromDiscord_<treeform> https://cdn.discordapp.com/attachments/371759389889003532/675709876374339594/unknown.png
14:30:01narimiranit was just a placeholder
14:33:05FromDiscord_<treeform> for what?
14:33:17narimiranowned IIRC
14:33:58FromDiscord_<treeform> ok
14:34:15FromDiscord_<treeform> newSeq gives you a non ref-seq while newTable gives you a ref-table...
14:34:22FromDiscord_<treeform> Why is newSeq not initSeq?
14:34:39FromDiscord_<treeform> Why is difference between Table and TableRef important?
14:35:31narimiran"Why is newSeq not initSeq?" i would say (and i might be wrong) it is because of historical reasons and now it is too late to change it
14:36:41*ng0 joined #nim
14:36:41*ng0 quit (Changing host)
14:36:41*ng0 joined #nim
14:37:47FromDiscord_<treeform> You are probably right
14:39:40*ng0_ quit (Ping timeout: 265 seconds)
14:41:58PMunchAnyone know who surf1nb1rd on GitHub is?
14:42:41PMunchdadada, the ones I linked from treeform are official and should contribute to that
14:42:51PMunchUrm, teespring..
14:43:19dadadaPMunch: is there a link from nim-lang.org?
14:43:36dadadait should at least appear in the donate section IMO
14:43:49PMunchI totally agree
14:43:54PMunchI found them here: https://forum.nim-lang.org/t/3284
14:44:02PMunchBut I remember when they were first posted
14:44:17PMunchI think they might've been updated though
14:44:27PMunchIIRC there is a mug design with the logo on both sides
14:45:14PMunchdom96, do you have any updates on merch?
14:45:32FromDiscord_<treeform> lol I am teespring now πŸ™‚
14:45:43FromDiscord_<Recruit_main_70007> @treeform is that vs?
14:46:10PMunchtreeform, narimiran, isn't init vs new when you create an object vs ref object?
14:46:16narimiranit is
14:48:38PMunchHmm, with nimble is it possible to require a library from a fork?
14:50:27PMunchAh, never mind, I can just specify the full github URL
14:54:26*Hideki_ joined #nim
14:56:14dadadafound this pretty interesting https://codescene.io/#
14:56:37dadadasadly proprietary, but free for FOSS, it doesn't have nim support yet
14:57:47*thomasross quit (Ping timeout: 240 seconds)
14:59:41dadadathe video on the frontpage explains it well
15:03:15FromDiscord_<sveri> Hi again. So I tried for some time now to have the AsyncHttpServer accept multiple requests at the same time using threads, but did not succeed to do so. Is that even possible at all?
15:05:35*Hideki_ quit (Remote host closed the connection)
15:05:51*sveri joined #nim
15:06:34*Hideki_ joined #nim
15:07:09*rockcavera joined #nim
15:07:17*Hideki_ quit (Remote host closed the connection)
15:07:34*Hideki_ joined #nim
15:07:45*thomasross joined #nim
15:08:29*Hideki_ quit (Remote host closed the connection)
15:09:00*Hideki_ joined #nim
15:09:43*vesper11 quit (Ping timeout: 260 seconds)
15:10:17*Zectbumo quit (Remote host closed the connection)
15:11:24*vesper11 joined #nim
15:13:02FromDiscord_<treeform> @sveri I would say its difficult. HttpBeast written by dom does it, because dom is smart and wrote all of Async stuff. The new --gc:arc run should make async+threads interactions easier, but that is still in progress. The new --gc:arc is the main focus of nim development right now. I think we all would like the async+threads interactions to be easier.
15:13:35FromDiscord_<treeform> I recommend not doing async+threads for now and wait for the smart people in charge to figure it out for us.
15:13:52FromDiscord_<treeform> Just use async - 1 thread. Or threas but no async for now.
15:14:44FromDiscord_<sveri> @treeform Thanks for stating my assumptions.
15:14:44FromDiscord_<sveri> My thinking is that it should be easier to have a server running with threads and introduce async / await down the call stack if it's needed?
15:15:33FromDiscord_<sveri> that's at least what I did in other languages.
15:15:34FromDiscord_<treeform> Not sure what you mean.
15:15:45FromDiscord_<treeform> down the call stack*
15:16:05dadadahttps://github.com/marketplace/codescene 5 open source projects can be analyzed for free
15:16:21dadadamight be interesting to find out what the technical debt of nim is according to it
15:16:29FromDiscord_<treeform> @sveri for async, the dispatcher must live at the highest level in order to dispatch IO stuff. It can't live down the stack.
15:16:46FromDiscord_<treeform> You would do it like HttpBeast
15:16:55dadadadarn, forgot for a second it doesn't support Nim yet
15:16:58FromDiscord_<treeform> where each thread has its own io dispatcher
15:17:52FromDiscord_<sveri> @treeform Yea, that's what I mean.
15:17:53FromDiscord_<sveri> I guess I still did not understand async / await completely.
15:17:53FromDiscord_<sveri> Thanks for bringing up httpBeast, I will read some more πŸ™‚
15:18:51FromDiscord_<treeform> @sveri, http beast is not that big, its around 1000 lines: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim
15:19:30FromDiscord_<sveri> I am looking into it right now. I wonder why it would not work on windows?
15:19:39FromDiscord_<treeform> That said you probably don't need its thread+async performance for your project. My recommendation is just wait for people smarter then us to figure out the async+thread stuff.
15:20:01FromDiscord_<sveri> @treeform I definitely do not need it. I just want to try out stuff πŸ™‚
15:21:22FromDiscord_<treeform> windows uses a different low level networking API then Linux/Mac it was just not implemented.
15:21:29FromDiscord_<treeform> Probably because most HTTP servers don't run on windows.
15:22:28FromDiscord_<treeform> You can see it creates a bunch of threads here: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L420
15:22:49FromDiscord_<treeform> Each thread runs its own event loop: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L268
15:24:13FromDiscord_<treeform> So its kind of running N separate nim programs. I don't think these threads communicate with each other. They use the OS's ReuseAddr to connect to the same address:port pair.
15:24:34FromDiscord_<treeform> You could probably do the same thing with N normal single threaded async programs.
15:26:04FromDiscord_<sveri> Interesting take. I did not know you could do that.
15:26:04FromDiscord_<sveri> Basically like just starting x AsyncHttpServers on your machin depending on the amount of cores you have and put a load balancer in front of it.
15:26:16FromDiscord_<treeform> yeah
15:26:21FromDiscord_<treeform> but the load balancer is the OS
15:26:34FromDiscord_<sveri> Exactly. And it's less ceremony.
15:26:54FromDiscord_<treeform> I usually put nginx in front of my nim servers.
15:27:18FromDiscord_<treeform> I could load balance there or event between different computers.
15:27:42FromDiscord_<treeform> I also have used haproxy in the past...
15:27:55FromDiscord_<Rika> > Why is difference between Table and TableRef important?
15:27:56FromDiscord_<Rika> i think because you want to not always need to deref to work on the table
15:28:22FromDiscord_<sveri> I used nginx too, just for the ease of installing letsencrypt with it πŸ™‚
15:28:38FromDiscord_<treeform> Totally, HTTPS is a must in todays world.
15:29:02FromDiscord_<treeform> I recommend using nginx to load balance.
15:29:18FromDiscord_<treeform> And maybe some thing like redis for inter process communication.
15:29:52FromDiscord_<sveri> I agree with using nginx as a load balancer. IPC makes things harder. I would avoid that as long as possible.
15:29:58FromDiscord_<treeform> This will mean that you could run your server on multiple machines if you need too.
15:30:15FromDiscord_<treeform> Well you are asking about async+threads
15:30:22FromDiscord_<treeform> so you must have big problems πŸ™‚
15:30:33FromDiscord_<treeform> if you don't ... do the simplest things.
15:30:36FromDiscord_<sveri> No offense, sorry if that came of as rude.
15:31:02FromDiscord_<treeform> Not offended, just agreeing with you.
15:31:32FromDiscord_<sveri> I am thankful for your suggestions.
15:31:33FromDiscord_<sveri> Coming from the java world it's just pretty easy and basically _standard_ to use threads when it makes sense.
15:32:09FromDiscord_<treeform> Well you can use threads in nim too.
15:32:21FromDiscord_<treeform> Its not that hard if you want to just use threads and no async.
15:32:29FromDiscord_<treeform> That is what Java does.
15:32:40FromDiscord_<sveri> Yea, that's true. No async in the java world.
15:33:18FromDiscord_<sveri> This lead me down into an interesting rabbit hole so far πŸ™‚
15:33:26*filcuc quit (Remote host closed the connection)
15:33:32FromDiscord_<treeform> Its an interesting rabbit hole.
15:33:41FromDiscord_<treeform> Its just a matter of power an efficiency.
15:34:34*ng0_ joined #nim
15:35:14FromDiscord_<treeform> HTTP Server power line: single threaded < multi threaded < async < async+threads < nginx + redis < haxproxy + ... < dns load balancer + haproxy per continent ...
15:36:00FromDiscord_<treeform> most people skip single threaded, do async first then skip to nginx.
15:36:07disruptekZevv: yeah. i have your png somewhere if you want it back. πŸ˜‰
15:36:26FromDiscord_<treeform> No one ever gets to DNS load balancer - that's for huge sites like Pinterest or Reddit...
15:37:15*thomasross quit (Ping timeout: 272 seconds)
15:37:25*thomasross joined #nim
15:37:27*ng0 quit (Ping timeout: 240 seconds)
15:37:29FromDiscord_<sveri> I think I just have a different point of view. Our team has been working on a rules engine with frontend and runtime. The engine runs multithreaded and it has always been enough.
15:38:04shashlickI use the same httpbeast mechanism in px2 and it works just fine on windows
15:38:08FromDiscord_<sveri> When node.js and async came up years ago it seemd like a step back to me. I am still not convinced.
15:38:15*ng0_ is now known as ng0
15:38:24shashlickI'm not sure why httpbeast isn't supported on windows
15:38:54FromDiscord_<sveri> shashlick: do you have the source somewhere available?
15:39:25*nsf quit (Quit: WeeChat 2.7)
15:39:29shashlickhttps://github.com/genotrance/px2
15:39:30FromDiscord_<treeform> @sveri thread per connection is too expensive.
15:40:02shashlickThread per core, async per thread
15:40:21FromDiscord_<sveri> shashlick: thank you, I will look into that.
15:41:05*thomasross is now known as Guest35738
15:41:05*thomasross_ joined #nim
15:41:05*Guest35738 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
15:41:05*thomasross_ is now known as thomasross
15:41:52FromDiscord_<treeform> @sveri, You usually get 2mb per thread soo a 64gb server can only handle 32,000 connections. But with async which is like like around 4kb per connection you can go to 16,000,000 connections on the same machine.
15:42:07shashlickI'm not using AsyncHttpServer though, just AsyncSocket
15:42:10FromDiscord_<treeform> @sveri but if you are not dealing which such numbers - you don't care.
15:42:24shashlickAnd a bunch of libcurl stuff but you get the basic idea
15:42:32disruptekterrible nim article, but at least it exists.
15:44:22FromDiscord_<sveri> @treeform True, that's a thing I have not considered yet.
15:44:54FromDiscord_<treeform> @sveri if you never reach such numbers - you don't have to think about it πŸ™‚
15:45:29FromDiscord_<treeform> If your business makes enough per connection you could just scales servers.
15:45:34FromDiscord_<Rika> argh cant break the habit of adding strintgs
15:45:42shashlickI disagree, making things as fast as possible is valuable if it isn't too hard
15:45:46FromDiscord_<sveri> Yea, I know. This is my spare time. I am doing premature-premature-premature-premature optimizations which I dont have to do at work πŸ˜„
15:46:08shashlickAnd dom96 has already solved async plus threads
15:46:40FromDiscord_<treeform> @sveri at one company I worked at ... our networking stack was soo bad ... we had haproxy give each connection its own machine... but they did a ton of CPU work and each user was pretty valuable so why not?
15:47:07shashlickTook me three days to get it working and most of that was because I didn't understand async well
15:47:27dom96how did you get that working on Windows? :O
15:47:28FromDiscord_<treeform> @sveri we can talk about millions of connections to machines, but that just pure IO, as soon as you are doing any work you get cache invalidation etc... it becomes soo much slower...
15:47:49shashlickYou asking me?
15:48:43FromDiscord_<sveri> @treeform Right. If someone pays for it, we do it. If my boss pays me to throw away three months of work I do it πŸ˜„
15:49:15*Hideki_ quit (Remote host closed the connection)
15:49:59*Hideki_ joined #nim
15:50:24dom96shashlick, yes
15:50:47FromDiscord_<treeform> httpbeast imports posix, that does not work on windows?
15:50:55disruptekusually, you split reads off writes early. so that may be an option you haven't considered.
15:52:22shashlickdom96: px2 uses AsyncSocket, usual async stuff, createThread and selector
15:52:33shashlickNone of that is gated on windows
15:52:45shashlickI'm not sure what else you do in httpbeast
15:54:59*Hideki_ quit (Ping timeout: 272 seconds)
15:55:04dom96well, the secret ingredient is SO_REUSEPORT which AFAIK windows doesn't support.
15:55:51shashlickThat works too
15:55:58FromDiscord_<sveri> that was my first thought too. port reusing sounds similar to deleting files that are in use, which works on linux, but not on windows.
15:56:20shashlickI did the same on my python based implementation
15:56:43shashlickIn fact my python version uses multiple processes since you know how threads are in python
15:57:26shashlickhttps://github.com/genotrance/px/blob/master/px.py#L1151
15:57:46dom96hrm, interesting.
15:58:12shashlickWhat do you import posix for
15:58:20dom96That said, an IOCP implementation would likely be the ideal on Windows
16:01:46shashlickIsn't that what asyncdispatch does
16:01:52shashlickThe underlying implementation is based on epoll on Linux, IO Completion Ports on Windows and select on other operating systems.
16:03:07dom96yes, are you using it?
16:06:39shashlickWell I'm using async so I presume that's what's being used behind the scenes
16:06:54shashlickI know nothing beyond that
16:07:15dom96that's not answering my question, are you or are you not using asyncdispatch? :)
16:10:36shashlickNot beyond the async macro, await and waitFor
16:10:58shashlickSo yes if that's the question
16:11:30dom96cool. Nice that it works
16:11:44shashlickHey I'm standing on your shoulders
16:13:20*al_ joined #nim
16:13:20*al_ is now known as Guest94576
16:14:36*thomasross_ joined #nim
16:14:36*thomasross quit (Killed (adams.freenode.net (Nickname regained by services)))
16:14:36*thomasross_ is now known as thomasross
16:22:27*Hideki_ joined #nim
16:23:06PMunchWoop woop, I hacked nim-prompt to support colours, and added live colour support to stacklang :)
16:23:21FromDiscord_<Rika> congrats
16:26:01PMunchActually works pretty well, and with my "stdlib" stacklang is actually pretty useable now :P The "stdlib": http://ix.io/2b6F (put it in stacklang.custom if you want to try it)
16:26:26*Hideki_ quit (Ping timeout: 240 seconds)
16:30:07FromDiscord_<Rika> why the quotes around standard lib
16:35:42*dddddd joined #nim
16:37:07PMunchBecase it's currently three functions :P
16:37:23livcdwhat is a stacklang?
16:37:44PMunchA `clear` function which is just a wrapper around `0 \pop until` that runs the `pop` command until the stack is 0 elements long
16:38:11PMunchAnd ( ) that essentially creates a new temporary command from everything within the brackets, essentially just a QoL thing
16:38:23PMunchlivcd, it's my little calculator/programming language :p
16:38:33PMunchThat I've spent way too much time and effort in creating
16:38:57PMunchIt started because I was annoyed that there were no simple RPN calculators for the terminal
16:39:03leorizenice
16:39:07nisstyreis there a way I can have one nimble file and build two projects? (JS backend for one, C backend for the other) ? I know I can just have a custom task that builds the JS one or something but I'm curious if there's a recommended way of doing this
16:39:24PMunchAnd while I was creating it I re-discovered my old HP-41C which has programming support
16:39:42leorizeI like how RPN calcs work but I never owned one
16:39:46leorizeluckily emulators are plenty
16:39:48PMunchAnd from there I just started adding features into some sort of weird stack based language thing :P
16:40:27disruptekyou know what's cool about the hp-41c?
16:40:42disruptekabsolutely nothing. not a thing.
16:40:50FromDiscord_<Rika> oof
16:41:08nisstyreleorize: I have an hp rpn calculator but I somehow fucked it up and it no longer works :(
16:41:13leorizenisstyre: yea a custom task is the way to go
16:41:17nisstyreleorize: ok cool
16:41:26PMunchleorize, you should try it out :) You can run it in a couple different ways, either just "./stacklang 1 2 +" and it will spit out 3. Or "./stacklang" and you will be in an interactive prompt with colours, history, and the whole shablam
16:41:49PMunchdisruptek, why are you hating on the 41C?
16:42:18nisstyrebut yeah, I turned my old HP calculator on after years a little while ago and I was hoping to recover my old programs from the memory, but it was corrupted or something
16:42:43disruptekbit rot.
16:43:54PMunchWell, what would you expect, it's from 1979 :P
16:44:22PMunchIt's the first (and really the only) calculator I've ever used
16:44:36PMunchOnce you go RPN you can't go back
16:45:27PMunchOh well, I'm off to take a shower
16:47:10FromGitter<deech> Can I use a destructor for just one field of an object and expect the rest of the fields to be freed in the standard way? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e3ee60e45000661fcab48a9]
16:48:20nisstyreseems like the JS backend is broken for me
16:48:29nisstyre/usr/lib/nim/system/jssys.nim(53, 6) Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory
16:48:39nisstyretrying to compile `echo "foo"`
16:48:40disruptekyou have no idea how hard it was to break it /just for you/
16:48:48nisstyrelol
16:54:05FromDiscord_<Rika> deech, is it not `f: var Foo` for the signature? also, i dont understand the destructor
16:54:23FromDiscord_<Rika> what is `freeAPtr`?
16:54:45nisstyreit's really weird, it only fails inside my nimble project
16:54:54nisstyreif I copy the file outside of it and compile it elsewhere it works fine
16:57:01leorize@deech: not yet
16:58:10leorizeZevv: re: manual `=destroy` needed for ref, have you tested this with strings and seqs?
16:58:31leorizeit'd be a major issue if you have to manually destroy strings and seqs if you write your own destructors
17:00:29nisstyreoh, it was my config.nims :|
17:01:05disrupteki would prefer .cfg to .nims if i were you.
17:01:22disrupteklemme restate: i prefer .cfg to .nims.
17:02:02disruptekeasier for tooling to grok.
17:02:43nisstyreI fixed it by disabling stuff explicitly
17:02:50nisstyreyeah that makes sense
17:03:10disruptekobviously, if you need nims, you need nims.
17:03:22FromDiscord_<Rika> is it guaranteed that an enum has a number tied to it? like it's guaranteed that SomeEnum.int will succeed?
17:03:38disruptekuse ord
17:04:09FromDiscord_<Rika> still
17:04:18disruptekit is guaranteed to be an ordinal.
17:04:21disruptekfocus on the semantics.
17:05:30disruptekZevv: are you still using this asyncGetAddr hack?
17:05:55ZevvIt's in production somewhere, yes
17:06:41ZevvI assume you mean https://github.com/nim-lang/Nim/issues/7422
17:06:42disbotβž₯ Async networking and blocking host name resolving / DNS
17:06:55disruptekyeah.
17:07:10disruptekit bit me in the beginning and now it bit me again.
17:07:20ZevvIt bites me in every single "async" framework
17:07:53disrupteki'm not always that unlucky.
17:08:27disruptekagree that it has to use the host's resolver.
17:08:44disrupteki hate using threads for this, but what can you do?
17:08:51Zevvfork a subprocess
17:09:05disruptekobviously worse.
17:09:11Zevvor use getaddrinfo_a
17:09:21disruptekobviously better.
17:09:23Zevvbut - surpise - wait - that uses threads
17:09:53dom96in what situation does it cause you trouble that this blocks?
17:09:56disruptekbut no one was ever fired for using getaddrinfo_a.
17:09:58dom96Are you doing lots of DNS resolutions?
17:10:07FromGitter<deech> leorize, so what's the proper way of writing a destructor for the example, ` ... = freePtr f.aPtr; f.aString = ""`?
17:10:14Zevvdom96: even if I do few, it can cause problems
17:10:21*Pqzcih5 joined #nim
17:10:33disruptekyou can't always afford the latency.
17:10:50Zevvmy case was: I talk to a farm of N servers which redirect to distribute load among each other. When there is a DNS issue *everything* stops
17:10:54Zevveven if one DNS lookup stalls
17:11:07Zevvit's simply not acceptable
17:11:10disruptekyep.
17:11:25Zevvyou can't say "well, you don't use *that much* lookups, so you only have a *bit* of a problem"
17:11:34Zevvone flakey lookup stalls your proc - boom dead
17:12:14dom96Makes sense. So how much would it take to create an async implementation?
17:12:24Zevvsee the issue
17:12:32disruptekwe're gonna go in circles here.
17:13:08*Hideki_ joined #nim
17:13:20Zevvwell, let's first fix async/thread coop then :)
17:13:27disruptekZevv: did you ever use lbnamed back in the day?
17:13:27Zevvbecause now I need to await on both
17:13:29dom96So TL;DR: write an implementation in pure Nim or use threads
17:13:31*hax-scramper quit (Ping timeout: 272 seconds)
17:13:45Zevvdom96: basically yes.
17:13:51ZevvAnd the first I find not acceptable
17:13:51disruptektl;dr: use getaddrinfo_a
17:13:57Zevvdisruptek: portability
17:14:02disrupteknot my problem.
17:14:12disrupteklbnamed?
17:14:15dom96so we should push for the ability to await a FlowVafr
17:14:17dom96*FlowVar
17:14:23Zevvriiiight!
17:14:29Zevvbut I think I gave up on that
17:14:34Zevvthat was reviewed to death
17:14:41*hax-scramper joined #nim
17:15:09dom96we were really close
17:15:23disrupteksome of these projects should be given a special tracker.
17:15:25FromDiscord_<Rika> ah, i'm too much of a scaredy cat to dream of making a PR to a language stdlib; do you think it's fine? i want to change something about how `json` parses nodes to enums
17:15:26Zevvand of course there is https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncdns.nim
17:15:30disruptekthat one and async leaks, for example.
17:15:46ZevvRika: that is what PR's are for.
17:16:03FromDiscord_<Rika> yeah, im just an anxious mess
17:16:08disruptekjust make sure you do a good job of explaining your use-case.
17:16:09Zevvsure, we can always decide to still burn you at the stake :)
17:16:13FromDiscord_<Rika> AAAAAAAAAA
17:16:16dom96Zevv, cool, can we copy that into stdlib? :)
17:16:33Zevvdom96: LICENSE says yes
17:16:45dom96I would first fix this sort of thing: Future[ptr AsyncAddrInfo]
17:17:27ZevvRika: you'll be fine. If you want to do a good job, make a PR with a good description of how and why, think about any advert consequences it might have, and just send in the PR
17:18:14Zevvdom96: please pull the rest of that repo in as well then. I'd *love* async procs
17:18:41dom96same, I use it for testing in some of my packages
17:19:34Zevveven Nim could use it so it does not die when gcc generates too much stderr outptu
17:20:06FromDiscord_<Recruit_main_70007> how do i import:
17:20:06FromDiscord_<Recruit_main_70007> namespace rlbot {
17:20:06FromDiscord_<Recruit_main_70007> struct ByteBuffer {
17:20:06FromDiscord_<Recruit_main_70007> void *ptr;
17:20:06FromDiscord_<Recruit_main_70007> int32_t size;
17:20:07FromDiscord_<Recruit_main_70007> };
17:20:07FromDiscord_<Recruit_main_70007> which is inside a dll?
17:20:09FromGitter<zetashift> And from the PR's I read, Nim maintainers are really fair to such PR's Zevv describes
17:20:40Zevvzetashift: well, I've been bikeshedded away a few times, but I just don't care.
17:21:02ZevvI put something in only becasue I personally need it, scrating my own itches. I send it in because it might be useful for others. If not, bad luck
17:21:09FromDiscord_<Rika> does nim have a commit naming scheme
17:21:16disrupteknah.
17:21:28Zevvnope. For convenience you can call it rika-something
17:21:29FromDiscord_<Rika> my lord why am i like this
17:21:50disruptekhow could gcc's too much output be a problem?
17:21:54ZevvRika: don't stress it dude.
17:21:56Zevvdisruptek: try it
17:22:09disrupteki can't, i'm trying to code.
17:22:18FromDiscord_<Rika> Zevv: last time i didnt stress something everything went wrong so :/
17:22:28disruptekbut, i am doing this in golden and so i wanna know if it's broken.
17:22:52FromGitter<zetashift> but bikeshedding (which I just googled) seems to happen a lot in these kinds of projects imho
17:23:17Zevvdisruptek: nim forky da gcc. gcc write da pipe. pipe go full. nim waity for gcc to be done. but gcc can no write because pipe issa full
17:23:29FromDiscord_<Rika> ZEVV
17:23:36ZevvRIKA
17:23:38disruptekwell, duh.
17:23:46disruptekgolden is smarter than that, at least.
17:24:02FromGitter<zetashift> JUST DO IT RIKA
17:24:20FromGitter<zetashift> I feel like I've quoted that meme clip way too many times
17:24:22FromDiscord_<Rika> I CANT I DONT WANNA RISK BEING MURDERED BY ARAQ
17:24:34FromDiscord_<Rika> oh fuck forgot that this is irc
17:24:35Zevvzetashift: I once tried to add a proc to allow a character insert into a string. Didn't make it in due to abundant opinions.
17:24:47ZevvThen I just go and rewrite the low level memory allocators or hack in the VM. An no one cares, stuff gets merged.
17:24:55*Hideki_ quit (Ping timeout: 272 seconds)
17:25:22FromDiscord_<Rika> RIP i'll be murdered nonetheless goodbye nim community; change da world, my final message. Goodby e
17:25:53disrupteki forgot about that insert-a-character-into-this-string pr.
17:25:56ZevvRika: stop whining dude and pull up the PR. You have to start somewhere, right.
17:26:02Zevvdisruptek: I tried too
17:26:32FromGitter<zetashift> tough love there zevv
17:26:32FromGitter<zetashift> that's the dutch mentality alrite
17:26:44ZevvRika: well, we *all* sent in our first PR once, right?
17:26:56*sveri quit (Remote host closed the connection)
17:27:19*sveri joined #nim
17:28:09disruptekmy first pr was amazon's marketplace web services api, in python.
17:28:10*ng0_ joined #nim
17:28:10FromDiscord_<Rika> Zevv: i've sent PRs before, just not to something this large, also my issue now is that i dont know what to name the commit; ill figure it out
17:29:08ZevvRika: I also shat my pants the first time when commiting PR's to the linux kernel. But in the end it's just pretty normal people on the other side of the line
17:29:51disruptekmonkeys building shelter out of mud and shit.
17:30:02*Pqzcih5 quit (Remote host closed the connection)
17:30:05Zevvthat kind of sums it up.
17:30:19*Pqzcih5 joined #nim
17:30:38disrupteki did some nfs fixes to lk in the late 90s.
17:30:46*ng0 quit (Ping timeout: 265 seconds)
17:31:30disruptekpre-git, everyone reads all the patches in their email.
17:31:37*nsf joined #nim
17:31:37disruptektalk about pant-shitting.
17:31:39ZevvI was *just* grepping the git log :)
17:31:49FromGitter<zetashift> just read that PR, feature reminds me of `patch()` in Scala, I couldn't come up with an example of how it solves something, isn't it just ment to ease string processing?
17:32:03FromGitter<zetashift> with that PR I ment the insert(string, char, pos) thingy
17:32:11ZevvAnyway, pizza is ready, and life has priorities
17:32:19FromGitter<zetashift> might be something for https://github.com/status-im/nim-stew tho
17:32:38FromGitter<zetashift> enjoy your meal
17:35:22FromDiscord_<Rika> what's the canonical way for converting an int to an enum
17:40:08disrupteki.SomeEnum
17:41:53*Guest94576 quit (Quit: Guest94576)
17:47:40*narimiran quit (Ping timeout: 256 seconds)
17:52:26*sveri quit (Ping timeout: 240 seconds)
17:52:34FromDiscord_<Rika> ah i should have started editing from devel...
17:54:34*tane joined #nim
17:58:34nisstyreHmm, `document.evaluate` isn't defined in the dom module
17:58:42nisstyreI'm trying to do XPath stuff
18:00:09FromDiscord_<Zachary Carter> just bind to it?
18:00:32nisstyrehow would that work?
18:00:37FromDiscord_<Zachary Carter> https://nim-lang.org/docs/jsffi.html
18:00:42nisstyreoh I see
18:00:44nisstyrethanks
18:00:51FromDiscord_<Zachary Carter> no problem
18:01:00nisstyreshould I file an issue to get it in the dom module, since it is technically part of it?
18:01:05*narimiran joined #nim
18:01:15FromDiscord_<Zachary Carter> I think a PR would be better
18:01:34nisstyremakes sense
18:01:55nisstyreugh the type signature is so complex
18:02:06nisstyreI guess I can just use JSobject
18:02:12nisstyrefor everything
18:02:37FromDiscord_<Zachary Carter> well cstring for string
18:02:58FromDiscord_<Zachary Carter> but yeah other parameters can just be JsObject or if you want to define them, you're free to do that as well
18:03:16FromDiscord_<Zachary Carter> hell someone might have already done this - may want to do a github search first
18:04:17nisstyreI did do some googling
18:04:20FromDiscord_<Zachary Carter> ah okay
18:04:25nisstyrecouldn't find anything
18:04:27FromDiscord_<Zachary Carter> well I just checked github and I'm not seeing much
18:04:38nisstyreI reckon not many people use the JS XPath stuff because it's so complicated to use
18:04:52*sveri joined #nim
18:05:53FromDiscord_<Zachary Carter> I haven't touched XPath in years and am happier because of it πŸ™‚
18:06:07nisstyresometimes it's the best solution
18:06:12*lritter joined #nim
18:06:21FromDiscord_<Zachary Carter> yeah - I just thankfully don't have to touch XML much these days
18:06:50nisstyreI'm essentially building a bookmarklet that you can use to grab the last tweet in a twitter thread, I have it working in regular JS, but I want to translate it to Nim
18:06:58FromDiscord_<Zachary Carter> ah cool
18:07:20nisstyrethen it opens up a new tab into a local server that is able to rebuild the thread from the Twitter API, and stores it in an sqlite database for you
18:07:23FromDiscord_<Zachary Carter> I'm working on implementing this pathfinding algo that @mratsim told me about earlier in the week
18:07:31nisstyrebasically like that threadreader thing, but running locally
18:07:45FromDiscord_<Zachary Carter> interesting
18:07:55nisstyreso I have all of that working, but I want to try and do it all in Nim
18:19:24livcdi just realized mratsim has a badass name
18:19:43Zevvand a badass threading lib
18:26:09*_1essn33k joined #nim
18:26:30nisstyrethe fun challenge with pathfinding (At least for games) is making them work well but not too well
18:26:38nisstyrebecause then it's not realistic
18:30:40FromGitter<zetashift> how is that going @zacharycarter ?
18:30:48FromGitter<zetashift> Are you using weave?
18:31:47Zevvzachary: you should put that in your came: some enimies just have *no* clue at all and no sense of direction. The wander 90% off and mumble to themselves about where they think they are going
18:31:56Zevv"Is that north? Pretty sure north is that way, right?"
18:33:32PMunchHmm, is it possible to conditionally add an element to an array?
18:33:56PMunchSomething like [1, 2, (if something: 3 else: discard), 4, 5]
18:34:48*_1essn33k quit (Quit: Leaving)
18:35:31disruptekmaybe using when.
18:36:38FromDiscord_<Zachary Carter> heh
18:37:08FromDiscord_<Zachary Carter> zetashift: I'm not - I can't really parallelize pathfinding in the procedural generation I'm doing, as each iteration of the pathfinding algo is dependent on previous iterations
18:37:22leorizePMunch: no, since it'd change the array type at runtime
18:37:28FromDiscord_<Zachary Carter> so I'm implementing this - http://www.gameaipro.com/GameAIPro3/GameAIPro3_Chapter22_Faster_A_Star_with_Goal_Bounding.pdf
18:37:29leorizealso we don't have a syntax for that :P
18:37:32FromDiscord_<Zachary Carter> so far so good
18:37:50PMunchleorize, ah I actually meant a sequence
18:37:58PMunchAnd it wouldn't change the type, only the length
18:38:00FromDiscord_<Zachary Carter> and Zevv: that sounds fun πŸ™‚ I will have to do this
18:38:08PMunchBut yeah, for arrays that means the type
18:38:28leorizethere aren't any syntax for that :P
18:38:57PMunchOkay, bummer
18:38:59*PMunch quit (Quit: Leaving)
18:39:05leorizeblock: (var r = [1, 2, 4, 5]; if something: r.insert(3, 2); r)
18:40:55*thomasross quit (Ping timeout: 272 seconds)
18:47:43*ng0 joined #nim
18:49:39disruptekZevv: what does it mean that your async addrinfo works fine but the sync version doesn't?
18:49:58*thomasross joined #nim
18:50:13*martinium joined #nim
18:50:27*ng0_ quit (Ping timeout: 260 seconds)
18:54:33*filcuc joined #nim
18:56:07*dadada quit (Ping timeout: 272 seconds)
18:58:35*dadada joined #nim
18:58:48*adalricus quit (Remote host closed the connection)
19:00:37*onionhammer quit (Quit: WeeChat 2.6)
19:02:53leorizethe best way to do async dns is to write your own dns resolver :P
19:03:04disruptekterrible.
19:03:15*onionhammer joined #nim
19:03:17leorizeas a starter you can just wrap libunbound, which features an async dns server
19:03:42disruptekpmunch did some with libunbound.
19:04:10disrupteki've written a couple dns servers. i don't think we want to go down that road yet.
19:04:13*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:05:10leorizeyou can do async + threadpool, if rayman22201's await FlowVar arrived to stdlib
19:07:59Zevvdisruptek: where did I say that about the sync version?
19:08:18Zevvleorize: *if* indeed
19:09:24shashlickIt works today
19:09:46leorizeZevv: ^ solved I guess?
19:11:37leorizethere's something that I've always been wondering
19:11:50leorizehow exactly do you "cancel" an async request?
19:11:51Zevvdidn't your mama tell you that?
19:11:53Zevvooh
19:11:54Zevvthat
19:11:57Zevvyou *don't*
19:12:06Araqleorize, by using Chronos I guess
19:12:20leorizeso basically you just remove all callbacks and ignore whatever the thing returns?
19:12:31Zevvno, you can't, really. It's not a feature
19:12:55*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:13:08Zevvyeah, ok, manaully removing the callbacks, that might work
19:13:23*Ven`` joined #nim
19:13:37leorizeI mean that's how it works on the OS level, right?
19:13:49*Ven`` quit (Client Quit)
19:14:04leorizeI have to read more on this
19:14:54*martinium joined #nim
19:15:22Zevvleorize: https://github.com/status-im/nim-chronos/pull/41 for inspiration
19:15:23disbotβž₯ [WIP] Initial cancellation proposal.
19:15:25disruptekwow, it's an atoz but.
19:15:27disruptekbug.
19:17:21shashlickdom96: https://github.com/dom96/choosenim/pull/164 is good to go
19:17:22disbotβž₯ Fix #28 - add ~/.nimble/bin to PATH on Windows
19:18:53dom96Araq, leorize: the only way to cancel is to close the FD that the operation is using.
19:21:41*Hideki_ joined #nim
19:26:16*Hideki_ quit (Ping timeout: 256 seconds)
19:26:16AraqZevv, disruptek, shashlick, leorize and others. Can we get ryu into the stdlib yesterday?
19:26:39rayman22201I really tried with Await flowvar. We ended up getting stuck in the weeds with the async event bug, which led me to the virtual async event PR, which has a race condition that I never figured out... And lost momentum because of chronos politics and then gc:arc
19:26:40disrupteki dunno why it's /suddenly/ a problem.
19:27:20Araqbecause /suddenly/ we noticed our serializers (json etc) are broken for floating point
19:27:23disruptekiirc, the basic ryu algo is only like 100 loc.
19:27:54disruptekthey've been broken forever. that's basically what ryu showed.
19:28:08Araqexactly. I would do it myself but I have to watch Columbo
19:28:10disruptekbut, sure, i will look at it.
19:28:18Araqthanks!
19:28:33disrupteksay `hi` to peter for me.
19:28:39dom96rayman22201, we're so close to having it!
19:30:02Zevvso what is the main rationale for ryu, performance, correctness? Why can't we rely on the c stdlib implementation?
19:30:04rayman22201We are so close to have leak free async in gc:arc too, but that last 10% is the hardest
19:30:12disruptekperformance and correctness.
19:30:44disruptekthe talks are the best introduction; pretty entertaining, actually.
19:31:03dom96rayman22201, how is that more important than spawn + async?
19:31:03ZevvI think I watched that one some time ago ye
19:31:16dom96Making spawn work with async will have a far bigger impact than async + arc
19:31:17*superbia joined #nim
19:31:45rayman22201Disagree
19:31:52leorizedo you know what will be bigger than that? making sure the new combination works with arc :)
19:32:16Zevvand integrate with weave right away, because now we have 3 kinds of awaitables
19:32:56leorizeZevv: it's easier to control the behavior when we are the one who implements it
19:33:17leorizeand besides, it's better to not rely too much on the C stdlib
19:33:19dom96rayman22201, why?
19:33:43disruptekdepending on who you ask, because closure cursors aren't a thing.
19:34:09dom96From my perspective, arc is just another GC type, it doesn't enable anything new for me.
19:34:16*tane quit (Quit: Leaving)
19:34:31leorizeit gives you new bugs if you're interested in that :p
19:34:39*thomasross_ joined #nim
19:34:39*thomasross quit (Killed (cherryh.freenode.net (Nickname regained by services)))
19:34:39*thomasross_ is now known as thomasross
19:36:11rayman22201Arc is the future of Nim. And the deterministic mm should allow Nim to actually have long running servers.
19:36:21rayman22201That's kind of a big deal imo
19:36:52*nsf quit (Quit: WeeChat 2.7)
19:37:05disruptekit will close leaks, enable better tooling and detection, and enable lots of new optimization opportunities.
19:37:10rayman22201I arguably think we need a new async all together. Rust style polling. The current asyc is legacy as far as I'm concerned
19:37:18disruptekagree.
19:38:24rayman22201I want the current async to work, to make the transition to arc smoother, but I'm less enthusiastic about making new features for it
19:39:19rayman22201And the politics around the sync event bug make it a hurculean effort to make any progress
19:39:25*superbia left #nim ("WeeChat 2.4")
19:39:27disruptekwe'll build something heavier on weave and then we'll have a story we can stand behind.
19:41:41dom96I agree about new async. Zero-cost futures themselves are a good goal and we will need to break stuff to get there.
19:41:43rayman22201I think weave is important for compute intensive multithreading, but I think we might also need something like seastar for more io bound multithreading.
19:42:23disruptekit's a fire-and-forget solution.
19:42:36rayman22201Agree @dom96
19:42:39dom96But long running servers are already a thing. You don't need arc for that.
19:42:55dom96Also, I'm curious which politics you're talking about.
19:43:11*thomasross quit (Ping timeout: 260 seconds)
19:43:12*thomasross_ joined #nim
19:43:12*thomasross_ is now known as thomasross
19:43:17rayman22201You were there lol
19:43:20livcddom96: you getting mad that status is writing its own async implementation
19:43:40*tane joined #nim
19:43:56dom96rayman22201, my memory is very short for this kind of thing :)
19:44:23dom96livcd, huh?
19:44:28rayman22201It took me a month to get that ioselector bug merged that was an obvious bug, because a certain person at status could not believe me.
19:45:51dom96:o
19:46:00rayman22201And that same person has said virtual async event is crap and is working on an alternate implementation in chronos
19:46:17livcdwho?who?who?
19:46:19dom96So what stops me from merging it?
19:46:36dom96I'll happily merge it if we can get this feature.
19:46:59rayman222014raq does. He always ends up being the middle man.
19:47:39rayman22201And instead of fighting all the time I decided it was more productive to do other things.
19:48:01dom96Ar4q can be reasonable, you just have to convince me and i'll fight for you. :)
19:49:07livcdare you trying not to highlight him ?
19:49:33leorizeyep, he's busy and should not be dragged into these conversations :P
19:51:16livcdsmart!
19:51:29dom96So which do we want, #12232 or #12372?
19:51:30disbothttps://github.com/nim-lang/Nim/pull/12372 -- 3Virtual async events 2
19:53:10disruptekdisbot prefers the 2nd one, i guess.
19:53:31leorizecan someone look at #13201 and provide me additional feedback on what kind of multiprocess server that I'm making hard to write?
19:53:33disbothttps://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default
19:54:03leorizeI can add more escape hatch if needed to not hinder such use case
19:54:44disrupteksounds like fud to me.
19:56:55leorizewell the concern was raised by folks at status from what 4raq told me on irc
19:57:09leorizeI'd expect them to know a thing or two about this stuff
19:58:50*ng0_ joined #nim
20:00:42dom96Why don't Status comment on the PR?
20:02:37*ng0 quit (Ping timeout: 272 seconds)
20:04:02leorize*shrug* well but I'll be adding -d:nimInheritHandles
20:04:27disruptekseems like a fine compromise to me.
20:06:51dom96huh, doesn't your PR still make it possible to restore the default behaviour via some flag or something?
20:07:09dom96(runtime flag I mean)
20:07:22leorize"backward compatibility" is the key here I s'pose
20:08:26leorizebasically I just change every inhertiable runtime flag into defined(nimInheritHandles) :P
20:08:48dom96IIRC Status is still on Nim pre-1.0
20:08:56dom96so it's odd that they'd care about this
20:09:27dom96I guess they may want to update to a Nim 1.1 (which to be fair shouldn't break compatibility)
20:09:42disrupteknah, they are on 1.0.4+.
20:11:18*xet7 quit (Read error: Connection reset by peer)
20:11:27*xet7 joined #nim
20:13:03rayman22201Sorry, driving. Second one is correct
20:13:23leorizeyou shouldn't drive and text
20:13:37rayman22201😝
20:14:05dom96Please don't drive and IRC
20:14:14*Jesin quit (Quit: Leaving)
20:16:00*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:16:47*thomasross quit (Ping timeout: 240 seconds)
20:17:00*Jesin joined #nim
20:17:45*thomasross joined #nim
20:27:40Zevvleorize: 13201 comments is FUD. It's not "much harder". It's just about documenting that you should be explicit about what you want to inherit.
20:27:50ZevvIt's one single call you need to do somewhere
20:28:29Zevvbut breaking compatibility is a fair point - existing code expecting fds to inherit will be surprised
20:28:35*filcuc quit (Quit: Konversation terminated!)
20:29:13leorizein the case of sockets, it's even easier, you just toggle a flag, and I believe that's the most common use case
20:29:32ZevvAnd pipes
20:29:40Zevvare commonly shared between parent and child
20:29:55leorizewe don't even have apis to create pipes :P
20:30:13Zevvwell, the normal posix ones, but these will not be affected anyway
20:30:20leorizeyea
20:30:24ZevvI'm jus accustumed to close all fds >2 anyway, but still
20:31:11leorizedo you want to add a close_fds flag to startProcess like python? :)
20:31:26leorizeit will just stall your process startup by around 400ms on freebsd :)
20:31:45Zevvyeah I hate it, there is no good common api for that
20:31:52ZevvIn linux you can iterate /proc/self/fd at least
20:32:18Zevvbut to be fair, how often do I use all that. Twice a year maybe?
20:35:14disruptekyou put the break in changelog; this isn't getting backported, is it?
20:35:36leorizeit wouldn't be backported
20:35:44leorizeand I'll have to write a change log message
20:35:46disruptekso it's fine.
20:35:58leorizemy english is horrible for this
20:36:13disruptekjust paste it here and we'll polish it.
20:40:24rayman22201@dom96 Now that I'm no longer doing dangerous things for the moment. I can finish my rant. Lol.
20:41:48rayman22201A lot of it is this: I'm glad you will fight for certain changes, but the reality is that you are not here as often, and I have limited time myself.
20:42:19rayman22201I have to choose the things that I'm most interested in.
20:42:42rayman22201I personally want to buse arc and asyc, so that was more important to me
20:42:59rayman22201Use / abuse, either one lol
20:43:43rayman22201That being said. We are close. I will try to look at it again
20:43:54dom96I understand
20:44:04dom96but indeed, I feel like we are super close
20:45:05rayman22201The biggest thing is the race condition I found. I don't remember the details. I will have to re grok the problem a little bit.
20:46:11rayman22201The regular async event didn't have the problem because the OS did all the hard locking stuff for us. The one advantage to having a FD for every event.
20:52:50*ng0 joined #nim
20:55:59*ng0_ quit (Ping timeout: 260 seconds)
20:59:41Zevv@leorize: https://github.com/nim-lang/Nim/issues/13373
20:59:43disbotβž₯ Nim lacks ref object constructor ; snippet at 12https://play.nim-lang.org/#ix=2b8u
21:01:30leorizeplease make an issue for no finalizer syntax for ref objects too :)
21:01:58ZevvAr_q will just veto that I guess. Finalizers are niche things
21:02:22leorizeit'd be needed for a new implementation of File :p
21:02:26shashlickI like 4raq best
21:02:28leorizesince those should use ref semantics
21:03:10FromGitter<alehander92> Iraq
21:03:14Zevvsure, but you make a FileObject and a File
21:03:23Zevvand put the =finalize on `var FileObject`
21:03:49Zevvthe solution is trivial. If you would type seven finalizers a day it would be handy
21:03:59Zevvbut I guess you don't
21:04:27leorizetrue that
21:04:48shashlickThat's cool too, 4raq looks best
21:04:57shashlickBut Ar4q sounds best
21:05:00Zevvor just Q
21:05:13shashlickR-foque
21:05:36FromDiscord_<clyybber> Just define a =destroy
21:05:41FromDiscord_<clyybber> No finalize needed
21:06:06FromDiscord_<clyybber> Its the same thing
21:07:26shashlickA BFDL shortcut is a more important discussion IMO
21:07:38Zevvclyybber: yeah that is what I ment. but you can't put that on a ref type
21:07:56*ng0_ joined #nim
21:07:57FromDiscord_<clyybber> Zevv: But you'd want the finalizer to be run when the rc is zero?
21:08:12FromDiscord_<clyybber> So you define `=destroy(x: var someRefType[])`
21:08:31Zevvyes - someRefType indeed. But sometimes I do not have a reftype
21:08:33Zevvbut a ref var
21:08:50Zevvoh wait no sorry, I'm rambling
21:08:50FromDiscord_<clyybber> Huh, wdym?
21:08:58FromDiscord_<clyybber> I think you meant the other way around
21:09:21Zevvyou can't do that: =destroy does not take 'var ref', it must be 'var object'
21:09:27Zevv/tmp/t.nim(6, 1) Error: signature for '=destroy' must be proc[T: object](x: var T)
21:09:36FromDiscord_<clyybber> Eh, I was trying to deref the type here
21:09:47*ng0 quit (Ping timeout: 240 seconds)
21:09:49FromDiscord_<clyybber> Should be `type(default(someRefType)[])`
21:10:00*FromGitter quit (Read error: Connection reset by peer)
21:10:01FromDiscord_<clyybber> IMO you should just be able to deref types
21:10:17ZevvCan you fix this for me? https://play.nim-lang.org/#ix=2b8z
21:10:19*FromGitter joined #nim
21:11:06FromDiscord_<clyybber> tyg: https://play.nim-lang.org/#ix=2b8B
21:11:27FromDiscord_<clyybber> oh, wait a minute
21:11:30Zevvyou make my eyes hurt
21:11:57Zevv)[])) is kind of offending
21:12:09FromDiscord_<clyybber> yeah
21:12:11FromDiscord_<clyybber> I agree
21:12:16Zevv/tmp/t.nim(6, 1) Error: too many brackets
21:12:18FromDiscord_<clyybber> sadly Iraq doesnt agree
21:12:19*letto quit (Ping timeout: 260 seconds)
21:12:50ZevvWell, fair enough: like I mentioned above, it's probably not worth making some special syntax for this because it would be pretty rare
21:13:08leorizehttps://play.nim-lang.org/#ix=2b8D
21:13:12FromDiscord_<clyybber> https://github.com/nim-lang/Nim/issues/12363 would be cool
21:13:12ZevvI can put an issue up if you thank it's worth discussing
21:13:14disbotβž₯ [Feature] Extend dereference operator to types to get base ; snippet at 12https://play.nim-lang.org/#ix=2b8E
21:13:19leorizeI broke your example :P
21:13:31FromDiscord_<clyybber> the issue is, it doesn't echo anything for some reason
21:13:50Zevvha
21:13:53FromDiscord_<clyybber> leorize: Lol
21:16:45FromDiscord_<clyybber> leorize: can you report it?
21:17:12leorizeI'm kinda busy rn, so no :p
21:18:34FromDiscord_<clyybber> alright, Im gonna do it then :p
21:19:09FromDiscord_<clyybber> oh,
21:19:10FromGitter<alehander92> good thing we dont have
21:19:12FromGitter<alehander92> a ref guy
21:19:14FromDiscord_<clyybber> it may not be a bug
21:19:23FromGitter<alehander92> what to do
21:19:48FromDiscord_<clyybber> ref me like one of your french girls
21:20:06Zevvargh leorize I forgot your github name, what was it
21:20:13FromDiscord_<clyybber> alaviss
21:20:17Zevvright
21:20:22leorizecheck your vim config if you forgot :P
21:20:25FromDiscord_<clyybber> leorize: its not a bug, DateTime requires explicit init
21:20:49leorizei know, it's just that you can't define destructor with that pattern for certain objects
21:21:20zedeusdom96: did you see #13361? it broke jester
21:21:22disbothttps://github.com/nim-lang/Nim/issues/13361 -- 3asynchttpserver form data/body broken with #13147 ; snippet at 12https://play.nim-lang.org/#ix=2b8H
21:24:33FromDiscord_<clyybber> leorize: The destructor doesn't make an error though
21:24:37FromDiscord_<clyybber> its your constructor
21:24:38FromDiscord_<clyybber> https://play.nim-lang.org/#ix=2b8D
21:32:17*letto joined #nim
21:38:47*dadada quit (Ping timeout: 240 seconds)
21:39:53*martinium joined #nim
21:41:05*martinium quit (Client Quit)
21:57:17*Pqzcih5 quit (Remote host closed the connection)
21:59:09*thomasross quit (Ping timeout: 272 seconds)
22:01:23dom96zedeus, :(
22:02:17zedeusbody is now always empty, you need to use bodyStream. was that intended?
22:02:46dom96if it breaks stuff then definitely not
22:03:02*PMunch joined #nim
22:04:23leorizeoh is asyncstreams a thing now?
22:04:33Zevvit seems
22:04:42ZevvI used it the other day
22:04:45leorize> Unstable API.
22:04:47leorizehttps://nim-lang.org/docs/asyncstreams.html
22:09:29*thomasross joined #nim
22:14:18lqdev[m]lol https://nim-lang.org/docs/sequtils.html#filterIt.t%2Cuntyped%2Cuntyped
22:14:34lqdev[m]binary floating point numbers.
22:15:07disruptekthey sure are fun.
22:18:47*narimiran quit (Ping timeout: 272 seconds)
22:20:10PMunchUgh, Nim really needs a better macros module..
22:20:22PMunchRemind me to create one when I'm back from vacation :P
22:21:35dom96True that
22:25:43*ng0 joined #nim
22:29:33*ng0_ quit (Ping timeout: 272 seconds)
22:31:27*hax-scramper quit (Ping timeout: 240 seconds)
22:31:34*solitudesf quit (Ping timeout: 256 seconds)
22:31:38*hax-scramper joined #nim
22:37:30lqdev[m]+1
22:38:22leorize4raq thought about it iirc
22:38:40shashlickdom96: am moving into nimble work, unless any other crucial choosenim work
22:38:48shashlickDo we want to make another release
22:39:03dom96my main concern is the openssl crash
22:39:51shashlickOh ya there's that one too
22:40:14shashlickThere is an issue with nimble since Nim 1.0
22:40:26enthus1astcan i somehow check in a macro if a proc with the given signature exists?
22:40:37shashlick@leorize found it while testing nimble packages
22:42:20PMunchenthusiast, well you can output a when declared statement..
22:42:59Zevventhus1ast: Sometimes you can abuse `compiles`
22:43:48shashlickhttps://irclogs.nim-lang.org/07-02-2020.html#03:04:14
22:43:59shashlickFails on 1.0 Nim but works on 0.20.2
22:44:05shashlickSo it's a Nim change
22:44:15enthus1astit seems that compiles works for: compiles(strfunc("")) but not for compiles(strfunc(string))
22:44:16shashlick@leorize ^^
22:45:33*thomasross quit (Ping timeout: 268 seconds)
22:46:39enthus1astwhat i'm trying to do is to patch json to deserialize objects in a predefined way, the quasi opposite of `%*`(mytype: MyType)
22:46:58*thomasross joined #nim
22:47:42enthus1astmy idea was to let the to macro call also my defined to procs for a given type
22:50:36enthus1astbut i'm unsure if this could work out :/
23:01:33*Ven`` joined #nim
23:05:58*ftsf joined #nim
23:11:21*hlavaty quit (Ping timeout: 272 seconds)
23:23:22*Hideki_ joined #nim
23:27:10*u0_a121 joined #nim
23:27:38*Hideki_ quit (Ping timeout: 240 seconds)
23:29:06*PMunch quit (Quit: Leaving)
23:32:31*sveri quit (Read error: Connection reset by peer)
23:34:00*martinium joined #nim
23:43:32*u0_a121 quit (Read error: Connection reset by peer)
23:46:29*ng0_ joined #nim
23:47:04*tane quit (Quit: Leaving)
23:49:21*ng0 quit (Ping timeout: 272 seconds)
23:50:18*u0_a121 joined #nim
23:51:48*thomasross_ joined #nim
23:51:48*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
23:51:48*thomasross_ is now known as thomasross
23:55:07*theelous3 quit (Ping timeout: 240 seconds)