<< 12-02-2021 >>

00:00:28FromDiscord<ElegantBeef> Matrix4f.Identity is a procedure? if so you need to invoke it
00:00:40FromDiscord<ElegantBeef> `var identity = Matrix4f.Identity()`
00:00:51*irchaxwell joined #nim
00:01:06FromDiscord<ElegantBeef> What package are you using?
00:01:18FromDiscord<~355/113 Man> In reply to @ElegantBeef "What package are you": my own
00:01:20FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2P6r
00:01:26FromDiscord<~355/113 Man> with opengl and sdl2
00:01:39FromDiscord<ElegantBeef> ah
00:01:50FromDiscord<ElegantBeef> So `Matrix4f` is a module
00:01:54FromDiscord<~355/113 Man> yea
00:01:58FromDiscord<~355/113 Man> and a type
00:02:09FromDiscord<~355/113 Man> is that bad to have a type the same name as a module?
00:02:31FromDiscord<ElegantBeef> I mean it works doesnt it?
00:02:36FromDiscord<~355/113 Man> yea
00:03:13FromDiscord<ElegantBeef> I see you're using PascalCase function names so i assume C#? πŸ˜„
00:04:08FromDiscord<~355/113 Man> uhhhhh πŸ˜… actually no..... (well yes but actually no)↡it's a "constructor" for an identity matrix, my function names are actually cammelCase
00:04:24FromDiscord<~355/113 Man> i'm coming from a mix of C and C++
00:04:33FromDiscord<~355/113 Man> as a hobyist programmer
00:04:38FromDiscord<ElegantBeef> Worth noting since Identity is constant you could just make it a `const` since i assume it's `object`
00:05:14FromDiscord<~355/113 Man> no, it's `Matrix4f = discrete array[16, float32]`
00:05:35FromDiscord<ElegantBeef> It's considered a value type
00:05:48FromDiscord<ElegantBeef> Which is what i mean by an object
00:05:58FromDiscord<~355/113 Man> `object` is considered value?
00:06:09FromDiscord<ElegantBeef> object is just a C struct
00:06:16FromDiscord<~355/113 Man> oh cool
00:06:27FromDiscord<ElegantBeef> `ref object` is just a managed pointer to a C struct
00:06:52FromDiscord<ElegantBeef> But anyway the const thing still applies
00:08:38FromDiscord<ElegantBeef> No clue the consensus with math types but constructors in Nim tend to default to `initType`
00:10:52FromDiscord<~355/113 Man> would assigning `identity` create a copy of `identity`?
00:11:30FromDiscord<ElegantBeef> Well it's a value type
00:11:54FromDiscord<ElegantBeef> !eval const I = 100; var a = I; a = 3; echo a
00:11:56NimBotCompile failed: /usercode/in.nim(1, 29) Error: invalid token: (\29)
00:12:05FromDiscord<ElegantBeef> Fuck
00:12:22FromDiscord<ElegantBeef> Guess take this link https://play.nim-lang.org/#ix=2P6u
00:13:23FromDiscord<~355/113 Man> yep ok, just making sure
00:18:52FromDiscord<acek7> sup
00:33:13asdflkj_2sup
00:34:53*NimBot joined #nim
00:41:53FromDiscord<~355/113 Man> can I not multiply a float and an int together without converting?
00:45:53FromDiscord<ElegantBeef> https://nim-lang.org/docs/lenientops.html
00:45:55*Jesin quit (Quit: Leaving)
00:46:13FromDiscord<Avatarfighter> wtf i didn't know that library existed
00:46:28FromDiscord<ElegantBeef> The stdlib is full of magic treats
00:47:16FromDiscord<ElegantBeef> Like we have `mimetypes`
00:47:30FromDiscord<Avatarfighter> wtf
00:48:11FromDiscord<ElegantBeef> Hell there is a module to open urls in your default browser
00:48:13FromDiscord<Avatarfighter> if you continue listing libraries beef you're going to put all the helper libraries I created for my projects out of business
00:48:42FromDiscord<ElegantBeef> Cant tell if you're serious πŸ˜„
00:50:30FromDiscord<Avatarfighter> im not
00:50:31FromDiscord<Avatarfighter> well
00:51:08FromDiscord<Avatarfighter> @ElegantBeef i can't share all my secrets
00:51:53FromDiscord<ElegantBeef> lol
00:52:22FromDiscord<ElegantBeef> The Nim stdlib has some super interesting things in it, i suggest all visit it at times
00:52:57FromDiscord<ElegantBeef> Got a full on console logger πŸ˜› https://nim-lang.org/docs/logging.html
00:53:05leorize[m]we should update lib.rst to point people to those instead
00:53:18leorize[m]we still have logging? thought we moved that to graveyard
00:53:26FromDiscord<ElegantBeef> apparently
00:54:01FromDiscord<ElegantBeef> It's still in devel
00:54:07FromDiscord<~355/113 Man> is there a list of libraries?
00:54:13FromDiscord<ElegantBeef> https://nim-lang.org/docs/theindex.html
00:54:26FromDiscord<ElegantBeef> There are some hidden modules aswell
00:54:34FromDiscord<ElegantBeef> like `termios` and the like
00:54:50FromDiscord<ElegantBeef> Think posix is also hidden
00:55:42FromDiscord<ElegantBeef> Leorize do you have any clue why some modules are listed in the index?
00:55:48FromDiscord<ElegantBeef> (edit) "are" => "arent"
00:56:09*Jesin joined #nim
00:56:13FromDiscord<ElegantBeef> Is it cause "you arent supposed to use it unless you know you need it"?
00:56:23FromDiscord<~355/113 Man> ooh there's a `math`
00:59:18FromDiscord<ElegantBeef> Cause it's sorta weird to things like `underscored_calls` in the index but not `posix`
00:59:32*xet7 quit (Remote host closed the connection)
00:59:41FromDiscord<~355/113 Man> oh it's pretty much just functions on scalars
00:59:59FromDiscord<ElegantBeef> Well what'd you expect?
01:01:15FromDiscord<~355/113 Man> was hoping for linear algebra stuff too, lol not sure wht
01:01:16FromDiscord<~355/113 Man> (edit) "wht" => "why"
01:01:35FromDiscord<ElegantBeef> You mean like matricies and vectors?
01:01:39FromDiscord<~355/113 Man> yea
01:01:51FromDiscord<ElegantBeef> https://github.com/treeform/vmath
01:02:41FromDiscord<ElegantBeef> Not in stdlib of course but it's better than rewriting it yourself πŸ˜„
01:03:54FromDiscord<~355/113 Man> I rewrite a lot of things myself anyways
01:04:26FromDiscord<ElegantBeef> Well have fun πŸ˜„
01:05:04FromDiscord<~355/113 Man> maybe I should just try a copy/paste of my C++ Matrix4f
01:05:30FromDiscord<~355/113 Man> but i'm also trying to use tests for the first time ever
01:13:34FromDiscord<~355/113 Man> is it normal to not have assignment (so like `=`) not return anything?
01:14:47Avahe[m]What do you mean?
01:15:23FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2P6J
01:16:24BitPuffin<FromDiscord "<Rika> well ive never met you is"> Yeah haha. Well I'm not really active in the nim community recently
01:23:44Avahe[m]I don't think assignment usually returns anything
01:24:01Avahe[m]I'm on my phone though, so I haven't double checked
01:27:40FromDiscord<~355/113 Man> it does in C and C++ and I think C# and maybe Java
01:28:19Avahe[m]You could try it or look at the Nim sauce
01:28:58FromDiscord<~355/113 Man> I did try it, would require the use of discard a lot though
01:30:13FromDiscord<InventorMatt> Unless you want to use discard alot or you are chaining functions its probably better to not return anything
01:30:24FromDiscord<~355/113 Man> yea, that's what I decided
01:33:21*Tanger quit (Quit: Leaving)
01:34:12*Tanger joined #nim
01:35:05leorize[m]@ElegantBeef not in theindex? probably because the docgen script didn't add them
01:35:17leorize[m]not in lib.rst then it's just because no one updated it
01:46:56*a_chou joined #nim
01:50:36FromDiscord<ElegantBeef> In reply to @~355/113 Man "I did try it,": `{.discardable.}` on the proc
01:50:48FromDiscord<ElegantBeef> But it's very weird to see in Nim code
01:52:07*abm quit (Read error: Connection reset by peer)
01:53:31FromDiscord<ElegantBeef> @~355/113 Man implementation https://play.nim-lang.org/#ix=2P6O
02:18:22FromDiscord<Pixtum> is there any chance that a future update would remove the need for nimscript files to have a file extension?
02:24:03FromDiscord<ElegantBeef> No technical reason why it has to have `.nims` so plausibly? πŸ˜„
02:32:03FromDiscord<Pixtum> ok, it's just kinda odd imo, if I want to distribute a small program in nimscript that I have to leave that tag or wrap it in something
02:33:23FromDiscord<ElegantBeef> i mean it tells you what interpreter to use, so it's pretty ok
02:33:30FromDiscord<ElegantBeef> What are you distributing if i may ask?
02:54:18*a_chou quit (Remote host closed the connection)
02:54:36*a_chou joined #nim
03:13:09*asdflkj_2 quit (Ping timeout: 264 seconds)
03:13:18*j-james joined #nim
03:24:41*wasted_youth2 quit (Quit: Leaving)
03:41:36FromDiscord<Rika> BitPuffin any plans on coming back? xd
03:46:14*muffindrake quit (Ping timeout: 264 seconds)
03:47:58*muffindrake joined #nim
03:51:13*rockcavera quit (Remote host closed the connection)
04:01:07*vicfred quit (Quit: Leaving)
04:02:48*j-james quit (Quit: WeeChat 3.0)
04:46:07*spiderstew_ quit (Ping timeout: 260 seconds)
04:46:20*spiderstew joined #nim
04:50:43*njoseph joined #nim
04:59:16*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
04:59:40*njoseph joined #nim
05:10:25*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:10:33*njoseph joined #nim
05:11:41*njoseph quit (Client Quit)
05:11:48*njoseph joined #nim
05:23:22FromGitter<timotheecour> yikes: https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/ ; not sure we need this kind of publicity
05:32:52FromDiscord<ElegantBeef> I mean it's bound to occur
05:34:47FromDiscord<Zeus> https://media.discordapp.net/attachments/371759389889003532/809658740894466058/unknown.png
05:34:59FromDiscord<Zeus> Maybe they just really like Nim :-p
05:35:38FromDiscord<~355/113 Man> I wouldn't blame them, i've been using nim for only 2 days and I already love it
05:41:19leorize[m]it just to show that antivirus are horrible :p
05:43:01*waleee-cl quit (Quit: Connection closed for inactivity)
06:14:19*opal joined #nim
06:15:26*a_chou quit (Remote host closed the connection)
06:16:00*a_chou joined #nim
06:32:12*a_chou quit (Remote host closed the connection)
06:45:56FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2P7E
06:46:50*opal left #nim ("i'm never coming back")
06:47:33FromDiscord<~355/113 Man> (eps is a public var double btw)
06:47:44FromDiscord<~355/113 Man> (edit) "btw)" => "btw `var eps = 0.0001`)"
06:50:20FromDiscord<InventorMatt> because eps is a variable it needs to be a constant to avoid side effects
06:51:05FromDiscord<~355/113 Man> hmm, is there a way to have eps not constant? (and avoid side effects)
06:51:43FromDiscord<~355/113 Man> or is the side effect that if eps is changed the output of the function will change
06:51:55FromDiscord<InventorMatt> yes, that is the side effect
06:52:03FromDiscord<~355/113 Man> ah ok, i'll just make it a proc then
07:53:52FromGitter<offbeat-stuff> anyone know how to sort merge and intersect and intervals on the surface of a sphere
07:55:26FromGitter<offbeat-stuff> Like I have many shapes Which I know cover a certain fov from a point around in 2d space
07:55:58FromGitter<offbeat-stuff> I want to create intervals to those angles
08:02:04*PMunch joined #nim
08:12:33*Tanger quit (Ping timeout: 264 seconds)
09:02:49FromDiscord<ElegantBeef> Pmunch does options-utils have anything similar to this? https://play.nim-lang.org/#ix=2P7j
09:03:09PMunchYup
09:04:36FromDiscord<ElegantBeef> What does it, i couldnt find it myself earlier
09:05:08PMunchhttps://github.com/PMunch/nim-optionsutils/blob/master/tests/toptionsutils.nim#L24
09:05:42FromDiscord<ElegantBeef> That's not what then does
09:05:59PMunchOoh
09:06:02FromDiscord<ElegantBeef> then takes the value and converts it to an option only if the condition is met
09:06:11PMunchSorry, I misread that snippet
09:06:13FromDiscord<ElegantBeef> Otherwise it's a none
09:06:14FromDiscord<ElegantBeef> Ah
09:06:20PMunchHmm, I don't think it has that no
09:06:34PMunchBut I'm happy to accept a PR request for it
09:06:35FromDiscord<ElegantBeef> Yea i seen that Rust had it and it seemed like a nice api
09:07:25PMunchYeah it looks pretty neat
09:10:12*MarderIII joined #nim
09:10:47FromDiscord<ElegantBeef> Oh cool i thought there would be an issue with if you have `false` and a procedure call as the val but it seems it doesnt invoke the proc
09:11:27FromDiscord<ElegantBeef> I guess that makes sense considering the fact the type is figured at CT
09:12:29FromDiscord<ElegantBeef> Also did i ever show that tiled web browser?
09:12:49FromDiscord<ElegantBeef> It's not usable as a daily driver, but it's pretty interesting
09:14:53PMunchTiled web browser?
09:15:00PMunchNo you definitely didn't show me that!
09:15:04FromDiscord<ElegantBeef> https://github.com/mlajtos/mosaic
09:15:38FromDiscord<ElegantBeef> It doesnt have keyboard shortcuts nor is it really usable, but yea it's pretty cool
09:19:14PMunchHmm, Vivaldi (the browser I used to use (and consider switching back to)) also has this feature
09:19:28PMunchAnd it's much more useable :P
09:19:56FromDiscord<ElegantBeef> Ah
09:20:04FromDiscord<ElegantBeef> I never seen it before
09:20:12FromDiscord<ElegantBeef> Did it support keyboard navigation?
09:20:26PMunchWell it has the usual stuff
09:20:32PMunchBut I had Vimium installed
09:20:44PMunchWhich gave me more convenient shortcuts
09:20:53PMunchAnd the ability to click links
09:21:06PMunchI've also been playing with nyxt over the past couple of days
09:23:25PMunchWell shit.. I've had a headache since yesterday morning. Turns out it was just a lack of coffee..
09:23:32PMunchMaybe I should cut back a bit
09:24:30FromDiscord<ElegantBeef> Possibly πŸ˜„
09:24:36liblq-devLMAO
09:24:43liblq-devyou pinged ache-of-head by saying headache
09:24:56PMunch:P
09:25:29FromDiscord<ElegantBeef> I've been trying to use Moe a bit more, i cannot wait for LSP support in it, linting and actual suggestions would vbe cool
09:25:42FromDiscord<ElegantBeef> You just pinged someone named ed, so take that
09:32:35PMunchBut seriously, I was massively unproductive all yesterday and when I woke up today I was a bit worried how long the headache would last. Turns out my first cup of coffee was how long it would last
09:32:57FromDiscord<ElegantBeef> Druggie!
09:33:07PMunchI can stop whenever I want!
09:33:25PMunchAnd it isn't hurting anyone!
09:33:29PMunchMind your own business!
09:33:50headachei can stop whenever you want as well
09:34:18PMunchHaha, good to see that you left my head and decided to join IRC instead :P
09:34:43PMunchBy the way @Elegant, if it wasn't clear enough that was just a joke :P
09:34:45headachei'm on matrix right now, checking it out
09:34:47FromDiscord<ElegantBeef> There you go pmunch got a pr
09:35:02PMunch@Elegant, sweet!
09:35:04FromDiscord<ElegantBeef> Wait you can joke, i always thought you were just an asshole?
09:35:10FromDiscord<ElegantBeef> See that's a joke
09:35:22FromDiscord<Rika> Was it
09:35:33PMunchHaha
09:35:36FromDiscord<Solitude> it was, im laughing
09:35:57FromDiscord<ElegantBeef> Rika doesnt like my jokes ever
09:36:05headachedam
09:36:19FromDiscord<Rika> Hey I like your parents jokes at least
09:37:04FromDiscord<ElegantBeef> Yea well they dont, my mom when i was born said "What a treasure!" and my dad responded "You think, i'll get the shovel to bury it"
09:37:24headacheoh no
09:37:48FromDiscord<Solitude> wait, this isnt offtopic. MODS, ban these guys
09:37:55FromDiscord<Rika> Gtg lol have to walk 3 km
09:38:09FromDiscord<ElegantBeef> Have fun, remember shit goes down hill
09:38:28PMunch@Rika just coming in here setting things ablaze and then running away :P
09:39:14PMunchBut yeah, this should probably have gone in offtopic
09:39:54FromDiscord<ElegantBeef> He i was talking about moe
09:40:03FromDiscord<ElegantBeef> (edit) "He" => "Hey"
09:40:03FromDiscord<ElegantBeef> That's written in Nim, cannot be more on topic than that!
09:40:03Yardanicodafaq happened to discord
09:40:19FromDiscord<Yardanico> Ah nvm it's back
09:40:20PMunchThat's true @Elegant, moe and optionsutils :)
09:40:24FromDiscord<ElegantBeef> Yea was ssuper laggy
09:40:41FromDiscord<Yardanico> for me the client wrote "server is unavailable due to temporary outage" for the Nim server
09:40:45FromDiscord<ElegantBeef> Rust also has a `then_some` but i couldnt figure out the purpose
09:40:58FromDiscord<ElegantBeef> It seems to be a impl for their functions
09:41:06FromDiscord<ElegantBeef> Those are works for free as far as i can see
09:41:13FromDiscord<ElegantBeef> You pass it a function call it doesnt care
09:41:22PMunchIt's to be able to write `100 and then_some`
09:41:43FromDiscord<ElegantBeef> lol
09:42:26FromDiscord<ElegantBeef> Ah sorry their `then` was different https://doc.rust-lang.org/std/primitive.bool.html#method.then
09:44:02FromDiscord<ElegantBeef> I think that only exists for function calls? idk it's weird, i liked then so we get it
09:44:18PMunchBy the way, care to add it to the documentation as well?
09:44:45FromDiscord<ElegantBeef> You dont just use nim's docgen? πŸ˜„
09:45:59PMunchWell I have this as well: https://github.com/PMunch/nim-optionsutils/blob/master/src/optionsutils.nim#L1-L126
09:46:13PMunchStill part of Nims docgen, but explains it a bit further with examples and such
09:46:26PMunchBut I guess `then` is easy enough not to warrant that
09:47:00FromDiscord<ElegantBeef> I could add a runnable example
09:47:09FromDiscord<ElegantBeef> Forgot to do that
09:50:08FromDiscord<ElegantBeef> Wait you dont export options in the module
09:50:17FromDiscord<ElegantBeef> Docgen wouldnt cause of that πŸ˜„
09:54:06liblq-dev@ElegantBeef rust closures compared to nim closures are dirt cheap
09:54:16FromDiscord<ElegantBeef> Ok?
09:55:36FromDiscord<ElegantBeef> Sorry i just dont know why you said that
09:56:46*Vladar joined #nim
09:59:19FromDiscord<ElegantBeef> Pmunch you've got another PR
10:00:55FromDiscord<ElegantBeef> Oh
10:01:57FromDiscord<ElegantBeef> You dont want to all of options?
10:02:16FromDiscord<ElegantBeef> I see i should be using `toOpt` instead of `some`?
10:04:16liblq-dev@ElegantBeef i said that because you mentioned "Those are works for free as far as i can see"
10:05:02FromDiscord<ElegantBeef> yea i meant "for those, our work for free" since the macro works for both
10:05:03liblq-devso i just confirmed that they work for free
10:11:09PMunchThe reason why `option` isn't exported is if people want to use `safeoptions` which makes it so that you can't call `get` and `unsafeGet`. This ensures that only the chaining and block versions that optionsutils supply can be used meaning you won't have exceptions.
10:11:47FromDiscord<ElegantBeef> yea i realized that you dont want to export all of options as far as i can telll
10:11:57FromDiscord<ElegantBeef> And to answer that disppearing new line, no friggin clue πŸ˜„
10:20:54PMunchHaha, I was worried this was some new Nim style-trend
10:21:10FromDiscord<ElegantBeef> Dont expect that from me i dont have style
10:24:41FromDiscord<Yardanico> so uhh
10:24:59FromDiscord<Yardanico> is it a known bug that hints/warnings from a module don't work if you import it with "../"? same also happens with nimble-installed modules
10:25:28FromDiscord<Solitude> amazing
10:25:50FromDiscord<ElegantBeef> Might be intended no? So you dont get warnings from other package creators
10:26:03FromDiscord<Solitude> lol
10:26:25PMunchPretty sure that's not intended
10:26:42FromDiscord<ElegantBeef> Well the hints could be, but the warnings certainly are not
10:26:43FromDiscord<Solitude> thats wrong reproduction, boys, pack it up
10:27:49FromDiscord<ElegantBeef> I dont need no stinking import hint from a nimble package πŸ˜„
10:29:44FromDiscord<Yardanico> not import hints
10:29:47FromDiscord<Yardanico> you didn't understand
10:29:55FromDiscord<ElegantBeef> No i did
10:30:07FromDiscord<Yardanico> @ElegantBeef when a package has {.hint: "test.} or {.warning: "test".} when you import it, those hints or warnings should be printed IMO
10:30:09FromDiscord<Yardanico> but they are not
10:30:17FromDiscord<Yardanico> they are when you use normal relative imports without nimble
10:30:19FromDiscord<ElegantBeef> Yea that's what i understood
10:36:31*wasted_youth2 joined #nim
10:37:22ForumUpdaterBotNew thread by Alexeypetrushin: Nim Design Patterns?, see https://forum.nim-lang.org/t/7498
10:58:06FromDiscord<dom96> In reply to @timotheecour "yikes: https://www.bleepingcomputer.com/news/securi": @timotheecour: if anything it just shows that Nim is great for portable software πŸ˜›
10:58:30FromDiscord<Yardanico> yeah, nothing wrong with nim being used for writing malware :P
10:58:40FromDiscord<Yardanico> except that nim binaries will probably get false detections by antivirus software
10:58:42FromDiscord<Yardanico> more
11:00:13FromDiscord<dom96> hah
11:00:27FromDiscord<dom96> "nim" in readFile(binary.exe): return "Yep, that's a virus"
11:00:49FromGitter<Araq> https://github.com/nim-lang/Nim/pull/17020 interesting discussion here
11:01:02FromGitter<Araq> and it's about the lexer so everybody has an opinion
11:01:19FromGitter<Araq> (it's also a really important feature, no irony)
11:02:24FromDiscord<Rika> Sounds strong but that would mean a change in spec would it?
11:02:38Yardanico@Araq is it intended that user hints/warnings are not displayed if they come from nimble packages? I get why normal warnings/hints aren't displayed if they come from nimble files, but why should it be the case for developer-made hints/warnings?
11:02:50Yardanicochanging compiler/options.nim line 431 to const foreignPackageNotesDefault* = {warnUser, hintUser, hintProcessing, warnUnknownMagic, hintQuitCalled, hintExecuting} fixes that
11:03:27Yardanicos/nimble files/nimble packages
11:03:36FromGitter<Araq> yes, that's a feature
11:04:06Yardanicoeven for user hints/warns?
11:04:48FromGitter<Araq> hardly. but it's done "consistently" so you cannot complain.
11:05:02FromDiscord<Solitude> i can
11:05:14Yardanicowell, I just know that I used user warnings in my package and thought that they will be displayed
11:05:17FromGitter<Araq> I learned consistency is a value in itself. That's why I will only use the letter A from now on.
11:05:25YardanicoI can actually check how many packages use user hints/warns
11:05:28FromDiscord<Solitude> whats the point of user hints then?
11:05:32FromGitter<Araq> AA.
11:05:39FromDiscord<Ardek> AA
11:05:48FromDiscord<Rika> I think he’s being extra sarcastic haha
11:05:57Yardanicoaaaaaaaaaaaaaaaaaaa
11:08:30FromDiscord<dom96> Do other langs do this too?
11:08:40FromGitter<Araq> AA.
11:09:20FromDiscord<dom96> I think open source work has finally made Araq snap
11:09:20Yardanicook, packages that have user hints: asynctools, chipmunk6, contra, nimcx, nimlapack, Nimscripter, nimx, nsh, numnim, rapid, sigv4, timezones
11:09:29Yardanicoand I mean {.hint: "some message.}
11:09:31Yardanico"
11:10:48FromGitter<Araq> ok, enough of this. yeah, let's please fix this
11:10:56FromGitter<Araq> user messages are not package specific
11:11:23FromGitter<Araq> it also kept me from warning about async + gc:arc ("use gc:orc instead")
11:13:05FromDiscord<dom96> warn? that should be an error
11:13:28Yardanicowell, we give the users a choice
11:13:32Yardanicoso they can leak memory if they want :D
11:21:18Yardanicohttps://github.com/nim-lang/Nim/pull/17024
11:23:39*leorize quit (Remote host closed the connection)
11:24:17*sekao[m] joined #nim
11:24:24*leorize joined #nim
11:24:32FromDiscord<Rika> Do we have something that makes all warnings into errors?
11:24:37FromDiscord<Rika> Or categories of such
11:25:11FromDiscord<Yardanico> yes
11:25:35FromDiscord<Rika> Then indeed the orc thing should be a warning
11:25:35FromDiscord<Yardanico> we even have "hints as errors"
11:26:01FromDiscord<Yardanico> only in devel though
11:30:45*abm joined #nim
11:33:41FromDiscord<Yardanico> it's a bit surprising that some packages like weave had those user warnings but no one noticed that they're not displayed :P
11:33:50FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/809749100270452736/unknown.png
11:41:06FromDiscord<mratsim> tlsEmulation was disabled on MacOS following a change by timotheecour I think
11:41:30FromDiscord<Yardanico> @mratsim no, I mean that no one who installed weave from nimble saw any of your warnings
11:41:50FromDiscord<Yardanico> e.g. this wasn't displayed https://media.discordapp.net/attachments/371759389889003532/809751109060788254/unknown.png
11:41:54FromDiscord<mratsim> no one must use Weave then :p
11:42:03FromDiscord<pouriya.jamshidi> Hey everyone↡Is there a way to tinker with socket or nativesocket to not send an ack upon receiving syn/ack?↡↡we're trying to make a custom tool to test our firewalls
11:42:28FromDiscord<mratsim> In reply to @Yardanico "e.g. this wasn't displayed": this one was to detect compiler bugs/regressions
11:42:37FromDiscord<Yardanico> @mratsim oh okay
11:43:14FromDiscord<mratsim> this: https://github.com/nim-lang/Nim/issues/14118
11:44:08FromDiscord<mratsim> I don't remember why I made this a warning and not an error though
11:45:10FromDiscord<Yardanico> yeah seems like a few packages use {.warning where it should've been an {.error
11:45:57FromDiscord<mratsim> it used to be an error, that's how i detected the bug in the first place
11:46:40FromDiscord<Yardanico> also nimcx has the biggest user "hint" of all packages :P
11:46:41FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/809752333914472488/unknown.png
11:46:57FromDiscord<Yardanico> something like this https://media.discordapp.net/attachments/371759389889003532/809752398159151124/unknown.png
11:47:13FromDiscord<mratsim> wtf? lol
11:47:17FromDiscord<Yardanico> for some reason he put it in almost all nimcx files
11:47:26FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/809752521349267477/unknown.png
11:47:34FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/809752553817767976/unknown.png
11:47:45FromDiscord<Yardanico> ah, different submodules
11:48:51FromDiscord<Yardanico> so when you import "cx" itself you'll see this https://media.discordapp.net/attachments/371759389889003532/809752877753040916/unknown.png
11:50:58FromDiscord<Rika> Eh
11:51:00FromDiscord<Rika> Why
11:51:04FromDiscord<Yardanico> ask nimcx's author :D
11:51:17FromDiscord<Yardanico> https://github.com/qqtop/NimCx
11:51:28FromDiscord<Solitude> he look to much at npm packages
11:51:31FromDiscord<Solitude> (edit) "look" => "looked"
11:51:35FromDiscord<Solitude> (edit) "to" => "too"
11:53:28FromDiscord<Ardek> npm is an example to follow
12:19:10*irchazwell_ joined #nim
12:21:31*rockcavera joined #nim
12:22:41*irchaxwell quit (Ping timeout: 265 seconds)
12:23:36*lritter joined #nim
12:23:50FromDiscord<dom96> In reply to @pouriya.jamshidi "Hey everyone Is there": For that you should look up how to do it in C and then just use the nativesockets/POSIX APIs as they are used in the C examples
12:37:22*haxscramper joined #nim
12:49:12FromDiscord<Rika> Is the c++ backend of Nim usually slower? Or faster?
12:49:24FromDiscord<Rika> Rather I guess my question is more of
12:49:42FromDiscord<Rika> Why don’t people use the c++ backend as much as the c one
12:50:56FromDiscord<pouriya.jamshidi> In reply to @dom96 "For that you should": thanks
12:51:59FromDiscord<Yardanico> @Rika because the default backend is C :)
12:52:39FromDiscord<Rika> Well are there significant dis/advantages to using the c++ backend
12:52:44FromDiscord<Yardanico> I don't think so
12:52:58FromDiscord<Rika> Okay, thanks, time to figure out QT
12:53:00FromDiscord<Yardanico> IIRC even 4raq says that Nim C++ backend should be used more often
12:53:01FromDiscord<Rika> Qt
12:56:50FromDiscord<Zachary Carter> gl!
13:01:39FromGitter<Araq> the C++ backend still has more bugs though. The test coverage has become really good, `koch boot` works with C++ too
13:02:44FromGitter<Araq> in theory the C++ backend has the much faster exception handling implementation, in practice I haven't seen it to make much of a difference, --goto:exceptions closed the gap
13:15:34planetis[m]so which one is better, exceptions or result types?
13:17:09*Guest91629 quit (K-Lined)
13:19:57FromDiscord<konsumlamm> depends on your preferred style ig? exceptions are used in the standard library (while result types aren't), so that's one point in favor of them
13:20:21*asdflkj_2 joined #nim
13:39:03*irchazwell_ quit (Ping timeout: 265 seconds)
13:40:03FromGitter<Araq> result type doesn't work for `[](x: var Container): var T`
13:59:31*Vladar quit (Remote host closed the connection)
14:03:27*Vladar joined #nim
14:09:13federico3https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/
14:10:44FromGitter<Araq> yes, Timothee also told us
14:15:19FromDiscord<dom96> This is cool https://github.com/jimblandy/context-switch
14:32:42PMunchfederico3, isn't their assumption a bit weird? Would Nim create significantly different binary structures to a program written directly in C?
14:33:22FromDiscord<mratsim> In reply to @PMunch "<@420949929062563842>, isn't their assumption": Antivirus are dumb pattern matching engine
14:33:33FromDiscord<mratsim> pattern is different, "does not match"
14:33:39PMunchYeah I know, but I thought that was based on fingerprinting
14:33:52PMunchSo as soon as a Nim program is fingerprinted it would be the same thing
14:34:09federico3@mratsim: some have heuristics and some even more
14:34:33FromGitter<Araq> yeah, but it's a quick way to fight the antivir until it catches up
14:34:50FromDiscord<Rika> what is the fundamental difference of rust's "async" and everyone elses?
14:35:04PMunchThis seems to be more about disecting the binary structure and finding "suspicious" things so the binary can be flagged
14:35:51federico3yet the article is very vague and even writes "focused on traditional binaries compiled in C/C++ style languages"... but Nim binaries are usually generated from C
14:35:58PMunchTBH I think it's less about detection and more about low level of technical debt and company structure means you can try out whichever language you want
14:36:25FromDiscord<Rika> i think its more because nim is another layer of translation
14:36:33PMunchExactly, that's why I was wondering if Nim did something weird to the binary structure itself, which I don't think it does
14:36:36FromDiscord<Rika> ya know, more translations mean more confusion
14:36:48PMunchHmm, maybe
14:36:58PMunchI would be interested in seeing some Nim malware
14:37:20PMunchCurious to see how well-written it is
14:37:46FromDiscord<mratsim> malware that you can see is probably not a good malware, nowadays they are hidden ;;)
14:37:49FromDiscord<mratsim> https://github.com/byt3bl33d3r/OffensiveNim
14:37:59*vicfred joined #nim
14:38:15federico3no, if anything an application written in plain C has less known patterns than one in Nim
14:38:25FromGitter<Araq> the Nim idioms translate to C that uses Nim's runtime and is easily quite different from "native C"
14:38:53PMunchI think these points are more of the reason to pick Nim: https://github.com/byt3bl33d3r/OffensiveNim#why-nim
14:38:53FromGitter<Araq> you can usually also tell if a binary was produced by C++ rather than C for the same reasons
14:39:02FromDiscord<mratsim> still, when you look at the assembly, it really ressembles C
14:39:23FromDiscord<mratsim> I stare at Nim / C assembly quite often.
14:39:24*asdflkj_2 quit (Ping timeout: 240 seconds)
14:39:46FromDiscord<mratsim> not sure for branchy code though, Nim for/while/gogo label transformations might do weird things
14:39:50federico3however some heuristics might be looking for patterns generated by popular libraries in C
14:40:06PMunchSlim binaries that can be compiled to anywhere. 0-layer access to C/C++ and assembly so if you need to do some "tricks" it would be trivial.
14:40:10federico3and alarm if they find such thing in unexpected places
14:40:28PMunchAnd the point "Avoids making you actually write in C/C++" I think we can all relate to
14:41:02FromDiscord<dom96> Let's just hope they don't add even more stupid rules that will autoflag any Nim programs as malware
14:41:07FromGitter<Araq> give me a binary file and I can tell you which language it comes from. Unless it's mratsim's code, of course
14:41:14FromDiscord<Rika> no one answered my rust vs everyone's async question 😦
14:41:31FromDiscord<mratsim> In reply to @Araq "give me a binary": Uh? what did my code do xD
14:41:35PMunch@Rika, sorry I have no idea, but I'm curious as well.
14:41:39FromDiscord<dom96> From my experience there are many stupid antiviruses, some freak out if your binary dares to staticRead an executable
14:41:40FromDiscord<Rika> the link dom sent makes it really sound like rust's async changes everything
14:41:47PMunch@dom96, are you planning on doing a similar experiment with Nim async?
14:41:56FromDiscord<Rika> which i, of course, have a hard time believing
14:42:21FromDiscord<mratsim> In reply to @Rika "the link dom sent": I think the benchmark are flawed, Rust async context switch looks really slow given their design choice
14:42:32FromDiscord<dom96> PMunch: I don't think so, I'd rather focus on making Nim's async work better with Nim's parallelism
14:42:40FromDiscord<mratsim> they should switch in less than 4 nanoseconds
14:42:46PMunch@Rika, if anything it looks like "async might not be as good compared to a threadpool as you think"
14:43:05FromGitter<Araq> mratsim: C++'s runtime is different from Nim's which is different from C's which is different from Rust's
14:43:17FromGitter<Araq> that's all I meant to say
14:43:24FromDiscord<mratsim> and my code runtime?
14:43:26PMunch@dom96, probably a good idea, I was just curious. I've been playing around a bit with similar ideas just for fun
14:43:31FromDiscord<Rika> whats so special with mratsim's code tho lmao
14:43:42FromGitter<Araq> and usually nobody avoids the runtime on the startup sequence and in non-critical code sections
14:44:11FromGitter<Araq> so you can tell, it doesn't matter that your super optimized inner loops look like handcoded assembler
14:44:15PMunchI was thinking of combining my fibers/coroutine stuff with my colourless async, and my simple work-stealing algorithm and see if I could get something similar to async running across thread without having to flag everything as async
14:44:32FromDiscord<mratsim> color is good
14:44:40FromDiscord<mratsim> I want to know if a proc can suspend
14:45:03PMunchYou will still have colour
14:45:04FromDiscord<mratsim> there is a reason why evolution gave us the ability to perceive colors.
14:45:09PMunchJust no discrimination based on colour :P
14:45:15FromDiscord<dom96> haha
14:45:24FromGitter<Araq> different colors are inconsistent
14:45:32PMunchSo you can call async from a non-async and non-async from async
14:45:34FromDiscord<mratsim> are you an artist now?
14:45:35FromGitter<Araq> colors were a bad idea.
14:45:51FromDiscord<mratsim> colors are the spice to the world
14:45:52FromDiscord<dom96> All you need is a mechanism by which to change red into green πŸ˜‰
14:45:57PMunchAlong with passing async things into places that expects a sync callback for example
14:46:16FromDiscord<mratsim> you will have an issue with fibers and calling convention.
14:46:27PMunchOh?
14:46:30FromDiscord<Rika> i wish i saw the difference between red and green
14:46:40FromDiscord<mratsim> you have things to do to save/restor stackframes
14:46:59FromDiscord<mratsim> meaning calling a fiber and a non-fiber is differet == color
14:47:08FromDiscord<mratsim> or you compile 2 versions
14:47:13FromDiscord<mratsim> which is what Cilk does.
14:48:09FromDiscord<mratsim> Embrace continuations and make both async and threading use continuation as the base layer.
14:48:17FromDiscord<mratsim> and then no compat issue.
14:48:38FromGitter<Araq> mratsim: please write the RFC
14:49:02FromDiscord<mratsim> https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md
14:49:20FromDiscord<mratsim> still WIP because I need to (re)write an implementation
14:49:48FromDiscord<mratsim> but there are examples in this branch on where I stopped: https://github.com/disruptek/cps/tree/mratsim-public-api-proposal/mratsim
14:52:17FromGitter<Araq> tell me one thing please (I will also study your article): since you have a thread pool, every thread runs a task on its own stack but then you said you don't need "cactus" stacks
14:53:05FromDiscord<mratsim> I don't understand the question.
14:53:26FromGitter<Araq> so you need to do some copying into the task. but only if the task will run on a different thread. otherwise you could skip the copy step
14:53:55FromGitter<Araq> do you do anything like that or do you always copy?
14:54:44FromGitter<Araq> (for example, how to send 'var buf: array[5000, char]' to the task queue)
14:55:06FromDiscord<mratsim> Cactus stacks are needed in 2 cases:↡- You use fibers and you manipulate the stask pointers on function entry↡- You want to do continuation-stealing (Cilk style) because it's more efficient than child-stealing (OpenMP, TBB, Weave): https://github.com/weavers-guild/weave-io/blob/master/research/n3872%20-%20work-stealing%20continuations%20or%20child%20tasks.pdf
14:55:57FromDiscord<mratsim> for buffers, you copy or send a pointer (and you have to deal with ownership)
14:56:22FromGitter<Araq> you cannot send a pointer, the stack frame is about to disappear
14:56:29FromDiscord<mratsim> The buffer issues is creating problems in Rust to support completion ased API like io-uring and IOCP
14:56:46FromGitter<Araq> (in the general case)
14:57:24FromGitter<Araq> what you can do is to have the buffer inside a .consumable proc and then the compiler creates it on the heap from the beginning
14:57:37FromDiscord<mratsim> yes, that's the problem of Rust zero-cost futures and IOCP, there are cases where the buffer needs to be on the heap with clear ownership: https://github.com/weavers-guild/weave-io/blob/master/research/async_await_cancellation_rust_matthias247.md
14:57:52FromGitter<Araq> so the buffer always is the environment and doesn't have to be copied
14:58:01FromGitter<Araq> no matter if the same thread picks it up or not
14:58:10FromDiscord<mratsim> yes
14:59:18*clyybber joined #nim
14:59:26*asdflkj_2 joined #nim
14:59:50FromDiscord<mratsim> but your buffer is passed as a parameter to the function? `proc readFrom(buf: var buffer[4096], conn: Socket) {.resumable.}` or is it created internally?
15:01:43FromGitter<Araq> if it's a parameter, there is little you can do.
15:02:06FromGitter<Araq> if it's created "internally", there is hope the compiler puts it into the environment
15:02:26FromDiscord<mratsim> if it's internal and it crosses a suspension point it will be part of the environment. regarding the copyno-copy it's an optimization.
15:02:48FromDiscord<mratsim> this is similar to "heap allocation elision"
15:03:23FromDiscord<mratsim> if the compiler sees that the continuations/coroutines is only used in the creating scope, there is no need to put it on the heap
15:04:06FromDiscord<mratsim> In C++, Clang is able to do constant folding across stack coroutines: https://godbolt.org/g/26viuZ
15:04:34FromGitter<Araq> I don't mind heap elision optimizations and we have the technology ready for it (it's not that different from escape analysis, deep immutability or anything we already do)
15:05:09FromDiscord<mratsim> for the copy no-copy, I'm pretty sure disruptek's code does directly create the environment
15:05:25FromDiscord<mratsim> and then use template a: untyped = env.a
15:05:40FromGitter<Araq> but I wonder if an explicit `task` isn't the better idea
15:06:30FromGitter<Araq> I'm also not a big fan of our traditional closures for the same reason
15:06:39FromDiscord<mratsim> I somewhat hint at this i think. A Future is a coroutine for example
15:06:58FromGitter<Araq> it's a poor man's object system that is problematic for serializations
15:09:28FromDiscord<mratsim> What I'd like is for closures is: being able to capture variables myself, and the resulting closure can be manually memory managed
15:10:03FromDiscord<mratsim> I don't mind having to specify the variables to capture.
15:10:10FromDiscord<mratsim> This is what i do in Weave.
15:10:57FromDiscord<mratsim> and for sequences/arrays, I'm not too sure how that can work, would have to look into Rust, but having to do foo[0].unsafeAddr is very annoying.
15:11:25FromDiscord<mratsim> I assume Async and openarrays is similarly problematic.
15:14:11FromDiscord<konsumlamm> would it be viable to automatically use rlwrap for `nim secret`?
15:15:17FromDiscord<mratsim> ssshhhhhh you said the forbidden word
15:15:29FromDiscord<mratsim> I'm sad to let you go, you were a valuable member of the community
15:15:58FromDiscord<konsumlamm> k, one last question, is the forbidden word "secret" or "viable"?
15:16:06FromDiscord<Rika> you did too mratsim ,you're not allowed to say rst uncensored
15:16:13FromDiscord<mratsim> please reflect on your action in the corner :p
15:16:15FromDiscord<Rika> ~~dont mind me doing such as well a few minutes ago~~
15:16:48FromDiscord<mratsim> nim scret is really a stopgap and any change would have to be really small and not cause maintenance burden.
15:17:15Clonkk[m]Inim is a better REPL than the REPL we shouldn't talk about (apparently)
15:17:30FromDiscord<mratsim> "nim voldemort"
15:17:45Clonkk[m]Because Nim doesn't have a nose ?
15:17:46FromDiscord<mratsim> (that was a joke btw)
15:18:06FromDiscord<konsumlamm> i mean, it works pretty well for small test cases, but the missing navigation is a huge bummer
15:18:15Clonkk[m]``nimble install inim``
15:18:28Clonkk[m]And all your dreams will come true
15:19:07FromDiscord<Rika> if i install inim will i immediately become as smart as mratsim?
15:19:41Clonkk[m]So anyway how's the weather today ?
15:21:50FromDiscord<konsumlamm> or i do `alias inim='rlwrap nim secret'` :P
15:21:56FromDiscord<konsumlamm> (sorry, i said it again)
15:22:01FromGitter<Araq> mratsim: defunctionalize the continuation
15:22:06FromGitter<Araq> http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html
15:22:24FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Pax
15:22:35*MarderIII quit (Quit: Leaving)
15:22:35FromDiscord<haxscramper> Though it is kind of strange, because just using REPL api https://github.com/haxscramper/hax-nim/blob/master/compilerapi/test6.nim seems to work just fine
15:22:50FromDiscord<haxscramper> I.e. is error-resistant
15:25:02haxscramperAfter reading python's pattern matching comments from HN (mostly just flames) I decided to test some of the patterns from pep 636 to test overall similarity. In the end I found out that our implementation is *very* similar API-wise, but has almost none of the pitfalls that people were annoyed in comments
15:25:10FromDiscord<konsumlamm> i just realized that `fusion/matching` supports view patterns (<https://gitlab.haskell.org/ghc/ghc/-/wikis/view-patterns>) through object patterns
15:26:03FromDiscord<konsumlamm> well, we have no by-position matching for objects (while python does)
15:26:27FromDiscord<mratsim> In reply to @Araq "http://www.pathsensitive.com/2019/07/the-best-refac": @Araq, what do you mean defunctionalizing continuations? LLVM devs while looking into C++ and Swift coroutines found out that keeping a coroutines as function as long as possible was way more optimization friendly than turning it into a state machines. Compilers are very good at folding across functions: https://llvm.org/devmtg/2016-11/Slides/Nishanov-LLVMCoroutine
15:26:56FromDiscord<konsumlamm> but i feel like most complaints are about `a` binding a variable instead of comparing to an existing `a`, which is kinda stupid to assume for pattern matching, given that that's how it works basically everywhere
15:26:58FromDiscord<haxscramper> In reply to @konsumlamm "well, we have no": we do have it in form of custom unpackers, but yes, this is different, and to be honestly I never understood the need for positional match in objects
15:27:06FromDiscord<haxscramper> Because this is insanely error-prone
15:27:21FromDiscord<haxscramper> Just add field somewhere in the middle and now all patterns are broken
15:27:29FromDiscord<konsumlamm> it's not for things like Option or Result
15:29:12FromDiscord<konsumlamm> in Rust for example, if your variants/types have fields (structs, "enum structs"), you can only atch by fields and if they don't, you can only match by position (classic enums, tuple structs)
15:29:18Clonkk[m]<FromDiscord "<haxscramper> In reply to @konsu"> I think it's just a matter of people being comfortable with writing this way.
15:31:42FromDiscord<konsumlamm> though tbf, for Nim that distinction doesn't exist
15:31:48FromGitter<Araq> mratsim: I'm well aware but I care more about being able to send things or store it to disk than I care about 4% differences in performance, esp if it's connected to my ability to understand the code
15:32:52FromDiscord<mratsim> your continuation is always proc cont(env: var Env)
15:32:58FromDiscord<mratsim> the env is serializable
15:33:24FromGitter<Araq> "you cannot send a function" is a perfect summary, it's why I use enum flags and not callbacks if I can
15:33:32FromDiscord<haxscramper> In reply to @konsumlamm "though tbf, for Nim": We have named tuples that kind of blur the line - you can do `(name: 12)[0]` and `(name: 12).name` , and they are used quite often
15:34:50FromDiscord<konsumlamm> mm, though named tuples aren't distinct, are they?
15:35:22FromDiscord<haxscramper> !eval let test: tuple[a: int, b: int] = (1, 2); echo test
15:35:24NimBot(a: 1, b: 2)
15:35:30FromDiscord<haxscramper> !eval let test = (1, 2); echo test
15:35:32NimBot(1, 2)
15:36:41FromDiscord<haxscramper> But actually right now `(name: <pattern>, <pattern>)` is explicitly checked for and disallowed
15:36:53FromDiscord<konsumlamm> i mean if you do two `type A = tuple ...`, they'll just be aliases
15:37:18FromDiscord<haxscramper> Yes, just aliases
15:37:56FromDiscord<konsumlamm> so matching by position with the type name wouldn't make much sense there anyway
15:42:07*PMunch quit (Quit: leaving)
15:44:09FromDiscord<mratsim> In reply to @Araq ""you cannot send a": @Araq, how do you execute your object?
15:45:32FromDiscord<mratsim> either you have a function that is a state machine and there is an enum token that tells what branch of the state machine you can resume, this is similar to the current closure iterators
15:45:58FromDiscord<mratsim> or you have a function that just calls other functions, which is similar to disruptek's CPS.
15:48:56FromDiscord<mratsim> you can't serialize a JS payload when you put your continuations/coroutines to disk. you have to assume that the receiver as the address of the next function to call in the binary.
15:49:10FromDiscord<mratsim> has the address
15:55:29FromGitter<Araq> if the enum token is hidden you cannot send it easily
16:00:14*jaens[m] quit (Quit: Idle for 30+ days)
16:14:47FromDiscord<mratsim> the enum token is in the env
16:15:16FromDiscord<mratsim> is it not for Nim closur e iterators?
16:15:28FromGitter<Araq> it is.
16:17:32*MarderIII joined #nim
16:18:14FromDiscord<mratsim> then what do you want to serialize that causes issue?
16:18:24FromGitter<Araq> if the continuation is a proc like `proc cont(env: var Env)` that's harder to send than an enum.
16:19:20FromDiscord<mratsim> I think there is a misunderstanding
16:20:25FromDiscord<mratsim> Here are the inner impl of a continuation: https://github.com/weavers-guild/weave-io/tree/master/implementation#the-innards-of-resumable-functions
16:20:54FromDiscord<mratsim> the env/frame which is data, is the only thing you need to send
16:27:13FromGitter<Araq> because you keep an enum in the Env and that's used for dispatching?
16:28:39FromDiscord<mratsim> yes
16:28:58FromDiscord<mratsim> if you use the state machine version that's what you do
16:29:13FromDiscord<mratsim> if you use the proc version, you change the proc address.
16:29:19FromGitter<Araq> thanks, good to know.
16:29:27FromGitter<Araq> ah so you have two versions
16:30:00FromGitter<Araq> the proc version is probably easier to use as the transformation doesn't have to see the full async body
16:30:05FromDiscord<mratsim> Disruptek has a proc version, either mutating proc where it's modified in-place or immutable, where a continuationProc is `proc foo(c: Continuation): COntinuation`
16:30:31FromDiscord<mratsim> He and Zevv thought I could explore the state machine version especially given that I have SYnthesis.
16:31:29FromDiscord<mratsim> personally I doesn't really matter. I think that unfortunately the "disappearing coroutines" from C++ will be too hard to do, first of all it seems to be very sensitive to what construct you use
16:31:36leorizea small reminder that disruptek's cps is still blocked by compiler bugs
16:31:36FromDiscord<mratsim> and neither GCC or MSVC supports it.
16:31:52leorizethough I'm not sure how important it would be now that disruptek stopped development on all nim stuff
16:32:13FromDiscord<mratsim> it's blocked by bugs related to types and macro no? :/
16:32:44FromDiscord<mratsim> CPS is still important
16:33:53FromGitter<Araq> I've said it elsewhere. if the transformation is too complex for today's macro system, write it as a transformation in the Nim compiler.
16:34:10FromGitter<Araq> the ASTs are identical
16:34:46leorizeit's just a testament of how broken the current macro system is
16:35:10leorizeif we fix the bugs blocking cps, we will end up fixing a lot of macro issues
16:35:21leorizecps is not too complicated that it can't be done in Nim's macro
16:35:31FromDiscord<mratsim> it's not macros that are buggy
16:35:37FromGitter<Araq> well we don't even have a spec for `typed` ASTs
16:35:42FromDiscord<mratsim> it's what you get from `getTypeInst` and friends
16:35:53FromGitter<Araq> it's futile to "fix" it all without a spec
16:35:59FromDiscord<mratsim> sometimes you get T, sometimes you get seq[int]
16:36:16FromDiscord<mratsim> and sometimes you get Alias
16:36:33FromDiscord<mratsim> well not exactly but you see what I mean
16:37:02FromDiscord<mratsim> and "sameType" doesn't work properly
16:37:19FromDiscord<mratsim> and you can't use "is" because typedesc are turned into NimNode.
16:39:58FromGitter<Araq> same, `getTypeInst` has no real spec, I don't know how it needs to work really, can't fix it then
16:40:17FromGitter<Araq> previously the development was based on "ugh, I think this should work..."
16:40:48FromGitter<Araq> I'm tired of "I think this should work" based language evolution
16:41:58FromGitter<Araq> extra points for mentioning "consistency" in your bug reports
16:42:43*MarderIII quit (Quit: Leaving)
16:43:39FromDiscord<ElegantBeef> I've never felt so attack by a sentence before
16:43:43FromDiscord<ElegantBeef> (edit) "attack" => "attacked"
16:45:40*leorize quit (Ping timeout: 268 seconds)
16:54:51*asdflkj_2 quit (Quit: WeeChat 2.8)
16:55:07*asdflkj_2 joined #nim
17:07:28*krux02 joined #nim
17:11:07FromGitter<Araq> Chronos is green with --gc:orc :-)
17:12:08FromDiscord<Yardanico> @treeform thanks for flatty! I wonder if you can add support for OrderedTable and CountTable as well to normal Table s - I tried doing this without duplicating the procs but then it doesn't really work
17:13:59FromDiscord<Yardanico> ok I think I made it work
17:14:03FromDiscord<Yardanico> but I'm not sure if my way is the best
17:14:10FromDiscord<Yardanico> proc toFlatty[K, V](s: var string, x: Table[K, V] | OrderedTable[K, V] | CountTable[K])↡proc fromFlatty[K, V; T: Table[K, V] | OrderedTable[K, V] | CountTable[K]](s: string, i: var int, x: var T)
17:14:21FromDiscord<Yardanico> `proc toFlatty[K, V](s: var string, x: Table[K, V] | OrderedTable[K, V] | CountTable[K])`
17:14:23FromDiscord<Yardanico> `proc fromFlatty[K, V; T: Table[K, V] | OrderedTable[K, V] | CountTable[K]](s: string, i: var int, x: var T)`
17:14:38FromDiscord<Yardanico> So when you change proc definitions for the Table procs to this it all seems to work
17:16:57FromDiscord<Yardanico> ah wait, this is wrong for CountTable
17:23:13Amun_Raare there plans to add timeout to asyncsocket's recvline? I often find recvline just hangs on closed socket without returning an empty string
17:25:54FromDiscord<Yardanico> you can use withTimeout
17:26:23FromDiscord<Yardanico> no async socket procs have a timeout because there's https://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint
17:32:34Amun_RaYardanico: I haven't noticed that, thanks
17:41:45FromDiscord<konsumlamm> is there any difference between `cast[int]` and `ord` for ordinals?
17:42:04FromDiscord<Yardanico> the former is considered unsafe :)
17:42:13FromDiscord<Yardanico> also yes, there is difference
17:42:37FromDiscord<Yardanico> in some cases
17:43:54FromDiscord<Yardanico> hmm weird
17:45:51FromDiscord<Yardanico> Apparently `ord` is broken (and behaves just like cast[int]) when you try to ord a 64-bit int on a 32-bit platform
17:46:27FromDiscord<Yardanico> well, it's because ord returns the platforms' int which is 32-bit in case of 32-bit platform
17:50:50FromDiscord<exelotl> it could be neat if `[:` syntax worked with casting
17:51:08FromDiscord<Yardanico> you mean .cast[:in32] ?
17:51:11FromDiscord<Yardanico> (edit) ".cast[:in32]" => ".cast[:int32]"
17:51:14FromDiscord<Yardanico> (edit) ".cast[:int32]" => "val.cast[:int32]"
17:51:17FromDiscord<exelotl> yeah
17:51:21FromDiscord<~355/113 Man> do cases have to use compile time known values?
17:51:34FromDiscord<Yardanico> wdym? you can "case" on a runtime value
17:51:51FromDiscord<~355/113 Man> oh wait nvm, I forgot to remove an `==` when converting from if to case
17:51:53FromDiscord<Yardanico> but values in branches have to be compile time known values (i mean `of value`)
17:51:56FromDiscord<~355/113 Man> weird error
17:52:06FromDiscord<~355/113 Man> `cannot evaluate at compile time: event` that was the error
17:54:04FromDiscord<Yardanico> @konsumlamm to answer your question: I think they both will return the same value, but using `ord` is better
17:54:54FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Pbu
17:55:18FromDiscord<exelotl> is the same as doing `case: of false:`
17:55:40FromDiscord<exelotl> but if you change x and y to `let` or `var` it's no longer legal
17:56:58FromDiscord<Yardanico> IMO for branches like these it's better to use `elif` to show their "difference"
17:57:52FromDiscord<Yardanico> wait nvm
17:57:56FromDiscord<exelotl> yeah I don't think I would ever write a branch like this, just trying to illustrate what the compiler was thinking when it gave that error x)
17:58:55FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pbx
17:59:24FromDiscord<Yardanico> so yeah, the error then was because one of the parts in your == expression was not evaluatable at compile-time
17:59:27FromDiscord<~355/113 Man> ~~also I have like 20 nim tabs open on firefox now lol~~
17:59:33FromDiscord<Yardanico> I mean it can look like a bad error, but it's logical
17:59:39*tane joined #nim
17:59:50FromDiscord<~355/113 Man> so the `of` statements have to be compiletime?
17:59:54FromDiscord<Yardanico> yes
18:00:05FromDiscord<~355/113 Man> yep ok, that error makes sense then
18:00:19FromDiscord<Yardanico> "Because case statements are checked for exhaustiveness during semantic analysis, the value in every of branch must be a constant expression. This restriction also allows the compiler to generate more performant code."
18:00:37FromDiscord<konsumlamm> @Yardanico the reason i'm asking is because `packedsets` uses `cast[int]` in a few plces for no apparent reason
18:02:31FromDiscord<Yardanico> you can make a PR
18:05:08FromDiscord<konsumlamm> kk
18:06:30FromDiscord<konsumlamm> conversion between `int` and `uint` can be done by using the types like functions, right?
18:06:51FromDiscord<Yardanico> yes, if you want to convert (have the same number value)
18:08:32FromDiscord<konsumlamm> oh, so there it makes a difference if i use `cast`
18:08:42FromDiscord<Yardanico> yes
18:08:43FromDiscord<mratsim> cast and convert are equivalent for integers
18:08:50FromDiscord<mratsim> except that convert does runtime value checks
18:09:00FromDiscord<mratsim> it's a bit unfortunate.
18:09:24FromDiscord<konsumlamm> but `ord` doesn't do any runtime checks, does it?
18:09:49FromDiscord<mratsim> you can cast[uint8](uint64) even though they don't have the same size iirc and that's only possible for integer
18:10:09FromDiscord<Yardanico> @mratsim but they're not equivalent between int and uint, are they?
18:10:13FromDiscord<mratsim> ord is basically byte(char)
18:10:27FromDiscord<mratsim> In reply to @Yardanico "<@!570268431522201601> but they're not": yes, there are runtime check for signed conversion
18:10:39FromDiscord<mratsim> so no no check
18:10:45FromDiscord<mratsim> because all char maps to an integer
18:11:38FromDiscord<mratsim> it's just the rule about "you can only cast between types of the same size" that doesn't apply to integer that I find unfortunate
18:16:12FromDiscord<treeform> @Yardanico thank you for the PR.
18:16:16FromDiscord<Yardanico> np :)
18:16:20FromDiscord<treeform> πŸ™‚
18:16:44FromDiscord<Yardanico> will you make a new release?
18:16:56FromDiscord<treeform> no, I will now
18:17:52FromDiscord<treeform> done 0.2.1
18:18:29FromDiscord<treeform> (edit) removed "no,"
18:24:07FromDiscord<Yardanico> @treeform oh, there's a problem with ref tables - they don't take the table code path but rather the generic one, here's one way to make them do so - https://gist.github.com/Yardanico/1e9a75874ace4672689e1fce085fc804
18:24:35FromDiscord<Yardanico> it basically checks if flatty has toFlatty proc for T from ref T, and if it does, uses that instead of the generic path
18:25:18FromDiscord<treeform> neat
18:25:44FromDiscord<Yardanico> this will work for any other refs of types that have flatty-specific procs as well
18:28:06FromDiscord<treeform> hmm does not appear to work
18:28:40FromDiscord<treeform> getting nil errors, tried `new(x)`
18:28:49FromDiscord<Yardanico> huh?
18:30:58FromDiscord<treeform> can you PR the code that you have?
18:31:12FromDiscord<treeform> the patch crashes for me, maybe you have extra stuff some place else?
18:31:16*hyiltiz quit (Ping timeout: 265 seconds)
18:31:39*hyiltiz joined #nim
18:33:21FromDiscord<treeform> No need I figured it out, I put the new() in the toFlatty case!
18:33:26FromDiscord<treeform> me dump
18:34:56FromDiscord<treeform> https://github.com/treeform/flatty/commit/5c57a24840fd1fc45c96622ea14b294d5c41a386
18:54:22*SebastianM joined #nim
18:57:45*xet7 joined #nim
18:59:36FromDiscord<dom96> hello hello
19:00:16FromDiscord<treeform> Hey, dom96 how are you?
19:00:38FromDiscord<hamidb80> Did anyone try Karax?
19:00:57FromDiscord<treeform> I think dom96 tried it once.
19:00:59FromDiscord<dom96> I'm alright, happy that it's Friday
19:01:03FromDiscord<dom96> How are you? πŸ™‚
19:01:09FromDiscord<treeform> Fridays are great, no meetings.
19:01:13FromDiscord<dom96> @hamidb80 I've built Nimforum using it
19:01:28FromDiscord<dom96> We've got no meetings wednesdays
19:01:49FromDiscord<treeform> I have that too, but its a bonus when it happens on Fridays
19:01:53FromDiscord<hamidb80> In reply to @dom96 "<@!745944009918251010> I've built Nimforum": Really? This? https://forum.nim-lang.org/
19:01:59FromDiscord<dom96> In reply to @hamidb80 "Really? This? https://forum.nim-lang.org/": yep
19:02:02FromDiscord<treeform> yep
19:02:18FromDiscord<hamidb80> In reply to @dom96 "yep": Is it open source?
19:02:32FromDiscord<dom96> Yep: https://github.com/nim-lang/nimforum/
19:02:34FromDiscord<~355/113 Man> can nim compile to dll?
19:02:46FromDiscord<hamidb80> In reply to @dom96 "Yep: https://github.com/nim-lang/nimforum/": Tnx
19:03:13FromDiscord<treeform> In reply to @~355/113 Man "can nim compile to": yes `nim c --app:lib`
19:03:23FromDiscord<~355/113 Man> or in another way be used as a lib for a C++ project?
19:03:26FromDiscord<~355/113 Man> cool
19:04:32FromDiscord<treeform> In reply to @~355/113 Man "or in another way": is probably best to make a c style lib and use that from C++. Some thing like this maybe: https://github.com/sdwfrost/nim-shared-object-example
19:05:17FromDiscord<treeform> I have integrated with C++ and ObjC before but its more pain and not as a dll.
19:05:28*waleee-cl joined #nim
19:06:32FromDiscord<~355/113 Man> C is fine
19:07:06FromGitter<Araq> nobody cheers :-/ Chronos works with --gc:orc
19:07:20FromDiscord<~355/113 Man> is there anything I need to pay attention to on the nim side as far as things like function/proc names and types and calls?
19:07:45FromDiscord<~355/113 Man> I might make the first VR game written mostly in Nim lol
19:07:55FromDiscord<~355/113 Man> (if it hasn't been done already)
19:08:34FromDiscord<treeform> Araq, what is Chronos?
19:09:09FromDiscord<treeform> this https://github.com/status-im/nim-chronos better async?
19:09:13FromGitter<Araq> yes
19:09:46FromDiscord<treeform> why was it hard? We don't know. Would love more marketing materials in form of blog posts/videos.
19:09:54FromDiscord<treeform> We don't know what to cheer for if we don't know what it is.
19:10:07FromDiscord<haxscramper> In reply to @~355/113 Man "is there anything I": IIRC you should look into `{.bycopy.}` pragma (though it is necessary for using C code in nim, not sure if it is mandatory the other way around). `ARC` would give you better results (probably) when creating C/C++ library in nim
19:10:34FromDiscord<~355/113 Man> `ARC`?
19:10:38FromDiscord<haxscramper> `{.exportc: .` can (?) take function name, so you don't need to specifically play around it
19:10:53FromDiscord<haxscramper> In reply to @~355/113 Man "`ARC`?": `--gc:arc` https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
19:11:32*xet7 quit (Remote host closed the connection)
19:11:41FromDiscord<haxscramper> Our new memory management system
19:12:01FromGitter<Araq> treeform: it took a couple of days
19:12:17*xet7 joined #nim
19:12:42FromDiscord<treeform> Araq, its kind of odd to me, I feel like I follow nim everyday, but I seem miss all of the important nim milestones... have no clue what fusion, chronos etc... what are the top nim priorities now... I wish those things would be more visible some how 😦
19:13:03FromGitter<Araq> @leorize is trying to tell me how to do that
19:13:13FromGitter<Araq> I'm listening but so far I don't know
19:13:34federico3treeform: https://forum.nim-lang.org/t/7457
19:14:10FromDiscord<haxscramper> In reply to @treeform "Araq, its kind of": Maybe we could reiterate on key points in "this month in nim"
19:14:49FromDiscord<mratsim> In reply to @treeform "Araq, its kind of": I never used fusion and never missed it. Change my mind.
19:15:09FromDiscord<haxscramper> sad pattern matching sounds
19:15:33FromDiscord<mratsim> maybe i should try the ast builder in there as well
19:15:44FromDiscord<haxscramper> But I doubt you really need fusion, especially considering what you are working on most of the time
19:15:45FromDiscord<mratsim> but I'm fine with planting newTree
19:16:35FromGitter<Araq> mratsim: fwiw we figured out how Fusion should work
19:16:38FromDiscord<mratsim> a doc generator would be a good incentive to try fusion πŸ˜‰
19:16:49FromDiscord<mratsim> with hudrogen?
19:16:53FromDiscord<~355/113 Man> can I specify compile args in `.nimble` config?
19:17:00FromDiscord<mratsim> (edit) "hudrogen?" => "hydrogen?"
19:17:06FromDiscord<~355/113 Man> (I assume I can but idk how)
19:17:09FromDiscord<mratsim> use a nim.cfg or config.nims
19:17:23FromDiscord<~355/113 Man> oh, so not in the `.nimble`
19:17:46FromGitter<Araq> should work in the `.nimble` file too
19:17:51FromGitter<Araq> bbl
19:17:59FromDiscord<mratsim> didn't know
19:18:43FromDiscord<mratsim> then this should work in both config.nim or .nimble: https://github.com/status-im/nimbus-eth2/blob/stable/config.nims#L25-L27
19:19:00FromDiscord<mratsim> and the nim.cfg version: https://github.com/mratsim/Arraymancer/blob/master/nim.cfg#L9-L25
19:19:54FromDiscord<mratsim> and you can scope the flags: https://github.com/status-im/nimbus-eth2/blob/stable/tests/all_tests.nim.cfg
19:20:08FromDiscord<mratsim> by using filename.nim.cfg
19:20:31FromDiscord<~355/113 Man> so ↡`switch("passL, "--gc:ocr")`?
19:20:31FromDiscord<dom96> I also never used fusion
19:20:39FromDiscord<dom96> also don't see why there is still effort put into it
19:20:57FromDiscord<dom96> just install the packages you need
19:21:16FromDiscord<mratsim> `switch("gc, "orc")`
19:21:26FromDiscord<mratsim> it's the battery included part.
19:21:53FromDiscord<mratsim> a certain standard of review/quality as well (or at least I hope)
19:22:26federico3I'd be curious to see something like https://hotwire.dev/ in karax or as a karax alternative
19:22:34FromDiscord<dom96> so far it just seems like a dumping ground for what should be perfectly good packages that stand on their own
19:22:52FromDiscord<haxscramper> In reply to @dom96 "also don't see why": I view it mostly as consolidation effort for cases where we have multiple existing implementation, to the point it is clear that some standartisation is necessary
19:23:01FromDiscord<dom96> federico3: json is plenty fast
19:23:06FromDiscord<haxscramper> But not that necessary to put into stdlib
19:23:08FromDiscord<~355/113 Man> do I have to put in in a `task build` in the `.nimble`?
19:23:18FromDiscord<~355/113 Man> or can I just have it global
19:23:32FromDiscord<haxscramper> As well as various helper tools and data structures.
19:23:40FromDiscord<dom96> federico3: although server-side rendering for karax would be nice
19:24:10FromDiscord<haxscramper> The problem is that fusion is not advertised enough (like parts of our stdlib too, which has a lot of interesting things)
19:24:22FromDiscord<haxscramper> In reply to @mratsim "a certain standard of": And that holds true as well
19:24:29federico3dom96: it's not only about speed
19:24:55FromDiscord<mratsim> In reply to @dom96 "federico3: json is plenty": json is slow
19:25:11FromDiscord<Recruit_main707> @~355/113 Man i think global is fine
19:25:16FromDiscord<mratsim> the only slowest compiled language than us is Swift
19:25:25FromDiscord<mratsim> and all the others are 2x 3x faster
19:25:41FromDiscord<mratsim> just look at @treeform benches
19:25:54FromDiscord<dom96> @mratsim you're missing the context
19:25:57federico3yep, even Python
19:25:58FromDiscord<Recruit_main707> we cannot advertise speed with this json performance >.>
19:26:01FromDiscord<dom96> it's plenty fast for Karax
19:27:05federico3that depends on you hardware on both server and client side...
19:28:03FromDiscord<mratsim> It's embarassing that languages can be 10x faster here: https://github.com/kostya/benchmarks#json
19:28:50PrestigeWhy is our json parsing so slow
19:29:05FromDiscord<dom96> I've learned over the years that it's enough to worry about the majority who have good enough hardware on both sides
19:29:55FromDiscord<Recruit_main707> tbh even packedJson is not that much faster
19:30:03federico3Prestige: good question
19:30:05FromDiscord<Recruit_main707> but at least we are on top of python and c#
19:30:07FromDiscord<dom96> even so, I ended up writing a thrift binary protocol implementation for stardust
19:30:27FromDiscord<dom96> but json for a real-time online game would have been laughable
19:33:34PrestigeI'm guessing our parsing algo is just bad?
19:34:18FromDiscord<~355/113 Man> oh I see there is a benchmark for multiplying matrices, is this a special thing I can take advantage of?
19:34:46FromDiscord<Recruit_main707> take advantage in what way?
19:35:47FromDiscord<~355/113 Man> like some special annotation or proc rather than just individually calculating each component, like hardware acceleration or something?
19:36:50federico3I opened https://github.com/nim-lang/Nim/issues/12152 but it has been closed
19:42:53*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
19:44:25PrestigeInteresting read
19:45:16PrestigeSo it's recommended to use packedjson and not the standard library?
19:47:53FromDiscord<ElegantBeef> I believe it depends completely on what you want, cause the `json` module in stdlib is one of the few that allows you to manually interact with the json tree afaik
19:48:43FromDiscord<ElegantBeef> It's how all the other json libraries get their speed, they dont have an intermediate Nim object representation, atleast i think that's what treeform said for jsony
19:49:42PrestigeYeah that makes sense
19:50:39federico3IMO loading and then modifying JSON data is a very uncommon need
19:51:04FromDiscord<ElegantBeef> Yea manually interacting with the json is very unlikely
19:51:49federico3also, often you don't need to access every value, only some
19:51:51FromDiscord<ElegantBeef> It happens but it's rare, since i use a json file for the config of my auto builder i do it there for more informational error messages/edge case handling
19:52:32federico3...therefore the stdib json could be optimized for fast "read-only" load
19:53:35FromDiscord<~355/113 Man> does Nim have function pointers or something similar?
19:53:43FromDiscord<~355/113 Man> (edit) "similar?" => "similar like function objects?"
19:53:54FromDiscord<~355/113 Man> for callbacks
19:53:58FromDiscord<~355/113 Man> (edit) "for callbacks ... " added "ish"
19:54:30FromDiscord<ElegantBeef> !eval let a = proc(i: int) = echo i; a(100)
19:54:32NimBotCompile failed: /usercode/in.nim(1, 32) Error: undeclared identifier: 'a'
19:54:38FromDiscord<ElegantBeef> Damn it!
19:54:44FromDiscord<ElegantBeef> Yes it does
19:55:36FromDiscord<~355/113 Man> πŸ‘Œ
19:55:50FromDiscord<~355/113 Man> am I asking too many questions πŸ˜›
19:56:07FromDiscord<ElegantBeef> Nah as long as there is someone willing to answer it's not too many
19:56:08PrestigeNah, ask away
20:02:05FromDiscord<~355/113 Man> if I do an import in a sub module, is the import from the project local directory or the sub module local directory?
20:04:39FromDiscord<ElegantBeef> It's module relative
20:05:10FromDiscord<ElegantBeef> so up is `../` and down is `/foldername/module`
20:05:19FromDiscord<~355/113 Man> got it
20:05:54FromDiscord<ElegantBeef> @Recruit_main707 did you ever test `\` on windows again?
20:17:38FromDiscord<konsumlamm> would be cool if someone could take a look at this PR of mine: https://github.com/nim-lang/Nim/pull/16961
20:18:07FromDiscord<ElegantBeef> You didnt resolve any of timothees reviews πŸ˜„
20:21:42FromDiscord<konsumlamm> he also said to leave this to future PRs tho :P
20:22:20FromDiscord<konsumlamm> and one of the comments is about possibly changing the API
20:23:48FromDiscord<ElegantBeef> Yea jokes aside seems better, are you sure the backticked variables render properly in docs?
20:25:17FromDiscord<ElegantBeef> Thought the entire reason for the double back ticks was that the doc replaces those with a div to render them as a block, and the single backticks render as is
20:26:36FromDiscord<ElegantBeef> Ah guess i'm wrong
20:27:43FromDiscord<konsumlamm> double and single backticks have the same effect
20:27:49FromDiscord<ElegantBeef> Yea i had to check to make sure
20:29:55*asdflkj_2 quit (Ping timeout: 272 seconds)
20:31:39FromDiscord<~355/113 Man> can I make an assets directory where `readFile` will try to read from first instead of the modules local directory?
20:35:46FromDiscord<~355/113 Man> doesn't look like it
20:36:00FromDiscord<ElegantBeef> Not without writing code for it, Nico does that exactly
20:36:36FromDiscord<ElegantBeef> Implements an assets folder so you can drop files in there then just use the Nico asset load procedures with paths relative to that folder
20:38:11*nekits07 quit (Quit: The Lounge - https://thelounge.chat)
20:38:47*NimBot joined #nim
20:39:07*nekits07 joined #nim
20:45:30FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pcv
20:46:22FromDiscord<~355/113 Man> is it because the string being passed into the function is a literal?
20:46:39*asdflkj_2 joined #nim
20:46:58FromDiscord<ElegantBeef> yess
20:46:59FromDiscord<ElegantBeef> (edit) "yess" => "yes"
20:47:20FromDiscord<treeform> In reply to @mratsim "It's embarassing that languages": We should make that use my json lib.
20:47:25FromDiscord<~355/113 Man> hmm, any way to get this to work with literals? or am I going to have to save the literals to a variable
20:48:15FromDiscord<ElegantBeef> What are you doing exactly? `"yourShaderHere".compileShader(type)`?
20:48:35FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pcx
20:48:47FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pcy
20:48:59FromDiscord<ElegantBeef> Ok, so yea that's not going to work for two reasons there is no `var string` and you probably want `unsafeaddr` of that cstring
20:49:48FromDiscord<ElegantBeef> literals are immutable so that should've threw an error before that addr issue
20:50:10FromDiscord<~355/113 Man> i'm not editing the string though
20:50:22FromDiscord<ElegantBeef> you pass it into a function that takes a `var string`
20:50:59FromDiscord<~355/113 Man> the `shaderSource: var string` is the result of `readFile`
20:51:28FromDiscord<~355/113 Man> which I guess would be fine making that a variable and passing the variable
20:51:57FromDiscord<ElegantBeef> But yea i see two issues there
20:52:28FromDiscord<ElegantBeef> Dont really need `var string` and you use `addr` instead of `unsafeaddr`
20:52:36FromDiscord<~355/113 Man> the `var string` was to try and allow getting an address
20:52:49FromDiscord<~355/113 Man> unsafeAddr didn't change anything
20:52:59FromDiscord<ElegantBeef> ah then need to bound that cstring first
20:53:37FromDiscord<ElegantBeef> Although Nim strings are nul terminated iirc, so you can just `string[0].unsafeaddr` right?
20:54:10FromDiscord<~355/113 Man> then cast that to `ptr cstring`?
20:54:41FromDiscord<ElegantBeef> yea, probably wiser though to just convert the string to a cstring then pass the first element's addr
20:55:20FromDiscord<ElegantBeef> `let yourPtr= input.cstring[0].unsafeAddr` should work, but i should shut up considering my track record with anything like this πŸ˜›
20:55:54FromDiscord<~355/113 Man> that gets a `ptr char`
20:56:47FromDiscord<~355/113 Man> hmm, it seems it doesn't like the conversion
20:56:50FromDiscord<ElegantBeef> Ah yea then remove the index of first element, when i toyed with the xlib bindings they wanted `ptr cchar`
20:57:08FromDiscord<~355/113 Man> I made the input cstring and now I can get an address
20:57:25FromDiscord<~355/113 Man> but with the input string and a conversion to cstring it didin't work
20:57:35FromDiscord<ElegantBeef> What didnt work?
20:59:35FromDiscord<~355/113 Man> sent a long message, see http://ix.io/2PcC
21:00:39FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2PcG
21:00:49FromDiscord<ElegantBeef> Ah yea the first wont work
21:01:04FromDiscord<ElegantBeef> i was dumb with my let πŸ˜„
21:01:23FromDiscord<ElegantBeef> without assignment it doesnt have an address cause all it did was convert a constant
21:02:07FromDiscord<Solitude> In reply to @ElegantBeef "`let yourPtr= input.cstring[0].unsafeAddr` should": glShaderSource takes ptr ptr char, not ptr char
21:02:32FromDiscord<ElegantBeef> Yea like i said i should've shushed πŸ˜„
21:18:29*rockcavera quit (Read error: Connection reset by peer)
21:18:57*rockcavera joined #nim
21:54:17FromDiscord<exelotl> about allowing foo.cast[:uint32] syntax for casting... Should that be an issue or RFC?
21:54:33FromDiscord<exelotl> it's literally a 1 sentence feature request lol
21:55:02FromDiscord<exelotl> well, it does depend on the future of the [: syntax I guess
22:03:27FromGitter<Araq> I like the [: syntax and doubt it will go away
22:03:53FromGitter<Araq> however, `cast` is designed to be ugly to use and at the same time is easily made better with a custom template
22:04:22FromGitter<Araq> so I cannot imagine your RFC would be accepted, sorry
22:04:35FromGitter<Araq> but you can try, I rarely use my veto powers
22:09:08ForumUpdaterBotNew thread by Mantielero: Templates and include, see https://forum.nim-lang.org/t/7499
22:10:32FromDiscord<exelotl> hehe, okay I'll think about it a bit more before making an RFC
22:15:30ForumUpdaterBotNew question by Alex Craft: How to write macro list.findBy(key, value) in Nim?, see https://stackoverflow.com/questions/66179729/how-to-write-macro-list-findbykey-value-in-nim
22:39:10*clyybber quit (Quit: WeeChat 3.0.1)
22:45:02FromDiscord<ElegantBeef> @treeform so when you see the PR for the googleapi, i read a total of one stack oveflow and the docs for `Cache-Control` so i have no clue if all of the string conversions are properly handled or what actually changes with them, but using `NoCache` and `NoStore` with my unity build system does resolve my friends launcher cache requesting problems
22:45:31FromDiscord<ElegantBeef> Suppose i should've added that to the PR, now that the tests show it works as intended πŸ˜„
23:01:57FromDiscord<treeform> Cool, I am away now, but will take a look at the pr
23:19:21FromDiscord<ElegantBeef> Yea it's not that big of a deal, using my fork atm for the build system so it seems fine
23:36:05FromDiscord<~355/113 Man> hmm, any reason `not` takes precedence over `==`?
23:36:44FromDiscord<~355/113 Man> actually wait, i'm stupid I could just use `!=`
23:37:12FromDiscord<ElegantBeef> It doesnt take precedence over it's the same level https://media.discordapp.net/attachments/371759389889003532/809931139330474044/unknown.png
23:38:18FromDiscord<ElegantBeef> In the manual here if you want to read about it https://nim-lang.org/docs/manual.html#syntax-precedence
23:43:58FromDiscord<~355/113 Man> hmm, I don't seem to be able to open a file and i'm not sure why
23:44:40FromDiscord<~355/113 Man> i'm pretty sure the file path is correct, but i'm getting IO Error
23:44:53*xet7 quit (Remote host closed the connection)
23:44:55FromDiscord<Recruit_main707> relative to the exe?
23:45:11FromDiscord<~355/113 Man> oh
23:45:24FromDiscord<~355/113 Man> I had it relative to the module
23:45:39FromDiscord<~355/113 Man> derp yea that makes sense
23:45:50FromDiscord<Recruit_main707> try that then, im not 100% sure it will work tho
23:46:04FromDiscord<Recruit_main707> i always have to try both things and always forget xd
23:46:19FromDiscord<~355/113 Man> actually I don't think that worked either
23:46:35FromDiscord<~355/113 Man> nope
23:46:36*tane quit (Quit: Leaving)
23:47:26FromDiscord<~355/113 Man> ah, it's local to the .nimble file
23:48:40FromDiscord<ElegantBeef> Well it's relative to your CWD
23:48:49FromDiscord<~355/113 Man> ooooh
23:49:02FromDiscord<ElegantBeef> That's just how binaries tend to work πŸ˜„
23:49:31FromDiscord<~355/113 Man> so it's relative to where the exe is executed from not where the exe is?
23:50:05FromDiscord<ElegantBeef> Just imagine https://nim-lang.org/docs/os.html#getCurrentDir is before all your relative paths
23:51:58FromDiscord<Clyybber> In reply to @ElegantBeef "It doesnt take precedence": but that table is for binary operators only
23:51:58FromDiscord<~355/113 Man> hmm, but the built binary is in bin which where I would need to back out one folder to get to the assets folder, but it `nimble run` only works if I don't back out
23:52:16FromDiscord<Clyybber> unary ops always bind closer
23:52:28FromDiscord<ElegantBeef> Well change the current dir in the binary, or in the a nimble run task
23:52:31FromDiscord<Clyybber> which can be considered "weird" since not looks like a command invocation too
23:52:50FromDiscord<ElegantBeef> https://github.com/ftsf/nico/blob/master/exampleApp/exampleApp.nimble look at what nico does
23:53:06*haxscramper quit (Remote host closed the connection)
23:53:32FromDiscord<ElegantBeef> Yea i mean it says that
23:53:55FromDiscord<ElegantBeef> I guess `not` is a unary op so yea it's bound first, but the same result appears
23:55:13FromDiscord<ElegantBeef> The changing of the directory in the binary will be kinda annoying to do, since it'll move where your terminal is afaik
23:55:25FromDiscord<ElegantBeef> I could be wrong
23:57:06FromDiscord<~355/113 Man> can I use the .nimble to copy the assets folder into bin?
23:57:53FromDiscord<ElegantBeef> https://nim-lang.org/docs/nimscript.html#mvFile%2Cstring%2Cstring
23:58:03FromDiscord<ElegantBeef> got `mvfile` and `mvdir`
23:58:31FromDiscord<ElegantBeef> clyybber do you know if the nim compiler will ever ship with libffi enabled by default?
23:58:45FromDiscord<Recruit_main707> Why is multiprocessing with Nim so unusual, I can’t find any examples