<< 06-04-2020 >>

00:01:20ryukoposting(update on GC_ref extravaganza: maybe I should just not be lazy and redesign my audio buffer queueing)
00:02:02*Jesin joined #nim
00:03:00wgetchwell thanks again for the help. finally parsed this binary format that eluded me for months :P
00:03:12leorize[m]looks like the 1.2 release bought a lot of newcomers here :)
00:03:15ryukopostingnice
00:03:33ryukopostingand every single one wants to know how to turn an array of bytes into a string
00:03:53wgetch^_^
00:04:16IWSnimBut wow I'm glad I've found this lang. After doing the same in rust and in C this is a real breath of fresh air
00:05:06IWSnimSo thanks for the answers guys :)
00:05:22FromDiscord<Rika> what was wrong with rust or C???
00:05:30ryukopostingfor sure, there's always someone here to help
00:05:53IWSnimNothing really wrong with them, it just didn't click like this has
00:06:19ryukopostingC is very good at a certain set of tasks that it was designed to do, and it's pretty terrible at everything else
00:06:37FromDiscord<Rika> C is good if the programmer is πŸ˜›
00:06:51ryukopostingC is my job lol
00:07:43IWSnimmy primary lang is PHP (ducks), but I am loathe to do anything that involves sockets or bit-heavy things like protocol emulation in it
00:07:55FromDiscord<Rika> quack
00:07:58Demos[m]I hear modern PHP is a pretty nifty language
00:08:13IWSnimYea, it's gotten a *lot* better in the past few years
00:08:29FromDiscord<Rika> companies are stubborn to update though arent they lol
00:08:30ryukopostingfor a long time it was the constant subject of ridicule
00:08:37IWSnimsadly lots of the world is still running on ancient versions and there's so much "bad idea tutorials" out there
00:08:51IWSnimlike the first tutorials you find for forms + mysql are like
00:08:56leorize[m]nim used to have a php backend fwiw :p
00:09:00*whaletechno joined #nim
00:09:30ryukopostingit's like how junior car journalists pick on the pontiac aztek, it's an easy target. PHP was every new hacker news member's punching bag
00:09:38Demos[m]hmm. I almost always learn a new language by reading the manual cover-to-cover (some exceptions like c++)
00:10:02IWSnimINSERT INTO users (name, password) VALUES (" . $_POST['name'] . ", " . $_POST['password'] . ")";
00:10:05IWSnimor something
00:10:06Demos[m]and kinda fortran, unfortinately the manual is written in standardese and there are no resources for really learning modern fortran other then its standard
00:10:09FromDiscord<Rika> `PHP was every new hacker news member's punching bag` i fear for nim
00:10:18IWSnimand that's obviuosly horrific
00:10:24IWSnimbut that's the state of PHP tutorials.
00:10:39ryukopostingnim will never be that, too fringe
00:10:41IWSnimThat or you go straight to laravel or Symfony and quickly explode your DB due to lazy loading ORMs
00:10:47Demos[m]fun fact. I wrote a nim module that let you write that but always extracted the subs to paramaterized queries
00:11:02leorize[m]you can read c++ spec cover to cover if you're crazy enough
00:11:09Demos[m]oh, I know
00:11:16FromDiscord<Rika> `nim will never be that, too fringe` not sure if good or not
00:11:21Demos[m](my dayjob is a c++ standard library implementer)
00:12:19IWSnimYea, I got my toy projects. I'm super excited to play around with raw sockets and implement IS-IS or something
00:12:43IWSnimthis looks perfect for small stuff like that
00:13:42Demos[m]grrr I don't like IS-IS
00:13:55Demos[m]and not just because it's the most unfortinately named protocol out there
00:14:12IWSnimCLNS got ya down?
00:15:05Demos[m]prefer OSPF3
00:15:17Demos[m]since open implementations are a little better
00:15:49IWSnimYea can't argue there
00:16:04IWSnimI've always used quagga + BGP if I needed an appliance to peer with the network though
00:16:07IWSnimlike Anycast dns or whatever.
00:16:43IWSnimhaven't tried opsfd or whatever else is there in Zebra? etc
00:20:09ryukopostingif I have a global non-ref object, is that safe for another thread to stick its fingers into, provided I handle synchronization right?
00:30:55leorize[m]yes, as long as the gc is not involved, you're fine
00:37:22ryukopostingpray to the nim gods that I've finally found a way to make this stupid thing not segfault
00:38:47ryukopostingokay, loop 2, no explosion yet
00:48:20*pbb quit (Ping timeout: 265 seconds)
00:48:36*pbb joined #nim
00:53:46*krux02_ is now known as krux02
00:58:24*Zectbumo quit (Remote host closed the connection)
00:59:44*dwdv quit (Ping timeout: 256 seconds)
01:13:17*dongbei joined #nim
01:13:20dongbeihi
01:13:25dongbeii was just wondering why they get so much praise. To me they only seem like a way to make a domain specific syntax but don't do anything super important over anything that functional programming concepts can accomplish. Hopefully someone can explain how my point of view is flawed. I don't mean to start a fight btw, just lost.
01:13:36dongbeii have a question about macros and why they're important.
01:13:44dongbeiout of order, please excuse me
01:14:25dongbeii'm still not grasping the importance of macros so I'd like some help
01:20:53*chemist69 quit (Ping timeout: 265 seconds)
01:22:40*chemist69 joined #nim
01:22:56dongbeihi chemist
01:24:39leorizedongbei: so for starters, it let you write your own features without explicit compiler support :)
01:25:06leorizea big feature that's the prime example of this is Nim's async-await system
01:25:25leorizeimplemented completely using macros, no special casing in the compiler was used, at all
01:26:36leorizethis also bring up the possibility of creating nice syntax and efficient code at the same time
01:26:41leorize!repo weave
01:26:42disbothttps://github.com/mratsim/weave -- 9weave: 11A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead 15 134⭐ 8🍴
01:27:40leorizeand if you're used to functional programming things such as pattern matching, we got you covered
01:27:41leorize!repo gara
01:27:42disbothttps://github.com/alehander92/gara -- 9gara: 11 15 63⭐ 5🍴
01:27:50FromDiscord<Bawbby> quick q: how do i pass --threads:on for compile flags with nimble?
01:29:45dongbeileorize: thank you, I'm reading about those projects right now
01:29:51leorize@Bawbby: add it to your config.nims file
01:31:38FromDiscord<Bawbby> never used a config.nims before, how would I do that?
01:32:00leorizemake a file named config.nims in your project
01:32:11leorizethen add --threads:on in there
01:33:00leorizethe syntax of this file is nimscript
01:33:10leorizehttps://nim-lang.org/docs/nims.html
01:33:16leorizeyou can read more over here
01:33:30FromDiscord<Bawbby> alright, I'll take a look at that, thanks.
01:36:51FromDiscord<KingDarBoja> Oh, TF2 engineer is here!
01:41:15*cjb` joined #nim
01:41:33ryukopostingFINALLY audio queueing works, explosion-free
01:41:36disruptekuse .cfg instead, please.
01:41:50*cjb quit (Ping timeout: 250 seconds)
01:47:57*cjb` quit (Quit: ERC (IRC client for Emacs 26.3))
01:49:43*dongbei quit (Ping timeout: 265 seconds)
01:51:26*krux02 quit (Remote host closed the connection)
01:52:14FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2gNh
01:52:51FromDiscord<KingDarBoja> Trying to pass a generic procedure to some type procedure but getting the error on the playground (which is the same I got locally on some different setup)
01:53:22FromDiscord<KingDarBoja> The procedure argument will be different procedures with different return types
01:53:47FromDiscord<KingDarBoja> But those return values will be used by the generic one to perform the same operation
01:54:42FromDiscord<KingDarBoja> Forgive me if I didn't make it understandable πŸ™ˆ
01:54:51*dongbei joined #nim
01:57:44leorizeKingDarBoja: here you go: https://play.nim-lang.org/#ix=2gNj
01:58:21leorizeto pass generic params with UFCS, use `[:T]`
02:01:46FromDiscord<KingDarBoja> UFCS?
02:02:03FromDiscord<Rika> TIL
02:02:13FromDiscord<Rika> nice, been trying to figure out how to do that for so long
02:02:18leorize[m]method call syntax
02:02:25FromDiscord<Rika> why the weird syntax though?
02:02:32*ryukoposting quit (Quit: Leaving)
02:03:01*ryan_ joined #nim
02:03:13*ryan_ is now known as number_two
02:03:20leorize[m]to not be ambiguous w index addressing
02:03:43*FromDiscord <KingDarBoja> Uniform Function Call Syntax (UFCS)
02:03:51number_twoHey all, congrats on 1.2!
02:05:53FromDiscord<KingDarBoja> Replaced the `:int` by `:Student` (and did the same on my local code) and got pretty much same error
02:05:57FromDiscord<KingDarBoja> "type mismatch: got <Classroom, int literal(9), proc (self: Classroom): int{.noSideEffect, gcsafe, locks: 0.}>"
02:06:11FromDiscord<KingDarBoja> But expected this -> "proc (self: Classroom, someParam: int, a: proc (self: Classroom): Student{.closure.}): seq[Student]{.noSideEffect, gcsafe, locks: 0.}"
02:06:41FromDiscord<KingDarBoja> I dont see the difference...
02:08:32*dongbei quit (Ping timeout: 258 seconds)
02:10:40*ryan_ joined #nim
02:10:46*ryan_ is now known as tanger
02:12:59*number_two quit (Ping timeout: 256 seconds)
02:18:14*dongbei joined #nim
02:22:39*dongbei quit (Ping timeout: 250 seconds)
02:23:04leorizeKingDarBoja: int vs Student
02:27:06*endragor joined #nim
02:34:21*muffindrake quit (Ping timeout: 265 seconds)
02:36:08*dongbei joined #nim
02:36:17disruptek~news
02:36:18disbotnews: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. -- disruptek
02:36:31*muffindrake joined #nim
02:46:04disrupteksupakeen: thanks for that pr.
02:57:04FromDiscord<Rika> @KingDarBoja your proc that your passing returns an int, when it expects a Student
02:57:18*dongbei quit (Read error: Connection reset by peer)
02:59:22*a_chou joined #nim
03:00:29*a_chou quit (Client Quit)
03:01:16*a_chou joined #nim
03:02:58*a_chou quit (Client Quit)
03:03:55FromDiscord<KingDarBoja> πŸ€¦β€β™€οΈ
03:03:59FromDiscord<KingDarBoja> You're right
03:06:25*drewr quit (Ping timeout: 240 seconds)
03:09:26*endragor quit (Remote host closed the connection)
03:09:53*endragor joined #nim
03:10:30*endragor quit (Remote host closed the connection)
03:10:39*endragor joined #nim
03:16:37FromDiscord<Rika> lmaoooo
03:22:12*chemist69 quit (Ping timeout: 265 seconds)
03:23:08*chemist69 joined #nim
03:24:45*Zectbumo joined #nim
03:26:30FromGitter<eliezedeck> https://play.nim-lang.org/#ix=2gL9 ⏎ @dom96 @Araq : all versions of Nim is affected by this bug, not just latest or 1.x ... I would say this is a *priority bug* (unless there is a define or something that I should use instead), and I'm wondering how this got past the 1.x ... I mean it's not uncommon to have multiple await on a single future value. I'm currently writing a program that does exactly this, and it's
03:26:30FromGitter... basically broken because only the last await will be triggered. @dom96 as per your suggestion, where in the source code should I go in order to patch this? I should be able to send a PR, hopefully.
03:27:01*Tlongir joined #nim
03:30:03*tanger quit (Ping timeout: 256 seconds)
03:34:10FromDiscord<KingDarBoja> But still doing that on my code (the local one) yields something similar, I do better check again to see if I am missing something
03:36:24FromDiscord<KingDarBoja> I think it is because I am trying to get the value of the passed procedure into the sequence, perhaps? https://play.nim-lang.org/#ix=2gNF
03:39:01FromDiscord<Rika> one moment, ill look into it
03:40:01FromDiscord<Rika> humbleSample returns a seq[proc], not a seq[T], i think you didnt call the proc is why
03:40:20FromDiscord<Rika> https://play.nim-lang.org/#ix=2gNG here @KingDarBoja
03:41:42FromGitter<ksandvik_gitlab> It it deliberate that nim source files with a dash, like foo-thing.nim is considered a module?
03:42:47FromDiscord<KingDarBoja> Oh...
03:43:05FromDiscord<KingDarBoja> I thought the procedure was being called as soon as the parameter refering to that was called
03:56:11FromGitter<eliezedeck> @dom96 @Araq so I posted a bug report about it: https://github.com/nim-lang/Nim/issues/13889
03:56:13disbotβž₯ Critical: 1 completed Future, multiple await: Only 1 await will be awakened (the last one) ; snippet at 12https://play.nim-lang.org/#ix=2gNK
03:59:26FromGitter<eliezedeck> @ksandvik_gitlab I believe so ... it seems a bit limiting too from my point of view, but I haven't written big modules yet to be hindered by it so far ... largest file I wrote so far is about 500 lines of code, I'm just beginning to use Nim now after years of not using it
04:00:03FromGitter<eliezedeck> I think, every file is a module ... or, at least, that's how I feel
04:00:17FromGitter<ksandvik_gitlab> OK, just an interesting gotcha using a '-' in a file name.
04:00:40FromGitter<eliezedeck> simply because every-file has its own context, not visible to other files, unless exported ... to me, that's a module
04:01:35FromGitter<ksandvik_gitlab> I like Nim's module system as it's not over-engineered, usually you just want a path wherefrom to import and annotate vars or functions with a *.
04:02:41FromGitter<eliezedeck> in the old days, I believe it was a convention (I might be wrong) to not use any dash or underscore for file names ... like, asyncdispatch, not async-dispatch; I suppose that is still the case nowadays
04:02:50FromGitter<eliezedeck> indeed, it's simple and convenient
04:03:24FromGitter<ksandvik_gitlab> I like something to separate meaning in file names but I could live with this.
04:03:37*xace quit (Ping timeout: 250 seconds)
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:38*supakeen joined #nim
04:08:34leorize@ksandvik_gitlab: module name must be a valid identifier
04:09:04leorizethe restriction can be lifted, but no one really pressed it so it's there :p
04:16:20FromGitter<ksandvik_gitlab> OK, was just interesting to see that the warning was mentioned with a single .nim file with no modules, but if every file is basically a module then it makes sense.
04:17:07*uu91 quit (Ping timeout: 260 seconds)
04:18:09FromDiscord<Rika> i like how nims modules are super straightforward
04:18:25FromDiscord<Rika> breath of fresh air from something like pythons system
04:23:24*uu91 joined #nim
04:31:03*waleee-cl quit (Quit: Connection closed for inactivity)
04:31:50*nsf joined #nim
04:48:32*dongbei joined #nim
04:52:06*rockcavera quit (Remote host closed the connection)
05:04:19FromDiscord<KingDarBoja> Good night everyone, πŸ˜„
05:11:28FromDiscord<Rika> gn
05:14:58*narimiran joined #nim
05:21:05*Pixeye joined #nim
05:36:25*dongbei_ joined #nim
05:39:06*dongbei quit (Ping timeout: 256 seconds)
05:41:18*dongbei_ quit (Ping timeout: 256 seconds)
05:41:31*dongbei joined #nim
05:46:16*andinus joined #nim
05:46:30*xace joined #nim
05:58:36supakeenGood morning :)
06:03:47*PMunch joined #nim
06:05:33FromDiscord<Rika> good morning
06:05:59FromGitter<eliezedeck> good morning :)
06:19:03*leorize quit (Ping timeout: 240 seconds)
06:20:52*uu91 quit (Ping timeout: 265 seconds)
06:21:20*leorize joined #nim
06:22:19*dddddd quit (Ping timeout: 256 seconds)
06:23:23*uu91 joined #nim
06:24:23*uu91 quit (Read error: Connection reset by peer)
06:24:38*uu91 joined #nim
06:25:41*kenran joined #nim
06:31:43FromDiscord<Benumbed> oh my god, whoever added dark mode to the docs by default, I am your biggest fan
06:31:46FromDiscord<Benumbed> my eyes love you
06:32:15FromDiscord<Rika> it was added on release of 1.2
06:32:29FromGitter<eliezedeck> indeed
06:33:16FromDiscord<Benumbed> I know it was added in 1.2, but someone had to make that decision and fix the docs to do it
06:33:39FromDiscord<Benumbed> And I wanted to express my appreciation to that person, whomever they are
06:33:53FromDiscord<Rika> devel docs were like that before 1.0.4 afaik
06:41:25*arecaceae quit (Remote host closed the connection)
06:41:51*arecaceae joined #nim
06:59:50*solitudesf joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:44*gmpreussner joined #nim
07:27:33*dongbei quit (Quit: leaving)
07:37:44*wowi42 joined #nim
07:41:07*Vladar joined #nim
07:41:19*hax-scramper quit (Read error: Connection reset by peer)
07:41:42*hax-scramper joined #nim
07:44:09*voltist joined #nim
07:46:17*hax-scramper quit (Ping timeout: 260 seconds)
07:46:36*hax-scramper joined #nim
07:48:46voltistIs there a proc/macro in the standard library that takes a string and a series of arguments, then executes the proc of that name with those args?
07:50:47FromDiscord<Rika> no, but a macro is doable
07:51:24voltistOk I might give it a go
07:57:45*hax-scramper quit (Ping timeout: 258 seconds)
07:58:18*hax-scramper joined #nim
08:00:16FromDiscord<Rika> https://play.nim-lang.org/#ix=2gOj how would i go by this more elegantly?
08:01:01FromDiscord<Rika> `current.hitObject is HitObject` but can be `of AnySubtype`
08:03:09axionThat is a good case for `case`
08:03:21FromDiscord<Rika> can you even case this?
08:03:50FromDiscord<Rika> also youre not on mumble today
08:04:32axionNope, and won't be
08:04:38FromGitter<Vindaar> @voltist: I fixed a lot of things yesterday and it should work for you now. I haven't merged the PR yet, but will probably do it later today. I added the neural spike plots as recipes here: ⏎ https://github.com/Vindaar/ggplotnim/blob/arraymancerBackend/recipes.org#creating-a-neural-spike-plot-in-ggplotnim
08:05:49voltistV1ndaar: I'm getting an error now about there not being a data scale for setting ticks or something? I will be at my computer in a bit if you want specifics
08:05:51leorize@Rika: use a method
08:07:07FromGitter<Vindaar> @voltist: Did you pull the current changes from the branch?
08:07:22FromGitter<Vindaar> That error usually means that your x or y axis has no data
08:07:38FromGitter<Vindaar> which could of course be a bug
08:08:16FromDiscord<Rika> leorize: all but Circle are fields, Circle's the only one that's a proc
08:08:33FromDiscord<Rika> hmm
08:08:34FromDiscord<Rika> okay
08:09:30FromGitter<Vindaar> @voltist: and btw why do you write my name with a 1 instead of i? And if possible add an `@` before my name, because otherwise it doesn't show up as a ping on gitter
08:18:34*hax-scramper quit (Read error: Connection reset by peer)
08:18:48*hax-scramper joined #nim
08:20:07FromDiscord<Benumbed> Um, has anyone else had problems with httpclient and HTTP 204 responses?
08:20:26FromDiscord<Benumbed> When I get one, the client just hangs indefinitely
08:20:28FromDiscord<Rika> what's the issue exactly
08:20:40FromDiscord<Benumbed> I just said what it was ^ πŸ™‚
08:21:04FromDiscord<Rika> yeah, that was sent before i saw the 2nd mesasge
08:21:05FromDiscord<Benumbed> Extend hands, recieve HTTP 204, and hang
08:22:36FromGitter<Vindaar> oh and @axion if you wondered why I asked about your name a few weeks ago, look for instance at: ⏎ https://github.com/Vindaar/ggplotnim/blob/arraymancerBackend/recipes.org#tell-me-an-axion-story-without-telling-it-to-me-story
08:25:42FromDiscord<Benumbed> I think the client's expecting to read body data when it can't, because I left a process running and it eventually fell through
08:32:16FromDiscord<Benumbed> Yep, found it
08:32:56FromDiscord<Benumbed> It's trying to `recvFull` on a connection that won't give it any data
08:38:45FromDiscord<exelotl> @Benumbed I believe it was Yewpad who added the dark theme, but I can't see them on discord now
08:46:48voltist@Vindaar Ah my fonts must be weird because it looks like a 1 to me
08:51:53*dwdv joined #nim
08:54:39FromDiscord<Benumbed> Well I just had to hack the stdlib of my Nim install to get things working again, that's a first πŸ™‚
08:55:03FromDiscord<Rika> you can submit the fix as a pr to nim's code
08:55:19FromDiscord<Benumbed> Yeah, I know
08:55:36FromDiscord<Benumbed> I already dropped a ticket that shows the fix, but I won't submit a PR without a test
08:55:48FromDiscord<Benumbed> which means pulling the repo and figuring out all the contributor stuff
08:56:01FromDiscord<Benumbed> Which I will do eventually, but not tonight
08:58:18FromGitter<Vindaar> @voltist: haha, no worries
08:58:28FromDiscord<Benumbed> Hmmm it appears httpclient has no tests
08:58:32FromDiscord<Benumbed> not that I can find anyway...
08:59:15*aEverr joined #nim
09:04:16FromDiscord<Benumbed> NM I'm an idiot
09:04:42FromDiscord<Benumbed> Ok well, now that I've found everything I'll do something about this tomorrow
09:12:29voltist@Vindaar Nah still getting that error "A data scale is required to calculate tick positions!"
09:18:24FromGitter<Vindaar> can you post a paste of the ggplot call and the output of your input DF?
09:23:28FromGitter<Vindaar> by output of the DF I mean just printing the DF of course
09:23:45voltistYeah I will in a moment. Could the problem be caused by all the data points being identical? Eg, only one x value and y value across them
09:24:03FromGitter<Vindaar> oh, that's a good point indeed
09:24:13voltistOh wait no one of them is different
09:24:17voltistSo it can't be that
09:24:44FromGitter<Vindaar> but that could have indeed been a possible explanation, because in that case min == max, which might run into trouble somewhere
09:26:00voltist@Vindaar: Code and DF https://pastebin.com/YxUrqULT
09:26:52*Tlongir is now known as the_fool
09:27:01FromGitter<Vindaar> thanks, give me a minute
09:27:16voltistOf course there is only one neuron (rows on the x axis) in this data
09:27:28voltist*rows along the X axis
09:28:52FromGitter<Vindaar> yep, that I think is the problem
09:29:13voltistOh?
09:31:07FromGitter<Vindaar> oh
09:31:22FromGitter<Vindaar> I was just typing up what the bug is, when I noticed that your `ylim` call is `ylim(1, -1)`
09:31:54FromGitter<Vindaar> The signature is `func ylim*[T, U: SomeNumber](low: T, high: U, outsideRange = ""): Theme`
09:32:03FromGitter<Vindaar> that's why it gets confused
09:32:17voltistAh
09:32:25FromGitter<Vindaar> I could of course determine the min and max value by comparing low and high
09:33:18voltistUnfortunately the problem persists when that is changed to `ylim(-1, 1)`
09:33:36FromGitter<Vindaar> yeah, I had a bug in my recreation of your code, haha
09:33:42FromGitter<Vindaar> the point still stands though
09:34:19FromGitter<Vindaar> the problem now is that indeed it cannot determine a data scale, because neurons is 0 everywhere. There is bug though, namely that the call to `ylim` should override that scale
09:34:29FromGitter<Vindaar> Should be an easy fix
09:35:17FromGitter<Vindaar> without the ylim call the y scale is not well defined, since it doesn't have a range deducible from the data. ⏎ Well, it does, but only if one takes into account `ymin`, `ymax`, which we should, but don't right now for some reason. That's bug number 2
09:35:23FromGitter<Vindaar> bug number 2 I was aware of though
09:35:35FromGitter<Vindaar> (that's the comment already mentioned behind the ylim call)
09:35:45voltistI also had the ymin and ymax in the geom_linerange the wrong way round (1 in min and -1 in max), but changing that doesn't fix it either
09:35:58FromGitter<Vindaar> I'll fix both
09:36:12FromGitter<Vindaar> I'll let you know once I'm done. Shouldn't take long
09:36:34voltistCool
09:40:41*liblq-dev joined #nim
09:43:05dom96eliezedeck: FWIW I and many others have written large async programs without running into this bug, so I wouldn't call it "critical"
09:43:30dom96It's not common that you create a global future and then await it in an async proc
09:47:26FromGitter<eliezedeck> Well, I don't agree that "it's not common" ... and it's critical because it had fundamentally incorrect behavior for such a trivial thing ... critical also because it is already taken for granted that a future when complete must yield its value/error
09:47:52FromGitter<eliezedeck> just to give you an idea:
09:48:55dom96async has been in Nim for many years now
09:49:00dom96if it was common we would have seen this bug
09:49:05dom96someone else would have reported it
09:49:29dom96it's quite likely that what you want to implement is typically implemented differently by everyone that used async await
09:50:54FromDiscord<clyybber> well, he encountered it and it was critical there
09:51:03FromGitter<eliezedeck> I'm creating a GraphQL client right now, it is supposed to be always trying to reconnect, and it should be transparent to its user whether the client is connected or not ... so: the client is allowed to send any GraphQL query they want, it's just not going to be executed until there is connectivity. So, there will be several queries `await`ing one single future (when the client is connected). ⏎ Now, tell me: how
09:51:03FromGitter... uncommon is that kind of scenario ... sure, it is debatable, but *what's important is correctness, not that it's common or not*
09:51:11FromDiscord<clyybber> yeah
09:52:32FromDiscord<Rika> i agree that how common something is done does not mean it is not to be considered, thats like disregarding edgecases because theyre just edgecases
09:52:43dom96I'm not saying we should disregard it
09:52:50dom96I am just responding to eliezedeck's comments above
09:53:03dom96where they were speculating about how this could have gone past 1.0
09:53:14FromGitter<eliezedeck> @Rika I couldn't say it better myself
09:54:31supakeen@eliziedeck be careful with that, if a connection gets lost you could end up queuing a *lot* of requests that will all suddenly go through :)
09:54:42supakeenI'd think about thundering herds and backpressure.
09:54:44FromGitter<eliezedeck> @dom96 I don't know how you would implement this above scenario yourself if you were on my shoes, but I sure am not going to do a lot of `sleepAsync` just to poll something
09:54:49supakeenOr at least those are terms to look at :)
09:54:51Araq"(I don't trust the Nim CI nowadays)." FUD machine
09:54:58Araqthe CI is better than ever before
09:56:00dom96eliezedeck: I don't think I ever ran into a case where a client should always be trying to reconnect, you're either connected or not, if you're not connected and you want a response why not reconnect then? Why do you need to constantly be reconnecting?
09:56:15FromGitter<eliezedeck> @supakeen ... it is a native GraphQL client, for mobile device ... so, it will be coupled with a Flutter app; so, yes, I'll try to be careful not to queue many requests, thanks
09:57:10dom96If you have something like an IRC client, which implements reconnection logic then you are always asking for data from the server using `recv`
09:57:17dom96`recv` returns "" and you know to reconnect
09:57:36dom96if you have something like HTTP, you call `get`, if the HTTP client has a connection open it reuses it
09:57:38dom96if not it reconnects
09:58:09FromGitter<eliezedeck> @dom96 I'm not really good at explaining, sorry ... it's a GraphQL library (client might be misleading) ... it's using Websocket also, not POST requests ... so, it needs to be connected before it can send any GraphQL query
09:58:13*sentreen_ joined #nim
09:58:34dom96eliezedeck: it's exactly the same when it comes to Websockets
09:59:01FromGitter<eliezedeck> right, and the goal is: Flutter app shouldn't care about it
09:59:12supakeenAraq: Is there some sort of coverage report or such to easily counter that type of FUD?
09:59:20supakeenOr did they mean something else.
09:59:50FromGitter<eliezedeck> it will just queue a bunch of string to execute (the query) ... the library will try to reconnect on its own, and at the same time, it will queue queries to be executed as soon as the library is connected
10:00:36FromDiscord<Rika> and i think what dom is saying is that the logic for reconnecting can be written into the library
10:00:41dom96eliezedeck: I'll be honest: it sounds to me like the mechanism you've fixed is not necessary, but until I see the code it's hard to say for certain.
10:00:41FromDiscord<Rika> and he doesnt see the issue i dont think
10:01:18dom96supakeen, Araq: every other PR I see shows the CI failing for unrelated reasons, how can I trust that?
10:01:31FromGitter<eliezedeck> @Rika it IS in the library
10:01:46FromDiscord<clyybber> dom96: > it sounds to me like the mechanism you've fixed is not necessary
10:01:52FromDiscord<clyybber> Do you mean the fix is not necessary?
10:02:05dom96No. I mean eliezedeck's use case doesn't call for it
10:02:13dom96And it's certainly not "critical"
10:02:25dom96since there are alternative ways to achieve it
10:02:29FromGitter<eliezedeck> @dom96 :) well, let's agree to disagree
10:02:58dom96Sure :)
10:03:14dom96I want it to be fixed anyway, I'm slightly concerned about what it might break but I suppose we'll find out :)
10:03:47*krux02 joined #nim
10:04:01FromGitter<Vindaar> @voltist: ok, I pushed the fix now. ⏎ You would right now still run into trouble if you only set e.g. `yMin`, but not `yMax`, since all neurons would be `0` still and the resulting data scale would end up just taking into account `yMin`. I still need to come up with a more reliable way to allow scales of (0, 0)
10:05:43FromGitter<Vindaar> also the `ylim` does not matter in this case after all, since the bug came from the post processing phase, where the theme (which is what `ylim` is part of), plays no part. It's a thing I need to think about whether that is required. I rather have to avoid calling `calcTickLocations` in the post processing phase when the scale is invalid. But anyways, that's just internal details :)
10:05:46FromGitter<eliezedeck> let's think about those people who see Twitter post, and they say, "well... Nim v1.2.0 ... let me try that" ... oh, they are Golang programmers, used to writing codes that are awaiting on a single channel, and they end-up awaiting on a single future in Nim ... then they bang their head on the wall and they think... "well... this Nim thing is pretty unstable" ⏎ I find beauty and value in Nim, and other people should
10:05:46FromGitter... see it too ... but trivial bugs like these are *critical* in that they drive out adopters
10:05:59FromGitter<eliezedeck> @dom96 I believe we do have tests right?
10:06:10FromDiscord<clyybber> yeah we do
10:06:14dom96yes, but not for this issue specifically
10:06:15voltistOk I'll give it a go shortly
10:06:17FromDiscord<clyybber> and I agree that its critical in this case
10:06:51FromGitter<eliezedeck> in any case, it's a PR, I trust you can assert its quality, and you're free to do whatever you want
10:07:07FromDiscord<clyybber> eliezedeck: Can you split the PR up?
10:07:09*tane joined #nim
10:07:29dom96Okay, let's stop. Arguing about whether it's critical or not is a waste of time. We'll be merging it, that's all that matters
10:07:34voltistHmmm, who would have thought that doing 30 million regex searches would take a long time...
10:07:35dom96we can even back port to 1.0.x
10:07:47FromDiscord<clyybber> We should, yeah
10:07:53FromGitter<alehander92> :)
10:07:54FromGitter<alehander92> morrning
10:07:55FromGitter<eliezedeck> @dom96 well, you could probably use the code in the actual bug report (https://github.com/nim-lang/Nim/issues/13889)
10:07:56disbotβž₯ Critical: 1 completed Future, multiple await: Only 1 await will be awakened (the last one) ; snippet at 12https://play.nim-lang.org/#ix=2gNK
10:08:10dom96yes, but I want you to add it as part of your PR :)
10:08:11FromDiscord<clyybber> alehander92: Morning
10:08:49FromDiscord<clyybber> eliezedeck: If you are ok with it, I can create a PR with a testcase included for you (if its too much of a hassle for you)
10:08:55FromGitter<Vindaar> @mratsim sweet, even the search works! :)
10:09:42FromGitter<eliezedeck> @dom96 thank you! much appreciated
10:09:50FromGitter<eliezedeck> @Clyybber no problem
10:10:36FromGitter<eliezedeck> all I care is that Nim also has super correct behavior ... not really the PR
10:14:36*PMunch quit (Ping timeout: 258 seconds)
10:15:03*PMunch joined #nim
10:17:53FromGitter<Vindaar> @voltist: ups, I messed up an if condition. Your example should work (that's what I used to test), but other stuff broke..
10:18:12voltistAww snap
10:19:21*Sixte joined #nim
10:19:57*Sixte left #nim (#nim)
10:20:20FromGitter<Vindaar> pushed the fix for the fix ;)
10:20:38FromGitter<Vindaar> wasn't anything complicated, just me being stupid
10:21:15*Tlongir joined #nim
10:25:10voltist@Vindaar I'll give it a test tomorrow as I'm having technical issues and i'd much rather have a break this evening. Thanks for all your help though!
10:25:26*the_fool quit (Ping timeout: 265 seconds)
10:25:40FromGitter<Vindaar> @voltist: no worries and you're welcome! Thank you for playing beta tester!
10:25:45FromGitter<Vindaar> enjoy your evening!
10:28:47*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
10:31:11*voltist quit (Quit: Leaving)
10:37:17krux02Araq: your reviews of my PRs are just worthless.
10:42:02FromDiscord<clyybber> krux02: The repr change is unrelated right?
10:47:58FromDiscord<clyybber> @timotheecour, dom96: Should we really have both `defined(macos)` and `defined(macosx)` ?
10:48:27dom96context?
10:50:55FromDiscord<clyybber> https://github.com/nim-lang/Nim/pull/13892
10:50:55disbotβž₯ [TODO] openDefaultBrowser now works on OSX
10:51:15FromDiscord<clyybber> This line: https://github.com/nim-lang/Nim/pull/13892/files#diff-6d2a31accaa1994357340dccfeb4ba53R24
10:51:15disbotβž₯ [TODO] openDefaultBrowser now works on OSX
10:51:24*Zectbumo quit (Remote host closed the connection)
10:52:15krux02clyybber: If you have a very long sing expresiong ast and print it with repr, the output is ugly. I didn't fix repr, instead I postprocessed the output of repr to make it look good for this single use case.
10:52:29krux02The postprocessing can be removed after repre works for my use case well
10:53:12krux02my postprocessing eats all whitepace and reintroduces whitepsace bast on () positions
10:54:07FromDiscord<clyybber> Yeah, but it doesn't really belong into the PR
10:54:13FromDiscord<clyybber> I guess thats why Araq complained
10:54:49krux02Araq just complained because he just wants to shit on MY PRs without actually looking into what I accomplished.
10:55:44krux02Otherwise he could have provided constructive criticism, which he did not do.
10:56:34FromGitter<eliezedeck> @Clyybber @dom96 thanks for the merge ... sorry about the mixed PR, it was a really stupid thing on my part
10:57:36FromDiscord<clyybber> Hey np. Its not merged yet but I opened https://github.com/nim-lang/Nim/pull/13896 and am waiting for the tests
10:57:37disbotβž₯ Fix #13889 with testcase
10:59:46FromGitter<eliezedeck> oh, ok
11:02:38FromGitter<eliezedeck> @Clyybber it might be better to reduce the `sleepAsync` to lower number, I'd say 10 milliseconds each should enough, so, at the minimum it will have a runtime of 20 ms
11:03:46FromGitter<eliezedeck> I'm worried 3 seconds total runtime for the test I wrote might be just too much, given the fact that we're likely to have hundreds even thousands of test to automate each time
11:04:03dom96please avoid sleepAsync if you can
11:04:07dom96it makes tests flaky
11:04:52FromGitter<eliezedeck> so, how would one have a delay in an async proc? that's the only one I know
11:04:54FromDiscord<clyybber> Yeah, the test is 3 seconds long now, but then its also less flaky
11:05:05FromDiscord<clyybber> I'm not sure how I would do it without the sleepAsync
11:06:44FromDiscord<clyybber> dom96: Any idea?
11:07:28dom96just do sleepAsync(1)
11:07:33FromGitter<eliezedeck> I'm wondering, how are the tests done? I'm not sure how sleepAsync is making tests flaky ... unless there are thousands of system threads all fighting for CPU cores at a given moment, may be
11:07:36dom96I think you just need to yield
11:08:13FromGitter<eliezedeck> yeap, sleepAsync(1) works
11:08:49supakeenSome asynchronous frameworks often offer a `await checkpoint()` or such as a macro for `await sleepAsync(0)` just to yield control back.
11:09:32FromDiscord<clyybber> dom96: So I would just change sleepAsync(1500) to sleepAsync(1) ?
11:09:55FromGitter<eliezedeck> or may be, the test system's scheduler has been tuned to very large granularity ... the highest I found so far is 10 ms, and it was on a MIPS router ...
11:10:35FromGitter<eliezedeck> @Clyybber that worked for me
11:10:54FromGitter<eliezedeck> and so is `sleepAsync(0)`
11:12:32FromDiscord<clyybber> But doesn't that mean that it will fail if it takes longer than 1 ms
11:12:33FromDiscord<clyybber> ?
11:13:15FromGitter<eliezedeck> @supakeen so, I suppose that's `sleepAsync(0)` for Nim, right?
11:14:23supakeen@eliezedeck I won't say I'm familiar enough with Nim's async system to say 'yes'. I'd assume so but you know what they say about assumptions :)
11:15:02FromDiscord<clyybber> Whats the first sleepAsync for btw?
11:15:30FromGitter<eliezedeck> @Clyybber please use `sleepAsync(0)` ... first sleepAsync can be removed ...
11:15:48FromDiscord<clyybber> I don't want to use sleepAsync(0)
11:15:51FromGitter<eliezedeck> the example was meant to simulate a christian belief, in Nim :)
11:15:55FromDiscord<clyybber> As I don't want the test to get flaky
11:16:05FromDiscord<clyybber> eliezedeck: lol
11:16:06FromGitter<eliezedeck> so, the first sleepAsync is like the savior's delay
11:16:22FromGitter<eliezedeck> the second one is just so to see who have been saved
11:16:34FromDiscord<clyybber> Yeah, and the test checks the output
11:16:36FromGitter<alehander92> @eliezedeck imaginative!
11:17:42FromGitter<eliezedeck> right ... well, Nim is inspiring
11:17:53FromDiscord<clyybber> ok, chronos is waiting 100 ms
11:18:04FromDiscord<clyybber> So I'll be doing that too.
11:18:32FromGitter<eliezedeck> @Clyybber I think the timing is really not important
11:18:41FromGitter<eliezedeck> 0 will not be flaky
11:18:52FromDiscord<clyybber> But it won't print the messages?
11:19:03FromDiscord<clyybber> Right?
11:19:11FromGitter<eliezedeck> it will
11:20:11FromDiscord<clyybber> Ok, I'll leave it at 50 then
11:20:59FromGitter<eliezedeck> the await sleepAsync will not return unless it has been given back control ... and control won't be back unless all previous callbacks have been processed (all 3 believers have been saved) ... well, who am I? I'm a beginner in Nim ... but that would be how other event loops act, at least, those that I have seen
11:21:37FromDiscord<clyybber> I see
11:21:45FromDiscord<clyybber> Thanks!
11:22:24FromGitter<eliezedeck> man, it's been a while since I wrote event loops manually in C ... my mind is rusted ... but it's ok, because we just take it for granted and just use Nim or the likes nowadays
11:22:52FromGitter<eliezedeck> thank You!
11:25:00*liblq-dev quit (Quit: WeeChat 2.7.1)
11:27:26FromGitter<eliezedeck> ...
11:27:39FromGitter<eliezedeck> question: do we have a cancellable timer?
11:28:08FromGitter<eliezedeck> or, in another way: can we cancel `sleepAsync` *efficiently* (not just let it timeout)
11:30:22FromGitter<alehander92> @eliezedeck God is inspiring :)
11:30:41FromGitter<alehander92> clyybber is there a way to control explicitly those yields
11:30:55FromGitter<eliezedeck> @alehander92 very true
11:31:12FromGitter<alehander92> :))
11:33:22FromDiscord<clyybber> alehander92: Which yields?
11:33:35FromDiscord<clyybber> Ah, those. I dunno :p
11:33:56FromGitter<alehander92> the event loop giving control back etc, the seconds thing seems a bit not ideal
11:34:13FromDiscord<clyybber> Yeah, but the test doesn't depend on it so its fine
11:34:13FromGitter<alehander92> not a big deal
11:39:54*liblq-dev joined #nim
11:48:01FromGitter<eliezedeck> without the sleepAsync after the completion, the proc will exit immediately, thus: waitFor() will exit as well, and so, the callback had to chance to execute, hence: nothing will be printed
11:48:19FromGitter<eliezedeck> *had no chance
11:50:36*dddddd joined #nim
11:50:57FromGitter<alehander92> yeah i wondered if there is a way to just wait for "n" callbacks executed or something
11:51:05FromGitter<alehander92> but this actually doesnt make a lot of sense maybe
11:51:12FromGitter<alehander92> as you test that they are executed at all
11:51:29FromGitter<eliezedeck> there is, but it would make the test file more complex
11:52:15FromGitter<eliezedeck> we could also store the futures, and check them one by one if they have `.finished`
11:52:51FromGitter<eliezedeck> but I strongly believe that the current test is not flaky
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:44*supakeen joined #nim
12:08:25dom96eliezedeck: no way to cancel timers right now
12:08:43*abm joined #nim
12:09:00*sleepyqt joined #nim
12:11:57*lbart joined #nim
12:18:29*Guest19582 quit (Ping timeout: 250 seconds)
12:20:08*dadada joined #nim
12:20:31*dadada is now known as Guest29531
12:32:20*arecaceae quit (Remote host closed the connection)
12:32:44*arecaceae joined #nim
12:34:13FromGitter<eliezedeck> ok, thanks
12:37:02*rockcavera joined #nim
13:04:45FromGitter<alehander92> ook
13:05:46PMunchDamn, running some stuff with gc:arc and seeing some serious memory and time improvements!
13:08:25PMunchFrom 4.52s, 1.32Gb down to 3.14s, 1.08Gb
13:09:16PMunchAnd I just realised I need to seriously optimise this algorithm for it to be useful for me..
13:11:42*dsrw joined #nim
13:14:04*lritter joined #nim
13:20:22FromGitter<kaushalmodi> @Vindaar Your ggplotnim recipes and the plots in them are music to my eyes :) I do not understand many of the plots, but I am amazed that ggplotnim can create those. Awesome work!
13:21:00FromGitter<Vindaar> @kaushalmodi you mean like plotting a periodic table? :D ⏎ Thanks, really appreciated :)
13:21:19*natrys joined #nim
13:21:21FromGitter<kaushalmodi> hehe yep, also those neural spike plot you mentioned above
13:21:56PMunchHmm, am I missing something here or should `for x in y.toHashSet: echo x` never print duplicates?
13:23:03FromGitter<Vindaar> Hehe yes. But to be fair, the majority of the praise has to go to Leland Wilkinson for thinking up the grammar of graphics concept and Hadley Wickham for expanding it and building ggplot2 :)
13:24:34PMunchhttp://ix.io/2gPl
13:25:00PMunchOn the left is the trees I have in a sequence, on the right is the hash of the node.
13:25:10PMunchThe hash set doesn't seem to remove the duplicates..
13:30:06FromGitter<kaushalmodi> PMunch: I vaguely remember issues opened by @timotheecour on the topic of hash and duplicates keys, somewhere in last 1-2 months
13:30:31PMunchAm I doing something wrong here? Or is the hashset module just completely broken? https://play.nim-lang.org/#ix=2gPm
13:30:39PMunchHmm
13:31:13FromGitter<kaushalmodi> .. may be it was tables: https://github.com/nim-lang/Nim/issues/13499
13:31:15disbotβž₯ `==` incorrect for tables with repeated keys ; snippet at 12https://play.nim-lang.org/#ix=2gPo
13:32:20FromGitter<Vindaar> yeah, I also only remember the issue with using `add`. Hash collisions of course might happen, but seem unlikely for a small set. Also the iterator over a HashSet surely should still only contain one such hash, since in case of a collision information on hash insertion should be lost, no?
13:34:09PMunchYeah, I mean isn't the whole point of a set to only have one of each thing?
13:34:19FromGitter<Vindaar> I agree
13:34:49narimiranPMunch: print `combinations`
13:35:03FromGitter<kaushalmodi> That's what I thought too, but given that duplicates are supported, I am not sure I know enough to comment on that
13:35:21narimiranoooops, disregard, i haven't seen it correctly
13:35:50PMunchkaushalmodi, they are supported for HashTables, which is fine
13:36:02PMunchBut HashSet shouldn't ever have duplicates..
13:39:49narimiranPMunch: `echo combinations[3] == combinations[^1]` gives `false`
13:40:02narimiransorry, that's `^3`
13:40:49narimiransame for `echo hash(combinations[3]) == hash(combinations[^1])`
13:41:34*NimBot joined #nim
13:42:12PMunchOkay, adding == that uses hash works
13:45:49*uu91 quit (Read error: Connection reset by peer)
13:46:38*uu91 joined #nim
13:46:55PMunchOkay, that fixed most of my performance issues :)
13:47:03PMunchBy removing all the duplicates
13:48:39*uu91 quit (Read error: Connection reset by peer)
13:48:50PMunchMan, the memoize package is really nice
13:49:04*uu91 joined #nim
13:49:05PMunch6.7s -> 0.4s
13:49:14PMunchBy adding a single pragma to my function :)
13:49:19*uu91 quit (Read error: Connection reset by peer)
13:49:40PMunchRAM usage also dropped from 22Mb to 12Mb
13:49:40*uu91 joined #nim
13:50:47supakeenI was wondering re: consistency. Is there a preferred thing between `x == nil`, `x.isNil', `isNil(x)` etc in stdlib?
13:51:04PMunchisNil is the preferred way
13:51:17narimiranPMunch: nice numbers there!
13:51:23PMunchI personally like `x.isNil`
13:51:25supakeenThen my next PR with general asynchttpserver cleanup/features will rewrite them to isNil :)
13:51:34shashlickI need to get nimterop working with arc as well
13:51:36PMunchBut that's just because I find it easier to read
13:51:46PMunchThen again I use postfix for pretty much anything
13:51:49shashlickHopefully it will speed up toast
13:52:06supakeenIt's fine currently it's quite literally `if x != nil` and then 2 lines down `if not x.isNil()` :)
13:52:14Araqsupakeen: use != nil please
13:52:20supakeenAraq: Ah.
13:52:31AraqisNil could be deprecated, it's pointless
13:52:32PMunchAfter adding in memoize and HashSet gc:arc is actually slower
13:52:48PMunchOh really? I was told once that the preferred thing was to use isNil
13:53:00Araqyes
13:53:08Araqit used to be the other way round :P
13:53:20PMunchAh :P
13:53:29Araqbut now that seqs and strings cannot be nil anymore 'isNil' should be removed
13:53:40PMunchWasn't that because it wasn't 100% clear that nil should be kept?
13:53:52PMunchWhy was isNil better for those?
13:54:06Araqit was better for seqs because
13:54:11PMunchI'm loving the seqs and strings can't be nil thing by the way
13:54:15shashlickWhat about ref objects - I use isNil for PNode
13:54:36AraqPMunch: the == for seqs is lifted from the elements' ==
13:55:07Araqthat's problematic if the element type lacks the ==
13:55:13PMunchshashlick use cast[Option[ref MyType]](myObject).isSome :P
13:55:20PMunchAaah
13:55:29Araqshashlick: use != nil for refs
13:55:59shashlickOk
13:56:38PMunchI'm curious if a converter that casts nilable things to options would be practical
13:56:45PMunchWhen using optionsutils for example
13:56:58FromGitter<alehander92> but so much code uses .isNil
13:57:01PMunchThen you could use ?. for example on nilable types
13:57:17FromGitter<alehander92> one really needs to provide nim rewriting tool for deprecations like that
13:58:21FromGitter<alehander92> look at ast => find dot/call nodes with isNil => turn to arg != nil nodes => nimpretty render
13:58:24FromDiscord<Recruit_main707> is there an easy way of converting a json node into an object?
13:58:48FromGitter<alehander92> a.to(Type)
13:59:17Araqalehander92: well a single isNil template in system.nim doesn't kill us
13:59:23FromDiscord<Recruit_main707> cool, and... will it work if my type has some fields which are other types??
13:59:28Araqbut currently it's even a magic, silly
14:00:14FromGitter<alehander92> Araq yeah, less builtins is good
14:00:32FromGitter<alehander92> Recruit_main707 well .. all your fields have types :D
14:00:51FromDiscord<Recruit_main707> but, my own types :p
14:00:57FromGitter<alehander92> it doesnt matter
14:01:01FromGitter<alehander92> yes, it should work recursively .. maybe it has limitations with case objects not sure
14:01:13FromDiscord<Recruit_main707> i will try i guess
14:01:32FromDiscord<Recruit_main707> thanks, and sorry for interrupting the conversation
14:01:41FromGitter<alehander92> if the types can be reasonably mapped to json, it should work
14:01:52FromGitter<alehander92> no interruption
14:04:38*Vladar quit (Quit: Leaving)
14:08:52FromDiscord<clyybber> does it still *need* to be magic?
14:09:37*endragor quit (Remote host closed the connection)
14:10:30FromGitter<alehander92> i feel that many things can be not special anymore
14:10:54Araqclyybber: nah and it hurts DrNim
14:11:00Araqmore special cases to consider
14:11:56FromGitter<alehander92> e.g. in system/jssys many things seem to be possible with just nim code not so much `asm`
14:12:17FromDiscord<clyybber> Araq: Ok, I'll make a PR to unmagic it
14:13:05shashlickBest to do that early in devel cycle and see who all break
14:14:59shashlickAraq: did you see the arc related issue I commented on?
14:15:25Araqno arc development will continue tomorrow, today is DrNim day
14:15:41shashlickhttps://github.com/liquid600pgm/euwren/issues/17#issuecomment-609573188
14:15:43disbotβž₯ Build fails when using --gc:arc. ; snippet at 12https://play.nim-lang.org/#ix=2gPy
14:15:43*kungtotte quit (Read error: Connection reset by peer)
14:16:10shashlickNo worries
14:16:40shashlickI plan on porting to arc for nimterop so wanted to understand how to deal with such issues
14:16:40*kungtotte joined #nim
14:19:15*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
14:21:07Araqshashlick: well a stacktrace would be helpful, use 'koch temp'
14:23:54*natrys quit (Quit: natrys)
14:24:15companion_cubeAraq: https://nim-lang.org/docs/destructors.html <-- is nim getting closer to rust? (not meant to be a loaded question)
14:24:45FromDiscord<clyybber> Araq: Ok to merge https://github.com/nim-lang/Nim/pull/13896 ?
14:24:46disbotβž₯ Fix #13889 with testcase
14:25:06FromDiscord<clyybber> companion_cube: Yes, in some ways
14:25:33companion_cubeinteresting how D seems to follow the same path
14:25:50*liblq-dev quit (Ping timeout: 265 seconds)
14:26:43shashlickAraq: I've attached it to that issue, should help when you get to see it
14:27:11Araqcompanion_cube: yeah, it's definitely getting closer
14:27:26Araqwe're also getting some borrow checking
14:29:14companion_cubewith lifetime variables and everything?
14:29:21companion_cubeseems like a very complicated thing to do
14:32:13Araqwell it's simplified
14:33:02Araqyou can only borrow from a location that is derived from the first formal parameter
14:33:58Araqseems to work out for every example I ever wanted to be able to express
14:34:44companion_cubedo you prevent the variable from being mutated while there's a borrow?
14:35:00companion_cubeseems to me you keep some runtime checks (which is valid, it's simpler than full on rust semantics)
14:36:17*waleee-cl joined #nim
14:39:02Araqcompanion_cube: it depends on the mutation, I think. resizing is much more harmful than mutation
14:39:18Araqno runtime checks are planned for it
14:39:43companion_cubealso, case types, when you borrow a field and change the tag
14:39:46companion_cubeas you were saying earlier
14:40:00Araqtrue
14:42:18Araqbut Nim is well prepared, consider that you can pass a 'seq' to 'var openArray' (no resizing possible) or to a 'var seq' (resizing possible)
14:42:45companion_cubeah nice indeed
14:42:54companion_cube`var openArray` is like `&mut […]` in rust then
14:43:11FromGitter<rishavs> quick question on tables, how would I define a type for tables? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Here I want to define a custom table type., where the key is an id and the value is a room. But I am not able to find what should be the correct way to declare this type [https://gitter.im/nim-lang/Nim?at=5e8b3ffef87c5956a23e5cbb]
14:44:58*Lord_Nightmare joined #nim
14:47:13Araqthe way you did it is fine
14:48:01PMunchFound a use for `isNil`, when defining a `==` operator
14:48:19FromGitter<rishavs> Thanks Araq.
14:51:12AraqPMunch: you can simply use system.`==` to avoid the infinite recursion
14:51:20PMunchTrue
14:51:33PMunch`isNil` looks nicer though
14:51:52Araqgood point
14:52:38Araqtemplate isNil(x: typed): bool = system.`==`(x, nil) # prevent endless recursions in clients
14:54:22*liblq-dev joined #nim
14:55:42*endragor joined #nim
14:56:27disruptekwe support repr for runtime now?
14:58:23Araq--gc:arc does support repr but uses a different implementation
14:58:55disruptekokay.
15:02:43FromDiscord<kraptor> noob question: varargs pragma doesn't enforce a parameter when binding against C/C++, this conforms with varargs.h but not stdarg.h, therefore having linking errors on CPP but not C... is this intended behavior?
15:05:10*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
15:06:27*Lord_Nightmare joined #nim
15:07:42Araqkind of, but we map .varargs to '...' so both ways are supported
15:08:03Araqyou need to specify the first parameter separately though
15:08:20Araqproc printf(fmt: cstring) {.varargs.}
15:09:49*PMunch quit (Ping timeout: 265 seconds)
15:13:47FromDiscord<kraptor> aham, what I found is in cpp + stdarg.h, that va_list requires always at least one value, but from nim side, you can call without value, therefore failing while linking...
15:14:02disruptekAraq: shouldn't =destroy have a sfUsed?
15:15:04Araqer ... yeah
15:15:46disruptekhmm, okay. i will fix that too.
15:22:15*PMunch joined #nim
15:25:16disruptekkrux02: can i have your .ctags please?
15:25:54krux02yes
15:26:41krux02http://ix.io/2gPY
15:26:59krux02I just realized I don't have the = in the regex.
15:27:18*lbart quit (Ping timeout: 256 seconds)
15:27:30disruptek=?
15:27:37*lbart joined #nim
15:28:21FromDiscord<Recruit_main707> @Araq: packedjson should probably include the normal json `to` function
15:28:47krux02yes I think I said it in the stream
15:29:10krux02you get false positives on forward declarations if the regex doesn't required the = sign
15:29:49krux02but on the other hand if the proc declaration is really complicated with multiple lines and temple/macro expressions for the types, you might miss out on the declaration of you do include the = in the regex.
15:30:05krux02there is a tradeoff, but the regex works really very well for Nim.
15:30:54disruptekoh, gotcha.
15:30:59*kenran quit (Ping timeout: 260 seconds)
15:31:03disruptekthanks.
15:32:25AraqRecruit_main707: PRs are always welcome
15:41:48disruptekkrux02: it seems no better, unfortunately.
15:42:33leorizeAraq: looking at the SSL issue, fixing it would mean to bump Nim's openssl requirement to 1.1
15:42:53leorizebecause openssl developers doesn't care about backward compatibility
15:44:00leorizedo we wanna bump the requirement or should I try to do it without having to bump the requirement?
15:44:46Araqbump the requirement, on windows we ship the DLLs we need and Unix users are happy to constantly babysit everything
15:45:04*nsf quit (Quit: WeeChat 2.7)
15:45:34krux02disruptek, what is no better?
15:45:43disruptektags.
15:45:47disruptekcouldn't make it work.
15:45:54disruptekvery spotty performance.
15:45:56krux02for me they work very well.
15:46:01krux02interesting
15:46:04krux02they are instant for me
15:46:16disrupteki will show you onstream sometime.
15:46:27krux02sorry the script you have, it generates emacs TAGS file, you should remove the -e flag
15:46:48disruptekyeah, that didn't help me.
15:46:56disrupteki did use your script, though.
15:47:51*pbb_ joined #nim
15:47:53dom96leorize: add a define like -d:insecureOpenSSL to get the best of both worlds
15:48:13*pbb quit (Ping timeout: 272 seconds)
15:49:00*endragor quit (Remote host closed the connection)
15:49:35leorizesure
15:55:32*endragor joined #nim
15:59:56*Trustable joined #nim
15:59:59shashlicki'm still getting SIGSEGV: Illegal storage access in some builds of nimterop - no stack trace, works fine when run through gdb
16:00:10*hax-scramper quit (Ping timeout: 256 seconds)
16:00:19disruptekyeah, i run all my arc projects in gdb.
16:00:22disruptekonly way to fly.
16:00:37shashlickthis isn't even arc - just regular gc
16:00:37*hax-scramper joined #nim
16:00:45shashlickand has been reported on 1.0.6
16:02:42disruptekwut
16:02:47disrupteknimterop? 0.4.4?
16:03:17shashlickhas been reported yes
16:03:25disruptekwhoa.
16:03:50shashlickhttps://github.com/genotrance/nimarchive/issues/10
16:03:51disbotβž₯ SIGSEGV Nim 1.2+
16:03:58shashlickwent away when toast was recompiled
16:04:06shashlickis failing randomly in my CI runs
16:04:32*endragor quit (Remote host closed the connection)
16:05:01disruptekmight explain some of my issues.
16:05:36shashlickbut are you recompiling toast?
16:06:11disruptekit's one way i solve this problem, yes.
16:09:26shashlickokay
16:13:56*endragor joined #nim
16:16:54shashlickyep - restarted that job and it passed now
16:35:57*endragor quit (Remote host closed the connection)
16:36:36*endragor joined #nim
16:38:08*dsrw quit (Read error: Connection reset by peer)
16:43:00*endragor quit (Remote host closed the connection)
16:43:01FromDiscord<gour> hello, would it be feasible to write back-end for desktop app in Nim as python extension and hen write front-end in e.g. wxpython call Nim-extensions?
16:45:12FromGitter<zetashift> @gour this might help you: https://github.com/Pebaz/nimporter
16:45:31*sentreen_ quit (Ping timeout: 265 seconds)
16:46:34FromDiscord<kodkuce> karax has no support for websockets right?
16:47:15FromDiscord<gour> thanks!
16:47:40FromDiscord<gour> other option would be to do everything in Nim, but not sure what is the state of wxnim...
16:48:44leorizekodkuce: karax is just for ui, use a websocket lib for websockets
16:48:45FromGitter<zetashift> friendly ping to @PMunch I think he worked a fair bit on it
16:49:03PMunchWorked a fair bit on what?
16:49:06leorizewxnim
16:49:09PMunchOh wxnim
16:49:19PMunchYeah I wrote genui and fixed up some bits and pieces
16:49:59PMunchwxnim should work just fine, not sure why you'd want to drag Python into this..
16:50:53FromDiscord<gour> PMunch: well, wxpython is actively supported...there are several gui-options for nim, but not sure if any is production-ready?
16:51:12leorizeI'd say gintro and wxnim are the more solid ones
16:51:20leorizethe rest are incomplete
16:51:33FromDiscord<gour> PMunch do you still have interest for wwnim?
16:52:09FromDiscord<gour> @leorize how much of wx is covered (approx.)?
16:52:30FromDiscord<gour> PMunch do you still have interest for wxnim?
16:52:53leorizeonly PMunch can answer that :P
16:53:05PMunchwxnim is essentially just a wrapper for wxWidgets, so it doesn't really require much maintenance. Only thing it could need is a couple helpers here and there to make it easier to use in Nim, but with genui I haven't really found any of those pain points.
16:53:05leorizebut afaict, fairly complete
16:53:06FromDiscord<kodkuce> leorize: i can use websocket lib for backend but dont think i can use it for fronted UI cuz dont think it supports js
16:53:15leorize!repo websockets
16:53:18disbothttps://github.com/niv/websocket.nim -- 9websocket.nim: 11websockets for nim 15 79⭐ 25🍴 7& 6 more...
16:53:40PMunchSorry, I was writing that. I do still have an interest in wxnim, and I make sure that it keeps working on new releases.
16:53:53FromDiscord<gour> @leorize gi ntro is gtk3, right? i t wo uld be ok for linux, bu t to deliver multi-platform, i believe wx is better option
16:53:59PMunchIt's also automatically generated from the wxWidgets sources, so it's got close to 100% coverage
16:54:10leorize@kodkuce: you gotta use native js apis
16:54:18leorizeit's easy to wrap them so you'll be fine
16:54:23FromDiscord<gour> @leorize gintro is gtk3, right? it would be ok for linux, but to deliver multi-platform, i believe wx is better option
16:54:27livcdsomeone please do sciter bindings already
16:54:32livcd:D
16:54:56FromDiscord<gour> PMunch: that's good to hear. thank you!
16:55:12PMunchlivcd, you mean like these? https://github.com/sciter-sdk/nsciter
16:55:48livcdyeah but these do not work
16:56:47PMunchI'm sure he'd accept a PR to fix them :)
16:57:55livcdi am too stupid for that :-(
16:58:07livcdtrust me i tried
16:59:00PMunchHaha
17:02:21FromDiscord<gour> is ST (with vim emulation) still considered viable option to write Nim code or majority of folks moved to vscode?
17:02:36leorizesublime?
17:02:43FromDiscord<gour> yes
17:02:52leorizewell there's still a fair amount of users using it
17:03:15leorizecurrently neovim and vscode are the more well supported ones though
17:03:24FromDiscord<gour> ST4 is improving auto-completion etc.
17:03:28PMunchShould still work fine with nimlsp though :)
17:04:07FromDiscord<gour> PMunch: ST package for Nim uses nim-lsp?
17:04:18PMunchDon't think so
17:04:21FromDiscord<gour> ST community is working on st-lsp plugin
17:04:22FromGitter<zetashift> talking about nimlsp could you take a look at this PR :P: https://github.com/PMunch/nimlsp/pull/41
17:04:24disbotβž₯ Add emacs for setting up
17:05:09PMunchAh, I can merge it. But I have no idea if those instructions work or not :P
17:05:27FromDiscord<gour> here is it: https://github.com/sublimelsp/LSP
17:05:33shashlickis it fair to say that {.header.} and {.dynlib.} cannot coexist
17:05:40shashlickwith {.importc.}
17:05:48*zacharycarter joined #nim
17:05:48Araqshashlick: yes
17:05:52shashlickcool
17:05:57PMunchYeah I know, that's the one I used when I was testing LSP in Sublime
17:06:44leorizefun, SSL_CTX_set_min_proto_version is an actual function in libressl, but a macro in openssl
17:06:53zacharycarterHi shashlick: quick question - doesn't look like the `cCompile` mode parameter accepts objc. Is this a limitation or just an oversight?
17:07:06zacharycarterI'm inquiring about nimterop - sorry for not making that clear
17:08:16shashlickoversight i guess - never tried it and don't even know if it works
17:09:03shashlickif you can make a PR, will gladly accept
17:09:40zacharycarterOkay thanks - I guess I'm not quite sure what it does - it says it recursively searches for c / cpp files - but what I really want to have happen is for the objc compiler backend to be used
17:09:48zacharycarterI'll try to figure out a way to make it happen - thanks for the clarification
17:11:28shashlickcCompile is to create {.compile.} calls for c/c++ files
17:11:46shashlickif you want to use a different backend, can be done with your `nim objc` call itself right?
17:13:08*gour joined #nim
17:13:17zacharycarterWell I do want to create a compile pragma (I think) but I want to use the objc backend - even if I try calling `nim objc`, things still don't work. I'll play around with this more - clearly I'm not doing something correctly.
17:13:48shashlickbackend used is determined by how you call nim up front on the wrapper
17:14:53shashlick{.compile.} calls the correct gcc/g++/??? depending on the file type
17:14:58shashlickthat's determined by Nim itself
17:15:04*arecaceae quit (Remote host closed the connection)
17:15:32*arecaceae joined #nim
17:16:53zacharycarterah it may just be because I'm not doing `{.passC:"-objc-arc".}
17:18:47FromGitter<alehander92> kodkuce it does iirc
17:18:50FromGitter<alehander92> i think i used it
17:23:49shashlickwhat are valid objc file extensions?
17:24:17zacharycarterm, mm and h - m is objc mm is objcpp and h for header files
17:24:34zacharycarterI was able to get it to work - I just didn't have objc arc support explicitly enabled
17:24:37shashlickhttps://nimterop.github.io/nimterop/cimport.html#cCompile.m%2C%2Cstring%2Cstring
17:25:11shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L527
17:25:18shashlickI can add objc search to cCompile if there's interst
17:26:02zacharycartereh I guess I just was thinking that mode did something else - so maybe don't bother unless someone else asks for it :P
17:26:10zacharycarteryou probably have way more important things to do
17:26:30shashlicksure and given it will be untested
17:26:37zacharycarteryeah that too
17:28:24shashlickanother question - today nimterop pulls in tree-sitter-c and tree-sitter-cpp but I only use cpp mode to parse both types of headers
17:28:39shashlickof course c++ is not really supported but i'm wondering if I can remove tree-sitter-c altogether
17:29:26shashlickfrom a wrapping perspective, do c headers have stuff in them that are invalid c++
17:29:54shashlicki haven't seen any issues raised around this and nimterop has used cpp mode as the default since the beginning
17:30:40*rockcavera quit (Read error: Connection reset by peer)
17:30:50shashlickhttps://github.com/tree-sitter/tree-sitter-c/issues/15 is some additional context - appreciate some feedback
17:30:51disbotβž₯ Question: use tree-sitter-cpp all the time?
17:30:59*rockcavera joined #nim
17:31:09*rockcavera quit (Changing host)
17:31:09*rockcavera joined #nim
17:32:23*ryukoposting joined #nim
17:34:28disruptekshashlick: what does it buy you?
17:37:18shashlickone less package to pull, build and compile in
17:37:28shashlickcompletely unused
17:37:39disrupteki would leave it in.
17:38:08shashlickcomment it out? until it might be useful some day?
17:38:19ryukopostingshashlick, you are the guy who develops feud, right? or is genotrance a different guy
17:38:28shashlicksame
17:38:35ryukopostingok cool, just double checking
17:38:57ryukopostingmaking sure you're the right one to piss and moan to when stuff doesn't work
17:39:20shashlickyep πŸ˜„
17:39:35ryukopostingthis thing is really cool though, props for cooking up such an elegant design
17:40:24*endragor joined #nim
17:41:02*PMunch quit (Quit: leaving)
17:41:33shashlickglad to hear that
17:42:01shashlickbut before you get too deep into the feud plugin system, i'd recommend reading up the updated system in http://github.com/genotrance/plugins
17:42:51ryukopostingI've hardly touched it, feud as-is is already 95% of what I need
17:44:20ryukopostingMy plan is to distribute a "project manager" program based on nigui that'll have a button for "open script file," which will open feud then use that socket thing to open the script file in the new feud instance
17:44:54shashlickwhy not just add a project.nim plugin and it can manage projects for you
17:45:08shashlickthen users can run feud and say openproject xyz
17:45:13*endragor quit (Ping timeout: 250 seconds)
17:45:23ryukopostingooooooh man, I should look into this plugin thing lol
17:45:33shashlickyou can add callbacks for loadproject, saveproject, etc as simple procs
17:46:16ryukopostingso, how does one add a plugin to feud? or is that a question that will be answered once I dig into this plugins package?
17:47:17shashlickyou can start by adding a new feudCallback to an existing plugin and doing something int here
17:47:51shashlickadding a new plugin is simply adding a new x.nim to the plugins/server directory and making sure it has feudPluginLoad section
17:47:59shashlicksee any of the plugins in that dir
17:48:20ryukopostingwill I need to rebuild feud to add a plugin?
17:48:28shashlickthis should help understand the system - https://genotrance.github.io/plugins/api.html
17:48:36shashlickno feud will build it for you on startup
17:48:45shashlickand if it is edited, feud will unload, rebuild and load it back
17:49:02ryukopostingthat's pretty sweet
17:49:10shashlickyou need to be careful with the objects you create and fill out the right load/unload event callbacks
17:49:20zacharycarterdoes the plugin system you write for feud work with the arc gc shashlick?
17:49:34shashlicknot yet z, haven't tested it
17:49:45zacharycarterhopefully I can be your guinea pig
17:49:48shashlickbut genotrance/plugins works across all OS
17:49:52zacharycarterniceeee
17:50:01shashlickunlike feud which is mainly tested on windows
17:50:05shashlickso you can definitely build on it
17:50:39shashlicknote that the plugins system does need boehm today
17:50:49shashlickso getting it to work with arc is crucial
17:51:02ryukopostingI hope that, as a general rule, if a program works in the current runtime, it will work fine in arc as well.
17:51:28ryukopostingChroma may be an exception since it's dealing with a multithreaded C library at a fairly low level.
17:51:39shashlickthat's the hope but there might be some modifications needed, i don't have first hand experience
17:53:37*rockcavera quit (Read error: Connection reset by peer)
17:53:59*rockcavera joined #nim
17:53:59*rockcavera quit (Changing host)
17:53:59*rockcavera joined #nim
17:56:23FromGitter<brentp> what's the simplest way to add auth to a jester app? even a single user, single password specified on command-line.
17:58:58Araqryukoposting: there are differences but once we fixed even more bugs porting code is easy enough
17:59:13companion_cubeis there info on how `object` is compiled? a struct + a typeinfo field?
17:59:33leorizea struct, but don't depend on that
17:59:46leorizethe typeinfo field only exists if dynamic dispatch is used iirc
18:00:32leorizein general you should never count on Nim `object` ABI
18:00:53companion_cubeoh for sure, I'm wondering about the overhead and layout
18:01:24Araqif you don't use 'of ...' there is no type field and it's a C struct
18:01:55companion_cubeoh ok, I thought you'd have to use `tuple` for that. cool.
18:02:00*natrys joined #nim
18:02:10companion_cubeand if there's no `ref object` it's a value type?
18:02:56Araqyes
18:03:49companion_cubemakes a lot of sense, thanks.
18:03:58companion_cube(interesting too how crystal has similar choices)
18:05:41FromDiscord<Yewpad> @Benumbed I plan on doing more design stuff regarding the docs. Glad you like the dark theme. πŸ™‚
18:05:51*matti_ joined #nim
18:07:16*nikita`_ joined #nim
18:07:36*vqrs_ joined #nim
18:07:41*blueberrypie7 joined #nim
18:07:59*rockcavera quit (Remote host closed the connection)
18:08:02FromDiscord<Recruit_main707> dom96: how can i uninstall choosenim?
18:08:05*matti quit (Ping timeout: 246 seconds)
18:08:05*vqrs quit (Ping timeout: 246 seconds)
18:08:05*nikita` quit (Ping timeout: 246 seconds)
18:08:05*koltrast quit (Remote host closed the connection)
18:08:05*blueberrypie quit (Quit: Ping timeout (120 seconds))
18:08:08*nikita`_ is now known as nikita`
18:08:09*koltrast_ joined #nim
18:08:55FromGitter<zetashift> remove the binary?
18:09:14*ryukoposting quit (Quit: Leaving)
18:09:15*Vladar joined #nim
18:09:26FromDiscord<clyybber> @Yewpad cool to hear!
18:09:31shashlickDelete $HOME/.choosenim
18:09:33FromDiscord<clyybber> looking forward to it
18:09:41shashlickBut all toolchains go with that
18:09:57shashlickSo copy what you need
18:11:39FromDiscord<Yewpad> Don't know whether or not the design changes will be implemented in the default Nim doc gen or I'll make a custom doc gen. Reason for this is that the default Nim doc gen is so messed up that... I don't know. I can't even find words for it. πŸ˜‚ But the design changes focus on readability and structure. The coloring probably stays the same.
18:11:46FromDiscord<Yewpad> @clyybber
18:12:02FromDiscord<clyybber> ah ok
18:12:39FromDiscord<Yewpad> Something like a OFL (Open Font License) font that is more easy on the eyes etc.
18:13:51*pbb_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
18:15:01*waleee-cl quit (Quit: Connection closed for inactivity)
18:15:31FromDiscord<Yewpad> I figured that it would be better to just make a custom CSS file people can drop in their directories. I think the custom doc gen is a bit far fetched and unnecessary.
18:17:01FromDiscord<Benumbed> Nice, good to hear @Yewpad πŸ™‚
18:17:13FromDiscord<exelotl> @Yewpad oh you're alive! Discord app wouldn't let me @ you for some reason earlier :/
18:17:44FromDiscord<exelotl> Glad you're thinking about big structural changes, I think the docgen really needs it
18:18:00FromDiscord<Yewpad> No no, it's not your or Discord's fault. I re-joined the Discord after I left because of some heated discussions.
18:18:14FromDiscord<exelotl> Ah I see
18:18:35FromDiscord<Benumbed> It would be nice to have the manual and stdlib available as PDFs, so a custom docgen could@have it’s uses too if it supported multiple renderers
18:19:14FromGitter<awr1> hello all
18:19:32FromGitter<zetashift> hiya
18:19:57FromDiscord<Yewpad> Hm. So a custom doc gen !could! be beneficial, that's for sure. Because there's this one golden rule: "Never change a running system" and I don't want to delay any other development process in Nim's repository. And yeah, custom render frontends.
18:20:16*pbb joined #nim
18:20:45FromGitter<awr1> nim doc gen can output json, can't it?
18:21:01FromDiscord<Yewpad> And after some battle testing, the new docgen could be integrated by Nim
18:21:04FromGitter<awr1> perhaps you can develop your own site frontend for docgen
18:21:13FromDiscord<Yewpad> awr1: Don't know for sure
18:21:33FromGitter<awr1> https://nim-lang.org/docs/docgen.html
18:22:17FromDiscord<Yewpad> Hm, that is actually really nice.
18:24:20FromDiscord<Benumbed> Hmm json to reST and MD would pretty much open up the world in terms of output
18:25:13FromDiscord<Yewpad> Yeah I think a transformer could be way more better than actually touching the docgen itself. TBH I don't wanna lay hands on the docgen. Hell no
18:25:29FromDiscord<Benumbed> Don’t blame you at all haha
18:26:16FromDiscord<Benumbed> Ok back to work with me, while I still have work... :/
18:26:23FromDiscord<Yewpad> πŸ˜„
18:28:11Araqjust touch the docgen, there is nothing to be afraid of
18:28:37*waleee-cl joined #nim
18:28:40AraqI looked at it a minute ago, apparently it's source code
18:28:47disruptekwut
18:29:44FromDiscord<Yewpad> I feel like if anybody touches the docgen, everything falls apart. Like you would accidently bring your Domino imperium to collapse. πŸ˜„
18:29:56*hax-scramper quit (Ping timeout: 256 seconds)
18:30:06Araqfeelings are overrated
18:30:24disruptekespecially your feelings, yewpad.
18:30:33*rockcavera joined #nim
18:30:49*FromDiscord <Yewpad> Let's see if I can get his stream to crash
18:30:50FromDiscord<Benumbed> That’s not what Star Wars taught us!!
18:31:09FromDiscord<exelotl> I was thinking of making a proposal for custom headings for the existing docgen. As opposed to the predefined "Types", "Procedures", "Iterators" sections, which aren't the most human-friendly categorisation
18:31:51*hax-scramper joined #nim
18:32:49FromDiscord<Yewpad> With pragmas? Like `{.doccat: "Parsing".}` or `{.doccat: "Encoding".}`? (doccat = doc category)
18:33:37FromDiscord<exelotl> Maybe! Or with some custom rst directive
18:33:42*Pixeye quit (Ping timeout: 258 seconds)
18:38:49FromDiscord<Yewpad> araq: The problem with docgen is that if you make any changes to it that could cause problems, people aren't gonna be pleased. I had planned structural and even more design-specific changes. And the thing is: It is hard to please everybody. That's why I think working on a new docgen somewhere else is more practical. Otherwise, I think, we would have to build in a flags and conditions so people can do switcheroo between behavior A and B. If t
18:39:37FromGitter<eliezedeck> With `httpclient`, is it possible to send a `multipart/related ` POST request?
18:39:53FromGitter<eliezedeck> I suppose the default mode would be `multipart/form-data`
18:39:58FromDiscord<Yewpad> brb, shop will close in 20 minutes
18:40:02*gour_ joined #nim
18:43:32*gour quit (Ping timeout: 256 seconds)
18:44:23FromGitter<eliezedeck> @Araq now comes the need for a `bodyStream` for HTTP requests :/
18:45:26AraqPR please
18:47:18*inv2004 joined #nim
18:48:43FromDiscord<Yewpad>
18:48:43FromDiscord<Yewpad> https://cdn.discordapp.com/attachments/371759389889003532/696793526381314108/20200406_204751.jpg
18:48:48FromDiscord<Yewpad> For fuck sake
18:49:25FromDiscord<Yewpad> "2m safety distance" my ass lol
18:49:35FromGitter<eliezedeck> lol
18:49:52FromGitter<eliezedeck> @Araq I'll try ... again, this is *all new* to me
18:50:24*gour_ is now known as gour
18:54:42*hax-scramper quit (Ping timeout: 256 seconds)
18:54:50*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
18:55:30*hax-scramper joined #nim
18:55:31*pbb joined #nim
19:00:18*dddddd quit (Ping timeout: 256 seconds)
19:00:36krux02Yewpad: I have the idea in my head to allow module scoped macros that allow you to post process en intire module. With this you could write an documentation emitter as a macro.
19:02:01inv2004Did anyone trying websockets with deflate compression?
19:02:11inv2004... tried ...
19:06:42*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
19:07:43stefantalpalaruDid something change in the object AST on 32-bit platforms?
19:08:28*pbb joined #nim
19:09:37zacharycarterhttps://gist.github.com/zacharycarter/0e97b0e88ec04ce957b3649c7fcb5f24
19:09:48zacharycarterI'm getting an error trying to access an array on devel
19:09:54zacharycarteran element in an array rather
19:11:23*Vladar quit (Quit: Leaving)
19:12:49zacharycarternot really sure why...
19:16:25zacharycarteroh I think I know why
19:17:02zacharycarternevermind :/
19:17:45*Trustable quit (Read error: Connection reset by peer)
19:18:34FromGitter<eliezedeck> when contributing changes to the standard library, how can I make the compilation faster? like only compile the changes I recently made, not build everything all over again, and of course, exclude stuffs like `nimble` and `nimsuggest` from the build
19:19:05disrupteklemme know if you figure it out; i'm supposed to be adding that feature.
19:19:33*Trustable joined #nim
19:20:12FromGitter<eliezedeck> @Araq any pointers? ^
19:23:07leorizethat's by default?
19:23:31FromGitter<eliezedeck> @leorize doesn't seem to be the case
19:23:32leorizechange whatever in the stdlib, then just compile a test file to see if it works
19:24:13leorizeall the nim code will be processed again, but the C code will only be recompiled when any nim code changed
19:24:18FromGitter<eliezedeck> oh, right, so I don't really have to recompile the compiler for that ...
19:24:27leorizelol
19:24:29FromGitter<eliezedeck> stupid me
19:25:39FromGitter<eliezedeck> thanks @leorize :D
19:25:52FromGitter<eliezedeck> good night everyone :)
19:33:21*filcuc joined #nim
19:43:52*filcuc quit (Ping timeout: 265 seconds)
19:44:47*filcuc joined #nim
19:50:18inv2004Q: how to extract last version of the package from nimble? I see --ver, but it does not help to show something about ver
19:52:41stefantalpalaruAny known problems with uint64 on 32-bit platforms in Nim-1.2.0?
19:52:53leorizeno
19:53:00leorizedid you found something?
19:53:47stefantalpalaruA weird heap corruption, but I don't know yet where it comes from: https://github.com/status-im/nim-beacon-chain/pull/829
19:53:48disbotβž₯ Bump modules to deal with the Nim 1.2 upgrade
19:54:12stefantalpalaruThe "slot" field is a "distinct uint64" type.
20:01:18*liblq-dev quit (Quit: WeeChat 2.7.1)
20:06:06*filcuc quit (Ping timeout: 256 seconds)
20:13:59*inv2004 quit (Quit: Leaving)
20:25:42stefantalpalaruI got a small reproducibleprogram for you: https://github.com/nim-lang/Nim/issues/13902
20:25:45disbotβž₯ "distinct uint64" type corruption on 32-bit, when using {.borrow.} operators ; snippet at 12https://play.nim-lang.org/#ix=2h0c
20:28:11leorizestefantalpalaru: try -d:nimEmulateOverflowChecks
20:28:45stefantalpalaruNo change.
20:29:37stefantalpalaruIt does not look like a uint wrap-around, because that resulting value keeps changing from one run to another.
20:31:25leorizeI'm using an older version of devel and these pass
20:31:32leorize6e0c06f50e0450522b32a1bad23a3d2a4e36e9f9
20:31:41leorizelet me try to update this
20:31:54stefantalpalaruTime for a Git bisection?
20:37:44zacharycartershashlick: is it possible to have nimterop define an enum as consts instead? There are some array member properties defined on types in the C code I'm binding to, and in the C code, the size of the arrays reference an enum
20:38:13*Zectbumo joined #nim
20:38:21zacharycarterthis creates problems when using `[]` and `[]=` so I tried using cOverride and cSkypSymbol but then the arrays don't have a size in the generated Nim code from nimterop
20:38:46leorizenimterop always define enum as consts iirc
20:38:54zacharycarterhmmm
20:38:58FromGitter<zetashift> what are you up to zacharycarter? :O
20:39:08zacharycarterHi zetashift! Working on sokol bindings right now
20:39:19leorizezacharycarter: they will be distinct cint though, so you gotta convert them back to cint
20:39:26zacharycarterhmmm
20:40:25*narimiran quit (Ping timeout: 265 seconds)
20:41:15shashlickcan you post a gist to explain?
20:41:21zacharycartersure
20:43:32shashlickalso which enum - if it isn't being converted, might not be recognized by the old algorithm
20:45:43*leorize quit (Ping timeout: 240 seconds)
20:46:33zacharycarterI guess it's being defined as a const but then being coerced to another type that's declared using `defineEnum` as leorize described
20:46:42zacharycarterbut I'll throw together that gist
20:48:02shashlickyou might just need to implement a converter for that to work
20:48:21zacharycarterlet me give that a shot
20:49:50shashlickas long as the enums are converted correctly
20:50:08shashlickcheck out nimterop/types.nim for the default converters for enums
20:50:34zacharycarterthanks will do
20:53:37*dddddd joined #nim
20:55:48*moerm joined #nim
20:55:58moermHello everyone
21:05:07*solitudesf quit (Ping timeout: 258 seconds)
21:10:24*Jesin quit (Quit: Leaving)
21:16:06FromGitter<alehander92> :))
21:16:58*Jesin joined #nim
21:29:22*leorize joined #nim
21:32:04*filcuc joined #nim
21:33:12*sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in)
21:34:52dom96lol whoever came up with this crazy openssl backwards compat mechanism
21:35:01dom96There is a bug in here somewhere that's causing stack corruptions
21:38:02*sacredfrog joined #nim
21:45:53Araqhi moerm, I decided to build the SA on the "structured programming" aspects for version 1
21:47:34disruptekholy shit it works
21:50:10leorizeyou cracked ic?
21:53:42disrupteki'm so bad at this.
21:53:45*Trustable quit (Remote host closed the connection)
21:57:23*filcuc quit (Ping timeout: 260 seconds)
22:09:05dom96Someone want to help me find a corruption?
22:09:15dom96Could use a second pair of eyes on the implementation here: https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L327
22:10:35dom96#13903
22:10:38disbothttps://github.com/nim-lang/Nim/issues/13903 -- 3openssl wrapper corrupts stack on OpenSSL 1.1.1f + Android ; snippet at 12https://play.nim-lang.org/#ix=2h0G
22:11:30moermAraq Hi ;) oops, sorry was largely away ...
22:12:21*gour quit (Remote host closed the connection)
22:14:44leorizedom96: it's simple, just look loadPSSLMethod implementation
22:15:06leorizeit doesn't account for both method being nil
22:15:11dom96yes
22:15:13dom96I fixed that
22:15:20*iws joined #nim
22:15:24leorizethe reason we need such stupid fix is because openssl is a living hell :p
22:15:28dom96Noticed it too, didn't solve the problem after fixing
22:15:59*IWSnim quit (Quit: leaving)
22:16:24dom96I stepped through it in GDB and it ends up in some unknown function, which suggests to me a stack corruption
22:16:27leorizedom96: https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L285
22:17:00dom96I also tried to use sslModule first instead of thisModule.
22:17:15leorizethis is super hacky
22:17:24dom96I agree
22:17:41leorizebut again we don't have any better choices here...
22:17:55dom96we do actually
22:18:14dom96but there are drawbacks
22:18:23dom96which for some might be too much
22:19:05dom96but we should at least give users the ability to statically tell the wrapper to link against a particular openssl version
22:19:32dom96to be honest, I wonder if at this point the old API that this wrapper implements is even supported by OpenSSL
22:19:52leorizeit's still "supported"
22:20:07leorizeopenssl just use C macros to redirect people to the newer symbols
22:20:19leorizebut they don't care about the ABI
22:21:16zacharycarterhmm still having trouble with this enum array accessor issue - I tried writing a converter from my distinct int type that nimterop generated to int - but it doesn't seem to be getting called
22:21:51zacharycarterso I'm still not sure how to access these C arrays that use an enum value to specify their size
22:22:03leorizedom96: directly linking with openssl seems to be the only way out here
22:22:30dom96leorize: yeah, that's what I'm using as a workaround
22:22:36dom96had to modify the source code though :(
22:22:58leorizewhy?
22:23:18leorizeif you use --dynlibOverride:ssl it should disable all of those hacks
22:23:25dom96yeah, but then I cannot dynamically link
22:23:33dom96I still want to link with my .so
22:23:39leorizeyou can, just use --passL
22:23:57leorize--dynlibOverride just tell Nim to not do the dlopen() dance
22:24:05leorizeyou can decide to link however after
22:24:13dom96oh really
22:24:15dom96til
22:24:16dom96How?
22:24:56leorize--passL:"-lssl" or --passL:"/path/to/lib.so"
22:25:44dom96Doesn't -lssl statically link?
22:25:57leorizeonly if you add '-static'
22:26:27dom96hm, but then I need to grab the header files into my Android project
22:26:28dom96meh
22:26:39leorizeyou don't need the headers lol
22:27:50leorizeyou just need the .so
22:28:03leorizethe wrapper acts as your header already
22:28:34leorizeif you ship the .so next to the binary, throw in `--passL:'-rpath,$ORIGIN'` <- yes, that's a literal dollar
22:28:50leorizeit will tell the runtime linker to look at the current directory for .so files
22:29:07dom96or I can just do what I'm doing now and reuse Nim's dynlib mechanism
22:29:19dom96it's 11:30pm and I spent too much time faffing with this already :)
22:30:41*tane quit (Quit: Leaving)
22:30:48iwsIs there some easy way to convert a uint8 to a signed int8?
22:31:05leorizeiws: int8(your_uint8_here)
22:31:23disruptekthey want an /easy/ way.
22:31:29iwsI tried that actually.
22:32:01iws
22:32:02iwszoey@luna:~$ ./test
22:32:02iws/home/zoey/test.nim(2) test
22:32:02iws/home/zoey/bin/nim-1.2.0/lib/system/fatal.nim(49) sysFatal
22:32:02iwsError: unhandled exception: value out of range: 250 notin -128 .. 127 [RangeError]
22:32:05iwszoey@luna:~$ cat test.nim
22:32:07iwslet u = 0xFA'u8
22:32:10iwslet x = int8(u)
22:32:12iwsecho x
22:32:15iws
22:32:16leorizeiws: well what are you expecting? :P
22:32:17iwsI did try to read the docus :)
22:32:22leorizealso don't paste
22:32:27iwsoh, my appologies
22:32:43leorizeif you want bit-reinterpretation then use `cast`
22:32:51leorizecast[int8](value here)
22:33:31leorizeconversion like above will be subjected to bounds checking
22:33:40iwsAh, I'd seen that in the source for toUnsigned template
22:33:45iwsI'll flip it around and see how it goes
22:35:11iwsoh, yea, sure enough, I should have tried that first, but I figured there was a reason not to since it wasn't in the bitops lib
22:35:14iwsthank you
22:35:49*natrys quit (Quit: natrys)
22:46:59shashlick@zacharycarter gist?
22:47:13shashlickOr some test code
23:10:58*moerm_ joined #nim
23:11:31*moerm quit (Read error: Connection reset by peer)
23:13:27*zacharycarter quit (Ping timeout: 260 seconds)
23:23:47*dwdv quit (Ping timeout: 265 seconds)
23:28:46FromDiscord<KingDarBoja> Hi all
23:29:33FromDiscord<Rika> hello
23:29:43FromDiscord<KingDarBoja> ❀️
23:30:11*rockcavera quit (Read error: Connection reset by peer)
23:31:30*moerm__ joined #nim
23:32:10*rockcavera joined #nim
23:32:11*rockcavera quit (Changing host)
23:32:11*rockcavera joined #nim
23:34:04FromDiscord<Rika> has anyone implemented a skip list in nim?
23:35:12*moerm_ quit (Ping timeout: 265 seconds)
23:37:33moerm__cu and have a good time everyone
23:37:37*moerm__ quit (Quit: Leaving)
23:38:43FromDiscord<konsumlamm> whats the point of `|`?
23:39:01*zacharycarter joined #nim
23:39:53leorizekonsumlamm: for creating type classes
23:40:45FromDiscord<konsumlamm> hmm, so that you can write multiple conditions in one line?
23:41:50leorizeno, for smt like this: `proc foo(i: int | uint)`
23:42:28FromDiscord<konsumlamm> huh
23:42:35FromDiscord<konsumlamm> is it a builtin then?
23:42:53FromDiscord<konsumlamm> because its definition is just discard
23:42:59*krux02_ joined #nim
23:44:23leorizeyea
23:45:00FromDiscord<konsumlamm> ah, ok
23:45:52*krux02 quit (Ping timeout: 260 seconds)
23:47:18FromDiscord<konsumlamm> i experimented a bit with it and it seems like the first time you assign something it chooses the type, is that right?
23:47:42leorizeyea
23:47:50FromDiscord<konsumlamm> kk
23:48:03leorizeit's generics with constraints
23:49:36zacharycarterhttps://imgur.com/a/WwGz3Hs - got sokol working with nimterop
23:50:48FromDiscord<Rika> cant you use `or` isntead of `|` too?
23:51:53FromDiscord<KingDarBoja> U can
23:52:14FromDiscord<KingDarBoja> At least I have seen it working the same