00:00:17FromDiscord<ElegantBeef> Something similar with nico/nimscripter would be awesome
00:00:22FromDiscord<ElegantBeef> Sorta pico-8 like
00:00:45FromDiscord<ElegantBeef> Or insert your favourite game framework + nimscripter ๐Ÿ˜›
00:01:01FromDiscord<nikki> haha indeed!
00:01:18FromDiscord<ElegantBeef> Stuff like that is awesome as it reduces the barrier to entry, so people can both checkout nim in a repl like situation and see how others do it
00:01:39FromDiscord<nikki> yeah totally' also if you can place objects visually and then incrementally add code
00:02:02FromDiscord<nikki> the main thing is to show people "hey u can make stuff!" once they feel that they just keep going
00:02:57FromDiscord<ElegantBeef> @rayman22201 i see you just starred my repo and i have to say you're encroaching on Zach's pfp, atleast one bird on a shoulder ๐Ÿ˜›
00:03:29rayman22201shhhh, I only lurk these days :-P
00:04:00*stefantalpalaru joined #nim
00:04:05FromDiscord<ElegantBeef> Hey lurking's not cool
00:04:25FromDiscord<ElegantBeef> Atleast i've got introuble doing it outside people's windows
00:05:24rayman22201lol. As long as you follow the restraining order it's all good. 50 feet / 15 meters ;-)
00:05:50FromDiscord<ElegantBeef> You seem to be an expert in lurking
00:05:57rayman22201I take all my legal advice from disruptek so you know It's foolproof
00:06:13FromDiscord<ElegantBeef> Well it involves fool, dont remember if it's foolproof though
00:07:10*stefantalpalaru quit (Changing host)
00:07:10*stefantalpalaru joined #nim
00:21:53*Tanger joined #nim
00:30:33*Mortir joined #nim
00:51:17*D_ quit (Quit: ๐Ÿ’จ)
00:52:05*D_ joined #nim
00:52:23*Axiomatic quit (Remote host closed the connection)
01:13:03*Axiomatic joined #nim
01:24:46*Mortir quit (Quit: leaving)
01:34:18jonjitsu[m]Are concepts the substitution for interfaces in other languages? I'm trying to figure out how I would pass an object to a proc without specifying a concrete type. I just need it to be able to respond to a certain method.
01:35:07jonjitsu[m]I guess I could use inheritance with methods...
01:35:08mipridefining thing-i-can-thismethod-against is a use of concepts yeah
01:35:48jonjitsu[m]are concepts going to become official soon?
01:36:06mipriwell they're in the language and they're documented and they work by default without a feature flag
01:37:16miprido you mean: when are people not going to say that there are some bugs still with them, or when is stdlib going to be written to make extensive use of them?
01:37:52*Axiomatic quit (Remote host closed the connection)
01:39:03jonjitsu[m] I saw them on the experimental page and thought they were still a WIP.
01:40:08mipriah, since an {.experimental.} isn't required I forgot that
01:47:05*Axiomatic joined #nim
01:52:02*kinkinkijkin quit (Ping timeout: 260 seconds)
01:53:53FromDiscord<zetashift> @Jonjitsu https://github.com/nim-lang/Nim/pull/15251
01:53:54disbotโžฅ 3new-style concepts implementation, WIP
01:54:04FromDiscord<zetashift> (edit) "<@490586708732280842>jitsu" => "jonjitsu"
01:54:33FromDiscord<ElegantBeef> Concepts work but they currrently have multiple RFCs afaik
01:58:09FromDiscord<flywind> What happened with Nim CI?
01:58:09FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/15783
01:58:10disbotโžฅ 3fix adding empty sequence to HTTP headers
01:58:59FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2D3m
02:01:02*abm quit (Quit: Leaving)
02:01:24FromDiscord<ElegantBeef> @nikki hey next time you have lunch and want some shoddy nim content you now can watch my nimscripter vidja ๐Ÿ˜› https://www.youtube.com/watch?v=GXBxvtHDjbg
02:01:58FromDiscord<nikki> awesome ๐Ÿ˜„
02:01:59FromDiscord<ElegantBeef> Yes i should've zoomed in
02:02:15*kinkinkijkin joined #nim
02:04:02jonjitsu[m]I'm going to use concepts for this exercise project. How would I achieve the same without? Inheritance + methods?
02:04:28FromDiscord<ElegantBeef> What're you trying to replicate?
02:05:03FromDiscord<ElegantBeef> Concepts are compile time only, so you cannot use them in runtime types like sequences
02:09:44jonjitsu[m]I have an emulator and I wan't to swap out the display. The display just needs to respond to certain methods like clear()
02:14:44FromDiscord<ElegantBeef> You can use a few different methods for that you can use inheritance, or you can use an object with something like `clearImpl: proc(args: T)` so you can use that like an interface where you change what it calls based off the display type
02:16:05FromDiscord<ElegantBeef> Then you also can use this, although the lack of license is ehh https://github.com/slangmgh/interfaced
02:19:58FromDiscord<nikki> also if that's a compile time decision, you could just import a different module depending on which impl you want to use, or something like that
02:20:18FromDiscord<ElegantBeef> Yep left that out
02:21:06FromDiscord<ElegantBeef> Streams are a great example of that entire `impl` style interface https://github.com/slangmgh/interfaced
02:21:10FromDiscord<ElegantBeef> damn it
02:21:17FromDiscord<ElegantBeef> (edit) "https://github.com/slangmgh/interfaced" => "https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/streams.nim#L109"
02:27:02*apahl quit (Ping timeout: 264 seconds)
02:28:39jonjitsu[m]Interesting thanks. It's definitely a compile time decision since one display is for sdl and the other for canvas in js...
02:29:06*apahl joined #nim
02:29:11FromDiscord<ElegantBeef> Yea you can always checkout how nico does it
02:30:12FromDiscord<ElegantBeef> https://github.com/ftsf/nico/blob/master/nico.nim#L11
02:31:27FromDiscord<ElegantBeef> If i stop giving links to things i do implode
02:35:15FromDiscord<nikki> yeah i think using modules is good for your case since the display funcs could get called a lot and it's nice to not have the runtime overhead
02:40:05*^omn1present^ joined #nim
02:40:13^omn1present^Hello Nim folks
02:41:56^omn1present^Anyone here :sad:
02:42:14FromDiscord<Rika> hello
02:42:18FromDiscord<Rika> how are you
02:43:08FromDiscord<ElegantBeef> For someone that's omnipresent you didnt know you were going to get a response
02:44:32FromDiscord<Rika> lol
02:44:38^omn1present^thats what i want u to think
02:44:40FromDiscord<Rika> theyre omnipresent not omniscient
02:44:42FromDiscord<Rika> or omnipotent
02:45:02FromDiscord<ElegantBeef> > (of God) present everywhere at the same time.
02:45:06FromDiscord<Rika> yeah
02:45:09FromDiscord<Rika> they dont know everything
02:45:13FromDiscord<Rika> theyre just everywhere
02:45:28FromDiscord<ElegantBeef> If they were everywhere they could see that we in process of responding ๐Ÿ˜„
02:46:02FromDiscord<Rika> i mean i only started responding 5 seconds before i sent my message
02:46:13FromDiscord<Rika> which was 2 minutes after they sent their message
02:46:33FromDiscord<ElegantBeef> Shhh
02:46:35FromDiscord<Rika> lol
02:46:35^omn1present^hol' up IRC gives everyone my ip
02:46:36FromDiscord<ElegantBeef> Dont look much into
02:46:38FromDiscord<ElegantBeef> Just rejoice
02:46:51FromDiscord<Rika> omnipresent: you get used to it
02:47:02FromDiscord<Rika> as long as you arent dumb with network security it should be fine?
02:47:07FromDiscord<ElegantBeef> ^
02:47:12FromDiscord<ElegantBeef> Plus only irc users get it
02:47:17FromDiscord<Rika> at least thats what i think lol
02:47:30FromDiscord<ElegantBeef> I mean every service you use gives your ip
02:47:34FromGitter<offbeat-stuff> How to get len of cstring
02:47:41FromDiscord<ElegantBeef> Cant return a package to an unknown sender
02:47:43FromDiscord<Rika> theCstring.len
02:47:44FromDiscord<Rika> lol
02:47:53FromGitter<offbeat-stuff> var err = getError โŽ โŽ ```if len(err.string) > 0: โŽ echo err``` [https://gitter.im/nim-lang/Nim?at=5fa367d8b4283c208a46c0a3]
02:47:57FromGitter<offbeat-stuff> this doesn't word
02:47:58FromGitter<offbeat-stuff> work
02:48:03FromDiscord<Rika> why?
02:48:07FromGitter<offbeat-stuff> len(err) also doesn't
02:48:15FromDiscord<Rika> what does getError return?
02:48:24FromDiscord<ElegantBeef> well it doesnt matter which you use they're identical internally
02:48:35FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2D3A
02:48:35FromGitter<offbeat-stuff> cstring{.cdecl.}
02:48:37FromDiscord<ElegantBeef> Yea it works
02:48:58*^omn1present^ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
02:49:15FromGitter<offbeat-stuff> I am using cpp and 1.5.1
02:49:38FromDiscord<ElegantBeef> Can we see your entire code?
02:49:42FromDiscord<Rika> that is really odd
02:49:48FromDiscord<Rika> are you sure its that code thats broken
02:49:52FromDiscord<Rika> and not elsewhere
02:50:19FromGitter<offbeat-stuff> Here https://play.nim-lang.org/#ix=2D3E
02:50:28FromGitter<offbeat-stuff> Yeah
02:50:44FromDiscord<Rika> whats the full error?
02:50:56FromDiscord<Rika> i think the issue is that you're not putting parentheses on getError
02:51:08FromGitter<offbeat-stuff> Sorry i forget the ()
02:51:55FromDiscord<ElegantBeef> interestingly nim playground has sdl2...?
02:52:11FromDiscord<Rika> yeah playground has first few important packages
02:52:14FromGitter<offbeat-stuff> Where would someone see the window
02:52:18FromDiscord<ElegantBeef> Oh i knew that but sdl2 is weird
02:52:19FromDiscord<ElegantBeef> You dont
02:52:22FromDiscord<Rika> well nowhere
02:52:24FromDiscord<Rika> its just there
02:52:26FromGitter<offbeat-stuff> Can we download the rendered video
02:52:28FromDiscord<ElegantBeef> It just gives stdout
02:52:29*^omn1present^ joined #nim
02:52:32FromDiscord<Rika> well no
02:52:33FromDiscord<Rika> lol
02:52:47FromDiscord<Rika> its just there because its a popular package
02:52:52FromGitter<offbeat-stuff> It can upload it somewhere
02:52:58FromDiscord<ElegantBeef> Well it doesnt
02:53:04FromDiscord<ElegantBeef> It's just a quick place to sorta repl
02:53:07FromGitter<offbeat-stuff> It can't upload
02:53:13FromGitter<offbeat-stuff> Using code
02:53:13FromDiscord<Rika> it can yeah but it doesnt
02:53:22FromGitter<offbeat-stuff> Oh I see
02:53:51FromDiscord<ElegantBeef> It's physically possible but more likely than not it's running on a headless server with 0 interest in renderering graphics ๐Ÿ˜„
02:54:24FromDiscord<ElegantBeef> Never ever make a renderer or else you'll never be able to write just render again
02:54:39FromDiscord<Rika> stdout rendered as image when
02:54:59*^omn1present^ quit (Client Quit)
02:56:17FromGitter<gogolxdong> How to do file stream with jester?
03:11:22*muffindrake quit (Ping timeout: 260 seconds)
03:13:25*muffindrake joined #nim
04:01:50*blueberrypie quit (Quit: leaving)
04:05:17*blueberrypie joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:12:13*vicfred quit (Quit: Leaving)
04:20:05*kinkinkijkin quit (Read error: Connection reset by peer)
04:21:57*kinkinkijkin joined #nim
04:35:25disruptekpackedjson doesn't support serializing tuples or uints. it's slower than std/json for every encoding benchmark i have.
04:35:28disruptek!repo jason
04:35:29disbot12https://github.com/disruptek/jason -- 9jason: 11JSON done right ๐Ÿคฆ 15 30โญ 1๐Ÿด
05:11:23*NimBot joined #nim
05:15:00*hyiltiz quit (Remote host closed the connection)
05:18:08FromDiscord<Avatarfighter> imo the memory usage of packedjson is worth it when encoding/decoding huge json strings in memory
05:25:19*nekits0 quit (Read error: Connection reset by peer)
05:25:52*nekits0 joined #nim
06:04:24*hyiltiz joined #nim
06:15:21*mmohammadi9812 quit (Ping timeout: 258 seconds)
06:16:14*hyiltiz_ joined #nim
06:17:22*narimiran joined #nim
06:17:55*hyiltiz quit (Quit: hyiltiz)
06:29:18FromDiscord<nikki> does `nim doc` support any notion of adding 'category comments' for headings that separate your procs into sections?
06:33:53FromDiscord<Rika> none that i know of
06:35:36*Q-Master quit (Read error: Connection reset by peer)
06:36:00*^Q-Master^ joined #nim
06:36:14*habamax joined #nim
06:36:40FromDiscord<ElegantBeef> I have a joke response of "Yea they're called modules" ๐Ÿ˜„
06:37:15*solitudesf joined #nim
06:38:24*Q-Master joined #nim
06:38:24*^Q-Master^ quit (Read error: Connection reset by peer)
06:50:18FromDiscord<nikki> haha i think headings within a module would still be useful; but also yeah nbd
06:50:30FromDiscord<nikki> do i have to freeze a .compileTime. seq for it to show up at runtime somehow ๐Ÿค”
06:50:44FromDiscord<nikki> i'm trying to build a seq of asset filenames and content strings at compiletime that is accessible at runtime
06:50:52FromDiscord<nikki> at compile time it does have the right contents, but at runtime it's empty
06:51:00FromDiscord<nikki> https://play.nim-lang.org/#ix=2D4n is what the code looks like
06:51:08FromDiscord<ElegantBeef> `a = static:`
06:51:54FromDiscord<nikki> huh interesting and yeah makes sense i'll try that
06:52:00FromDiscord<nikki> i could also just make it a proc and call that and make it const i guess?
06:52:08FromDiscord<ElegantBeef> yes
06:52:10FromDiscord<nikki> like `const theSeq = figureItOut()`
06:52:11FromDiscord<nikki> cool
06:52:15FromDiscord<ElegantBeef> compiletime vars dont exist at runtime
06:52:20FromDiscord<ElegantBeef> or atleast shouldnt
06:53:00FromDiscord<nikki> yeah the weird thing is -- https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma what i do seems to be similar to what they're doing here
06:53:05FromDiscord<nikki> where they describe the pragma in the manual
06:53:12FromDiscord<nikki> i also tried it in a registration case like the one in the manual and got empty there too
06:53:27FromDiscord<nikki> in any case i'll do it in the expression way
06:54:07FromDiscord<nikki> it'd be interesting to just generate a huge case statement that checks each filename and returns the staticread lol
06:55:45FromDiscord<ElegantBeef> This is how you should do it https://play.nim-lang.org/#ix=2D4o
06:56:00FromDiscord<ElegantBeef> Possibly with static infront
06:56:44FromDiscord<nikki> what do you think of the manual example that i linked
06:56:57FromDiscord<ElegantBeef> I think it has the possibillity to have issues
06:57:48FromDiscord<ElegantBeef> `static` may need to be used occasionally, so it's just a case of what happens
06:57:59FromDiscord<ElegantBeef> I'm surprised it doesnt complain about usage of a variable that doesnt exist
06:58:36FromDiscord<nikki> yeah
07:11:49*mmohammadi9812 joined #nim
07:18:18*mmohammadi9812 quit (Read error: Connection reset by peer)
07:22:57*deepend quit (Remote host closed the connection)
07:25:22*deepend joined #nim
07:39:46*habamax quit (Remote host closed the connection)
07:49:57*MarderIII joined #nim
07:59:36*kinkinkinkin joined #nim
07:59:55*kinkinkijkin quit (Ping timeout: 244 seconds)
08:00:26FromDiscord<Ryuzaku> Hey, is there a way to find the smallest element in a set according to an arbitrary func? ( i mean without converting it to a seq and using idxmin)
08:00:31*andinus joined #nim
08:10:08FromDiscord<ElegantBeef> @Ryuzaku no clue if this fits your requirements but this? https://play.nim-lang.org/#ix=2D4A
08:10:14FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:15FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:16FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:19FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:21FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:26FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:27FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:28FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:28FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:29FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:30FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:31FromDiscord<ElegantBeef> @arnetheduck can you moderate the above please?
08:10:35FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:36FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:10:36FromDiscord<KevinN> https://discord.gg/xtEu6mMnfT
08:11:02FromDiscord<ElegantBeef> Thanks?
08:11:17FromDiscord<Ryuzaku> yeah, I guess it does. I was just curious whether there is something in the stdlib
08:12:36FromDiscord<ElegantBeef> Doesnt appear so there are 24 procs that have `set[T]` and non seem to get it
08:14:01FromDiscord<Ryuzaku> hmm. This is probably the wrong place to propose it, but what about fallback implementation for all those functions (like min, max, etc) that work based on iterators, that can always be used as callback in case a more specialized implementation is not available?
08:14:20FromDiscord<Ryuzaku> even sequtils work on seqs and not on iterators
08:14:28FromDiscord<ElegantBeef> Well you could implement that with a concept
08:17:20FromDiscord<ElegantBeef> Although i could be wrong ๐Ÿ˜„
08:21:03*habamax joined #nim
08:25:04FromDiscord<lqdev> mods are asleep, shit
08:25:14FromDiscord<ElegantBeef> Arne was green
08:25:18FromDiscord<ElegantBeef> Still is
08:25:21FromDiscord<ElegantBeef> They're gone
08:25:23FromDiscord<lqdev> doesn't mean he saw it
08:25:29FromDiscord<ElegantBeef> no clue if banned or left
08:26:06FromDiscord<lqdev> if only i were a modโ€ฆ i wouldn't have moderated the above anyways because i had a maths exam eh
08:26:16FromDiscord<lqdev> how are you guys doin' today
08:26:25FromDiscord<lqdev> working on some cool nim stuff?
08:28:47FromDiscord<ElegantBeef> At the moment i'm not coding, but tomorrow i plan on recording me wrapping a library be it nico or fidget with nimscripter to show how to do it/easy it is
08:29:13FromDiscord<lqdev> cool!
08:29:35FromDiscord<lqdev> if nimscripter becomes usable at some point i may just try to use it for planet overgamma
08:29:38FromDiscord<lqdev> no promises tho
08:29:51FromDiscord<ElegantBeef> "if it becomes usable"?
08:30:09FromDiscord<lqdev> as in, stable
08:30:11FromDiscord<ElegantBeef> https://streamable.com/aipyfv
08:30:15FromDiscord<ElegantBeef> Are you not entertained!
08:30:43FromDiscord<ElegantBeef> I think the API is going to be pretty stable from here on out
08:30:48FromDiscord<lqdev> source code?
08:31:05FromDiscord<Varriount> What API?
08:31:20FromDiscord<ElegantBeef> https://github.com/beef331/nimscripter
08:31:26FromDiscord<ElegantBeef> I havent got to make any examples yet
08:31:27FromDiscord<lqdev> than
08:31:28FromDiscord<lqdev> ks
08:32:14FromDiscord<ElegantBeef> The one thing i do have to do is figure out how i'm going to manage it for shipping nim files
08:32:32FromDiscord<ElegantBeef> Right now users need to have nim installed but it's a minor change to remove that requirement
08:32:49FromDiscord<ElegantBeef> Just need to think about how i'll let the developers load the files they want and ship only those on compilation
08:33:04FromDiscord<Varriount> Hm, I don't like the way procedures are registered to be available in Nimscript
08:33:06FromDiscord<ElegantBeef> Probably will do an all but X
08:33:19FromDiscord<ElegantBeef> What would you prefer a block based method?
08:33:19FromDiscord<Varriount> Why not a pragma?
08:33:29FromDiscord<ElegantBeef> I use a pragma?
08:33:37FromDiscord<lqdev> i'd prefer a block-based method tbh
08:33:44FromDiscord<Varriount> It uses an import
08:33:49FromDiscord<ElegantBeef> What?
08:34:16FromDiscord<Varriount> import nimscripter #Must appear after any wanted nimscript procs
08:34:24FromDiscord<ElegantBeef> Yes i dont like that either
08:34:33FromDiscord<ElegantBeef> It's due to nim consts
08:34:42FromDiscord<lqdev> it's most likely due to how macros work.
08:34:45*habamax quit (Ping timeout: 240 seconds)
08:34:53FromDiscord<lqdev> or compile-time variables
08:34:54FromDiscord<lqdev> or both
08:34:56FromDiscord<ElegantBeef> Yep
08:35:00FromDiscord<Varriount> You can't add entries to a const sequence at compile time?
08:35:13FromDiscord<lqdev> btw beef
08:35:15FromDiscord<ElegantBeef> Well the issue i've had is that if you do it out of order the const is empty
08:35:16FromDiscord<lqdev> have you seen this? https://nim-lang.org/docs/macrocache.html
08:35:26FromDiscord<lqdev> @Varriount it's const for a reason
08:35:30FromDiscord<ElegantBeef> I have but uncertain how beneficial it is
08:35:43FromDiscord<Varriount> Why not use a var then
08:35:54FromDiscord<ElegantBeef> Cause i need to calculate stuff at compile time
08:36:03FromDiscord<ElegantBeef> And add it to the table for runtime
08:36:11FromDiscord<Varriount> Consultants are only constant at runtime. Not compile time
08:36:21FromDiscord<Varriount> constants
08:36:49FromDiscord<Varriount> Is the constant only used at compile time?
08:37:00FromDiscord<ElegantBeef> The issue is that because how consts are evaluated adding values to the var it copies after the const is evaluated the data is gone at runtime
08:37:02FromDiscord<ElegantBeef> No
08:37:15FromDiscord<ElegantBeef> The constant holds the data to interop with nimscript
08:37:18FromDiscord<lqdev> @Varriount https://play.nim-lang.org/#ix=2D4C
08:38:27FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2D4D doesnt work for the data i have
08:38:34FromDiscord<ElegantBeef> If it did i wouldnt have that requirement
08:39:22FromDiscord<lqdev> and it's all thanks to https://github.com/nim-lang/Nim/issues/13375 :D
08:39:23disbotโžฅ 3Accessing compileTime variable at runtime returns zeroed data. ; snippet at 12https://play.nim-lang.org/#ix=2bba
08:40:42FromDiscord<ElegantBeef> Hmm i can try that global pragma
08:41:20FromDiscord<lqdev> it doesn't work
08:41:31FromDiscord<lqdev> https://play.nim-lang.org/#ix=2D4E
08:42:10FromDiscord<Varriount> What about the workaround mentioned in the issue?
08:42:19FromDiscord<lqdev> that's what he uses
08:42:43FromDiscord<lqdev> the big advantage of beef's approach is that you don't have to deal with the pains of overload resolution
08:42:57FromDiscord<lqdev> compared to a block-based approach, where you do something like
08:43:10FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2D4F
08:43:31FromDiscord<ElegantBeef> i can make a block based version of `exportToScript` in theory atleast
08:43:40FromDiscord<lqdev> good luck with that dude
08:43:51FromDiscord<lqdev> it's a pain in the ass
08:44:13FromDiscord<lqdev> i know because i implemented one for euwren
08:44:19FromDiscord<lqdev> !repo liquid600pgm/euwren
08:44:20disbot12https://github.com/liquid600pgm/euwren -- 9euwren: 11High-level Wren wrapper for Nim 15 30โญ 0๐Ÿด
08:44:29FromDiscord<lqdev> and it's buggy as hell
08:44:41FromDiscord<ElegantBeef> Yea i mean it's not high priority
08:44:59FromDiscord<lqdev> i think i'm gonna create a {.pubapi.} pragma for planet overgamma anyways
08:45:01FromDiscord<ElegantBeef> It'd be nicer if i could just use `push`
08:45:03FromDiscord<lqdev> you can
08:45:09FromDiscord<ElegantBeef> it doesnt work for my macro
08:45:55FromDiscord<lqdev> oh yeah
08:46:01FromDiscord<lqdev> i thought Araq said otherwiseโ€ฆ?
08:46:01FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/773830462249631784/unknown.png
08:46:21FromDiscord<ElegantBeef> I have 0 clue why it doesnt work
08:46:24FromDiscord<lqdev> thanks for reminding me to implement a nim linter for lite btw
08:46:31FromDiscord<ElegantBeef> lite?
08:46:36FromDiscord<lqdev> !repo rxi/lite
08:46:37disbot12https://github.com/rxi/lite -- 9lite: 11A lightweight text editor written in Lua 15 3905โญ 176๐Ÿด 7& 10 more...
08:46:42FromDiscord<ElegantBeef> Ew
08:46:48FromDiscord<lqdev> you're ew
08:46:52FromDiscord<ElegantBeef> Lua is ew
08:46:58FromDiscord<lqdev> lua is cool
08:47:10FromDiscord<ElegantBeef> Dynamically typed = me die
08:47:34FromDiscord<ElegantBeef> Oh shit this is kinda like what i want to make using Nim instead ๐Ÿ˜„
08:47:37FromDiscord<lqdev> it's not bad if you know what youre doing
08:47:45FromDiscord<ElegantBeef> I know what i'm doing
08:47:45FromDiscord<nikki> it's totally possible to understand and appreciate qualities of many technologies at once
08:47:52FromDiscord<ElegantBeef> Nah
08:48:04FromDiscord<ElegantBeef> I dislike dynamic typing so cannot appreciate python/js/lua
08:48:19FromDiscord<ElegantBeef> To do otherwise would be hypocrisy ๐Ÿ˜›
08:48:24FromDiscord<lqdev> dynamic typing isn't as bad as you portray
08:48:34FromDiscord<lqdev> i've never had many problems with it
08:48:38FromDiscord<ElegantBeef> Who portrays it badly
08:49:51FromDiscord<lqdev> dynamic typing has its advantages, primarily in rapid prototyping
08:49:56FromDiscord<nikki> i think it's just easier to take someone seriously when actually discussing aspects rather than just throwing ews and likes and dislikes around
08:50:10FromDiscord<nikki> i think lua is p good as a runtime
08:50:13FromDiscord<nikki> luajit especially
08:50:17FromDiscord<ElegantBeef> nikki you've been talking to me for how long and dont think i'm overly hyperbolic?
08:50:34FromDiscord<lqdev> i would never use a dynamically typed language as the core of my game, but as a content language it's fine
08:51:01FromDiscord<ElegantBeef> I'm rarely 100% serious, but i do dislike dynamic typing as it's just not informational enough for me
08:51:16FromDiscord<ElegantBeef> You remove a lot of information and put it on words alone
08:51:42FromDiscord<Varriount> Depends on the game. I've been trying out a tabletop game program written in JavaScript
08:51:50FromDiscord<nikki> yeah i think static typing is very useful, for sure
08:52:07FromDiscord<nikki> but i think there's a lot of interesting things to talk about regarding lua
08:52:11FromDiscord<lqdev> static typing often slows you down imo
08:52:31FromDiscord<nikki> and purely talking about dislike of dynamic typing is not close to the most interesting one
08:52:39FromDiscord<ElegantBeef> It's a rigid structure that ensures you cannot run into runtime errors
08:52:44FromDiscord<lqdev> true
08:52:55FromDiscord<ElegantBeef> So i mean sure it can slow you down but have fun with your runtime errors
08:53:19FromDiscord<nikki> the biggest benefit i think also is that sizes of memory layouts can be known, and functions can be ... monomorphized
08:53:22FromDiscord<Varriount> Or it's a rigid structure that prevents you from quickly developing prototypes
08:53:57FromDiscord<nikki> but yeah like, in a lot of cases i've used lua and been quite productive in ways that i would've thought otherwise
08:54:05FromDiscord<nikki> the amt of overhead is low
08:54:06*Tanger quit (Remote host closed the connection)
08:54:16FromDiscord<nikki> nim feels good for similar reasons
08:54:22FromDiscord<Varriount> Monomorphized == single representation?
08:54:25FromDiscord<nikki> like, why ufcs is good
08:54:28*mmohammadi9812 joined #nim
08:54:36*mmohammadi9812 quit (Client Quit)
08:54:42FromDiscord<nikki> @Varriount compiling / generating variants of a function for a type
08:54:44FromDiscord<nikki> eg. generics
08:54:49FromDiscord<Varriount> Ah
08:54:56FromDiscord<nikki> which allows further optimization per type etc
08:55:16FromDiscord<nikki> weirdly JITs are a runtime form of this, and Luajit's tracing jit is a cool case there
08:55:32FromDiscord<Varriount> My biggest hurdle with Nim is that parts of it are (unfortunately) unnecessarily high friction
08:55:56FromDiscord<nikki> interesting, what are those?
08:55:58FromDiscord<Varriount> (edit) "are" => "have an"
08:56:17FromDiscord<Varriount> Well, like the issue @KingDarBoja ran into
08:56:26FromDiscord<nikki> i spent a lot of time doing mixed lua + c++ engine kinda stuff and am finding nim interesting as a more ergonomic + metaprogrammable angle from c++
08:56:29FromDiscord<Varriount> Bah, I mean @ElegantBeef
08:56:43FromDiscord<nikki> specifically?
08:56:51FromDiscord<nikki> anyways i actually should go to bed haha sorry
08:57:04FromDiscord<ElegantBeef> Const not being lately bound so it doesnt calculate what happens after all modules have been imported
08:57:07FromDiscord<Varriount> Not being able to use a compile-time variable at runtime
08:57:14FromDiscord<ElegantBeef> Well i never ran into that
08:57:26FromDiscord<ElegantBeef> Compile-time variables arent supposed to be stored
08:57:42FromDiscord<nikki> hmm that sounds to me like an impl issue
08:57:43FromDiscord<Varriount> Well, whatever that issue lqdev posted
08:57:44FromDiscord<lqdev> @Varriount one of my biggest pain points when developing games is lack of mutual dependencies :(
08:57:46FromDiscord<nikki> vs. a design issue in the lang
08:58:08FromDiscord<Varriount> @nikki I never said the problem was with the design
08:58:25FromDiscord<ElegantBeef> An impl issue making a table from any module in the entire project
08:58:27FromDiscord<nikki> right, i just mean, that at least gives more hope
08:58:29FromDiscord<nikki> hehe
08:58:37FromDiscord<Varriount> True
08:58:37FromDiscord<nikki> or a different distribution of hope at least
08:58:38ForumUpdaterBotNew thread by Nealie: Changes to 1.4 affecting packaging, see https://forum.nim-lang.org/t/7036
08:59:10FromDiscord<nikki> i meant an impl issue in the lang's compiler @ElegantBeef
08:59:12FromDiscord<nikki> not in user code
08:59:17FromDiscord<ElegantBeef> Yea i realized that after
08:59:26FromDiscord<ElegantBeef> I was like "Oh they arent blaming me"
08:59:45FromDiscord<nikki> xD
08:59:52FromDiscord<nikki> your lib is doing good things!
08:59:57FromDiscord<nikki> the things nim promises
08:59:58*habamax joined #nim
09:00:10FromDiscord<nikki> compile time magic to register stuff etc.
09:00:26FromDiscord<ElegantBeef> 99% pixie dust and 1% code?
09:01:13FromDiscord<ElegantBeef> And varriount sure it's not ideal but it's hardly that big of an issue, there is a usable work around until it gets resolved
09:01:18FromDiscord<ElegantBeef> No one likes that it has to be done this way
09:02:30FromDiscord<ElegantBeef> Who knows the macro cache might help but not a clue
09:02:54FromDiscord<ElegantBeef> Nope it's only strings
09:03:00FromDiscord<ElegantBeef> I need pointers to procs ๐Ÿ˜„
09:03:01FromDiscord<lqdev> NimNodes
09:03:24FromDiscord<ElegantBeef> Eh still hard to do
09:04:20FromDiscord<ElegantBeef> The procs dont need to be exported so the subscription needs to happen next to them
09:04:44FromDiscord<ElegantBeef> So either i'm too tired to understand the benefit or there is none
09:05:32FromDiscord<ElegantBeef> I suppose i can always do the subscription at runtime
09:09:34*clemens3 quit (Ping timeout: 256 seconds)
09:12:47FromDiscord<Varriount> @nikki if I had to pick a design flaw (or more accurately, pain point) in Nim, I would have to say polymorphism
09:13:16FromDiscord<Varriount> Specifically, runtime polymorphism
09:14:19FromDiscord<Varriount> Yes, I know that it can be achieved via libraries, but that's the kind of mechanism that the community around a language needs to settle on
09:15:31FromDiscord<Varriount> Otherwise you have 2 or 3 different implementations that are incompatible, which makes usage more troublesome.
09:16:48FromDiscord<ElegantBeef> I agree that's probably the most annoying part
09:18:23FromDiscord<ElegantBeef> That and the fact i cannot legally force it into the hands of all programmers ๐Ÿ˜„
09:18:33*clemens3 joined #nim
09:19:34*krux02 joined #nim
09:24:59FromDiscord<Varriount> I like Go's interface design the most, and think it would work quite well with Nim
09:25:38FromDiscord<Varriount> Of course, the concept -> vtable would be great
09:26:01FromDiscord<lqdev> agreed
09:29:00*MarderIII quit (Quit: Leaving)
09:29:02FromDiscord<lqdev> i wish we could generate types using macros
09:29:10FromDiscord<lqdev> so that `type X = myMacro(a, b, c)` would work
09:29:28FromDiscord<lqdev> then implementing runtime interfaces would be trivial
09:29:41FromDiscord<lqdev> but alas, both `interface` and `concept` are reserved words >:(
09:29:48FromDiscord<ElegantBeef> macros returning typsections will be noice
09:29:57FromDiscord<ElegantBeef> So we can make properties and the like
09:30:07FromDiscord<ElegantBeef> Without a DSL
09:30:19FromDiscord<lqdev> we need to open an RFC
09:31:35FromDiscord<ElegantBeef> For what?
09:47:24*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:52:10*mmohammadi9812 joined #nim
09:52:31*PMunch joined #nim
10:07:37*gangstacat quit (Quit: ฤœis!)
11:04:18*lritter joined #nim
11:12:54*kinkinkinkin is now known as kinkinkijkin
12:05:17*TomDotTom joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:37*supakeen joined #nim
12:18:52*mmohammadi9812 quit (Ping timeout: 272 seconds)
12:27:12FromDiscord<Innokentiy Sokolov> does anyone had experience with compiling via `nim in docker` container?
12:27:44FromDiscord<Innokentiy Sokolov> How to deal with dependencies?
12:29:07*mmohammadi9812 joined #nim
12:35:37PMunchI regularly build Nim projects in a Nim container
12:35:46PMunchDocker container*
12:43:32FromDiscord<Innokentiy Sokolov> @PMunch how do you install dependencies in that case? like 'nimble install`
12:43:39FromDiscord<Innokentiy Sokolov> (edit) "'nimble" => "`nimble"
12:44:35*gangstacat joined #nim
12:51:01PMunchYeah, I just got a nimble project set up and then run `nimble build`
12:52:26FromDiscord<Innokentiy Sokolov> Did I get you right that nimble is installed on your host system? Or you connect to docker image to use nimble?
12:52:46FromDiscord<Innokentiy Sokolov> I'm just trying to figure out how to use docker only solution
12:53:29FromDiscord<Innokentiy Sokolov> Docker Hub contains nim image with `single file` example only. Not much info on workflow
12:53:51*abm joined #nim
12:54:01PMunchAh, no the nimble is run inside the container
12:54:09PMunchAre you familiar with how to use Docker?
12:55:54FromDiscord<Innokentiy Sokolov> Yeah but I never used docker images `as a console app`. Only used for deploy web services (aka traefik, portainer and etc)
12:56:50FromDiscord<Innokentiy Sokolov> But I think I get it now
12:57:03*Q-Master quit (Ping timeout: 260 seconds)
12:57:50PMunchWell there are two ways of doing it
12:59:06PMunchOne is making a "builder" image that you then run with something like `docker run -v $(pwd):/tmp/src <image> nimble build` to build the Nim project in the current directory.
12:59:36PMunchThe other option is to make a container that builds a specific project and then copies the build result into a run container
13:00:23PMunchSo after the `docker build` command you are left with a container that contains your app already built and runnable, but the container doesn't have Nim installed.
13:02:03FromDiscord<Innokentiy Sokolov> Thanks for explanation! That sheds light
13:03:49PMunchNo problem! I guess I could do a simple write-up of how to build Nim in Docker
13:04:38FromDiscord<Innokentiy Sokolov> @PMunch That would be awesome really!
13:07:47*fredrikhr joined #nim
13:14:29*agent0x00 joined #nim
13:20:10*Q-Master joined #nim
13:20:22*Q-Master quit (Client Quit)
13:41:00*Q-Master joined #nim
13:58:50*TomDotTom quit (Quit: Leaving)
13:59:07*TomDotTom joined #nim
14:12:14FromDiscord<Innokentiy Sokolov> sent a code paste, see https://play.nim-lang.org/#ix=2D7a
14:12:50*habamax quit (Read error: Connection reset by peer)
14:13:05*habamax joined #nim
14:13:42FromDiscord<Innokentiy Sokolov> init part creates whole nimble structure folder structure with helloworld app. and the second part - install necessary dependencies (mounted locally) and run the task
14:13:48FromDiscord<flywind> https://www.reddit.com/r/nim/comments/jkk9bd/building_an_prologue_binary_for_alpine_in_docker/
14:15:53FromDiscord<Innokentiy Sokolov> Yeah but creating a `Dockerfile` is a bit an overtake versus using already cooked Nim docker image
14:16:17FromDiscord<Innokentiy Sokolov> I may be wrong tho
14:21:38FromDiscord<Innokentiy Sokolov> The reason I made a fuzz about all this is that I had a real life scenario recently with old VPS on CentOS - I wasn't able to install Nim there via `choosenim` properly. Don't remember the details but I gave up at that point. The docker image would solve the issue
14:29:00PMunchSorry, when you send long messages they get converted to a paste link and I don't get highlighted
14:29:40*habamax quit (Quit: leaving)
14:29:49PMunchIf you have prologue as a dependency in your nimble file then simply `nimble run` should suffice, it will automatically install it
14:30:00*habamax joined #nim
14:30:36PMunchOh by the way `nimble run` does build and run, so no need for an extra task
14:30:41PMunch@Inno ^
14:32:11FromDiscord<Innokentiy Sokolov> @PMunch I never tried that actually because I add `--define:ssl` to my task.
14:34:01FromDiscord<Innokentiy Sokolov> @PMunch thanks again for enlightening me
14:34:01PMunchThat's what nim.cfg is for
14:34:13PMunchPut your defines in there
14:34:29PMunchMakes nimlsp (and probably other tools) happy as well
14:34:30FromDiscord<Innokentiy Sokolov> @PMunch that's unknown territory for me yet :)))
14:34:44FromDiscord<Innokentiy Sokolov> didn't know that
14:36:44PMunchHere is an example one: https://gist.github.com/mashingan/6cd3af4528ad5c11ed4f27f3aac72cc4
14:36:57PMunchWell, that is the one for the Nim compiler it seems
14:40:28*agent0x00 quit (Quit: WeeChat 1.9.1)
14:41:45FromDiscord<Innokentiy Sokolov> `nim.cfg`, `.nims` files. my head hurts
14:42:58*tane joined #nim
14:43:56FromGitter<christopherzimmerman> Is it possible to have a default named argument after varargs? โŽ โŽ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fa40fab7cac87158f8acf2d]
14:44:19PMunchI don't think so, unfortunately
14:44:40PMunchWell, not without a macro that is
14:47:50PMunchAnd that wouldn't look very good in the documentation
14:59:03*opal quit (Ping timeout: 240 seconds)
15:00:59PMunchHmm, is there a `mgetOrPut` that sets puts the default?
15:04:26*lol-asd joined #nim
15:04:49*opal joined #nim
15:07:41*lol-asd quit (Remote host closed the connection)
15:08:05FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=2D7K
15:09:20FromDiscord<Zachary Carter> look at the generated C code?
15:12:45FromDiscord<AmjadHD> That's a good idea.
15:13:21FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2D7O
15:13:48FromDiscord<Zachary Carter> you can ignore the `nimfr` lines
15:14:01FromDiscord<Zachary Carter> and `nimln` as well
15:27:20FromDiscord<AmjadHD> @Zachary Carter can you do me a favor and paste the c code when you explicitly assign to result instead.
15:27:31FromDiscord<Zachary Carter> sure
15:28:09FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2D84
15:28:41FromDiscord<lqdev> @AmjadHD if the last expression in a procedure is non-void, it acts as a shortcut for assigning to result
15:33:02FromDiscord<lqdev> it would be nice if params of procs generated from templates wouldn't appear as x`gensym1: int in docs and nimsuggest :(
15:40:23*mmohammadi9812 quit (Ping timeout: 258 seconds)
15:50:28*nekits07 joined #nim
15:51:49*nekits0 quit (Ping timeout: 264 seconds)
15:52:21*mmohammadi9812 joined #nim
16:08:42PMunch"Error: cannot export: UnsatisfiableConstraintException", why not?
16:13:37PMunchOh.. It's not exported
16:14:56disrupteknikki: compiletime vars do exist at runtime, but they are immutable.
16:15:14disruptekyeah, i don't like it, either.
16:15:18*TomDotTom quit (Ping timeout: 256 seconds)
16:15:52FromDiscord<nikki> that's fine, but it was just showing up empty for me, there seems to be an issue about it
16:16:11disruptekgot a demo?
16:16:23*hnOsmium0001 joined #nim
16:23:00FromDiscord<nikki> will post one soon, gotta do some other stuff irl for a bit
16:27:36*habamax quit (Ping timeout: 256 seconds)
16:32:18FromDiscord<nikki> actually disruptek i found the one i posted earlier: https://play.nim-lang.org/#ix=2D4n
16:36:18FromDiscord<nikki> i was just trying to have a filename + contents list embedded, i got it working by doing `const assetContents = figureItOut()` instead
16:37:02*xace quit (Ping timeout: 260 seconds)
16:38:58*xace joined #nim
16:40:46disruptekthat's what i'd have done. also, a table would be faster.
16:41:02disrupteki don't see a flaw in this code, though.
16:42:27FromDiscord<nikki> yeah ๐Ÿค”
16:43:07FromDiscord<nikki> i was gonna use a table initially but i had similar code populating a table that was empty earlier so i wondered if it was due to table vs. seq and decided to try a seq
16:43:17FromDiscord<nikki> (the table turned out empty too)
16:44:22disrupteki'm probably missing something. i just dunno if i don't do it this way because it doesn't work, or if i don't do it this way because i never learned these semantics.
16:45:42disrupteki will say that i avoid compiletime vars. i think they are super creepy. i use a let and a compiletime proc instead.
16:46:19disruptekthe fact that code that assigns a value at runtime compiles and runs without mutating the value is fucking nuts.
16:46:35FromDiscord<Recruit_main707> can you disable array bounds checking?
16:46:52miprinim --fullhelp|grep check
16:47:01FromDiscord<nikki> `-d:danger` does, i think you can set/unset granularly too
16:47:22disruptekit seems that maybe a compiletime var can only observe a value upon initialization.
16:48:01disruptekhmm, but your static block finds a value. see, it's just madness.
16:49:27*rockcavera joined #nim
16:49:49FromDiscord<nikki> yea -- the main usecase i'm eyeing for the future is the 'registration' one where i have a pragma that allows me to do `type Foo {.rememberMe.} = ...` and then later i can look up all of the remember-me'd stuff
16:50:43FromDiscord<nikki> which is exactly the example in the manual for `compileTime` https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma
16:56:08FromDiscord<lqdev> is there any reason for `new` to return nil?
17:03:05disrupteklol wut
17:03:59disruptekactually, i kinda remember something about this.
17:09:08FromDiscord<lqdev> nevermind that question. turns out it was just my idiocy.
17:09:25Zevvwhat, again?!
17:10:03disrupteklqdev: don't insult me.
17:10:36FromDiscord<lqdev> disruptek: you can't tell me what to do
17:11:46disruptekfair enough.
17:11:54ZevvSure he can tell you
17:12:20disrupteklqdev is a sharper coder than i am. i have to concede his authority.
17:16:03FromDiscord<lqdev> my authority lol
17:16:19Zevvwe could use some authority here
17:16:24Zevvar4q is seldom around
17:17:07disruptekhe's around, he's just bored by all the whining.
17:19:51Zevvaren't we all
17:20:17disruptekZevv: your irc graph might be a decent measure of language popularity growth.
17:23:09disruptekor maybe it just measures whining. ๐Ÿค”
17:25:12*TomDotTom joined #nim
17:36:07*habamax joined #nim
17:36:26*solitudesf- joined #nim
17:38:13*solitudesf quit (Ping timeout: 260 seconds)
17:41:52Zevvit's only the top 100 whiners in the graph
17:42:24disruptekover which timespan?
17:42:44disruptekthe stack is a stupid invention.
17:42:51disrupteki hate it so much.
17:43:33Zevvstacks are so great
17:43:36ZevvI love stacks
17:43:47Zevvmy house is full of them
17:43:48Zevvstacks of books
17:43:50Zevvstacks of plates
17:44:11Zevvstacks of everything with a aspect ration > 0.5
17:44:22PMunchHaha, ditto
17:44:53ZevvAnd I naturally forth well. I read 4 books at a time, so rot and swap and pick2 come natural
17:45:13disruptekyeah, great.
17:45:26FromDiscord<nikki> leo brodie wrote some good books
17:45:27disrupteki'm moving you to the top of the list of people i will kill next time i'm overseas.
17:45:32ZevvI love the pictures
17:45:50ZevvI bought the brodie boek 3 years ago or so when I made https://github.com/zevv/zForth
17:45:56Zevvoh is it 5 years already. damn
17:47:14FromDiscord<nikki> nice! i made a stack based interpreter a while ago that's not embeddable or tiny at all https://github.com/nikki93/nscript lol
17:47:19FromDiscord<nikki> just interprets the string directly
17:47:39Zevvsee, stacks are just solid stuff
17:47:45FromDiscord<nikki> ya
17:47:47disruptekfuck that.
17:47:47FromDiscord<nikki> stax!
17:48:01FromDiscord<nikki> disruptek what are you mad about
17:48:02FromDiscord<nikki> if you are
17:48:08FromDiscord<nikki> you may also not be mad
17:48:16Zevvperpetual madness
17:48:31FromDiscord<nikki> if you're always mad to the same extent, are you actually mad?
17:49:02disruptekthe doctors tell me i'm quite mad.
17:49:07FromDiscord<nikki> oh
17:49:07ZevvHey this dude made a nim port of zforth \o/
17:49:32FromDiscord<nikki> there's no implicit `this`in nim
17:49:39Zevvthere used to be
17:49:49disruptekthis is a bad idea.
17:50:01FromDiscord<nikki> `import this`
17:50:28*muffindrake quit (Ping timeout: 244 seconds)
17:52:04*muffindrake joined #nim
17:52:55disrupteki'm one of those people who is so fucking depressed that i develop outrage just to feel anything.
17:53:11disruptekthis is a travesty.
17:53:19disruptekthis makes me so angry i cannot see straight.
17:53:48disruptekeither i'm eating Cap'n Crunch cereal right now or someone is typing this into a computer.
17:54:52FromDiscord<nikki> i think i've seen that
17:55:44FromDiscord<nikki> have u watched american psycho? p good movie
17:55:57disruptekof course. i'm old.
17:56:17Zevvi havent. i save all the good stuff for when I'm old
17:56:25mipriwhat do you mean of course? I'm old and I haven't watched it.
17:56:32disruptekZevv: i just put a bullet next to your name.
17:56:46mipridon't let anyone tell you that age forces you to consume Hollywood products. There's lots of new vtubers out there.
17:57:00disruptekmipri: you may make the list yet.
17:57:11FromDiscord<nikki> i think hollywood products consume you
17:57:29FromDiscord<nikki> that's how you get old
17:57:35disruptekmipri: how old are you?
17:58:07mipriI'm... not 40 yet.
17:58:40disruptekthen my title is intact.
18:00:10Zevvwe're staltler and waldorf.
18:00:20disruptektalk about a blast from the past.
18:00:42*rockcavera quit (Remote host closed the connection)
18:01:41FromDiscordUptime - 2 weeks, 1 day, 22 hours, and 25 minutes
18:04:56*habamax quit (Quit: leaving)
18:05:13*habamax joined #nim
18:38:40*abm quit (Read error: Connection reset by peer)
18:45:24*xet7 quit (Quit: Leaving)
19:20:01FromDiscord<treeform> OMG why is this not in? https://github.com/nim-lang/Nim/pull/7761
19:20:02disbotโžฅ 5Implements parseQuery in uri module.
19:20:19FromDiscord<treeform> What am I supposed todo?
19:21:42disrupteki'm not sure it's right, anyway; not clear if it handles singleton query params correctly.
19:24:22FromDiscord<treeform> it puts them in a seq
19:24:34FromDiscord<treeform> do I have to write my own query string parser?
19:25:27disruptek?foo&bar=bif is a valid query string, but i'm sure it can be parsed and re-rendered correctly. are you?
19:25:39disrupteker, i'm /not/ sure.
19:25:42*vicfred joined #nim
19:25:53FromDiscord<treeform> not sure too
19:26:04FromDiscord<treeform> is there query parser in nim that just worksโ„ข๏ธ?
19:26:08disruptekso why would you want to use this shitty code?
19:26:13disruptekit's not like it's hard to write.
19:26:33FromDiscord<treeform> I don't. I just want to parse query strings and not worry about it.
19:26:39disrupteki feel you.
19:26:51FromDiscord<treeform> import uri and get all of that for free
19:26:59FromDiscord<treeform> and now its like nope...
19:27:15disruptekthere's a Url type that has never served any purpose except to clash names.
19:27:25disruptekdid you really expect more from this stuff?
19:27:32FromDiscord<treeform> yes
19:27:57disruptekbtw, is there a technical reason your ws lib cannot be synchronous?
19:28:44FromDiscord<treeform> no I had a synchronous version with threads first.
19:28:57disruptekin the same repo?
19:28:57FromDiscord<treeform> but async is just easier due to thread to thread comunication
19:29:13FromDiscord<treeform> some time long time ago
19:29:22FromDiscord<treeform> your best best now is just to remove async from everywhere
19:29:22disrupteki get it, i just don't use async/await anymore.
19:30:37FromDiscord<treeform> if you just remove all away and {.async.} it will probably just work for you.
19:30:48FromDiscord<treeform> (edit) "away" => "`await`" | "{.async.}" => "`{.async.}`"
19:31:04disruptekcool. if i can make it painless, i'll offer a pr.
19:36:03FromDiscord<Clyybber> @treeform use cgi.decodeData
19:39:39*astronavt joined #nim
19:40:30*rockcavera joined #nim
19:40:42FromDiscord<treeform> @Clyybber thanks!
19:41:39FromDiscord<treeform> gar! cgi cant work in JS mode...
19:41:59FromDiscord<treeform> `undeclared identifier: 'stdin'`
19:45:23*abm joined #nim
19:48:10PrestigeTrying to reason about concepts, and if they can be used for this particular use case. I'm writing a spatial hashing module, which requires an object and a bounding box. I'd like to say, give me an object that has a `getBounds` proc that returns a Rectangle.
19:48:37PrestigeCan this not be done with concepts, because they are compile time helpers?
19:48:38disruptekyou can if the params don't vary.
19:49:27disruptekgetBounds(c) is Rectangle
19:49:52FromDiscord<haxscramper> I just pushed last fixes for pattern matching, so now I need someone to review it (implementation/documentation/tests etc.)
19:50:47Prestigedisruptek: I'll give that a shot. Thanks
19:51:28disruptekconcepts work best as a concept.
19:51:38disruptekin practice, things fall apart quite quickly.
19:51:58PrestigeYeah. I keep wanting something like an interface
19:52:20disrupteki keep wondering what that word means.
19:53:40Prestigejust a reference to what other languages use - basically an interface is just a "class" that has only abstract functions
19:53:53Prestigeso it's partial multiple inheritance
19:54:08disruptekconcepts are a superset of this.
19:55:39disruptekalso, you cannot use negation in your concepts, which is a little infuriating.
19:55:45FromDiscord<haxscramper> From my understanding interface is just better way to say that object has field like `implCallback: proc()`
19:57:51FromDiscord<haxscramper> Which is nice but yeah, concepts are superset of this, and also allow for use of standalone procs as long as they match. Prototype should be different though - e.g. for `implCb: proc()` you need to have `implCb(obj: Type)`
19:59:01Prestigehm I guess that did work, at least in this small example: https://play.nim-lang.org/#ix=2D9r
19:59:16Prestigedisruptek: negation in what manner? I'm just curious what you mean
19:59:49FromDiscord<haxscramper> Maybe I can use concepts to make wrappers for OOP-heavy code? Since concepts can inherit from each other (or I think so), and can be misused to describe methods etc.
20:00:12PrestigeI'd be interested in seeing that
20:00:25FromDiscord<haxscramper> Someone should probably just shoot me before I try to do this for real
20:00:29FromDiscord<Recruit_main707> i wish there was something like concepts for runtime
20:00:31disruptekconcepts will disappoint you if you attempt anything remotely sophisticated.
20:00:42FromDiscord<haxscramper> The most cursed idea I've had for the last 20 minutes
20:00:44PrestigeI would still like to see MI but my method for doing it can't be accomplished with macros
20:00:48*kinkinkijkin quit (Remote host closed the connection)
20:00:55disruptekyou cannot do `concept c ... foo() isnot Bar` for example.
20:01:05disruptekno negation of boolean logic.
20:01:06Prestige@Recruit yeah that's basically what an interface would be
20:01:09*kinkinkijkin joined #nim
20:01:26FromDiscord<Recruit_main707> but, like with concept syntax
20:01:42PrestigeYeah, that would be nice
20:01:50FromDiscord<haxscramper> @Recruit_main707 Isn't it like just dynamic typing basically, with `assert hasMethod` and `impls; Table[string, proc(args: RuntimeArgs)]`
20:02:17FromDiscord<haxscramper> Or something like CLOS (not saying I'm familiar with it though)
20:02:33FromDiscord<Recruit_main707> yes, but then id have to write it myself :P
20:03:20disrupteknothing wrong with writing nim.
20:03:34miprisome negation: https://play.nim-lang.org/#ix=2D9u
20:05:14disruptekhmm, my mistake. maybe it's just certain boolean templates.
20:06:12FromDiscord<Recruit_main707> those error messages are horrible though
20:07:16*natrys joined #nim
20:07:31miprithe error message in that link works; it just needs to suppress some of the spam. that's come up and been fixed in the past for other spammy errors
20:07:43disruptekthis is my canonical demo of concept problem: https://github.com/disruptek/nimph/blob/0de876f3497adf99363a6e1e50a7984d9dac318d/nimph/groups.nim
20:10:01disruptekalso be aware that the order of boolean expressions in the concept declaration /matters/.
20:10:17*hyiltiz_ quit (Quit: hyiltiz_)
20:11:53*hyiltiz joined #nim
20:12:01FromDiscord<AmjadHD> How to pass a char literal to a template ?
20:12:40miprisame way you pass char literals to anything.
20:14:06FromDiscord<Recruit_main707> lemme guess, you used python before? :p
20:14:30FromDiscord<Recruit_main707> "x" is a stringโ†ต'x' is a char
20:22:22FromDiscord<nikki> is there a way to call the "original" / "default" `=destroy` hook from your own `=destroy` hook for an object? if not i guess you can wrap all the fields inside another object and call `=destroy` on that one and keep your extra work in the `=destroy` for the outer one
20:23:08FromDiscord<Clyybber> @nikki system.`=destroy`
20:23:13FromDiscord<nikki> ๐Ÿ˜ฎ ๐Ÿ˜ฎ ๐Ÿ˜ฎ
20:23:28FromDiscord<nikki> game changer
20:26:19FromDiscord<nikki> um wait my program hangs so did it go recursive
20:26:19FromDiscord<nikki> lmao
20:26:56FromDiscord<nikki> ya definitely went recursive @Clyybber lol
20:27:11FromDiscord<Clyybber> oh; sry. I thought that worked
20:27:26FromDiscord<nikki> https://media.discordapp.net/attachments/371759389889003532/774006983618461736/unknown.png
20:27:36FromDiscord<nikki> the highlighted part on the left is what corresponds to the C code on the right, C code is recursive
20:28:26mipriyes, it's recursive
20:28:46FromDiscord<nikki> woooooops
20:28:58FromDiscord<nikki> guess i have to stick to manually doing it over the fields / wrap in another layer of object if i want default
20:29:01FromDiscord<Clyybber> @nikki heh, so did it do the right thing?
20:29:03miprihttps://play.nim-lang.org/#ix=2D9w simpler example
20:29:06FromDiscord<Clyybber> oh
20:29:38FromDiscord<nikki> yeah i want to additional work over the system's automatic destroy, but if i hook destroy i lose the system one ๐Ÿ˜
20:29:53FromDiscord<Clyybber> @nikki you could also try just making your object distinct and giving it a different destructor that calls the undistinct one
20:30:25FromDiscord<nikki> huh i see. interesting. and then calling the undistinct one would involve casting and calling `=destroy` on it right
20:30:35miprias demonstrated: https://play.nim-lang.org/#ix=2D9y
20:31:29FromDiscord<nikki> hmmmmmmmmmmm if the thing i am distinct from is anonymous, can i cast to it
20:31:45FromDiscord<nikki> so that i could just do `type Thing = distinct object ...` and then still cast to the anonymous type it's distinct of
20:32:11mipriif it's anonymous, how did you even define the =destroy for?
20:32:31FromDiscord<nikki> originally it was `type Thing = object <fields>`
20:32:54FromDiscord<nikki> i could do `type ThingPayload = object <fields> ... type Thing = distinct ThingPayload` but
20:33:23FromDiscord<nikki> if i were to do `type Thing = distinct object` but the anonymous type after the `distinct` in that type expression is still available, i avoid needing to name `ThingPayload`
20:33:38FromDiscord<Clyybber> @nikki theres typetraits.distinctBase
20:33:48FromDiscord<nikki> yeah nice
20:33:53FromDiscord<nikki> i'll consider this
20:34:57FromDiscord<nikki> hmm i guess i could do it the other way too where, there's a subfield, on which i add the destroy hook, that still can access the parent object
20:35:08FromDiscord<nikki> that might be nicer tbh
20:35:48FromDiscord<nikki> could allow this to be a reusable construct where the subfield type is generic and it just casts the ptr to itself to the parent type and calls a `userDestroy` hook on it
20:35:59FromDiscord<nikki> (the cast would work if the subfield is always the first member)
20:49:52*habamax quit (Quit: leaving)
20:56:47Zevvdisruptek: smart man, think for me.
20:57:15ZevvI made a little tool in Lua ages ago, but I don't understand anymore how it works. I want to redo it in Nim. It's called "mp" which stands for "mathpipe"
20:57:38disrupteklemme get my pipe.
20:57:43ZevvYou feed it an arbritrary text file where it looks for numbers in each line. Typically logs, measurements, or whatever kind of data
20:57:50ZevvThe input of the tool is this log on stdin
20:57:52disruptekyou put meth in the top, right?
20:58:05Zevvand a little expression which references the Nth number in the input lines
20:58:23Zevvso `avg($1)` would give me a running average of all the inputs from the 1st number in the line
20:58:52Zevvor `max($1) - min($2)` gives the difference between the min-up-to-now of the 1st and the max-up-to now of the 2nd
20:59:00disruptek!repo miller
20:59:01disruptekgo on.
20:59:02disbot12https://github.com/johnkerl/miller -- 9miller: 11Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON 15 2578โญ 86๐Ÿด 7& 29 more...
20:59:25Zevvmiller is close, but no cigar I think
20:59:38Zevvbecause the magic is in these expressions. I had highpass, lowpass, and whatever not. Any kind of maths
20:59:46disruptekso you've predefined the functions you can perform?
21:00:10Zevvyeah, that's a hard coded set.
21:00:44disrupteknpeg runs at compile-time, so it seems like you can impl this in that.
21:01:22Zevvyeah but I do need a complete expression evaluator, and some kind of representation of the 'running parts'
21:01:32ZevvLike the avg(). It has history. It keeps a total of all inputs
21:01:37disruptekwhat's wrong with nimscript?
21:01:45Zevvtrue, true
21:01:52Zevvno bad
21:02:12Zevvmiller has interesting ideas as well
21:02:13Zevvdidn't know that one
21:02:45Zevvho hmmm. let me whip something up
21:03:25disrupteki haven't used it. who has the energy to devote to yet another tool when you can just code something that will stay perfect for years?
21:03:42Zevvthat's the spirit
21:04:04Zevvmy lua thing has served me well for ages, but it's kind of over-abstracted in a monadian way
21:04:17disruptekseems like the right approach, honestly.
21:04:43Zevvit seems, because now that I look at it, it's pretty tiny. Because lua does the interpreting, it creates lua from lua
21:04:47Zevvlua is not unlike nim :)
21:05:03FromDiscord<nikki> totally, man
21:05:13disrupteki'm debating switching to using lua instead, in my tierra clone.
21:05:24Zevvdo it man
21:05:27FromDiscord<nikki> lua is gud
21:05:29Zevvlua makes you a happy man
21:05:34disrupteki was excited about packedast at first but now i think it's flawed.
21:05:37FromDiscord<nikki> if you are using it in a place with executable mmap access, luajit will just kill everything
21:05:42FromDiscord<nikki> speed-wise
21:05:55disruptekit's really more about future applications.
21:06:01ZevvI did hefty real time audio stuff in luajit at 48.000hz
21:06:25FromDiscord<nikki> ya luajit calls c functions faster than c does
21:06:41disrupteki know, it's a bit of a mindfuck.
21:06:51Zevv*some* c functions
21:06:52disruptek!repo lunacy
21:06:52disbot12https://github.com/disruptek/lunacy -- 9lunacy: 11a hack to let me work with some lua data more naturally 15 5โญ 0๐Ÿด
21:07:00FromDiscord<nikki> a lil mike pall rewriting your code to be better at runtime
21:07:05disruptekalways be pluggin'.
21:07:06FromDiscord<nikki> "hey i noticed ur code sux"
21:07:09Zevvdisruptek: was this why you were whining about stacks
21:07:14FromDiscord<nikki> "so i wrote a program to make it better, here"
21:07:26disruptekZevv: yeah, packedast has made me grumpy.
21:07:32disruptekit's not the impl i had in mind originally.
21:08:23disruptekthe problem is that i don't want any of this extra structure.
21:08:37disrupteki just want a single alloc and then i want to query the shit out of it from cache.
21:09:01*PMunch quit (Quit: leaving)
21:09:06disruptekand we're duplicating data out-of-phase and across modules and it's just going to shit.
21:09:37Zevvyeah we all want that
21:09:46disruptekbtw, i meant to ask you... do you still have an npeg json?
21:09:55FromDiscord<alehander42> hey
21:09:57Zevvyeah its in the dist
21:09:58FromDiscord<alehander42> guys
21:10:00Zevvbut hidden away
21:10:03FromDiscord<nikki> yeah json, do you have an npeg?
21:10:07Zevvbecause otherwise people will want to use it for something
21:10:21*narimiran quit (Quit: leaving)
21:10:28ZevvIt parses but does not collect, nor capture
21:10:38disruptekwell, jason is getting faster, slowly, but i need to think about deserializing now.
21:10:39Zevvafaik it's complete and correct
21:10:45Zevvdon't use npeg
21:11:00disruptekcan't i just use it for tokenizing?
21:11:13Zevvwell, you could, but not sure if it is worth the hassle
21:11:18Zevvparsing json is trivial as fuck
21:11:21Zevvrecursive descend
21:11:32disruptekthen why is packedjson so slow?
21:11:35FromDiscord<nikki> disruptek: i read about jason but i think i'm not totally sure i get it -- is teh idea that you serialize / deserialize to / from json string directly from the type instance, and the logic is comptile time generated from type meta info?
21:11:36Zevvit's almost like lisp with two kinds of brackets
21:11:43Zevvnpeg is slower
21:11:57FromDiscord<nikki> there's this thing in c++ that seems to go fast: https://github.com/beached/daw_json_link
21:12:03FromDiscord<nikki> by doing sth like that
21:12:10disruptekthe idea of jason is that we just skip all the bullshit.
21:12:25disruptekhonestly, we don't need to do like 90% of what we do.
21:12:43disruptekand even jason is doing too much because concepts are too broken for me to use them.
21:12:50disruptekand don't get me started on typed macros.
21:12:54FromDiscord<nikki> yeah, like constructing an in memory spaghetti of references that you then just copy to a typed instance and then throw away?
21:13:06disruptekjason was poc for frosty.
21:13:25disrupteklook at this:
21:13:27disruptek!repo flatty
21:13:28disbot12https://github.com/treeform/flatty -- 9flatty: 11Flatty - tools and serializer for plain flat binary files. 15 5โญ 1๐Ÿด
21:13:35disruptekthis is explicitly /not/ what i want.
21:13:56disruptek"i don't care." -- araq, 2020
21:14:02disrupteki don't give a shit about types.
21:14:08FromDiscord<nikki> i'm probably gonna start with the std json when i need to do json serialization / deserialization in this game thing, then see how bad it is
21:14:12FromDiscord<nikki> and then use other things if its bad enough
21:14:18Zevvit's not bad
21:14:22disrupteklook, i can give you my data, okay? can you just fucking serialize it for me? is that too much to ask of a macro?
21:14:24FromDiscord<nikki> cool
21:14:24Zevvit is perfectly ok for 95% of the use caes
21:14:25disrupteki don't think so.
21:14:34*disruptek yawns.
21:14:47FromDiscord<nikki> another thing i use it for is i'm down to keep this jsony dommy structure around just bc. i use it for undo buffer in the editor lol
21:15:04disrupteki mean, it's whatever.
21:15:08disruptekwho really gives a shit.
21:15:25FromDiscord<nikki> apparently --- you?
21:15:25disruptekbut i do hate a broken abstraction.
21:15:27FromDiscord<nikki> can't tell
21:15:47disruptekand i hate giving away performance when it buys me absolutely nothing.
21:15:57Zevvtrue, that
21:16:02disruptekand i hate not exploiting proper types.
21:16:32disruptekand i really can't see the point in machinery that i write prior to compile time but have to evaluate every single time i run my code.
21:17:04disrupteki mean, fuck. it's never the case that i cannot tell you what i expect a json operation to yield.
21:17:19disruptekwhy is that something that we need a computer to tell us every damned time?
21:17:42disruptekthere's absolutely zero dynamicism here.
21:17:49FromDiscord<nikki> i guess it depends on if you're willing to be given random borked data over the network or whatever right? even in that case it's fine. the main thing is if you want some logic for "oh if this isn't present, do this"
21:17:50Zevvso go fix that shit!
21:18:00disrupteki did fix it.
21:18:01FromDiscord<nikki> but in that case i think you deserialize to some intermediate type and read from that
21:18:31disruptekjason has some room for improvement but it's already miles better than the other options.
21:20:29disruptekit doesn't deserialize at all. that's what i'm ruminating upon right now.
21:21:24ZevvWhat was the source of the "I don't care"
21:22:59disruptekthere's a lot of stuff we don't care about and simply making that assertion let us remove it from the designs for the new ir.
21:24:04disruptekcaching doesn't make any sense when you can quickly evaluate anything at all.
21:24:08disruptekas an example.
21:25:41disrupteki just like the phrase because it captures the sense that we are trapped by our expectations for how software is designed and built.
21:26:42Zevvman that's pretty deep for a thursday night
21:26:50disrupteki don't care how json should be written. can i write it faster than anyone else with less code to boot? yes? then i don't care.
21:27:22disruptekjason is 355 lines with docs and examples.
21:27:35Zevvbut man is it stupid
21:27:47disruptekyeah, it's not exactly brilliant.
21:27:55disrupteklike i said, plenty of room for improvement.
21:27:59Zevvwell, that was a positive thing, actually
21:28:18Zevvfirst time I read the source I scratched my head thinking what the hell is this about
21:28:25Zevvit's so dead obvious
21:28:29disrupteki dropped arrays from like 500 cycles to 150 last night.
21:28:39disruptekand there's more meat on the bone, still.
21:29:06Zevvdo seqs
21:29:18disruptekcome closer.
21:29:22*Zevv steps away
21:30:07disruptekthe code that folds literals together isn't that fast.
21:30:18disrupteki just to just accumulate the result instead.
21:30:28disrupteker, i need to just.
21:31:52*xet7 joined #nim
21:33:15*xet7 quit (Remote host closed the connection)
21:35:02*xet7 joined #nim
21:35:57*solitudesf- is now known as solitudesf
21:38:54*FromDiscord quit (Remote host closed the connection)
21:38:55ZevvA lot of time is still spent in escaping I guess
21:39:10*FromDiscord joined #nim
21:40:30disruptekthere are a couple allocs in there that can be taken out.
21:43:54Zevvhow do you debug that stuff when you write it. expandMacro?
21:44:15disruptekbut mostly i read treeRepr.
21:44:31disruptekyou should look at the output of my testes. it's unreal.
21:47:37*solitudesf quit (Ping timeout: 264 seconds)
21:50:00Zevvdo I see right that compile time constant strings are not compile time escaped?
21:51:23Zevvand constant numbers are not stringified at compile time?
21:51:39Zevvor am I a bad seeer
21:52:36disruptekin jason?
21:53:07disrupteknumbers, integers, strings.. all done at compile-time if possible.
21:53:20ZevvI thought so, but then I miss something in my repr output
21:54:03disruptekif you have something like a mixed-type tuple, it falls back to a slower impl i think.
21:54:12disrupteknot everything is fully optimized out.
21:54:29disruptekbut even the slower impls are 50-100% faster than stdlib.
21:54:37Zevvbut. `12345.jason`
21:54:55Zevvdoes not pre-stringify the number. That's done at run time
21:55:06Zevvno i's not
21:55:25Zevvhm I'm stupid.
21:55:34ZevvI did `let o = 12345; o.json`
21:55:40disrupteki have commented out the term rewriting macro for literals, but yeah, i think we need to do something like that still.
21:56:15disruptekterm rewriting macros are so powerful that i really think they shouldn't exist.
21:56:26FromDiscord<nikki> https://play.nim-lang.org/#ix=2D9X getting a "hey i'm copying the `path` string" warning from compiler about this -- logically i want to store the path in the resource but also as the key in the table so ... the copy is necessary right
21:56:29Zevvyeah but for cases like this
21:56:37FromDiscord<nikki> like there's no way to reorder this to make it not complain / not copy
21:56:49*xet7 quit (Remote host closed the connection)
21:57:29disruptekwhat do you mean by complain?
21:57:35FromDiscord<nikki> um this is also definitely happening alongside reading an decoding an image so it's fine
21:57:46FromDiscord<nikki> just a hint from the compiler:
21:57:48FromDiscord<nikki> Hint: passing 'tex.path' to a sink parameter introduces an implicit copy; if possible, rearrange your program's control flow to prevent it [Performance]
21:58:07FromDiscord<nikki> so not a complaint, just a suggestion
21:58:19FromDiscord<nikki> a helpful nudge, a word of advice
21:59:19disrupteki can't see how it could be rearranged.
22:00:16FromDiscord<nikki> yeah. i guess i can turn the hint off within that scope
22:00:29disruptekmaybe if you gfx.texs[tex.path] = tex
22:00:42FromDiscord<nikki> huh interesting will try
22:00:51*xet7 joined #nim
22:01:00disruptekthat'll make the last read the ctor.
22:02:01FromDiscord<nikki> ya nah same(-ish) issue
22:02:53FromDiscord<nikki> so this case is fine, tbh, i have another case where it's popping up that i was wondering about ... will paste
22:03:21FromDiscord<nikki> https://play.nim-lang.org/#ix=2D9Z
22:03:36disrupteki wonder if it makes a copy for the cstring. i wouldn't expect so but i dunno.
22:03:41FromDiscord<nikki> just collecting removable textures in a pass through the table, then removing them right after
22:04:16FromDiscord<nikki> the `toDestroy.add(tex.path)` seems to do a copy, and i was wondering if there was some other (maybe even more idiomatic) way to do this
22:04:26FromDiscord<nikki> interesting disruptek, i'll see if it does a copy, have the gen'd C handy
22:05:38FromDiscord<nikki> yea nah when passing to `cstring` it just passes a ptr to the string data, no copy
22:05:51disruptekjust add the tex and not tex.path. then del(tex.path).
22:06:05disruptekseq[ref Texture] instead of [string]
22:06:08FromDiscord<nikki> nice one
22:06:10FromDiscord<nikki> yeah makes sense
22:06:24FromDiscord<nikki> i guess i could make it `seq[ref Texture {.cursor.}]` lolol
22:07:09disruptekwhile toDestroy.len > 0: gfx.texs.del(toDestroy.pop.path)
22:07:40FromDiscord<nikki> cool
22:07:41disruptekalloc the seq as the same size as the table, too.
22:07:46disruptekso it won't grow.
22:07:51FromDiscord<nikki> yeah nice
22:08:32FromDiscord<nikki> oh actually, on most frames this is not happening at all, so i think it's fine / better to not prealloc
22:08:41FromDiscord<nikki> since if there are no removals it won't alloc the seq at all
22:09:04FromDiscord<nikki> and when there are i think it's fine to -- either there's only a few removals and it maybe allocs just once, or there are many and unloading is the bottleneck anyways i think / it's at a game scene boundary
22:09:36disruptekwell, you are the programmer.
22:09:48FromDiscord<nikki> ๐Ÿ‘Œ
22:09:56FromDiscord<nikki> ^ do those show up as emoji for you or is it the discord text lol
22:10:05disrupteknah, it's emoji.
22:12:10disruptekthey show up as green rectangles for zevv.
22:12:26disruptekwhatfer staltler reasons.
22:15:48PrestigeIs there a way to say a declared type conforms to a certain concept? I'm wanting it to apply to a ref object of RootObj
22:15:59Zevvhttp://zevv.nl/div/irc.png Protects me against disruptek-induced eye sore
22:16:28FromDiscord<nikki> irssi?
22:16:39Zevvwhat else
22:16:48ZevvI have to use slack 8 hours a day
22:17:02PrestigeI'm so tired of slack
22:17:22FromDiscord<nikki> my cpu is probably more tired of slack than i am
22:17:44ZevvI had this chunky diarrhea for months, the kind that smells of vomit. I recently found out its because of slack
22:17:57Prestigeslack basically freezes if I have a call open on another workspace
22:18:00ZevvI out-type slack as if I'm on 300bps
22:18:08Prestigelmao Zevv
22:18:57disruptek1st world problems.
22:19:19FromDiscord<nikki> lol disruptek i may have thought of a nice way to do the clearing from map thing
22:19:29FromDiscord<nikki> it's to move the ref into the seq, and then just clear the seq (or not even clear it, is lost at end of scope)
22:19:35FromDiscord<nikki> that way doesn't inc/dec refcounts i think
22:19:44disruptekyep, that also works.
22:20:46FromDiscord<nikki> wait .. i guess i could literally just zero the ref in the table itself. ytf do i need a seq lmao
22:21:25disruptekbecause of mutation while traversing?
22:21:47FromDiscord<nikki> sry i'm dumb, i forgot the remove table entry part
22:22:03FromDiscord<nikki> i was thinking to zero the ref but not remove the entry .......... but then i need to remove the entry so yeah haha
22:22:07FromDiscord<nikki> yes the move approach works
22:22:20disruptekmaybe you actually /don't/ need to remove the entry, though.
22:22:48*kinkinkijkin quit (Remote host closed the connection)
22:22:58FromDiscord<nikki> yeah that's a fair consideration. for now it feels right to not leave it there, but yeah
22:23:06*kinkinkijkin joined #nim
22:24:41disruptekbut take my advice with a grain of salt.
22:24:52disruptekthis is how i ended up in with a daughter in baton rouge.
22:25:11FromDiscord<nikki> what if i am that daughter
22:25:27disruptekare you in baton rouge?
22:25:36Prestigehm can't have a HashSet[MyConcept], dang. Is there a way to use concepts in collectios?
22:25:53disruptekwhat did i just tell you about trying to get sexy with concepts?
22:26:00disruptekwe just fucking went over this.
22:26:31disruptekwhat you are talking about is a MyConceptHashSet[T] concept.
22:26:36PrestigeLol I thought it would be basic functionality. I'm not sure where to draw the line on what concepts can be used with
22:26:49disruptekif you have to ask, you can't afford it.
22:27:17disruptekthere are basically three corners to the triangle of pain.
22:27:23disruptekconcepts, statics, and generics.
22:27:52disruptekyou mix those together and you are in mratsim territory. woe be the coder who trespasses therein.
22:28:12Zevvso where does handling types in macros go, in your triangle?
22:28:30disruptekokay, so it's a tetrahedron of pain, wise guy.
22:28:33Zevvbetter make it a pentagram
22:28:42disruptekit's the 20-sided die of pain.
22:28:54Zevv11 dimensions
22:29:06FromDiscord<nikki> just a sphere
22:29:08FromDiscord<nikki> pain everywhere
22:29:11Prestigehm I think this is not possible, then. Dang
22:29:20ZevvI still long for `macro foo[T]()`
22:29:22disruptekit's possible, chucklehead.
22:29:49PrestigeI thought you said it isn't
22:30:01FromDiscord<nikki> how can i iterate a hash table without copying the key if i don't wanna use the key
22:30:08disrupteki'm just telling you that you're straying close to the black hole.
22:30:10FromDiscord<nikki> just looked at the gen'd code and it copies the string key lol
22:30:31disruptekuse the values iterator.
22:30:36FromDiscord<nikki> ohoooooooooo
22:30:47FromDiscord<nikki> use the thing that was meant for what you wanna do, got it
22:31:20Zevvalso, when just iterating you're not likely to copy the keys, i guess
22:31:20disrupteksame advice applies to prestige.
22:31:44disruptekunless you're ready to ride that temptress, stay away from the black hole and use the thing that was meant for what you wanna do.
22:31:57FromDiscord<nikki> zevv i'm looking at the C and there's a string copy in there
22:32:26PrestigeI think concepts are that thing, but are limited because it isn't a concrete type
22:32:33Prestigeunless I'm missing something, here
22:32:52disruptekyou can't define a type in terms of a concept unless that type is a concept.
22:33:03disruptekbut generic concepts are a thing.
22:33:17FromDiscord<nikki> i'm curious what your usecase is Prestige
22:33:22disruptekit's just that, y'know, they don't really work well.
22:33:54Prestige@nikki I'm creating a spatial hash module, which takes objects that have a `getBounds(): Rectangle` proc
22:34:29Prestigean internal data structure holds this `Boundable` concept I've created, which doesn't compile
22:34:41disruptekah, you want a converter that converts the concept type into the key type for your HashSet.
22:34:49*natrys quit (Ping timeout: 246 seconds)
22:35:08disruptekbasically, an IntSet. don't expect to get the values back out, right?
22:35:09FromDiscord<nikki> are the values meant to be object values themselves, or refs / ptrs to object values?
22:35:30PrestigeI suppose I could make it take a ref
22:35:33FromDiscord<nikki> if the latter you could just store a type erased ptr
22:35:52FromDiscord<nikki> idk if you can have an untyped ref that still preserves gc semantics tho?
22:35:56FromDiscord<nikki> am nim noob
22:36:14FromDiscord<nikki> probs not bc. the destructor needs to know the type right
22:36:26*Prestige shrugs
22:36:29FromDiscord<nikki> and i'm guessing it nim doesn't hold the destructor as a ptr in the ptr bc that sucks
22:36:30PrestigeI also don't know
22:37:06Prestigedisruptek: Yeah I want to get the object back from this HashSet
22:37:28Prestigewell, the Rectangle... maybe I could just use that
22:38:15Prestigenope, scratch that, I do need the object back from the set
22:39:04FromDiscord<nikki> another consideration is to just hold ids to lookup in another table
22:39:07PrestigePreviously I was using a particular object that has a getBounds(): Rectangle proc, but would be nice if I could use concepts to make it more generic
22:39:34PrestigeYeah, that's possible too
22:39:37FromDiscord<nikki> personally for a spatialhash api it'd be nice if the api just held ids and i did the resolution myself so i can do the data storage, but, depends
22:40:32disruptekAraq: can you give me a hook so i can start some integration tests?
22:41:16disrupteki need just some kinda call with the graph at the point where we're passing it into ic so i have some data to work with.
22:42:14PrestigeYeah idk, just going to revert back and give up on using concepts
22:42:31disruptekdon't wimp out now.
22:42:44PrestigeIf you have ideas I'm all ears
22:42:44FromDiscord<nikki> yeah maybe not a good time to invest in it for a core construct?
22:43:21disrupteki told you what i'd do.
22:43:23FromDiscord<nikki> i think the id approach seems nice. like i'd want a spatial hash to do the hashing. but not necessarily the data layout for the associated data.
22:43:34FromDiscord<nikki> unless it's actually meant to be a container but ..
22:44:10PrestigeIt's just a cell of a spatial grid that holds the objects (or refs to the objects, rather)
22:44:39FromDiscord<nikki> and the cell can be of various types? why do you need a concept for the cell type itself i guess
22:45:06*sagax quit (Remote host closed the connection)
22:45:14PrestigeThe concept is for the stored object, since the requirement is just for the object to have that getBounds proc
22:45:29*tane quit (Quit: Leaving)
22:45:51FromDiscord<nikki> ah i see
22:46:30disruptekthat's not how concepts work.
22:46:37PrestigeThis is the current working file: https://play.nim-lang.org/#ix=2Dab
22:46:39disruptekthey are literally user-defined typeclasses.
22:46:46PrestigeWhere GameObject has the getBounds proc
22:46:54disruptekit's a typeclass with very fine control over its definition.
22:47:58FromDiscord<nikki> yeah i think generally, a concept makes sense in places about type instantiation / parameterization, but maybe not places where types come up for storage layout
22:48:38FromDiscord<nikki> eg. -- parameters of generic procs, yes. types for fields or for values of concrete containers -- maybe not?
22:49:03FromDiscord<nikki> but yeah the concept of a container where the elems satisfy a concept makes sense. that's just not a type
22:50:05disruptekwhat you are talking about is a MyConceptHashSet[T] concept.
22:50:20PrestigeHow does that work?
22:50:36Zevvwell that is a nice suprise. My nim version works and it's half the size of the lua one"
22:50:51disruptekah, but you had to understand the lua one first.
22:50:56disruptekkinda defeats the purpose, right?
22:50:57ZevvI did this one pragmatic
22:51:03Zevvand simpler
22:51:05disruptekis it slower?
22:51:09Zevvit's way faster
22:51:22FromDiscord<nikki> Prestige -- why would the spatial hash structure not be generic over the contained type?
22:51:37FromDiscord<nikki> if it were you can just have a `HashSet[T]` right
22:51:37PrestigeI want to make it generic
22:51:56Prestigethe only prob is I need T to be `Boundable`
22:51:59FromDiscord<nikki> ok so can you just make it a hash set of T instead of of the concept
22:52:11FromDiscord<nikki> yes, that's ok. but then you can just have a HashSet[T] no?
22:52:21PrestigeHmm let me try
22:52:41disruptekyou can't have a hashset of a non-concrete type.
22:53:00PrestigeThat's what I thought
22:53:15Prestigebut it seems like you're saying there's some way to do it
22:53:20FromDiscord<nikki> what i was getting at disruptek was -- if they had `type SpatialHash[T] = object ... theHashSet: HashSet[T]`
22:53:28disruptekthat's why i said, "have a converter that converts Boundable to your HashSet's type"
22:53:33FromDiscord<nikki> and they also say that `T` has to satisfy a concept somewhere
22:53:52FromDiscord<nikki> idk what the syntax for that is bc. i'm a noob and talking out of myturn
22:54:30disrupteknikki: that's generic to each Boundable type, though, right?
22:54:36Prestigejust because I need the bounds of T via a `getBounds` proc, for my use. The other way is to just have them provide T and a Rectangle, but I am trying to see if I can have T just be an object that has `getBounds`
22:54:49Prestigebut afaik it isn't possible with nim atm
22:55:03disruptekanything is possible.
22:55:09disruptekyou could box the objects, for example.
22:55:25PrestigeI do have gloves
22:55:32disruptekbut i really don't see what this buys you.
22:55:37FromDiscord<nikki> do you want a single spatial hash to contain multiple elem types?
22:55:49FromDiscord<nikki> if so then you def need some kind of boxing / type erasure right
22:56:05PrestigeYeah, if I could just store the pointer or something
22:56:23disruptekwell, you can.
22:56:27FromDiscord<nikki> and it then has to runtime dispatch to the bounds, unless the bounds call is only done through some call where the concrete type is known (eg. add[T](...) from some other code)
23:04:53FromDiscord<alehander42> hm
23:06:43disrupteksasha who did you vote for?
23:09:10PrestigeWhy am I getting an error here? https://i.imgur.com/1pMogOo.png cannot instantiate: 'SpatialCell[T]'; Maybe generic arguments are missing?
23:09:59disruptekhard to tell without seeing the rest of the code.
23:10:11disruptekmake sure SpatialCell is defined in the same type block.
23:10:21disruptekthe compiler thinks it's generic.
23:15:46*lritter quit (Ping timeout: 256 seconds)
23:15:52Prestigethis is getting crazy. lol
23:17:42FromDiscord<nikki> huh you have a T -> Rectangle table for the bounds?
23:18:31FromDiscord<Avatarfighter> i assume T is going to be the object
23:18:45FromDiscord<Avatarfighter> but why wouldn't you then store the bounds of the object inside the object itself?
23:18:56PrestigeI'd like to avoid that, which is what I'm trying currently
23:19:09FromDiscord<Avatarfighter> Why is that Prestige? I'm really curious now
23:19:42FromDiscord<nikki> hmm needing the object to be hashable so that it can be a key for that table seems ๐Ÿค” unlesss they are usually ptrs or refs or sth and the hash is based on the address?
23:20:22FromDiscord<Avatarfighter> ๐Ÿคทโ€โ™€๏ธ
23:20:22PrestigeI do store the bounds inside the object, which is why I'd like to make this take an object with a getBounds proc
23:20:29Prestigeso I can avoid the table
23:21:02FromDiscord<Avatarfighter> Is this for a game?
23:21:06PrestigeI'm trying with boxing atm and I feel like I'm walking into generics hell
23:21:19FromDiscord<Avatarfighter> is the game a drawn game?
23:21:19PrestigeConverting my engine from TS to Nim
23:21:38FromDiscord<Avatarfighter> Sorry I mean does it have textures
23:21:50PrestigeYeah - it's this game for reference https://astroships.einheit.tech/
23:22:04FromDiscord<Avatarfighter> Because you could get away with using the sizing of the texture itself to get the bounds of the object
23:22:25Prestigethe texture and collision bounds don't always match though
23:22:27FromDiscord<nikki> er, i think it's usually the other way round: have an actual bounds, use that to decide how to scale the texture when rendering
23:22:46FromDiscord<nikki> texture sizes are in image coordinates which are diff from world size
23:22:49FromDiscord<Avatarfighter> yeah
23:23:00FromDiscord<Avatarfighter> hm
23:23:14FromDiscord<nikki> it seems like you don't need the concept and you could just call `val.getBounds`?
23:23:21FromDiscord<nikki> and do the concept check elsewhere
23:23:54PrestigeYeah, that's essentially what I want. I haven't used concepts before, trying to figure this out
23:24:03FromDiscord<Avatarfighter> I still think that using the texture as the bounds would work best if the actual texture and collision bounds were the same
23:24:11PrestigeThey aren't
23:24:22FromDiscord<Avatarfighter> Yeah that's what I feared lmao
23:24:34FromDiscord<Avatarfighter> I was trying to save you those valuable bits in memory ๐Ÿ˜›
23:25:09FromDiscord<nikki> you want to be able to redraw textures at a higher res and not have your level objects suddenly be at a different size
23:25:15FromDiscord<nikki> or same for lower res, or whatever
23:25:32FromDiscord<Avatarfighter> Yeah I understand
23:27:26Prestigewell I think I'm just confusing myself at this point.
23:28:58FromDiscord<nikki> separate q: is there something similar to a built-in hashed string type in nim?
23:29:14FromDiscord<nikki> like something that can hash at compile time, and stores the hash along with the value in the object
23:29:26FromDiscord<nikki> by built-in i mean in the stdlib, sorry
23:31:15disruptekyou mean like for accelerating a string cache?
23:32:30FromDiscord<nikki> yeah sth like that. in this case i was gonna use it for this thing where ... i'm loading something that has parameter names that bind at runtime, but then the code sets some common parameters that are compile time known
23:32:42FromDiscord<nikki> but like, whether those parameters exist / which ones exist for that object are defined at runtime
23:33:00FromDiscord<nikki> and there's very few of them, so it makes sense to use a seq of eg. (hash, value) pairs bc. the whole thing will fit in a cache line immediately
23:33:07FromDiscord<nikki> vs. using a table per one of these objects
23:33:23FromDiscord<nikki> i think i'll just work with it by keeping a hash value
23:35:25PrestigeThis is what I came up with for boxing the Boundable concept, which is very wrong and does not compile: https://play.nim-lang.org/#ix=2Dax
23:35:41PrestigeLost on what could/should be done here. I'm just confused, now
23:35:59FromDiscord<nikki> mmmmmm it seems like there's too much going on
23:36:01FromDiscord<nikki> haha
23:36:29FromDiscord<nikki> have u thought about the store an id approach?
23:37:35*NimBot joined #nim
23:37:43PrestigeI was thinking of storing a pointer, but I think you can't use that in a collection either
23:39:15FromDiscord<nikki> pretty sure a pointer in a collection could work
23:39:45FromDiscord<nikki> the id idea is: the user of this data structure / the outside world is storing the objects, and just passes those ids to this data structure
23:40:53PrestigeI suppose I could do that, yeah. Wish I could just use concepts in a simple way like an interface, though :P
23:41:26FromDiscord<nikki> i kind of like that the language doesn't add runtime dispatch automatically like that ยฏ\_(ใƒ„)_/ยฏ
23:41:34FromDiscord<nikki> altho to be fair, closures are that kind of thing
23:48:14Prestigeeh, I think the best solution atm is to just use GameObject that has getBounds
23:59:37disruptekthe idea of the box is that it holds different types of object.