<< 25-10-2019 >>

00:00:31shashlickworks with your wren wrapper
00:03:30rockcaveraarray type does not have an equal insert of type seq?
00:08:13rockcaverawould using shallowCopy() be safe?
00:22:23rayman22201array type is fixed size at compile time. How can insert possibly work? You can't grow an array.
00:24:17*Hideki_ joined #nim
00:24:55*krux02_ quit (Remote host closed the connection)
00:29:24rockcaverarayman22201 I do not want to enlarge the array, I want to move it, eliminating the data that will be at an index larger than the size.
00:30:24rockcaverafor now shallowCopy() is doing the job. I don't know if it would be the most appropriate ...
00:32:09rayman22201shallowCopy() will probably work, but depending on the type inside the array, "there be dragons"
00:33:25rockcaverauint8
00:33:26rockcavera;)
00:33:41rayman22201lol. then yeah, shallowCopy is fine
00:34:20rockcaverathanks
00:34:52*Hideki_ quit (Ping timeout: 264 seconds)
00:38:54disruptekshashlick: looking for a pattern for conditional code based upon availability of a module.
00:43:38shashlickhttps://github.com/genotrance/nimarchive/blob/master/nimarchive.nimble#L17
00:43:45shashlickPoor man's solution
00:44:14disruptekahh, hah. 😊
00:44:25disrupteki'll just punt for now.
00:45:04disruptekyours is probably going to last a long time though, tbh.
00:46:04shashlickActually my thing is cause it is checked at install time itself
00:50:46disrupteka proc is the result of a macro and the compiler errors saying `express has no type`. i feel like this is simple but i can't remember what i need to do.
00:50:54disrupteks/express/expression/
00:52:56shashlickCode
00:56:43disrupteksomeday i really need to setup a paster.
00:58:08disruptekhttps://gist.github.com/disruptek/b3003fb8ec0c11648278c543f253f75c
01:02:14*ng0 quit (Quit: Alexa, when is the end of world?)
01:03:54shashlickUse ix
01:06:06*Traviss__ joined #nim
01:07:24shashlickI just use parseStmt
01:07:28*Traviss__ quit (Client Quit)
01:07:45shashlickOr quote do
01:07:48*Traviss__ joined #nim
01:08:00shashlickMakes things more readable for me
01:08:46disrupteki started with quote do but it feels hackish and expensive; i'm afraid it's going to break under me. but that's not really the problem.
01:08:55disrupteki don't think. πŸ˜‰
01:09:53*traviss quit (Ping timeout: 245 seconds)
01:10:23*Hideki_ joined #nim
01:10:57shashlickIt's working fine for me
01:11:11shashlickThat's what I do in nimterop
01:11:19*Traviss__ quit (Client Quit)
01:11:42*traviss joined #nim
01:12:17disrupteki know, i use it in openapi extensively, but mostly for `if` statements. other stuff, i try to just construct the ast by hand.
01:12:42disruptekbut, this isn't the problem; i can generate the proc just fine. i'm doing something else dumb.
01:14:26*Hideki_ quit (Ping timeout: 240 seconds)
01:25:49disrupteki'm building the proc manually here because i'm constructing input for cligen automatically; ie. a very long list of gully parameters, --long-options, and default values for same. so, it makes sense.
01:31:24*traviss quit (Quit: Leaving)
01:37:23*stefantalpalaru quit (Ping timeout: 265 seconds)
01:45:03disruptekah, it was returning NimNode instead of untyped. i knew it was stupid. 🀣
01:56:38*traviss joined #nim
02:05:56FromGitter<Willyboar> Release my 3rd week in nim project and i think it is the baddest code you can ever seen. But it works
02:08:54FromGitter<gogolxdong> Blender list Chinese community on the first page, https://www.blender.org/community/, do you want to list us?
02:10:53jkenCan two cases in a variable type share attributes? I get an error by redefining them in seperate cases.
02:19:35jkennevermind, rtfm'd
02:21:08FromGitter<gogolxdong> We have a new domain https://nim-cn.com/
02:21:51FromDiscord<Rika> Why a new domain instead of another path in the main domain
02:22:17FromGitter<Willyboar> yeap! like cn.nim-lang.org
02:22:28FromGitter<gogolxdong> .org cannot be registered as domain name in China
02:22:36FromDiscord<Rika> Oh shit, I see
02:22:42FromGitter<Willyboar> Chinese is one of the most difficult languages :)
02:22:45FromDiscord<Rika> They can't access orgs?
02:22:52FromGitter<gogolxdong> yes.
02:24:01FromGitter<gogolxdong> we tried nim-lang-cn.org for a peroid, but was banned.
02:25:10FromGitter<Willyboar> you can find a co in another country to update the content
02:26:37FromGitter<gogolxdong> what's co?
02:27:16FromGitter<Willyboar> co-operator
02:27:30FromGitter<Willyboar> a partner
02:28:21disruptekjken: there's an rfc discussing ideas on how/why to chase that variant object behavior.
02:29:16disruptekchange, too.
02:29:34FromGitter<gogolxdong> problem is .org is banned. We have the script to update website.
02:31:34FromGitter<Willyboar> Find a person outside china to register the domain.
02:33:30FromGitter<gogolxdong> Is the .com domain name a concern? Great Fire Wall will ban the ip point to .org if necessary, it's impossible to run a .org in China.
02:34:58FromGitter<gogolxdong> What you said is what we did a month ago, buy an AWS server as a flight.
02:36:20FromGitter<gogolxdong> Other domain name is unavailable and ridiculous.
02:54:12*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:54:47*pbb joined #nim
03:17:06*chemist69 quit (Ping timeout: 246 seconds)
03:19:15*chemist69 joined #nim
03:25:15FromDiscord<me2beats> hey guys. If my demo code is 12 lines long, is it still better to use code services for showing it?
03:25:39disruptekprobably; there are a lot of grumpy folks hanging out in here.
03:25:51disrupteksome of them are likely to have access to weapons.
03:26:21leorizeif the channel is not busy then you can paste it
03:26:28leorizejust remember not to edit it
03:26:49leorizebut play.nim-lang.org is the better way to paste nim code :P
03:27:28FromDiscord<me2beats> my question is can I do something like this:
03:27:28FromDiscord<me2beats> ```
03:27:29FromDiscord<me2beats> type
03:27:29FromDiscord<me2beats> Person = ref object of RootObj
03:27:29FromDiscord<me2beats> name: string
03:27:29FromDiscord<me2beats> age: int
03:27:29FromDiscord<me2beats>
03:27:31FromDiscord<me2beats> Animal = ref object of RootObj
03:27:33FromDiscord<me2beats> name: string
03:27:34FromDiscord<me2beats> age: int
03:27:34FromDiscord<me2beats>
03:27:36FromDiscord<me2beats> Student = ref object of Person if student_type == "person" else ref object of Animal
03:27:38FromDiscord<me2beats> id: int
03:27:39FromDiscord<me2beats> student_type: string
03:27:41FromDiscord<me2beats> ```
03:30:23FromDiscord<me2beats> don’t know what to name it, something like a dynamic base setting maybe
03:32:23disruptekhow about, Centaur?
03:32:32disruptekHALF MAN
03:32:34disruptekHALF BEAST
03:32:57disruptekHUNG LIKE A HORSE
03:33:17disrupteki think i have a picture here somewhere...
03:34:31FromGitter<Willyboar> Hercules died from the blood of one of them
03:34:38FromGitter<Willyboar> Chiron
03:35:20disruptekthey can be dangerous at certain times of the month, alright.
03:35:39disruptekbut, y'know herc was kinda a wimp. most of those stories are just that.
03:35:41FromDiscord<me2beats> lol
03:35:41disruptekstories.
03:36:59FromDiscord<me2beats> the problem is that I would like to set the instance class (object type?) depending on the arguments I enter.
03:36:59FromDiscord<me2beats>
03:37:00FromDiscord<me2beats> in python I can do something like this by changing the class of the object (obj.class = SomeOtherClass) Also in python2 you could use __bases__
03:37:07FromDiscord<me2beats> the problem is that I would like to set the instance class (object type?) depending on the arguments I enter.
03:37:07FromDiscord<me2beats>
03:37:07FromDiscord<me2beats> in python I can do something like this by changing the class of the object (obj.class = SomeOtherClass) Also in python2 you could use `__bases__`
03:39:58FromDiscord<me2beats> It just seems to me that this is one of the reasons OOP is not flexible enough.
03:39:58FromDiscord<me2beats> OOP does not suggest that it may be convenient for you to choose the "parent" of an object depending on the parameters
03:41:12disruptekol' herc was a more accomplished drinker than he was a strongman.
03:41:32disruptekand we already know how his animal husbandry skills failed him.
03:41:49disruptekfact is, drinking was in his blood.
03:41:54disruptekhe was born to it.
03:42:40disruptekyou spend that much time around alcohol, one of two things happen:
03:42:49disruptek1) you learn to keep your mouth shut,
03:43:12disruptek2) you die by the moon blood of a centaur.
03:43:45disruptekguess what i'm saying is, t'was not the drink that killed ol' herc.
03:43:58disruptekit was the way once he got started, he just WOULD NOT SHUT UP.
03:50:31leorize@me2beats try not to use inheritance :P
03:50:55leorizeit seems to me that an object variant might fit this use case more
04:00:44*M948e5[m] joined #nim
04:02:30FromDiscord<me2beats> I will try to delve into the object variant thanks.
04:02:30FromDiscord<me2beats>
04:02:31FromDiscord<me2beats> about inheritance - it’s hard for me to imagine how to can not use it when creating GUI elements (Widgets) for example.
04:07:11M948e5[m]hi, i tried to go to your forum but i received only a blank page.
04:07:12M948e5[m]i tried to sign up for gitter but they only allow signing in through github and gitlab. gitlab just changed their privacy policy, so thats a no go.
04:07:12M948e5[m]i wont even get started on <<<discord>>>, which i now see this room is bridged to.
04:12:12leorizeyou can just use irc :P
04:12:39leorizethe matrix bridge can be wonky at times due to matrix.org infrastructure
04:18:31*rockcavera quit (Remote host closed the connection)
04:20:04*u0_a172 joined #nim
04:21:24*u0_a172 quit (Client Quit)
04:28:22*theelous3 joined #nim
04:39:23FromGitter<vishr> Hello, I wanted to share a programming playground for that I created recently https://code.labstack.com/nim. I hope you will find it useful.
04:43:34FromDiscord<Rika> https://play.nim-lang.org/
04:44:26*narimiran joined #nim
04:45:36*dddddd quit (Remote host closed the connection)
04:48:06FromGitter<bevo009> @vishr nice! Can you add a keyboard shortcut eg Ctrl-Enter?
04:49:12FromGitter<vishr> @bevo009 to run the program?
04:49:26FromGitter<bevo009> Just noticed the Playground has a keyboard shortcut now, very nice
04:49:41FromGitter<bevo009> @vishr yep to run it
04:49:52FromGitter<vishr> I will :)
04:49:56FromGitter<bevo009> Ctrl-Enter seems to be a default standard
04:50:09FromGitter<vishr> @bevo009 πŸ‘
04:52:56shashlickif any ideas - please help - https://github.com/libarchive/libarchive/issues/1270
04:52:57FromGitter<bevo009> I forgot who took over developing the Playground, but thanks for all the latest improvements eg font size, Nim version, C++ target and the keyboard shortcut
04:53:52FromGitter<bevo009> That's on a par with other online editors now
04:54:20shashlick@PMunch did all that
04:58:36FromGitter<gogolxdong> Wrote a html2karax tool to convert static html to Karax application or server side rendering. https://github.com/nim-lang-cn/html2karax/
04:59:37*nsf joined #nim
05:00:12FromGitter<gogolxdong> We are using it to convert tutorial and manual.
05:02:09FromGitter<bevo009> @PMunch you're a champ, cheers!
05:11:54*Hideki_ joined #nim
05:15:57*Hideki_ quit (Ping timeout: 240 seconds)
05:42:36ZevvGuys, look at this Della-Vos book thing: https://github.com/FemtoEmacs/nimacros/blob/master/nimdoc.pdf
05:45:22Zevvit has illustrations from an 80's forth book, long chapers of prose about the antrophology of money. What *is* this?
05:49:34Zevv"The author recommends that you don't go beyond pate 30, and thus avoiding material that you may consider offensive"
05:59:19*LargeEpsilon joined #nim
06:03:13*theelous3 quit (Ping timeout: 245 seconds)
06:06:17FromGitter<zacharycarter> looks like someone is writing a book about creating Nim macros?
06:06:34FromGitter<zacharycarter> Victor Della-Vos is to be more specific
06:07:30FromGitter<zacharycarter> Also regarding the Lua conversation about games the other day - Lua is definitely well-suited for game scripting. It's (from what I can tell) the most widely used scripting language in game / engine development
06:08:01FromGitter<zacharycarter> so whoever was saying they don't think it's well suited - you're certainly entitled to your opinion but I think the majority of the industry disagrees with you
06:10:31FromGitter<zacharycarter> I'm attempting to learn from - https://github.com/gafferongames/networkedphysics-gdc2015. I've gotten the project to successfully compile on windows, but I can't figure out how it's supposed to run / work
06:10:49FromGitter<zacharycarter> I figured maybe something was broken on Windows, because support for it didn't seem complete, but I can't get it to compile / work on mac OS either
06:10:50FromGitter<zacharycarter> ugh
06:13:39ZevvIve been working on a 50kloc lua project over the last years, a small mips platform doing DSL modem, routing, ipsec, openvpn, gre, rip, ospf and tons of other features. Not sure if I would choose lua again in 2020, but it has been a pleasant yourney overall. Lua scales.
06:17:07FromGitter<zacharycarter> lua-jit might even be a better option, but you just have to keep in mind it's unmaintained and will stay that way unless Mike Pall reawakens with a hunger to work on it again
06:17:20FromGitter<zacharycarter> so it will not keep up with the lua standard
06:17:57ZevvI tried a port to luajit a few years ago when mips support came available, but it wasnt worth the switch for us.
06:18:06FromDiscord<Chiqqum_Ngbata> https://moonscript.org/
06:18:31*Mister_Magister joined #nim
06:18:35Zevvwe're mostly memory bound - on a system with 8M flash and 64M ram, and luajit does not do better memory-wise
06:18:38FromGitter<alehander42> lua isnt typed right
06:18:51Zevvthat is my biggest grope after all these yeras indeed
06:18:53Zevvthus nim
06:20:47FromGitter<zacharycarter> correct
06:20:57FromGitter<zacharycarter> moonscript doesn't solve much IMO
06:21:25FromGitter<alehander42> <3
06:22:17FromGitter<alehander42> i have to admit: not sure if this would be open sourced
06:22:21FromGitter<zacharycarter> originally I was going to use the valve steamworks sdk for my networking code, and then I was also considering the valve game networking sockets library, but they would both require me to write a C wrapper to handle callbacks
06:22:26FromGitter<alehander42> but i am trying to do something that seems very not obvious to me
06:22:32FromGitter<alehander42> but it should be obvious
06:22:42FromGitter<alehander42> i want to render a PNode (or NimNode)
06:22:44FromGitter<zacharycarter> so now I'm back to square one as far as how to do network code for my game
06:22:45FromGitter<alehander42> to string
06:23:00FromGitter<alehander42> but with changing the PNode locations to match the result string
06:23:04FromGitter<alehander42> while rendering it
06:23:27FromGitter<alehander42> if you think about it, this probably requires patching the whole nim renderer right
06:34:35FromGitter<alehander42> it seems i can patch gsub .. maybe
06:34:54*Mister_Magister quit (Quit: bye)
06:34:56*PMunch joined #nim
06:35:20*Mister_Magister joined #nim
06:35:44*Mister_Magister is now known as Guest25229
06:36:09Zevvzacharycarter: what level of networking are you looking for? More then just the sockets, I assume?
06:36:10*Guest25229 quit (Remote host closed the connection)
06:37:09FromGitter<zacharycarter> yeah - something a bit higher level, although if I dig through that gdc networked physics demo enough, I can probably start with raw sockets and add functionality on as I need
06:37:19FromGitter<zacharycarter> I don't think he's using any networking libraries in that demo
06:39:10*solitudesf joined #nim
06:39:53*Mister_Magister_ joined #nim
06:40:07*Trustable joined #nim
06:43:04narimiran!eval echo -11 mod 5
06:43:07NimBot-1
06:44:14narimiran!eval echo -3 mod 7
06:44:17NimBot3
06:46:50narimiran!eval echo (-3 mod 5, -13 mod 5)
06:46:52NimBot(3, -3)
06:50:04*Mister_Magister_ is now known as Mister_Magister
06:56:49PMunchnarimiran, yeah modulo is weird..
06:57:05narimiranjust in 1.0.x, it was ok in 0.20.x
06:57:49PMunchHuh, you're right. Your last example returns -3, -3 on 0.20.2
06:57:55PMunchWhich is what you'd expect
06:58:08narimiranand big thanks to you PMunch for having the version switch on the playground, it makes testing things quite easy
06:58:40narimiranhere's another example: https://play.nim-lang.org/#ix=1ZM6
06:59:02PMunchNo problem :) Took a little bit of doing as I now have to build the docker images myself instead of using the ones from dockerhub
06:59:34PMunchThose are the examples from the manual right?
06:59:53PMunchAlthough the manual says that the last column should look like the firts..
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:28narimiranthe top part is from our docs, the bottom one i created based on the issue report
07:00:43narimiran`a mod b` fails when abs(a) < abs(b)
07:00:48PMunchHuh, the behaviour of that example is different between 0.20.2, 1.0.0, and 1.0.2
07:01:26narimiranyeah, i know there was a recent fix because 1.0.0 was even more wrong :)
07:02:07narimiransign of `b` was taken into an account, instead of `a`
07:02:20Araqer. is this *still* wrong?
07:02:32Araq:'-(
07:02:40narimiranAraq: see the examples and the reported issue: https://github.com/nim-lang/Nim/issues/12514
07:02:48PMunchmath.mod still works fine for floats FWIW
07:05:04*gmpreussner joined #nim
07:05:35*krux02 joined #nim
07:06:07PMunchIt was right in 0.20.2 though..
07:06:31*filcuc joined #nim
07:18:53*Vladar joined #nim
07:21:04FromGitter<alehander42> Araq, do you think the thing i said about patching renderer for my usecase
07:21:07FromGitter<alehander42> makes sense
07:39:36*theelous3_ quit (Ping timeout: 246 seconds)
07:47:37*GordonBGood joined #nim
08:03:05*gmpreussner quit (Ping timeout: 265 seconds)
08:03:40*gmpreussner joined #nim
08:06:29*Trustable quit (Remote host closed the connection)
08:15:53*lritter joined #nim
08:22:35*ng0 joined #nim
08:23:24*letto_ quit (Quit: Konversation terminated!)
08:24:31planetis[m]Can you please remove the "della vos" spam and ban the spammer already?
08:28:12PMunchHuh?
08:29:31Zevvyeah but *what* is that exactly - who has taken the time to put that up?
08:29:59Zevvthere is a repo, it has code, it has a pdf that kind of makes sense and then changes into ramblings
08:30:51planetis[m]Its totally spam, good effort though
08:31:11Araqhuh, narimiran please take a close look
08:31:27Araqmaybe edit it?
08:31:44planetis[m]Maybe you didn't catch it bc its early morning
08:31:48narimiranedit what exactly?
08:32:15narimiranbtw, the spam received 7 likes :)
08:32:40FromGitter<alehander42> its bizarre
08:32:53Zevvit really is. You should try to read the pdf, it's great
08:32:55FromGitter<kayabaNerve> Where is it?
08:33:00Zevvhttps://github.com/FemtoEmacs/nimacros/blob/master/nimdoc.pdf
08:33:08PMunchThis is a really strange read..
08:33:46narimirani've checked other posts by the same user
08:33:48Zevvwhen the acid kicks in
08:33:55narimiranthey are not (yet edited to) spam
08:34:12PMunchZevv, yeah that is kinda what it feels like
08:34:41ZevvI really enjoyed that. Still groggy out of bed trying to read that, and halfway getting this doubt "is it *me*, or is there something wrong here?"
08:34:46Zevvget up, have a coffee, try again
08:35:41Zevvthe interesting part is that all of the text seems to be unique - I can't find any matches on the content from anywhere
08:35:58narimirani just scrolled to chapter 11. you have some nim code and then.... whatever that is :D
08:36:12PMunchI mean scrolling through it without reading much it seems completely fine
08:36:18ZevvRead page one: the author tells you not to go beyond page 30 becasue of offensive content
08:37:04Zevv"If I had not obtained the collaboration of Vindaar [...], I would not be able to write about Nim macros"
08:37:24PMunchI mean chapter 8 is a sharp turn from "A syntax changing macro" to "The tacit dimension"
08:37:43FromGitter<alehander42> i am like
08:37:45FromGitter<alehander42> ?????????????????????????????????????????????????
08:37:47FromGitter<alehander42> seriously
08:37:52FromGitter<alehander42> this is ridicolus
08:38:09PMunchIt's amazing!
08:38:15FromGitter<alehander42> ban this stuff man
08:38:21ZevvI'm saving me a copy :)
08:38:34Araqtrolling in a PDF file?
08:38:37PMunchZevv, wanna pitch in on a print run? :P
08:38:42FromGitter<alehander42> but why so much effort
08:38:49PMunchYeah that's the strange thing
08:39:06PMunchAnd they are obviously in the community, they mention Juan Carlos, and Vindaar by name
08:39:20narimiranso, what to do here? ban him based on this post, even though the previous two were ok? lock the thread?
08:39:42Zevvbetter delete it, imho.
08:39:56narimiranPMunch: their names come from https://forum.nim-lang.org/t/5383
08:40:14PMunchWhat is wrong with it? Apart from being really weird :P
08:40:20Zevv*look* at it
08:40:34PMunchnarimiran, aha
08:43:00lqdev[m]shashlick: verified the incompleteStruct update, works correctly
08:43:18FromGitter<kayabaNerve> Thanks Zevv
08:43:42PMunchHaha, chapter 11 is great :P
08:43:54*letto joined #nim
08:44:47PMunchJust a bunch of ramblings about indians, mormons, brazil, womens asses, and off course some unit conversion code examples in Nim :P
08:44:48FromGitter<alehander42> it gives me really bad vibe man
08:45:18PMunchOh jeez, chap 11 is literally just the rest of the book :S
08:45:23FromGitter<alehander42> remove this from planet earth
08:45:29PMunchYeah, it's like peeking into the mind of a mad-man
08:45:44FromGitter<kayabaNerve> Since when is there a tut3?
08:46:00FromGitter<alehander42> krux02 wrote it a while ago
08:46:01FromGitter<alehander42> iirc
08:46:04Araqsince version 1 or maybe 0.20
08:46:13FromGitter<kayabaNerve> Thanks for the info.
08:46:36lqdev[m]@kayabaNerve afaik it's since 0.20
08:46:41lqdev[m]it wasn't here in 0.19
08:48:07PMunchHmm, interesting: github.com/FemtoEmacs/nimacros/commit/22d6276f937574711a95b49261c31dd189a29f46
08:49:03FromGitter<kayabaNerve> Does anyone use Make + Nim?
08:49:08ZevvI do
08:49:11FromGitter<kayabaNerve> Or any build system + Nim other than nimscript?
08:49:53PMunchI mostly use Nimble
08:50:00FromGitter<kayabaNerve> Weird. I have a nimscript config file (likely could be a cfg though I do have a single if check) but I just use pragmas to coordinate builds.
08:50:21PMunchNake was popular a while ago, but I'm not sure if it's very much used nowadays
08:51:06FromGitter<kayabaNerve> Side question, does Nim's GC successfully handle circular objects that reference itself?
08:51:13FromGitter<kayabaNerve> Nake's pretty dead, RIP :(
08:52:55FromGitter<kayabaNerve> (and to further explain my question, I'm thinking about circular linked lists)
08:53:07PMunchMore by the same author, from three years ago: https://github.com/FemtoEmacs/femtodocs/blob/master/femto.pdf
08:53:40PMunchParts of chapter 2 is more or less a copy-paste into the Nim macro thing
08:54:31ZevvI like the little pictures, makes me think of Leo Brodie
08:54:37PMunchAnd then chapter 4 is "The man who knew Javanese" which appears to be a random short story
08:55:42ZevvBut try to find any sentence of that on google - nothing!
08:55:42PMunchAnd then chapter 5 "Arithmetic operations"
08:55:46PMunchThis is, special..
08:56:26PMunchWell the man who knew javanese is apparently a thing
08:56:47narimiranlook how entertained you are. and you want me to delete it so nobody else can experience this?
08:56:54narimiranyou selfish bastards!
08:56:55solitudesfrelax guys, thats just how old people think
08:56:57Zevv:)
08:57:18*floppydh joined #nim
08:58:01ZevvFirst I suspected malicious intent, but this might just as well originate from a disturbed person. A good friend of my would generate similar ramblings when on the edge of psychosis
08:59:15PMunchYeah, it really appears like that..
08:59:35ZevvTempleOS
08:59:44PMunchExactly!
09:00:02PMunchHmm, I found a version of that story from 1966, but it's quite different
09:00:11PMunchSeems like he's written his own version
09:01:24PMunchOh it's originally portugese..
09:08:45FromGitter<kayabaNerve> So I finished glancing through Chapter 11. It's hilarous
09:09:27PMunchDid you actually read it? I only read a sentence here and there
09:13:55*Hideki_ joined #nim
09:14:56FromGitter<kayabaNerve> Define reading
09:14:58FromGitter<kayabaNerve> I glanced it
09:15:07FromGitter<kayabaNerve> Oh. I did read Chapter 4
09:15:30FromGitter<kayabaNerve> *I rad enough of Chapter 11 to understand what it's about.
09:16:00PMunchHaha, can chapter 11 be understood?
09:16:12FromGitter<kayabaNerve> I mean, it's written horribly, but yes
09:16:19FromGitter<kayabaNerve> > Suddenly, the girl spoke. "Grandfather, after killing this bad man, and before throwing the body into the river, cut his hair off for me. I need it for Rachel's wig. The hair of the other bad man, which I sewed onto my doll's head has almost entirely gone."
09:16:32FromGitter<kayabaNerve> This was one of my favorite lines. Typed it up to text it to a friend.
09:16:39FromGitter<kayabaNerve> That exposition lol. Everyone speaks like that.
09:17:16PMunchWow, I really should read this..
09:18:24PMunchI assume no-one actually knows edu500ac? If this is indeed a psychosis thing they should probably seek help..
09:18:25FromGitter<kayabaNerve> That's after he invades a boat, talks about the practices of wrapping tobacco and chain smoking, and gets threatened by the captain to have his male personal parts cut off.
09:18:32*Hideki_ quit (Ping timeout: 268 seconds)
09:18:46FromGitter<kayabaNerve> He also slips in at the end of the statement he knows martial arts. I think he specified takwaendo.
09:19:05FromGitter<kayabaNerve> *taekwondo. I apparently do not know how to spell that 0_o
09:19:26PMunchYeah there are a lot of random slip-ins
09:20:14FromGitter<kayabaNerve> The entire section on women involving a danish mormon is ridiculous.
09:20:31PMunchIn the other story there was a footnote saying something like "Before any of my scholary readers accuse me of plagiarizing I must avow that I know Ancient Greek and the first book i ever read was <some book>"
09:20:42PMunchHaven't read that
09:20:43FromGitter<kayabaNerve> It probably gets too dicey to bring up further in this christian minecraft server.
09:20:52FromGitter<kayabaNerve> Yep, lol. That was also ridiculous.
09:21:15PMunchBut the part amount the study of american preferences in woman and butts was interesting
09:21:22FromGitter<kayabaNerve> It's in Chapter 11 after he talks about going to Brazil and how he wanted a French professor at the helm of the boat or something.
09:21:27FromGitter<kayabaNerve> ... yep, that's the part.
09:21:56PMunchOh, I just read a sentence here and a sentence there :P
09:35:58AraqSouthpark in reality
09:36:40AraqI'm sure you all remember the episode where they write a terrible book that adults love to get sick about
09:38:03Araq... silence ... ok, never mind
09:38:31PMunchHaha, I haven't actually seen that episode
09:41:05*GordonBGood quit (Remote host closed the connection)
09:43:10FromGitter<kayabaNerve> Oh. I remember this lol.
09:43:38FromGitter<kayabaNerve> And they're all puking but think it's the best book to ever exist, but the kids are scared so they blame Butters, and then they want credit when their parents aren't mad.
09:43:55Araqyep, that one
09:47:08*nif quit (Quit: ...)
09:47:21*nif joined #nim
09:51:39*ng0_ joined #nim
09:54:20*ng0 quit (Ping timeout: 260 seconds)
09:58:18*ng0_ is now known as ng0
09:59:59lqdev[m]wasn't there a pointer arithmetic module built into the stdlib?
10:01:13lqdev[m]I remember a PR for that but I don't know whether it was merged or not
10:03:39FromDiscord<arnetheduck> lqdev, not merged. we have a similar one in https://github.com/status-im/nim-stew/blob/master/stew/ptrops.nim
10:03:56Zevveverybody wants it, but nobody dares merge it
10:04:13FromGitter<matrixbot> `Balu` Hi there is this the official nim server? ⏎ And if so where could one ask for support?
10:04:40ZevvI think the idea is that it should be hard. If you stuff like `cast[pointer](cast[uint](p) + cast[uint](bytes))`, your increased heart rate and gooseebumps should act as a warning
10:04:47*solitudesf quit (Ping timeout: 268 seconds)
10:05:04ZevvHi Balu, you're in the right place
10:05:44lqdev[m]@Balu yes, this is the official Nim server. also, you don't need to connect via matrix, there's a gitter channel which is bridged directly to IRC
10:05:45lqdev[m]wait, it's the other way around
10:06:02lqdev[m]you can connect to #freenode_#nim:matrix.org directly
10:06:46*Balu[m]1 joined #nim
10:07:18*stefantalpalaru joined #nim
10:10:03lqdev[m]@arnetheduck, ah, it was this module
10:11:09Balu[m]1ok so hopefully i am in the right channel
10:11:09Balu[m]1i was trying to do some threading stuff with nim and i am having a hard time a, i have looked at the documentation are there some other ressources than the documentation? Ideally that also go low latency networking?
10:11:52Balu[m]1 * ok so hopefully i am in the right channel
10:11:53Balu[m]1i was trying to do some threading stuff with nim and i am having a hard time a, i have looked at the documentation are there some other ressources than the documentation? Ideally that also go into low latency networking?
10:12:01Balu[m]1 * ok so hopefully i am in the right channel
10:12:02Balu[m]1i was trying to do some threading stuff with nim and i am having a hard time , i have looked at the documentation are there some other ressources than the documentation? Ideally that also go into low latency networking?
10:20:19FromDiscord<ZeeQyu> Nim in Action has a chapter on threadpool which helped me a lot. It mentions threads too, but I can't remember if it was in depth or not. That might not be the caliber you're looking for, but I thought I'd mention it either way.
10:21:09Balu[m]1@ze
10:22:33Balu[m]1@ZeeQyu i have read the documentation and its a bit shallow for me tbh so i was looking for a more practical tutorial or guide
10:22:49Balu[m]1 *
10:27:16FromDiscord<ZeeQyu> Yeah, not talking about the online documentation, nim in action is a printed book.
10:27:46*solitudesf joined #nim
10:27:50PMunchBalu, by the way, please don't edit your messages. They show up as copies on IRC
10:27:54AraqBalu[m]1, compile with --threads:on --gc:boehm and use {.gcsafe.}: <block here>
10:28:06Araqif the compiler complains
10:28:23PMunchHaha, the ultimate hack
10:28:41Araqyou get all the thread problems and no help from nim but I'm beginning to think that's what people want so *shrug*
10:28:59PMunchThread problems?
10:29:40Araqdata races
10:29:54PMunchBalu, if you wait an indeterminate amount of time I will finish my article series on multitasking in Nim
10:29:54Balu[m]1I see, was wondering what these red messages meant
10:29:55Balu[m]1not really using gitter, matrix or irc much
10:30:04Araqdeadlocks
10:30:22Araqbut actually we have pragmas to fight them
10:30:24PMunchAraq, well you get those in Nim without boehm as well don't you?
10:30:37PMunchOh yeah, but you could use those with boehm as well, no?
10:30:41Araqno, because the sharing is MUCH more restrictive
10:31:00Balu[m]1i would not really call it thread problems its just i need a lot of performance out of it and i have no clue if i shoot myself in the foot with the things i write if i have no reference
10:31:47*Vladar quit (Quit: Leaving)
10:32:40PMunchOh right, yeah I guess data races would be an issue
10:32:42*abm joined #nim
10:32:49PMunchAs long as you don't use the locking pragmas
10:33:02Balu[m]1are there some projects people have written or something where i could get some feeling on how to do things
10:33:03Balu[m]1?
10:33:18Balu[m]1*that are pretty clear and not confusing af
10:34:36PMunchNothing I can think of off the top of my head
10:34:51*solitudesf quit (Remote host closed the connection)
10:34:56PMunchAre you familiar with threading in general?
10:35:02PMunchFrom another language for example
10:35:37leorizethere's httpbeast, but I'm unsure if it's quality :p
10:35:53PMunchIs httpbeast multithreaded?
10:35:58PMunchI thought that was just async
10:36:57leorizeit's multithreaded
10:37:04Balu[m]1yes i am so i know how you can end up in threadhell
10:37:11leorizeonly if you compile it with --threads:on though
10:37:18PMunchAah right
10:37:42PMunchBalu[m]1, okay, is there anything in particular that you are afraid of?
10:37:45leorizealso @mratsim should know a lot about threading in Nim
10:38:02PMunchThe default GC behaves a bit different from "normal" threading environments
10:38:09*solitudesf joined #nim
10:38:26lqdev[m]I'm wondering, how can I get a unique string representation for a type? I need it during runtime.
10:38:57Balu[m]1PMunch: yes being slow i need to hit certain speed requirerments
10:39:01PMunchEach thread gets its own heap, and sharing has to be done by copying, or explicit ptr passing and then manually making sure the memory is not collected
10:39:09Balu[m]1and obviously having leaks and crashes all over the place
10:39:21*kevin joined #nim
10:39:39PMunchlqdev[m], unique? Depends on the type I guess
10:39:44*kevin is now known as Guest94463
10:40:18PMunchBalu[m]1, well speed is mostly just normal Nim optimisation and then keeping in mind lock-contention and other such issues that you are probably familiar with
10:41:10*LargeEpsilon quit (Ping timeout: 268 seconds)
10:41:29PMunchLeaks should be pretty uncommon unless you start playing with GC_ref, which you probably shouldn't
10:41:57PMunchAnd crashes are more common when doing threading stuff, but that's just because you need to pass pointers around.
10:43:26lqdev[m]PMunch: talking about objecs here. say I have module a with object A, then module b with object A, I want a stringified representation of these objects' names so that they don't clash when added into a table
10:43:42lqdev[m]afaik it's impossible to use NimNodes at runtime?
10:44:49PMunchOf their names?
10:45:00Araqyou can turn the names into strings and store the names
10:45:49PMunchSo essentialy you want "a.A" and "b.A"?
10:46:04*Balu[m]1 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/xKWSErHGcBDFxSYrcvYWyBRD >
10:48:29lqdev[m]PMunch: yeah
10:48:35lqdev[m]something like this
10:49:24PMunchBalu[m]1, maybe set up a thread for each core, then create channels to pass the data back and forth. When a request comes it, pass it onto a channel. Then one of the threads can read it from that channel, do the processing, and pass it back over a different channel.
10:50:30*Guest94463 quit (Quit: Leaving)
10:50:56*kevin_ joined #nim
10:51:48*kevin_ quit (Client Quit)
10:52:03*kevin_ joined #nim
10:52:12*kevin_ quit (Client Quit)
10:52:42Balu[m]1the problem is i don't have enough cores to do that all at once
10:54:11PMunchWhat do you mean? That's why you spawn one thread per core and use channels to communicate
10:55:05Balu[m]1assuming a 4core machine for this
10:55:06Balu[m]1and lets say i have just 3 sockets and 3 pre built http request i need
10:55:12PMunchlqdev[m], well types don't really exist on runtime. So a macro that takes a typedesc and returns a string should work for you.
10:55:15Balu[m]1thats 6 threads
10:56:04Balu[m]1which means i have too many threads (i am aware that threads and cores are not the same)
10:56:23PMunchWait
10:56:39FromDiscord<arnetheduck> isn't threadpool broken?
10:56:44PMunchSo you have 3 sockets, data comes in, get's processed, and a reply is sent?
10:56:55PMuncharnetheduck, it is?
10:57:25FromDiscord<arnetheduck> I keep hearing that, and that yglukhov has some better version
10:57:41FromDiscord<arnetheduck> along with flowvars and channels
10:58:14FromDiscord<arnetheduck> only time I used channels (for a fairly simple case: testament) it crashed
10:58:23Balu[m]1i have x sockets (2-infinity) and that results into at least 2 http request i have to sent out if the comparison evaluates to true which i make on the data i get with those sockets
10:59:05Balu[m]1and performance is number 1 here so you can see how i can not just spawn random stuff around and do the request when needed
10:59:47Balu[m]1and afaik the fastest cpus atm are 4 cored and you would be even faster with less cores
11:00:44lqdev[m]PMunch: I know, I'm asking how I could write one that does what I need
11:00:53lqdev[m]I don't know how to get the module name.
11:01:17lqdev[m]or better yet, some type hash.
11:01:24*GordonBGood joined #nim
11:01:38PMunchlqdev[m], old post but: https://forum.nim-lang.org/t/2784
11:01:53PMunchWell you could hash the type implementation
11:02:15lqdev[m]sounds like an idea
11:02:25PMunchBut that would mean type a.A and b.A would be the same if they have all the same fields
11:02:35PMunchAnd/or names depending on how you do it
11:03:47PMunchBalu[m]1, well you can assume the sockets are IO bound, so running all those on a single thread should be fine. What kind of comparison do you do? Between the socket data, or only within a single socket?
11:04:24lqdev[m]hm, there's signatureHash
11:05:32Balu[m]1what do you mean io bound? can you elaborate a bit on that?
11:05:32Balu[m]1i am doing math comparison but very simple ones just some addition,subtraction,division and multiplication
11:06:31PMunchIO bound as in the time spent reading/writing to the socket is not bound by how fast the CPU is, but rather by the network. So multithreading the reading/writing probably won't help at all
11:07:01PMunchYeah, but are you comparing data across the sockets?
11:07:20Balu[m]1PMunch: i should have maybe mentioned the data i receive is json and pretty nested so i would do the unmarshaling or unjsoning whatever you wanna call it in that thread
11:07:25*GordonBGood quit (Remote host closed the connection)
11:07:31Balu[m]1yes but the sockets are from different providers
11:07:37*LargeEpsilon joined #nim
11:07:47Balu[m]1so i get socketA from lets say Australia socketB from japan
11:08:29Balu[m]1and so on so i think i am not bound by network speed there as they are two enteties
11:08:32PMunchSo there is no data sharing between the sockets?
11:08:41Balu[m]1there is
11:08:44Balu[m]1the comparison
11:08:51Balu[m]1for example:
11:08:58Balu[m]1i need to find the highest number
11:09:08Balu[m]1socket a gives me 1 socket b gives me 100
11:09:29Balu[m]1i need to compare that and send a http respond back to socket a saying you are lower
11:09:37Balu[m]1and a http request to b saying you are higher
11:10:00PMunchAnd how do you match them?
11:10:20Balu[m]1what do you mean?
11:10:30Balu[m]1i take all sockets compare teh data against all the other sockets
11:10:39PMunchie. if socket A sends 100 messages and socket B sends a 100 messages, which message from socket A should compare to which message from socket B
11:10:44Balu[m]1and would limit that amoun based on how many cores i have
11:11:01Balu[m]1always the lates message
11:11:13Balu[m]1you can think of it like a auction
11:11:19Balu[m]1they will send bids
11:12:20Balu[m]1and the main thing here is that the speed only matters in those comparison
11:13:34Balu[m]1it can take days to establish a socket connection and initalize whatever it wants i don't care about that it just matters in those ms during the comparison that the programm is as fast as possible so i want to preload/build and allocate as much as i can
11:19:01PMunchOkay, one thread does socket IO, sends the received "bids" tagged with a sender/message count to a channel. Then your N threads (where N is amount of cores or something similar) parse the JSON and extracts the data, this is then passed back on a channel with the same sender/message count label to the IO thread. This thread then matches the message count labels and sends the messages to the correct recipient.
11:19:20PMunchIf the comparisson is slow you need some kind of map/reduce structure instead
11:20:14FromDiscord<arnetheduck> re threads in general, there's still https://github.com/nim-lang/Nim/issues/9878 that's been accepted
11:22:51Balu[m]1PMunch: thats too slow i already tried that and other implementations beat that with no problem
11:23:14PMunchWhat other implementations?
11:23:56*ng0 quit (Ping timeout: 260 seconds)
11:24:22Balu[m]1basically every implementation where i splitted the sockets that receive data into their own threads or tried too
11:25:15Balu[m]1ideally i am looking for a freeze option or something like that where i can freeze threads and memory and move that somewhere else
11:25:32PMunchHuh?
11:25:37PMunchLike a thread-stealer?
11:25:46PMunchErr, work-stealer
11:25:49Balu[m]1afaik that does not exist so its more a theory example
11:26:18Balu[m]1ye i guess something like that
11:27:33PMunchWell, I wrote this a little while back: http://ix.io/1XA9/nim
11:27:35Balu[m]1i guess what i am trying to say is i am looking for something that allows me to use more cores than i have in the best way possible
11:27:41PMunchEssentially a simple PoC work-stealer
11:28:13PMunchMust be compiler with --gc:boehm by the wa
11:29:18PMunchI mean with channels you are copying the memory. If you can make sure that the socket IO thread doesn't free the JSON string you could pass a pointer to it over the channel instead..
11:31:57PMunchHave you tried to profile this?
11:32:25PMunchBy the way that work stealer is not very optimised
11:32:39Balu[m]1kinda tried it but more in theory land
11:32:54Balu[m]1don't know how to profile real world http requests reliably
11:33:35Balu[m]1afaik you either run it for a long time and just hope that everything averages out or you do some guess work
11:33:47Balu[m]1and both is not very scientific
11:34:29Balu[m]1my current aproach is just use the fastest tools i can reasonably have and hope for the best
11:35:02PMunchThat's even less scientific :P
11:35:17Balu[m]1i am very open for advice
11:36:46Balu[m]1i guess thats what i get for scipping CS class
11:40:53PMunchHaha, yeah having CS education helps :P
11:42:34*rockcavera joined #nim
11:44:50Balu[m]1PMunch: do you know if anyone has compared nim (speedwise) to normal C or Rust in a kinda trusthworthy and deep way?
11:46:18PMunchAt lot of such comparissons have been done for single-threaded code
11:46:34PMunchNot sure about multi-threading
11:47:33Balu[m]1a yes? where?
11:50:16PMunchJust google around
11:51:31Balu[m]1I did all i found were some kids benchmarking on their macbooks while running minecraft in the background
11:51:51FromDiscord<mratsim> what kind of bench?
11:52:10FromDiscord<mratsim> Any speed you can reach with C, you can reach in Nim
11:52:57Balu[m]1ideally a wide range of marks
11:52:58Balu[m]1so they say
11:53:08Balu[m]1mainly just curious
11:53:28FromDiscord<mratsim> well I have plenty in my repos, you just need to pick your poison
11:54:24FromDiscord<mratsim> Implementing exponential 10x faster than math.h: https://github.com/numforge/laser/blob/master/benchmarks/vector_math/bench_exp.nim
11:54:51FromDiscord<mratsim> As fast as assembly and JITtesd code in pure Nim: https://github.com/numforge/laser/blob/master/benchmarks/gemm/gemm_bench_float32.nim
11:55:45FromDiscord<mratsim> About 2x faster than Intel TBB and 10x faster than LLVM OpenMP on workstealing scheduler: https://github.com/mratsim/weave/tree/master/benchmarks/fibonacci
11:56:36FromDiscord<mratsim> as fast as C on a Quake raytracer: https://forum.nim-lang.org/t/5124#32243
11:59:51FromDiscord<mratsim> The only perf that might be hard to replicate might be C++ virtual functions, might be faster, might be slower but you can always write your own VTable
12:02:00Balu[m]1Nice will have a look at them
12:11:45*Trustable joined #nim
12:25:04*ng0 joined #nim
12:35:00*Hideki_ joined #nim
12:36:15*Vladar joined #nim
12:41:28planetis[m]mratsim: how you compiled your multiplication benchmark
12:41:40*clyybber joined #nim
12:42:09planetis[m]-d:release?
12:43:53PMunchHmm, I think I managed to get GCC to lock up..
12:44:44*nsf quit (Quit: WeeChat 2.6)
12:46:33PMunchIt just never completes CC: helloworld.nim
12:46:47clyybbernice
12:46:52clyybbershow us
12:48:02PMunchhttp://ix.io/1ZN6
12:49:04PMunchIf you actually want to try and run it: clone https://github.com/PMunch/unbound put that file in dynlibmod/examples. Then run ./configure --with-dynlibmodule && make in the root directory
12:49:18PMunchThen "nim c --app:lib helloworld.nim" in the examples directory
12:50:03PMunchCuriously compiling with cpp doesn't hang, but throws an error instead
12:50:41PMunchBecause it places an include to util/log.h before the config.h include I tried to force in there..
12:54:41ZevvPMunch: I think this is what I ran into a few months ago
12:54:53Zevvgcc is exectued and writes into a pipe
12:55:11Zevvnim waits for the proc to exit and *then* reads the pipe
12:55:19PMunchAaah
12:55:20Zevvand the pipe fills up, so gcc will stall and never end
12:56:57PMunchIt does spit out 3709 lines..
12:57:15PMunch(I did --genScript:on and then ran that script)
12:59:51PMunchOh great..
13:00:31PMunchrunning with --genScript:on, then manually adding the #include I was trying to emit in the correct place and running the script makes it compile fine..
13:08:18*a_b_m joined #nim
13:10:00*abm quit (Ping timeout: 265 seconds)
13:14:27clyybberSo its a nim issue?
13:15:07Zevvstdlib issue
13:15:20Zevvactually. We do not have proper handling of subprocesses and pipes
13:16:12PMunchHmm, interesting: /home/peter/.choosenim/toolchains/nim-#devel/lib/core/macros.nim(573, 3) Error: redefinition of 'headerwire2str'; previous declaration here: /home/peter/.choosenim/toolchains/nim-#devel/lib/core/macros.nim(573, 3)
13:16:55PMunchPrevious declaration from same line?
13:17:05PMunchOr is that just a quirk of the macros module?
13:17:52Araqcan happen easily if the declaration is inside a template and you instantiate it twice...
13:19:21FromGitter<Willyboar> Some feedback please. https://github.com/thebigbaron/pine
13:19:52FromGitter<Willyboar> Maybe the worst code base you can see but it is working
13:20:32FromGitter<Willyboar> Be polite it is my 3rd week project :)
13:31:11*tklohna_ quit (Ping timeout: 276 seconds)
13:40:49clyybberWillyboar: Would be a good idea to include the source of the example IMO
13:40:57PMunchHmm, this binding is hard to get right..
13:41:24PMunchSo essentially the files seem to be require types from each other
13:42:24FromGitter<Willyboar> @clyybber This is right. I will create a repo with the default build.
13:42:48PMunchSo module.h will require some type from msgreply.h, but msgreply.h also requires something from module.h. So there is no order I can do the cImports in that makes Nim happy..
13:43:00*tklohna_ joined #nim
13:49:21*dddddd joined #nim
13:50:30*a__b__m joined #nim
13:51:16PMunchSo I need to somehow grab the type definitions from the files first, then import the code while ignoring the types, essentially doing all the files in two different orders
13:51:39PMunchOh wait, I need to do this multiple times for all the orders :S
13:53:07*leorize_ joined #nim
13:53:59*a_b_m quit (Ping timeout: 265 seconds)
13:54:44PMunchWillyboar, the hamburger menu on the demo page has a really strange hitbox..
13:56:32*leorize quit (Ping timeout: 260 seconds)
14:03:13*floppydh quit (Quit: WeeChat 2.6)
14:04:44shashlick@PMunch how are the headers imported typically in C?
14:05:45shashlickIf one doesn't include the other you could add a manually
14:06:04shashlickOr create a new file that includes both and cimport that
14:06:13*clyybber quit (Quit: WeeChat 2.6)
14:07:58PMunchWell in my working helloworld.c program I have two includes on config.h and util/module.h
14:08:34PMunchutil/module.h is the only one of those that imports anything
14:08:55PMunchIt imports lruhash.h, msgreply.h, and msgparse.h
14:09:40PMunchHmm, wait a second
14:10:23shashlickBy the way, the redefinition isn't a macros issue
14:10:58shashlickIt's cause you are using multiple times on the same header file - toast creates that const
14:11:17PMunchAh right, msgreply.h has a "struct module_qstate;" definition, but msgreply.c has a #include "util/module.h"
14:11:42PMunchYeah I'm not sure what was going on with that, but it's not an issue any longer
14:12:02shashlickOk
14:12:18shashlickMacros complains cause we are using parseStmt
14:12:49FromGitter<Willyboar> @PMunch Hmm... I know whats going wrong with that. I will fix it soon.
14:14:01FromDiscord<mratsim> @planetis the compilation command is there: https://github.com/numforge/laser/blob/e660eeeb723426e80a7b1187864323d85527d18c/benchmarks/gemm/gemm_bench_float32.nim#L371
14:14:12FromDiscord<mratsim> nim cpp -r -d:release -d:danger -d:openmp --outdir:build benchmarks/gemm/gemm_bench_float32.nim
14:15:52shashlick@PMunch is hard with forward declarations
14:16:02PMunchIf someone more familiar with nimterop wants a challenge over the weekend, implement this in Nim: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c
14:16:16PMunchYeah I noticed..
14:16:24stefantalpalaru"danger" implies "release", @mratsim: https://github.com/nim-lang/Nim/blob/60ff41a8da9fffecea034846dc415086b2c12ed6/config/nim.cfg#L72
14:16:29shashlickYou might need to declare it up top in a type and skip it in both files
14:16:52PMunchYeah.. That's sorta why I wanted to use nimterop though
14:17:04PMunchIn order to not have to declare a bunch of types and such manually
14:17:26shashlickI don't yet have a solution for forward declarations
14:17:34shashlickYou only need to do it for those though
14:17:40*nsf joined #nim
14:17:53shashlickRest can be done automatically
14:18:06PMunchI mean look at this monster: https://github.com/PMunch/unbound/blob/master/util/module.h#L577-L645
14:18:32PMunchI'd probably need to do all the children types as well
14:18:49shashlickThat's the one that's forward declared?
14:18:54shashlickPlus nested types ugh
14:19:46PMunchI mean it is even forward declared within its own file: https://github.com/PMunch/unbound/blob/master/util/module.h#L172
14:21:10PMunchRunning toast on that file manually actually doesn't spit out a definition for it
14:21:21PMunchSees the first definition and ignores the second..
14:22:07skelettHi all, I'm currently implementing a parser using the `pegs` module. Is there an easy way to define an equivalent to the RegEx token `\b` using pegs?
14:22:48narimiranZevv: ^
14:23:01Zevvyellow!
14:23:14PMunchOh well, I'm off
14:23:15*PMunch quit (Quit: Leaving)
14:23:27narimiranhi off, i'm dad
14:24:16Zevvnarimiran: I can't do it. sorry.
14:25:03Zevvjust not my style
14:28:49FromGitter<Willyboar> @Clyybber I create one repo with the default build https://github.com/thebigbaron/pineblog
14:29:45*NimBot joined #nim
14:31:41*jjido joined #nim
14:31:42FromGitter<Willyboar> And here is the live https://thebigbaron.github.io/pineblog/
14:32:13disruptek!eval import md5; echo readFile(getAppFilename()).toMD5
14:32:15NimBotCompile failed: /usercode/in.nim(1, 27) Error: undeclared identifier: 'getAppFilename'
14:32:24disruptek!eval import md5, os; echo readFile(getAppFilename()).toMD5
14:32:28NimBot16fd8a2c93ce094f4e20125f66a9fcb8
14:32:36*disruptek o7
14:35:01*Hideki_ quit (Remote host closed the connection)
14:36:02*Hideki_ joined #nim
14:37:59*Hideki_ quit (Remote host closed the connection)
14:38:15*Hideki_ joined #nim
14:38:17shashlickYa cause toast can't do cOverride
14:38:27*theelous3_ joined #nim
14:42:11*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:44:05Zevvskelett: I don't think there is. What problem are you trying to solve?
14:52:47lqdev[m]this doesn't work as expected: https://play.nim-lang.org/#ix=1ZOH I'd expect the proc calls to yield the same results as the macro calls. can I work around that somehow?
14:54:18*a__b__m quit (Quit: Leaving)
14:55:12*jjido joined #nim
14:58:51*Hideki_ quit (Remote host closed the connection)
14:59:36*Hideki_ joined #nim
14:59:47disrupteklqdev: why don't you define typeHash[ObjX]() for the different types in a macro; then it'll be consistent by definition.
15:00:34lqdev[m]disruptek: what do you mean?
15:01:25disruptekhave a macro that writes a series of typeHash(o: `some type`): string = `some str lit` procedures.
15:01:33*clyybber joined #nim
15:04:03*Hideki_ quit (Ping timeout: 245 seconds)
15:09:13FromGitter<geotre> Anyone know why the nim js backend randomly puts objects in 1-element arrays?
15:09:14lqdev[m]disruptek: I'm afraid that it'd be way too complex for what I'm trying to do
15:10:09lqdev[m]well, then. I'll try asking a different question. how can I store a type's unique ID expressed as a uint16?
15:10:23disruptekwhat you're trying to do is make compile-time hashing of types match runtime hashing of types. the types won't change, so why don't you just store them as procs or constants?
15:10:35lqdev[m]maybe not specifically a uint16, can be any int really.
15:10:47disruptekah, you just hate strings that much?
15:10:58lqdev[m]no
15:11:05lqdev[m]I can't store a string
15:11:19lqdev[m]let me explain what I'm doing
15:11:25lqdev[m]I'm trying to store some runtime information about what object type is stored in a Wren foreign object
15:11:53FromGitter<Lecale> Hi nimsters, does anyone have time to try to answer a nimble install fail question for me
15:11:55lqdev[m]so I thought storing an additional int besides the actual object in foreign data might be an option
15:11:59lqdev[m]this int would represent the type of the object
15:12:38lqdev[m]@Lecale don't ask if you can ask
15:12:43lqdev[m]just ask the question
15:13:17FromGitter<Lecale> The system cannot find the file specified. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db3110de886fb5aa2f4633a]
15:13:33disruptekwell, the mechanism is the same regardless of the type of the value you want to store. calculate it at compile-time and define it there so that you can retrieve the same value at runtime. i don't see what's complex about that; it's hard to imagine a faster solution for runtime code.
15:15:47disruptekthis might help: https://www.youtube.com/embed/5X-Mrc2l1d0
15:16:09lqdev[m]disruptek: yeah, that's what I wanted to do. I wanted to store the type info in a table defined in the `Wren` object
15:16:38lqdev[m]which could be looked up with the previously mentioned int
15:16:56disrupteksounds really amazing, brah.
15:19:10*Traviss__ joined #nim
15:19:10*Traviss__ quit (Client Quit)
15:21:57FromDiscord<treeform> geotre, its because they are ref objects, JS can't have memory pointers, but it can have indexes. So each type has an object pool with indexes, each ref is just an index into that object pool.
15:22:05*Traviss__ joined #nim
15:22:05FromDiscord<kodkuce> Lecale you have gcc installed right?
15:22:29FromGitter<geotre> @treeform that's what I thought, but this isn't a ref
15:22:31FromDiscord<treeform> geotre, 1-element array probably means you only have 1 of that object.
15:22:48*traviss quit (Ping timeout: 245 seconds)
15:22:52*Traviss__ quit (Client Quit)
15:22:54FromGitter<geotre> It's an object as a field of another object
15:23:13FromDiscord<treeform> geotre, sorry its regular objects that do this, ref objects are plain js objects.
15:23:14FromGitter<geotre> And a similar field doesn't get put into an array
15:23:15*traviss joined #nim
15:24:02FromGitter<geotre> Let me see if I can get a simple reproduction
15:24:29FromDiscord<treeform> geotre, I use ref objects everywhere in my JS code so that I get regular JS objects.
15:27:57FromGitter<geotre> Just switched it to a ref object, same result
15:28:27FromGitter<geotre> Maybe it's down to the size of the object?
15:30:08*traviss quit (Quit: Leaving)
15:30:26*traviss joined #nim
15:33:47skrylar[m]lua's object model supports inheritance if you want it, tho
15:35:13*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:35:38clyybberAnd there are maintained lua-jit forks
15:36:34skrylar[m]have been using janet, which is a lisp by the same person as wrote the fennel (lisp>lua) transpiler
15:37:10disruptekwhat have you written in janet?
15:37:27skrylar[m]they also use prototypes for quite a few things
15:38:36skrylar[m]@disruptek gdk3 bindings are made by a janet script https://git.sr.ht/~skrylar/sknGDK3
15:38:37skrylar[m](mostly)
15:40:16*Hideki_ joined #nim
15:41:31FromGitter<geotre> If I remove some fields from the parent object then I no longer get the 1-element array problem, so I'm pretty sure it's down to the size
15:42:17skrylar[m]biggest difference between prototypes (lua/io/js/janet) and "inheritance" (ignoring for a moment thats an abuse of the word, but its what people want to call it) is the runtime cost of calling procs :\
15:43:49disruptekskrylar[m]: this is pretty cool. so you just process the original api to something easier to consume? i'm a little lost in the source.
15:44:41skrylar[m]theres a hand tweak stage to get rid of things that are hard to process and not worth it (ex. handing #ifdef when all that does is just work around stuff thats already deprecated anyway), then it goes in to a PEG parser to get a mini-ast, and then uses a visitor to spit out nim
15:44:58skrylar[m]followed by another hand tweak stage to handle stupidities like "enum out of order"
15:46:10FromGitter<brentp> how can i used the result of getStream from nim-lang/zip/zipfiles?
15:46:41FromGitter<brentp> ```code paste, see link``` ⏎ ⏎ gives a compile error [https://gitter.im/nim-lang/Nim?at=5db318e1fb4dab784a047ec1]
15:46:51disruptekoh, i get it. do you publish the product elsewhere?
15:46:52lqdev[m]disruptek: http://ix.io/1ZOW/nim line 160
15:46:55FromGitter<brentp> `Error: attempting to call undeclared routine: 'readData'`
15:46:57lqdev[m]I'm not sure how to solve this, at all.
15:48:30FromDiscord<mratsim> import the module that contains readData
15:48:52FromDiscord<mratsim> you might have a generic sandwich
15:49:20FromGitter<brentp> ah. that was it.
15:49:29FromGitter<brentp> I think zip/zipfiles should export streams, eh?
15:49:45FromGitter<brentp> thanks @mratsim
15:49:56disrupteklqdev[m]: what role does RawVM play here? why would you need the vm to hash the type?
15:50:13Araqthat's not a "generic sandwich", I know you love this word but it doesn't come up as often as you think
15:51:04Araqfor a "generic sandwich" you need to have a 'mixin' declaration
15:52:03clyybbernext time I go to subway I'm gonna order a generic sandwich
15:52:14lqdev[m]disruptek: `RawVM` stores the `Wren` instance in userdata. I want to store the generated hash/ID in a table in the `Wren` instance, the main problem is, the type I have is a generic type, and signatureHash doesn't work well with generics.
15:52:28lqdev[m]it hashes `T` and not the actual type passed as a generic param
15:52:59lqdev[m]so I'm asking: how can I get the generic param passed to my proc?
15:53:20clyybberHuh, just use the name of the generic param?
15:53:37disruptekbut you don't need generics for the hashing, because you aren't ever going to look up the type hash for a type that doesn't exist. πŸ€ͺ
15:54:02lqdev[m]clyybber: that won't work, see https://play.nim-lang.org/#ix=1ZOH
15:54:03disruptekagain, you can predefine them.
15:54:47lqdev[m]disruptek: OK, but that's not my point
15:55:52clyybberlqdev[m]: You want the hash of a type is that right?
15:56:24lqdev[m]yeah, and that type is passed in as a generic param.
15:56:46lqdev[m]simply doing what I did in that playground example doesn't work.
16:01:59disruptekdid you try my suggestion?
16:02:42disruptekskrylar[m]: which has more uptake, fennel or janet?
16:02:55clyybberlqdev[m]: I would use .getType() in that macro
16:03:12clyybberBut it complains with "node is not a symbol"
16:04:15clyybberlqdev[m]: Do you need that proc? typeHash?
16:04:53lqdev[m]I need the hash of the generic param `T` passed to `newForeign`
16:04:58*Hideki_ quit (Ping timeout: 265 seconds)
16:05:31lqdev[m]I just came up with something, hopefully noone will kill me for using globals for this.
16:07:20clyybberlqdev[m]: YOu can use default(T)
16:07:26clyybberAnd then pass it to the macro
16:07:35clyybberuse getType, etc.
16:07:42clyybberBut I can't get it to work
16:07:44lqdev[m]hmm, sounds like an idea
16:07:47clyybberstill have node is not a symbol
16:08:07lqdev[m]clyybber: make the macro parameter `typed`
16:08:13FromDiscord<mratsim> if "typed" it's a symbol
16:08:19FromDiscord<mratsim> yes ditto
16:08:43clyybberthe macro parameter is typed
16:09:20clyybberand when I do `let tmp = default(T); getHash(tmp)`
16:09:28clyybbertmp is arguably a symbol, isn;t it?
16:13:29clyybberah
16:13:34clyybber.getType() isn't..
16:13:36clyybberalright
16:16:29clyybberlqdev[m]: Normally every type has an associated sym. Not sure how to access that in macros tho. I'm coming more from a compilers perspective
16:17:30Araqno.
16:17:40disruptekstill think you're making this harder than it needs to be.
16:17:42Araqmany types do not have a sym
16:17:52Araqseq[int] for example
16:18:02clyybberAraq: Yeah, I meant a sym field, and in lqdevs example every type has
16:18:40clyybberlqdev[m]: What do you need it for though?
16:18:42Araqwell yes, seq[int] doesn't have a sym field
16:18:55Araqor to be precise: its sym field is nil
16:19:14clyybberYeah
16:19:23lqdev[m]clyybber: I need to get a unique int which denotes a type
16:19:46FromGitter<alehander42> but what about equivalence
16:19:49FromGitter<alehander42> e.g. if A = B
16:19:55FromGitter<alehander42> is A int = B int
16:20:14lqdev[m]I got it here so far http://ix.io/1ZP7/nim
16:20:45lqdev[m]but the problem is, this http://ix.io/1ZP7/nim#n-160 prints `Sym "T"` which is not what I want
16:21:03clyybberlqdev[m]: No I mean why you need it? For Wren?
16:21:09clyybberI thought Wren is a scripting language?
16:21:17lqdev[m]clyybber: yeah
16:21:25lqdev[m]I want it for better error reporting
16:21:54lqdev[m]I thought that I can prepend the actual type's data with an integer signifying the type, which I can then look up in a table for error reporting
16:22:13clyybberWhere comes wren into play?
16:22:23clyybberI'm not sure I understand what you are trying to do.
16:23:11clyybbernim types only exist at ct, wrens types exist only at rt but not at ct.
16:23:22clyybberAt least when you use it as a scripting language.
16:23:38*kungtotte quit (Quit: WeeChat 2.6)
16:23:51lqdev[m]hm, how can I explain this
16:24:01*abm joined #nim
16:24:12lqdev[m]I want to check whether you pass the right types to Nim procs from Wren
16:24:21*kungtotte joined #nim
16:24:36lqdev[m]but the problem is foreign types, where you can't easily check whether a value is of a given type at runtime
16:24:37clyybberAha
16:25:02clyybberBut Wren types are not nim types right?
16:25:08clyybberYou have to convert them at some point
16:25:13lqdev[m]nope
16:25:30lqdev[m]but Wren can store arbitrary bytes using foreign classes
16:25:37*LargeEpsilon quit (Ping timeout: 240 seconds)
16:25:44clyybberHmm
16:25:57lqdev[m]you can assign a Nim object to this data given to you by Wren
16:26:27shashlickIs cdecl available on osx?
16:26:34lqdev[m]but Wren only knows it's a "foreign" type, it doesn't know what it really is
16:26:46shashlickAnd is it the default for cmake
16:27:56lqdev[m]so I thought prepending the foreign data with an additional 'type ID' would allow for reporting the actual type stored in foreign data in errors
16:28:39disruptekso there's really no reason you cannot use a fixed-length string, or a cstring, or a serialized object with its length, or pretty much anything.
16:29:13disruptekso for the last time, why do you not simply calculate a hash for the type at compile-time and use that?
16:29:43clyybberThat is what he wants to do afaict
16:30:05clyybberBecause calling that proc from wren isn't gonna work. Nim needs to know the type at ct.
16:30:13lqdev[m]how do I get the type passed to a generic param? I need to know the actual type passed to my `newForeign` proc to calculate that hash.
16:30:31disruptekso write a macro that creates constants for each of the types you want to work with.
16:31:07disruptekor procs, if you must. then just call them. you don't need to know types; nim will bind them for you correctly. that's the whole point of generics.
16:31:34clyybberlqdev[m]: Can't get the hash of the type afaict. Since signatureHash only operates on symbols.
16:32:20disruptekyes, but you only run signatureHash at compiletime. on the symbol. and then you create something that you can run at runtime, which returns that value you discovered at compiletime.
16:32:56lqdev[m]disruptek: you're missing the point of my question. how do I get the type passed to my generic param in the first place?
16:33:15disruptekruntime or compiletime?
16:33:22lqdev[m]I need to hash it somehow, but if I simply pass `T` into my macro all it'll see is `Ident "T"`.
16:33:28lqdev[m]compile time
16:34:07disruptekare you telling me you don't know the types you'll want to use in wren? you aren't going to define them ahead of time?
16:34:14*jjido joined #nim
16:34:46lqdev[m]not in euwren.nim.
16:36:00disruptekat some point, you're going to have to provide information to the computer to tell it what to do.
16:37:01*luis_ joined #nim
16:37:09clyybberbbl
16:37:11*clyybber quit (Quit: WeeChat 2.6)
16:37:13*ng0_ joined #nim
16:37:32*ng0 quit (Ping timeout: 260 seconds)
16:37:36*ng0_ is now known as ng0
16:37:53lqdev[m]let me rethink what I want to do
16:40:03disruptekwhat you could do is to have a template that will register the type the first time you use it near some wren, ie. pass it to wren or w/e.
16:41:11disruptekor make the whole system runtime. it's not obvious to me that you need the compile-time component.
16:49:32FromDiscord<kodkuce> and i dont want to learn rust or C++ when Nim is almost 100% magic
16:50:08FromDiscord<mratsim> Any sufficiently advanced technology is indistinguishable from magic
16:51:29FromDiscord<kodkuce> thats why i writed almost ,still missing hacked newruntime πŸ˜›
16:54:52FromGitter<alehander42> learn many languages
16:54:58FromGitter<alehander42> if you feel like it
16:55:11FromGitter<alehander42> its good to have different tools
16:55:41*rockcavera quit (Remote host closed the connection)
16:55:45disrupteknew languages bring new paradigms to old tools, too.
16:58:03*luis_ quit (Ping timeout: 240 seconds)
17:01:39disruptekare there basically no operations for ranges or am i just not looking in the right place?
17:01:54*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:02:05FromGitter<Willyboar> I think nimble directory needs a redesign
17:02:11FromGitter<Willyboar> no offence
17:02:13narimiranfederico3: ^
17:02:14FromGitter<Willyboar> :)
17:03:08FromDiscord<mratsim> ranges uses the same operations of the base type
17:03:19FromDiscord<mratsim> unless you meant ranges as in openarray
17:03:30*tklohna_ quit (Ping timeout: 268 seconds)
17:04:38disrupteki have some ranges of enums and i want to, eg. `if thing notin Range1 + Range2:`
17:05:16disrupteki'll just turn them into sets i guess.
17:05:57FromGitter<Willyboar> @narimiran i tried to run it locally but i can't figure it out. I will try to play with it.
17:07:19*jjido joined #nim
17:09:22*nif quit (Quit: ...)
17:09:34*nif_ joined #nim
17:09:48*Trustable quit (Remote host closed the connection)
17:13:39FromGitter<Willyboar> ``` friendly_timeinterval.nim(50, 20) Error: type mismatch: got <Duration> but expected 'int' ```
17:14:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:19:24FromDiscord<Chiqqum_Ngbata> Range1 + Range2 implies rangeset no
17:30:38*rockcavera joined #nim
17:45:20*jjido joined #nim
17:47:25*jjido quit (Client Quit)
17:49:26shashlicksize_t might be biting me too
17:49:35*jjido joined #nim
17:49:56shashlickNeed a review of https://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L45
17:50:23shashlicksize_t and ssize_t seem wrong to me now
17:51:01shashlickCannot map to csize either cause that's wrong too
17:52:12Araq"size_t": "uint" is what you're looking for
17:52:54shashlickAnd ssize_t will be just int?
17:54:27Araqyes+
17:54:52shashlickAt least there's a bug but I'm wondering how this works on win lin but breaks on osx
17:55:27shashlickAnyway, will get back after some testing
17:56:45shashlickThanks @Araq
17:58:25FromDiscord<Chiqqum_Ngbata> Is float64 not SomeNumber ?
18:04:21*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:18:28lqdev[m]@Chiqqum_Ngbata how so?
18:18:48lqdev[m]!eval float64 is SomeNumber
18:18:50NimBotCompile failed: ???(0, 0) Error: expression 'true' is of type 'bool' and has to be discarded
18:19:36lqdev[m]!eval echo float64 is SomeNumber
18:19:39NimBottrue
18:19:59Araqlol the error message gave it away already
18:20:07Araq... expression 'true' ...
18:20:37lqdev[m]yeah, I'm just pedantic so I wanted a proper `true`
18:20:42lqdev[m]lol
18:28:33lqdev[m]does `newCall` work for calling macros?
18:29:05Araqyes
18:30:11lqdev[m]for some reason my macro is expanded immediately, then.
18:31:29lqdev[m]http://ix.io/1ZPG/nim#n-226 see `macro foreign` and `macro addProcAux`.
18:32:07*Vladar quit (Quit: Leaving)
18:34:58*nsf quit (Quit: WeeChat 2.6)
18:48:46lqdev[m]Araq: yesterday you said that `bindSym` can only be used for `typed` macro parameters, right? so what can I do if my parameter is `untyped`?
18:51:25Araqno
18:51:35AraqbindSym works with string literals.
18:52:58lqdev[m]only with string literals?
18:53:12lqdev[m]so how can I .getImpl for a proc?
19:02:22*rockcavera quit (Remote host closed the connection)
19:03:09*lbartoletti quit (Ping timeout: 246 seconds)
19:03:41*lbartoletti joined #nim
19:06:22Araqvia a typed macro parameter
19:15:42*rockcavera joined #nim
19:23:14*gangstacat quit (Ping timeout: 240 seconds)
19:31:03disrupteknimble doesn't install tests, docs, or examples. what a killer feature.
19:32:57disruptekif i have to clone the package to get any of that stuff, why bother with nimble?
19:35:47shashlickhttps://github.com/nim-lang/nimble/issues/653
19:37:03*gangstacat joined #nim
19:38:37disrupteki can see the utility of not including test data, but to me this is probably better handled with git submodules.
19:39:03skrylar[m]submodules are wonky, but i use them for dependencies :|
19:39:30skrylar[m]well they can get weird if A depends on B and C while B depends on C since you can end up with a submodule cloning a submodule that you are already cloning
19:40:01skrylar[m]which is why meson added that mechanic of all deps belong in a top level dep folder and then sub projects get cloned in to an overarching thing to assemble them
19:40:16disruptekyes, but they solve the problem of "i wanna git clone but i don't wanna dl 400mb of test data i don't need; if i run tests, you can fetch 'em then" and they let us act without prior knowledge.
19:40:46*filcuc quit (Ping timeout: 252 seconds)
19:40:48disruptekalmost all clones would include tests.
19:41:14disruptekthis has nothing at all to do with dependencies.
19:41:51disruptekignore me, i'm pretty frustrated right now. just sometimes feels like people don't even try to use this stuff.
19:44:43disruptekplease raise your hand if you want this: https://github.com/disruptek/ndoc
19:46:55dom96why when `nim doc` exists?
19:47:06disruptekhave you ever run `nim doc`?
19:47:17disruptekhave you ever run `pydoc`?
19:47:56shashlicki've used nim doc pretty successfully
19:48:07disruptekhave you ever run `pydoc`?
19:49:11disruptek'nuff said.
19:49:24shashlickso you want a cli tool to show the docs?
19:49:59disruptekyes, sincle apparently i also have to generate them myself, or at least try to -- nim doc doesn't even work for me much of the time.
19:50:58dom96Have you made an attempt to improve `nim doc`?
19:51:17disruptekwhat's the point?
19:52:02FromDiscord<treeform> I had this idea of md-doc, https://github.com/treeform/mddoc
19:52:18FromDiscord<treeform> what if instead of generating HTML you generate md file and add that to the read me.
19:52:40FromDiscord<treeform> Because most libraries are small and only have a few methods.
19:53:37FromDiscord<treeform> here is an example of the readme it generates: https://github.com/treeform/chroma
19:53:46disrupteki just want a way to get docs that a) don't yet exist, and b) are in my console, and c) might be constrained to a particular symbol.
19:54:43disrupteki would even render them with color/italics/bold/whatever, or even bounce you into a browser if you want. but i'm sick and tired of having to google every damned thing when i have a computer here that can actually compute exactly what i want to see.
19:55:32disruptekhave you seen this? https://github.com/h3rald/hastyscribe
19:55:56dom96disruptek, what do you think is the point?
19:56:37disrupteki dunno dom96, i'm still waiting for a review on a dead-simple hack to improve the usability of nimble dramatically. not gonna even contemplate adding bump or trying to hack `nim doc` for my needs.
19:56:45disrupteki mean, please.
19:56:48disruptekgive me a damned break.
20:01:17shashlick@disruptek - just tried bump - git branch --show-current => error: unknown option `show-current'
20:01:18disruptektreeform: where are you actually generating this md? i can't figure that out.
20:01:25shashlickuh oh; i cannot tell if i'm on the master branch
20:01:39disruptek`git --version`
20:01:48*Hideki_ joined #nim
20:02:29shashlick2.17.1
20:02:31shashlickubuntu
20:02:55disruptekdo you have an alternative method to determine your current branch?
20:03:16disrupteki just changed it so that it will refuse to run if you're not on master; seems safest.
20:03:24shashlicknot pretty - git branch | check for * in output
20:03:53disruptekalright, i will fix it. in the meantime, because i've tagged that change and only that change, you can simply revert to 1.7.4.
20:03:59dom96disruptek, 1) It's been just 5 days 2) Your attitude doesn't exactly encourage me to spend my time reviewing your PR 3) Your PR appears to have no impact on users other than yourself, 4) It does hacky shell escapes which may or may not work on Windows.
20:04:00disrupteknice, right?
20:04:21disruptekdom96: take your time.
20:05:33disruptekshashlick: oh, it's 1.7.3 you want, not 1.7.4 my bad.
20:06:23*Hideki_ quit (Ping timeout: 250 seconds)
20:06:25shashlick@dom96 - i would like to see some info in the PR that makes it easy to check the repo, i am often on my phone and seeing a new package repo added requires me to check the diff, select, copy paste and what not
20:06:55disrupteki just don't have the patience to codevelop dom's software. and that's fine. different strokes.
20:07:14disruptektreeform: i'm still curious about this if you wanna pass me a clue.
20:07:20FromGitter<alehander42> i kinda agree with dom's review
20:07:35disruptekthen you're happy i closed the pr. πŸ‘
20:08:01FromGitter<alehander42> no, i just think you should improve/add tests for the escape logic
20:10:16disruptekwell, iirc i tried to use the shellEscape in stdlib and it was broken for this application somehow.
20:11:34shashlicknimterop and nimarchive were both just bumped
20:11:46disruptekwow, trying something new?
20:12:09shashlickbug fixes - now hopefully choosenim osx starts working
20:12:26shashlickdon't have osx handy to test
20:12:40shashlickif i could just ssh in somewhere, would make life so easy
20:16:28disrupteki will never test nim code that i write on windows. i'm just not going to do it, ever. if that precludes my contributions, so be it. better to know before i go through the grief of submitting a pr.
20:17:26disrupteki guess i didn't read the contribution guidelines in this case.
20:18:24FromGitter<alehander42> well, nim is very multi platform
20:18:33FromGitter<alehander42> but i guess the CI should run the tests on windows
20:19:32shashlickmy general advice is to first confirm that the owner is interested in a change before spending any time building it
20:20:12disrupteki intend to use my branch. i explained my reasons. i wouldn't publish software if i didn't think it'd help people to use it.
20:20:40disruptekyou can decide if it's useful when i publish my next piece of code. if you like it, feel free to fork my branch.
20:21:17shashlickand i do get into details so that i'm in sync, i've wasted time in the past
20:22:15disruptekima build ndoc in any event. i just thought i'd gauge interest. i'm got too many projects that are important to me to build stuff for others that they don't want.
20:22:48*narimiran quit (Ping timeout: 245 seconds)
20:23:07shashlicki'd suggest using nim doc functionality to pull the docmentation from code and just focus on rendering it differently
20:23:59disrupteki think i'm gonna use nimsuggest but i really haven't done any research. i'm curious to try it, though, because it might yield a superior solution for gully.
20:24:58disruptekif nim doc worked for me, that'd be one thing, but i don't see the point in building on quicksand.
20:25:37shashlickwhat exactly is the issue with `nim doc`? i'm using it with nimterop, nimarchive and nimgit2 so am wondering what's the problem
20:25:45shashlicki understand it does not render to the CLI
20:25:49FromGitter<xmonader> I think i found bug in async ⏎ https://gist.github.com/xmonader/af0ed799520206acda6e78872678dc9e ⏎ ⏎ run `python3 -m http.server on any place` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5db35a4d3d669b28a0d86534]
20:26:23shashlickbut it could be expanded to print to the cli, allow search, etc
20:26:35disruptekshashlick: here's one: https://github.com/xomachine/NESM/issues/13
20:26:37shashlickan ndoc tool on top would make it cleaner sure
20:27:03FromGitter<xmonader> https://github.com/xmonader/nimdays/issues/11 original bug
20:28:00shashlicknimdoc and nimsuggest are completely different modes of the compiler and they do have issues
20:28:34Araqif I may try to moderate
20:28:49FromGitter<xmonader> stacktrace of what it's failing with ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db35b012f8a034357d9098e]
20:28:53disruptekyes, but leorize has nimsuggest on fleek. i'm down to rely upon it, as it works perfectly for me everywhere.
20:29:04shashlickhere's one I fixed recently - https://github.com/nim-lang/Nim/pull/11814
20:29:14Araqa PR that says "take it or leave it" but remains open is fine IMO
20:29:56Araqit's understandable that not everybody wants to play the tiresome ping-pong game with a PR review process etc
20:30:20Araqhaving said that, if the PR includes a testcase the CI runs it on Windows too anyway
20:33:11disruptekyou are welcome to anything i publish.
20:33:34Araqxmonader: I don't know if it's a stdlib issue or you misusing it ;-)
20:33:40dom96xmonader: seems this line is failing: https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1843
20:34:01dom96Did semantics for that line change Araq?
20:34:23Araqyeah ... now needs a len check
20:34:44Araqinteresting how long it takes to sort out these things
20:35:04Araqwe changed that in 0.19?
20:35:24dom96so this only gets triggered when `data` is "" I guess?
20:35:30Araqyes
20:35:31FromGitter<xmonader> one of nimdays readers tried to over use the tcp router and caught that :)
20:35:36FromGitter<xmonader> @dom96 yes
20:35:45dom96That's probably why we never caught it
20:35:50dom96No one would send that on purpose :P
20:36:05dom96but yes, these kinds of changes is why Nim 1.0 is so important
20:36:34FromGitter<xmonader> I guess it's more related to browser network
20:36:56dom96If you get "" from the socket then you should be handling that
20:36:59dom96it means the socket disconnected
20:37:13dom96I guess that code just attempts to send over another socket whatever it gets
20:38:27FromGitter<xmonader> the problem is http server running some where and a client (the browser) wants to reach it using that proxy, i think it's more related to the constant pulling? not sure
20:39:53FromGitter<xmonader> also I think maybe related to asyncCheck usage, because imo normal await on socket recv shouldn't yield ""
20:41:56dom96it should
20:42:15dom96Like I said, when a socket is disconnected that is what you get from `recv`
20:49:20FromDiscord<treeform> disruptek, "i'm still curious about this if you wanna pass me a clue." - I just saw a discussion around nim doc and I wanted to share my tool that does docs as a github readme.
20:51:38*GordonBGood joined #nim
20:55:05*lkw quit (Quit: ZNC 1.7.3 - https://znc.in)
20:55:34*lkw joined #nim
21:01:42FromGitter<xmonader> @dom96 did you try to do basic auth in jester? because I also encountered the same while trying to implement basic auth middleware
21:05:06dom96nope, but that's just a header no?
21:05:10*msmorgan joined #nim
21:06:27FromGitter<xmonader> yeah but i also got empty data during the process, so i think maybe just getting empty string isn't really an indication the socket is closed
21:07:08dom96it is
21:07:31dom96https://nim-lang.org/docs/asyncnet.html#recv%2CAsyncSocket%2Cint
21:08:39lqdev[m]https://play.nim-lang.org/#ix=1ZQs can anyone explain to me why is the macro fully expanded? I thought expandMacros only expands one level.
21:09:04FromGitter<xmonader> yeah but what if the socket will get some data pushed into it after a few seconds? maybe the user writing his creds and pressing enter?
21:10:30miprithe underlying syscall either blocks or gives you an error (including EAGAIN / EWOULDBLOCK , telling you to try again) if there could be more content. a 0-length reply is always EOF
21:11:24shashlick@dom96 - if you are still here, please review https://github.com/dom96/choosenim/compare/master...genotrance:nimarchive
21:11:42dom96shashlick, make a PR
21:11:46shashlicki'll submit soon after minor cleanup - replaced untar with nimarchive so now can extract xz, 7z natively
21:11:59dom96that way my comments can be preserved
21:12:02shashlicksetup full Windows CI
21:12:11shashlickokay how long you here
21:13:04shashlickalso, install linux binary builds when available
21:13:06lqdev[m]anyone? I've been struggling with this for a while now.
21:13:25shashlick@Araq - the size_t fix fixed my libarchive issue on OSX
21:13:58Araqthat's nice and disturbing, but ok
21:14:03FromGitter<xmonader> @lqdev it will generate the text `echo "Hello World"` in the compilation
21:14:35FromGitter<xmonader> and for b macro it will get replaced with a call to a
21:14:44lqdev[m]@xmonader I know, but why doesn't it generate `a()` instead.
21:15:05lqdev[m]as mentioned here: https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
21:15:09lqdev[m]it should expand one level
21:15:14FromGitter<xmonader> you expand b first -> a() -> a gets expanded -> echo("Hello, World")
21:15:28lqdev[m]that's two levels
21:15:44Araqthere is also --expandMacro
21:15:51FromGitter<xmonader> I don't think it's valid to have macros hanging in the code in the compilation step
21:15:53Araqnim c --expandMacro:foobar
21:16:00Araqit's new in v1
21:21:48shashlick@dom96 - https://github.com/dom96/choosenim/pull/143
21:22:51dom96shashlick, something that will make it easier for me to review and so faster for your PRs to be merged: please split up your PRs more. This PR seems to include a lot of different new functionality
21:23:23Araqjust accept that you have gained a core developer and let him do his thing
21:23:46shashlickthe travis stuff is inherited from nimarchive to enable windows CI
21:23:54shashlickchoosenim doesn't work as is, i have comments in there
21:25:22shashlickI can put in some explanations in the PR but it was distracting in the past
21:27:45disruptekmagic is open to interpretation.
21:27:58dom96Araq, I would love to have others review my changes tbh
21:28:10disruptektreeform: i mean, i looked at it, but while i can read the output, i don't see how it's created in the first place.
21:28:33Araqdom96: deal. create Nimble PRs and let me review it
21:29:49AraqI'll eventually review your PRs after a week or so, make silly remarks and then you need to change these things and then we wait for the CIs and then I might make more remarks until you lost interest in contributing
21:30:20shashlick@dom96 - i fixed tester.nim to use execCmdEx's algorithm since it was missing lines in the output and failing tests
21:31:43shashlickonce this is done, i'll add holy build box to the Linux CI so that the created binary can be used on any linux distro/version
21:35:47disruptekshashlick: bump 1.7.6 fixes your buglet; thanks.
21:35:56shashlickpeace
21:36:37dom96Approved with some minor comments
21:36:52dom96Also, please fix CI
21:37:21shashlickya nimble test hides all the messages and travis times out
21:37:24shashlicki'll clean it up
21:37:46*nif_ quit (Quit: ...)
21:39:43*nif joined #nim
21:41:14disruptekshashlick: did you see what cligen did for `csize`?
21:42:06disruptekhttps://github.com/c-blake/cligen/releases/tag/v0.9.40
21:42:45*nif quit (Client Quit)
21:44:43*nif joined #nim
21:45:02shashlickyep that's what nimterop is also effectively doing
21:45:47disruptekis that in 0.3.1?
21:47:12shashlickyep
21:47:20shashlickthat's what fixed my nimarchive osx issue
21:48:01disruptekokay, good; ima bump my nimterop and cligen reqs.
21:49:36shashlicksee i'm releasing more often πŸ˜„
21:49:50disruptekis good, yes?
21:49:52disruptekis good.
21:50:10Araqis 'nimble bump' a thing now?
21:51:25disruptekno, but while `nim doc` works, there should be enough here for an enterprising soul to add it: https://disruptek.github.io/bump/bump.html
21:51:57rockcaveraIs there any proc to do a reverse array? index 0 for high index and high index for 0?
21:52:07rockcaveraI searched, but I didn't find it.
21:52:12disrupteksee the `algorithm` module, iirc.
21:52:26disruptek`reversed`
21:53:10shashlick@Araq - did you want to update the mingw version we are testing and shipping?
21:53:13rockcaveradisruptek thanks =D
21:53:34rockcaveraI knew I had seen it, but I didn't know which package.
21:53:43disruptekyeah, it's sneaky like that.
21:56:03*solitudesf quit (Ping timeout: 240 seconds)
21:57:28Araqshashlick: sounds like a good idea
21:58:06shashlickdid you want to still have a link to mingw on our site or just point to the official links?
21:59:39shashlicklooking to resolve this - https://github.com/dom96/choosenim/pull/143/files/2f3ed0d366c889de97cd57338e2b1d89e9fcf8ad#diff-426be060ff890c3910f76bf5805616d1
21:59:58Araqwe mirror the mingws
22:01:01Araqbecause sourceforge is an offense
22:01:42shashlickyou prefer win32-dwarf for i686 and win32-she for x64 right
22:02:54shashlicki can post on nim-lang but i don't have access
22:03:38shashlickdo you want to retain version info in the names
22:09:06shashlick@dom96 - PR is passing now, made some changes and replied to feedback
22:14:47Araqversion info is fine and I prefer table based exception handling, however that is named
22:18:08*vsantana joined #nim
22:18:35shashlickStructured Exception Handling (SEH) on 64-bit only
22:19:07*vsantana quit (Client Quit)
22:20:42*vsantana joined #nim
22:23:04*abm quit (Quit: Leaving)
22:23:59Araqbah ok
22:24:20shashlickokay who can help me post the binaries on nim-lang
22:25:04*GordonBGood quit (Remote host closed the connection)
22:40:19rayman22201I found a race condition in virtual async events. But I won't have time this weekend to fix it :-(
23:02:35federico3what is the right way to normalize identifiers?
23:02:56disrupteknormalize?
23:03:52disruptekthis might be useful depending on what you're trying to do: https://github.com/disruptek/openapi/blob/master/src/openapi/codegen.nim#L160
23:03:59federico3nope: it lowercases everything
23:04:30disrupteki believe the capsOkay flag enables caps.
23:04:53federico3I mean normalize()
23:05:16disrupteki was asking what you meant by the word `normalize`.
23:05:51disruptekcapsOkay in my proc toggles FirstCharacterCaps or notFirstCharacterCaps.
23:05:57federico3hah, I thought you were suggesting strutils.normalize :D
23:07:13*ng0 quit (Quit: Alexa, when is the end of world?)
23:07:22disruptekwell, my thingy consumes any stupid string. but it's not designed to, like, hash it, so you could create collisions. fwiw.
23:07:44federico3btw you have dead code
23:08:13disruptekyeah it's more complete than anything.
23:09:04FromDiscord<SolarOmni> Hey guys, uh, sorry to interrupt, but, I saw that Nim is now 1.0, so, does anyone know any good libs or anything for game dev?
23:09:08disruptekalso, isValidNimIdentifier may be useful because i don't think there's one that's correct in stdlib.
23:09:35disruptekSolarOmni: what kinda games?
23:10:14FromDiscord<SolarOmni> What do you mean?
23:11:04disruptekthere is lotsa nim code for creating games; it's something nim accels at. if you can provide more detail on what kinda game you wanna work on, it'd be easier to steer you towards particular packages that may be of interest.
23:11:38FromDiscord<SolarOmni> Aw, well, that's hard to say, I was looking for something pretty versatile I'd say. Something that I can use for just about anything I guess.
23:11:50FromDiscord<SolarOmni> Something that I can use over and over again for many different games.
23:11:54FromDiscord<SolarOmni> But for the moment, I suppose..
23:11:58FromDiscord<SolarOmni> A simulation game.
23:12:01disrupteki guess look at nimgl for starters.
23:12:04FromDiscord<ZeeQyu> @SolarOmni For starters, are you looking for 2D or 3D? Installed or in the browser? Networked or singleplayer?
23:12:15FromDiscord<SolarOmni> 2D. Singleplayer. Desktop.
23:13:20FromDiscord<SolarOmni> nimgl, I'll take a look.
23:13:31FromDiscord<ZeeQyu> This page has a Game Development section
23:13:31FromDiscord<ZeeQyu> https://github.com/VPashkov/awesome-nim
23:13:51FromDiscord<SolarOmni> @ZeeQyu I'll also take a look at that.
23:14:47FromDiscord<ZeeQyu> If you're looking for a fully featured engine (3d and 2d) you can write nim in, look at Godot. The engine in itself seems well-developed, but I'm not certain how good the nim integration is.
23:14:53FromDiscord<ZeeQyu> Haven't looked ati t
23:17:03*lritter quit (Ping timeout: 250 seconds)
23:17:07FromDiscord<SolarOmni> I'm not.
23:17:14FromDiscord<SolarOmni> I don't like engines really.
23:17:18FromDiscord<SolarOmni> I prefer code.
23:17:29FromDiscord<ZeeQyu> Don't underestimate editors
23:17:35FromDiscord<ZeeQyu> But yeah, I can see where you're coming from
23:17:45FromDiscord<ZeeQyu> Something pure about just having code
23:18:16*krux02_ joined #nim
23:18:30FromDiscord<SolarOmni> Yeah.
23:18:42FromDiscord<SolarOmni> I actually have extensive experience with Godot already, I don't like it.
23:19:06FromDiscord<SolarOmni> I can't really say why..I can't put my finger on it.
23:19:12FromDiscord<ZeeQyu> Oh, you have? I haven't worked with it, what's your problem with it- Oh
23:19:45FromDiscord<SolarOmni> Maybe because it's too similar to Unity.
23:19:46FromDiscord<SolarOmni> I don't know.
23:19:55FromDiscord<ZeeQyu> I'd love to hear the reason if you realize what irks you, so please at me if you figure it out
23:20:20FromDiscord<SolarOmni> Well it's been about a year so I doubt I'll figure it out πŸ‘€
23:20:43FromDiscord<ZeeQyu> Aight
23:20:43*krux02 quit (Ping timeout: 245 seconds)
23:21:04FromDiscord<treeform> I prefer not to use engines and I like building everything from scratch.
23:21:11FromDiscord<SolarOmni> My man
23:21:13FromDiscord<SolarOmni> Or gal
23:21:14FromDiscord<SolarOmni> ...
23:21:21FromDiscord<SolarOmni> *shuts up*
23:22:49FromDiscord<ZeeQyu> You can only write an ecs so many times before you get tired of it and just want to make the actual game, so I can't really relate. But yeah, if the writing from scratch is something that makes you happy in itself, then all power to you.
23:23:11FromDiscord<SolarOmni> I like reinventing the wheel?
23:23:43FromDiscord<ZeeQyu> Alright then
23:24:00FromDiscord<treeform> I love reinventing the wheel, I made many open source libraries that you can use for game development: https://github.com/treeform/steamworks https://github.com/treeform/netpipe https://github.com/treeform/openal https://github.com/treeform/quickcairo https://github.com/treeform/euphony
23:24:01FromDiscord<SolarOmni> Of course if I'm using the same tech I can just write my own libs.
23:24:20FromDiscord<SolarOmni> Ooohhh~
23:24:25FromDiscord<SolarOmni> *grabby hands*
23:24:29FromDiscord<ZeeQyu> Oh hello. Don't mind if I do
23:25:05federico3too many gaming libraries and none that I really like :(
23:25:28FromDiscord<treeform> a ton of time I just need to see how other people done it, so that I can do it my way πŸ™‚
23:25:37FromDiscord<treeform> so I don't use the libraries but I love reading them
23:26:10federico3treeform: some demos of euphony?
23:26:20FromDiscord<ZeeQyu> I think that might be the healthiest way to write things from scratch. With a great degree of research
23:26:45FromDiscord<treeform> federico3 , each block: is a mini demo: https://github.com/treeform/euphony/blob/master/tests/test.nim
23:28:13FromDiscord<treeform> I really liked this one, it just came together so naturally: https://github.com/treeform/euphony/blob/master/tests/test.nim#L106
23:29:53federico3I mean an online, playable demo
23:30:32FromDiscord<treeform> euphony is a windows, mac, linux only. It does not work with JS.
23:30:44FromDiscord<treeform> it uses openAL.dll
23:30:59FromDiscord<treeform> So I can't really give that to you "online"
23:31:13federico3treeform: you can record the output :D
23:31:31FromDiscord<treeform> that I can do
23:37:19FromDiscord<treeform>
23:37:19FromDiscord<treeform> https://cdn.discordapp.com/attachments/371759389889003532/637434548912783361/2019-10-25_16-36-45.mp4
23:37:45FromDiscord<treeform> That's all from a single bell sound.
23:38:07FromDiscord<ZeeQyu> Did you implement the pitch shifting, or is that an OpenAL thing?
23:38:16FromDiscord<treeform> OpenAL thing
23:38:34FromDiscord<ZeeQyu> Aww. I hoped to read how that all worked in nim code.
23:38:43FromDiscord<ZeeQyu> Has never stopped fascinating me
23:39:40FromDiscord<treeform> pitch shifting is just 1d scaling
23:40:10FromDiscord<ZeeQyu> Do you mean as in slowing playback?
23:40:18FromDiscord<SolarOmni> So
23:40:33FromDiscord<SolarOmni> Anyone know if the SDL wrapper works okay?
23:40:44FromDiscord<treeform> I think the SDL wrappers work great.
23:40:51FromDiscord<treeform> I don't like SDL not low level enough for me πŸ˜ƒ
23:41:04FromDiscord<treeform> I recommend `glfw`
23:41:25FromDiscord<SolarOmni> Too low for me. ^^; I'm not well versed in black magic enough for that yet.
23:42:23FromDiscord<treeform> I have the exact same example implemented in glut, glfw and SDL. Would you like to see?
23:42:32FromDiscord<SolarOmni> Sure.
23:42:34FromDiscord<ZeeQyu> Oh yes please
23:42:42FromDiscord<treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_glut.nim
23:42:47FromDiscord<treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_glfw.nim
23:42:51FromDiscord<treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim
23:43:00FromDiscord<treeform> oh SDL2 ... no one uses SDL 1.
23:43:18FromDiscord<treeform> well some old linux games do... but you should not write new code for SDL1.
23:44:38FromDiscord<SolarOmni> Haha