<< 02-05-2020 >>

00:01:58Yardanicometaprogramming be like https://i.imgur.com/y7F7jeB.png
00:02:34Yardanicoand yes I took this print macro from nimpylib XD
00:08:54FromDiscord<KingDarBoja> https://github.com/nim-lang/Nim/wiki/Nim-for-Java-programmers
00:09:38disruptekot
00:10:01disrupteker, there's nothing inherently wrong with discarding a future.
00:11:33FromGitter<alehander92> but there is
00:11:53FromGitter<alehander92> it seems that an error can just stay hidden
00:11:59FromGitter<alehander92> which seems as a bad thing
00:12:27FromGitter<alehander92> maybe i am wrong, but if that's wrong, then we need to fix the "Futures should *never* be discarded." docs
00:13:04disruptekunless they MUST never be discarded, i'm okay with it.
00:13:47disruptekshould we also deny except:?
00:13:47FromGitter<alehander92> well, never makes it sounds like it should've been
00:13:51FromGitter<alehander92> must never
00:15:25FromGitter<alehander92> the problem is that i can easily imagine cases where you discard an async call and this leads to annoying non-obvious bug
00:15:42FromGitter<alehander92> and i cant imagine situation where you're like "oh no i need to discard this future"
00:16:02disrupteki guess i have a vivid imagination.
00:16:19FromGitter<alehander92> ok, give such a case
00:16:24FromGitter<alehander92> i am just trying to understand it, sorry
00:16:57disrupteki like to think that i'm god when it comes to software. unless i'm going to break the laws of physics, the machine should kowtow to me -- not the other way around.
00:17:27disruptekif i chose to type `discard` in front of a future, damnit what do you think i want to do with it?
00:17:52FromGitter<alehander92> but many users would just discard asyncCall() as the first obvious way
00:17:55FromGitter<alehander92> to run in background
00:17:59FromDiscord<Rika> @exelotl ok so after reading a bit of the article you sent, i have a question; how would i ensure that what objects i allocate on the heap are adjacent to each other?
00:18:03FromGitter<alehander92> thats just bad language design
00:18:11disrupteki'm going to give them all your cell-phone number so you can tutor them.
00:18:17disruptekisn't that what you want?
00:18:18FromGitter<alehander92> to make the easiest thing a buggy thing
00:18:21disrupteka better user-experience?
00:18:44FromGitter<alehander92> i want less bugs
00:18:48disruptekdiscard should be introduced later in the manual. that's a patch i'd support.
00:19:05FromGitter<alehander92> language design is not about "order in manuals"
00:19:11FromDiscord<Rika> then we'd have a lot of random people asking how to have an empty block
00:19:27disruptekit's not introduced in that context.
00:19:30FromGitter<alehander92> its about less "surprises which woudlnt be surprises if you read manual #2.7"
00:19:34disruptekbetter would be to really explain what it is.
00:19:40FromGitter<alehander92> dont we have enough with tax laws
00:19:59disrupteki think your argument might make sense for some languages, but not nim.
00:20:11FromDiscord<exelotl> if you have a seq of ref objects, where each one is allocated individually with new(), then you have no guarantee where each object will end up in memory
00:20:14FromGitter<alehander92> i dont want bugs in my programs in any language
00:20:22FromGitter<alehander92> its as simple as that
00:20:33disruptekthen don't program.
00:20:34FromDiscord<exelotl> but if you have a seq of non-ref objects, then those objects are guaranteed to be contiguous
00:20:44FromDiscord<Never Listen To Beef> Damn it disruptek, stealing my jokes
00:20:47FromDiscord<Rika> but non-ref are stackk
00:20:50FromGitter<alehander92> the other option is to make discard asyncCall() actually do what asyncCheck does
00:20:51FromDiscord<Rika> ?
00:20:56FromDiscord<exelotl> not if they're in a seq
00:20:58FromDiscord<Never Listen To Beef> Was going to say "Cant have any bugs in your programs if you dont make any"
00:21:00FromGitter<alehander92> but to just swallow errors
00:21:03FromDiscord<Rika> well i never mentioned a seq
00:21:04disruptekif i cannot discard a future, i cannot use async.
00:21:09disruptekthat's just nuts.
00:21:12FromGitter<alehander92> you cant philosophy your way out of it
00:21:21FromDiscord<Rika> okay, how would i make ref objects be contiguous with each other
00:21:33*xet7 quit (Quit: Leaving)
00:21:36disruptekuse memory regions or perform your own alloc.
00:21:59FromDiscord<Rika> memory regions?
00:22:03FromGitter<alehander92> i dont care about the discard, i care about the "raise error from it if it fails" part
00:22:06disruptek--gc:regions
00:22:09FromDiscord<Rika> if i perform my own alloc then am i really using nim at this point
00:22:25disruptekasyncCheck is terrible. i never use it and i cannot imagine why it exists.
00:22:41FromDiscord<exelotl> if it's a worthwhile optimisation then sure rika
00:22:58FromGitter<alehander92> ok, i am stupid
00:23:00FromGitter<alehander92> so, what should happen
00:23:05FromGitter<alehander92> when you do discard a()
00:23:10disruptekhaving related data nearby in memory is almost always an optimization.
00:23:10FromDiscord<Rika> okay, ill just keep that in mind; i fear that i am totally doing premature optim. right now
00:23:12FromGitter<alehander92> and a completes with fail
00:23:28disruptekmake it work, make it correct, make it fast.
00:23:35FromDiscord<Rika> disruptek: the thing is whether it is worthwhile or not
00:23:52disruptekif it's not worthwhile, don't even bother to make it work.
00:23:53FromGitter<alehander92> disruptek stop with the slogans
00:24:00disruptekthat's how i hack on the compiler.
00:24:02FromGitter<alehander92> this isnt a socialist demonstration
00:24:05FromGitter<alehander92> even if its 1 may
00:24:05FromGitter<alehander92> :D
00:24:12FromDiscord<KingDarBoja> Who said socialism?
00:24:18FromGitter<alehander92> this really doesnt answer a question
00:24:21FromDiscord<KingDarBoja> ☭
00:24:26disruptekyou haven't asked one worthy of answer.
00:24:28*xet7 joined #nim
00:24:40FromGitter<alehander92> and you can always do
00:24:48FromGitter<alehander92> let ignorename = future
00:24:50FromGitter<alehander92> here
00:24:57FromGitter<alehander92> you have it, discard workaround
00:25:08disruptekuh, no.
00:25:15FromGitter<alehander92> so this is bad
00:25:22FromGitter<alehander92> but *ignoring* errors on purpose
00:25:23FromGitter<alehander92> is fine
00:25:37disruptekthat's why we have discard.
00:25:45disruptekbecause programmers know better than us sometimes.
00:25:52FromGitter<alehander92> discard is for ignoring *values*
00:26:01disruptekdude.
00:26:05disruptekread the code.
00:26:18FromGitter<alehander92> dude, you can still ignore an error if you want
00:26:18FromDiscord<exelotl> throwback to the time I saw discard in a shader and assumed it was the same as discard in nim
00:26:28FromDiscord<Never Listen To Beef> lol
00:26:39FromDiscord<Never Listen To Beef> It sorta is, you say you dont want that pixel 😛
00:26:40FromGitter<alehander92> the problem is that i've seen that in node
00:27:04FromGitter<alehander92> writing several random background calls, never seeing any actual error, random stuff breaks
00:27:07FromGitter<alehander92> its just super annoying bugs
00:27:39FromGitter<alehander92> you cant discard an exception in sync code
00:27:46FromGitter<alehander92> if you could, then ok
00:30:02disrupteksure you can.
00:30:03FromDiscord<Rika> try: code except: discard
00:30:05FromDiscord<Rika> ????
00:30:14disrupteknailed it.
00:30:22FromGitter<alehander92> and .. you use .. except
00:30:23FromDiscord<Rika> with that code you've essentially discarded an exception
00:30:26FromGitter<alehander92> totally the same code
00:30:31disruptekuh, no.
00:30:32FromGitter<alehander92> that's exactly what i am saying
00:30:33FromGitter<alehander92> make it raise
00:30:41FromGitter<alehander92> then yeah, use try except
00:30:43FromDiscord<Never Listen To Beef> ```
00:30:43FromDiscord<Never Listen To Beef> a
00:30:44FromDiscord<Never Listen To Beef> defer: discard
00:30:44FromDiscord<Never Listen To Beef> ```
00:30:44FromGitter<alehander92> somehow
00:30:48FromDiscord<KingDarBoja> From past disruptek: _basically, it's a nice feature and discard discards it. keep it and use it instead._
00:30:50disruptekbut it's fine. i know araq agrees with me. 😁
00:30:56FromDiscord<Rika> @Never Listen To Beef what's that supposed t odo
00:30:59FromDiscord<KingDarBoja> Still no idea what he meant hahaha
00:31:17FromGitter<alehander92> but araq agreeing with you doesnt make it correct
00:31:34FromDiscord<Never Listen To Beef> i mean that'd put all the stuff inside a try block then discard the finally
00:31:36disrupteki'm saying that i'm not terribly motivated to convince you.
00:31:52FromDiscord<Never Listen To Beef> I mean it's silly cause it's silly
00:31:54FromDiscord<Rika> @Never Listen To Beef it wouldnt catch the exception
00:32:02FromDiscord<Never Listen To Beef> Doesnt he want to discard the exception?
00:32:09FromDiscord<Rika> thats what he said
00:32:12disrupteki want to discard /futures/
00:32:24FromDiscord<Rika> oh, you mean disruptek
00:32:44FromDiscord<Rika> well i dont understand why you want to but eh i might just not know
00:32:49FromDiscord<Never Listen To Beef> I mean i dont either
00:32:53FromDiscord<Never Listen To Beef> Exceptions exist to help you
00:32:55FromGitter<alehander92> which you can
00:33:08FromDiscord<Never Listen To Beef> Although the xlib library stuff i dont catch any of the errors directly
00:35:23FromGitter<alehander92> ok disruptek
00:35:30FromGitter<alehander92> you need to then solve for me
00:35:40disruptekunlikely.
00:35:43FromGitter<alehander92> how can i detect if "background" async calls
00:35:48FromGitter<alehander92> in my codebase
00:35:54FromGitter<alehander92> written from other random people
00:36:02FromGitter<alehander92> dont error
00:36:06FromGitter<alehander92> detect on runtime*
00:37:07disruptekhow do you detect any runtime error?
00:37:20FromGitter<alehander92> by seeing the exception
00:37:24FromGitter<alehander92> or crash
00:37:34disruptekwell, do that.
00:37:36FromGitter<alehander92> or *explicitly* handling it in try except
00:37:40FromGitter<alehander92> but i *cant* do that
00:37:45FromGitter<alehander92> if somebody just goes discard a()
00:37:49disrupteka future is not an exception.
00:38:10FromGitter<alehander92> but an async call can be
00:38:26disruptekshow me your problematic code.
00:38:55FromGitter<alehander92> every code that does discard aCall()
00:39:18disruptekoh, i see. we should break discard for just this one library in stdlib.
00:39:22disruptekthat's your position?
00:39:44disruptekbecause someone /could/ write something that has an unexpected effect.
00:39:53disruptekbecause they didn't read the manual.
00:39:57FromGitter<alehander92> every time you write discard asyncCall() # you just say "go silent errors"
00:40:04FromGitter<alehander92> the language doesnt work that way
00:40:13FromGitter<alehander92> it doesnt happen when you call sync calls
00:40:18FromGitter<alehander92> when you await normal calls
00:40:18disruptekif you don't understand it after your work on await, i don't think i can explain it to you.
00:40:26FromGitter<alehander92> oh, i understand it
00:40:33disruptekbut, look. we don't /have/ to agree.
00:40:37FromGitter<alehander92> but does one need to be an expert in async
00:40:47FromGitter<alehander92> or to have been bitten 5 times by it?
00:40:54disruptekthey do if they cannot discard a future, i guess.
00:41:04FromGitter<alehander92> ok, lets differentiate
00:41:12FromGitter<alehander92> i am ok with discarding a future variable
00:41:20FromGitter<alehander92> i dont want to discard an async call
00:41:27disruptekdude, i am trying to invent a new try/except. i really don't want to argue with you.
00:41:28FromGitter<alehander92> if it was possible to make the difference somehow
00:41:32FromGitter<alehander92> i would be ok with it
00:41:44FromDiscord<Rika> disruptek: do you think its a stupid idea to introduce a `new` proc that can be passed a count to initialize x ref objects of that type contiguously?
00:41:48FromGitter<alehander92> well if you dont want to, dont block useful additions
00:42:09disruptekthere's no point to argue because it won't be changed.
00:42:14leorizeRika: newSeqWith?
00:42:16disrupteki'm not blocking anything.
00:42:35FromGitter<alehander92> ok, sorry for the wrong way to word it
00:42:50FromDiscord<Rika> leorize: ?
00:42:53FromDiscord<Rika> hm?
00:43:06FromGitter<alehander92> probably we still kinda misunderstand each other
00:43:07disruptekdiscarding an async call... that's another story.
00:43:16disruptekdiscarding a future... this is something else.
00:43:31leorizeRika: `newSeqWith` seems to be what you're looking for :P
00:43:32FromGitter<alehander92> i agree, sorry, i should've separated them early
00:43:51FromGitter<alehander92> but is there a way to detect that on compile time?
00:44:03disruptekyou could have a macro that detects it.
00:44:29FromGitter<alehander92> maybe term rewriting macros can
00:44:32FromDiscord<Rika> leorize: i dont see how
00:44:36FromGitter<alehander92> but i am very unfamiliar with them
00:44:50FromDiscord<Rika> does it guarantee that the objects are near each other in memory?
00:45:04disruptekyes.
00:45:26disruptekthe refs, anyway.
00:45:29disrupteknot their values.
00:45:37FromDiscord<Rika> i mean their values
00:45:47disruptekuse value types if you want values?
00:45:57disruptekvalue types are better.
00:46:30FromDiscord<Rika> that'd be a bit difficult
00:46:37FromDiscord<Rika> ill think about it more
00:47:22leorizeif you want object next to each other, use a seq of values?
00:47:31leorizedon't copy C's broken semantics
00:48:48*PMunch quit (Quit: leaving)
00:49:24FromDiscord<Never Listen To Beef> You say value types are better but my OOP brain says, suuuuure 😄
00:49:43FromDiscord<KingDarBoja> You mean object variants? 😄
00:50:16FromDiscord<KingDarBoja> Btw, what's the recommended way of documenting a type, right after the type Rika = enum line?
00:50:31leorizewhen I first pick up programming I avoided OOP at all costs :P
00:50:35FromDiscord<KingDarBoja> Or between type and MyHumbleType (separated lines)
00:50:49leorizeone indent, then a doc comment
00:51:18FromDiscord<KingDarBoja> Okie Dokie 🙂
00:51:34FromDiscord<KingDarBoja> `type MyHumble = enum`
00:51:44FromDiscord<KingDarBoja> ` ## My docstirng`
00:51:57FromDiscord<exelotl> Pick two: by-reference semantics, contiguity, resizable container
00:51:59FromDiscord<KingDarBoja> ` north, west, etc..`
00:52:07FromDiscord<KingDarBoja> Like that?
00:52:26leorizeyea
00:52:30FromDiscord<KingDarBoja> 😗
00:53:01FromDiscord<exelotl> by which I mean, you can have a seq of values and take pointers to those values, but all the pointers will become invalid if the sequence is ever reallocated
00:53:53FromDiscord<Rika> i dont think i need resizing
00:54:35FromDiscord<Rika> man this is a headache
00:55:41leorizewhat are you trying to do?
00:55:47leorizemaybe I can figure out a way
00:56:03leorizeare you by any chance attempting object pooling?
00:58:25FromDiscord<Never Listen To Beef> I am sorta interested on how you guys would design a system where Screens have positions, sizes, Workspaces and a selected workspace, and those workspaces have windows, and a selected window
00:58:45FromDiscord<Never Listen To Beef> *I feel like you guys wouldnt use ref objects* 😄
00:58:47FromGitter<alehander92> disruptek sorry again
00:59:03FromGitter<alehander92> and thanks for the direction, i think i found a way
00:59:05disruptekwe're cool, dude.
00:59:10FromGitter<alehander92> to adapt this guy's macro
01:00:09disruptekyou could use the effect system.
01:00:35FromGitter<alehander92> no https://github.com/nim-lang/Nim/issues/11912
01:00:36disbotAdd undiscardable pragma and forbid Futures from being discarded
01:00:38FromGitter<alehander92> it seems it works
01:02:35FromDiscord<Rika> i think i know what to do now
01:02:56FromGitter<alehander92> sorry https://github.com/nim-lang/Nim/issues/11912#issuecomment-622645281
01:02:56disbotAdd undiscardable pragma and forbid Futures from being discarded
01:02:57FromDiscord<Rika> `object`s in a seq act like a `ref object` no?
01:03:04FromGitter<alehander92> yeah it seems this sould be an ok version
01:09:01FromGitter<alehander92> do we have a way to say "dont rewrite that more"
01:09:40leorizeRika: no, they don't have ref semantics
01:09:58leorizeyou can "refer" to them via indices though
01:12:42*muffindrake quit (Quit: muffindrake)
01:14:15disruptekalehander92: the best solution is to not add the code in the first place.
01:18:41*muffindrake joined #nim
01:31:12FromDiscord<Rika> leorize: i misphrased
01:31:21FromDiscord<Rika> ill just do whatever and see if i get issues
01:38:36FromGitter<alehander92> disruptek its like public safety
01:38:58FromGitter<alehander92> sometimes its ok to forbid people entering the hazard zone
01:41:30*waleee-cl quit (Quit: Connection closed for inactivity)
01:42:18FromGitter<alehander92> otherwise i am ok with giving `ignoreErrors a()` instead of discard
01:42:22FromGitter<alehander92> so at least one can grep
01:44:21FromGitter<alehander92> (which one can still do now just by using try/empty except around await and run that in the background)
01:45:26FromGitter<alehander92> and this way we dont break one such "law" of physics: exceptions travel up to an except clause
01:45:41FromGitter<alehander92> not to an except clause or one case of discard
01:46:11disruptekdiscarding a future isn't an exception.
01:46:22FromGitter<alehander92> yes, i am not talking about this
01:46:29FromGitter<alehander92> i am talking about discard asyncCall()
01:46:50disruptekwhat's the difference?
01:47:00FromGitter<alehander92> it is that now suddenly my exception
01:47:05FromGitter<alehander92> never gets to an except clause
01:47:11FromGitter<alehander92> because it is .. discarded ??
01:47:16FromGitter<alehander92> it doesnt make sense
01:47:23FromGitter<alehander92> it breaks the laws of physics
01:47:48disruptekwhat exception?
01:47:58disrupteki'm talking about futures.
01:48:00FromGitter<alehander92> the one somewhere inside asyncCall children
01:48:04disrupteky'know, the value you want to discard.
01:48:06FromGitter<alehander92> i agreed with you for futures
01:48:13FromGitter<alehander92> i changed the title of my issue
01:48:18disruptekwhat do your async procs return?
01:48:30FromGitter<alehander92> futures
01:48:34disruptekokay?
01:48:48FromGitter<alehander92> so then
01:48:57FromGitter<alehander92> discard asyncCall() should register an error callback.
01:49:21disruptekwhat's the error?
01:49:53FromGitter<alehander92> possibly an exception raised inside
01:50:00disruptekso what?
01:50:19FromGitter<alehander92> so your whole argument is that discard should not be broken for one case
01:50:27*chemist69 quit (Ping timeout: 240 seconds)
01:50:29FromGitter<alehander92> and my whole argument is that i also want raise to not be broken for one case
01:50:30disruptekit shouldn't be broken at all.
01:50:34FromGitter<alehander92> i want my raise
01:50:38FromGitter<alehander92> to raise
01:50:42leorize[m]what is this discard argument?
01:50:43disruptekraise isn't broken.
01:50:49FromGitter<alehander92> and the exception to travel until an except
01:50:52FromGitter<alehander92> not until a discard
01:50:56disruptekit does.
01:50:58leorize[m]can someone fill me in on this?
01:51:00FromGitter<alehander92> it does not
01:51:08disrupteknot really, it's silly.
01:51:10FromGitter<alehander92> i do asyncCall() = .. raise
01:51:11disruptek#11912
01:51:12disbothttps://github.com/nim-lang/Nim/issues/11912 -- 3Add undiscardable pragma and forbid Futures from being discarded (EDIT: only async calls maybe)
01:51:17FromGitter<alehander92> discard asyncCall() # bam no error
01:51:23FromGitter<alehander92> no except:
01:51:26FromGitter<alehander92> still no error
01:51:30FromGitter<alehander92> broken law
01:51:45disruptekyou just don't understand async.
01:52:00FromGitter<alehander92> so, explain it to me
01:52:00disruptekit's okay; i'm pretty sure dom doesn't understand it, either.
01:52:09FromGitter<alehander92> this is bullshit
01:52:19FromGitter<alehander92> with all my love for ya
01:52:31disruptekit's a closure. if you don't iterate over it, it doesn't run. if it does except, it stores the exception in the future.
01:52:43disruptekyou can query it if you want, or don't.
01:52:49*chemist69 joined #nim
01:52:53disruptekyou can raise it in sync code, or not.
01:53:08disruptekima go play video games. maybe leorize can convince you.
01:53:15FromGitter<alehander92> i know well the code which is generated
01:53:16disrupteki need to learn PoE for work.
01:53:33disruptekgotta get those exalts.
01:53:39FromGitter<alehander92> but this doesnt address my concerns at all
01:53:43FromGitter<alehander92> you still have silent bugs
01:53:46disrupteki'm okay with that.
01:53:49FromGitter<alehander92> and raise still works unexpectedly
01:54:15FromGitter<alehander92> and it shoudln't have anything to do with "its a closure" imho
01:54:16disruptekthere are lots of fair criticisms to be made of async.
01:54:26FromGitter<alehander92> closures dont know of "Futures"
01:54:32FromGitter<alehander92> this is not a property of closures
01:56:20FromGitter<alehander92> the whole "stores exception" thing is just an asyncmacro invention
01:57:14FromGitter<alehander92> and my problem is
01:57:36FromGitter<alehander92> i can see how let a = asyncCall() # ignore errors but maybe later do something about them somehow
01:57:39FromGitter<alehander92> can be useful
01:58:34FromGitter<alehander92> but discard asyncCall() just doesnt serve any useful purpose in my mind, it's just "lets not write let ignored = so people can suffer by silent bugs"
01:58:54FromGitter<alehander92> but maybe i am too emotional about it, sorry again, have a great night :D
02:01:50*Senketsu joined #nim
02:07:06*Senketsu quit (Quit: WeeChat 2.8)
02:08:20*Senketsu joined #nim
02:08:43*tlanger joined #nim
02:09:13*Senketsu quit (Client Quit)
02:11:15*ryan_ joined #nim
02:11:38FromDiscord<KingDarBoja> Rika, Yard?
02:13:05*Senketsu joined #nim
02:14:27*tlanger quit (Ping timeout: 258 seconds)
02:15:14*mono joined #nim
02:17:42*monok quit (Ping timeout: 260 seconds)
02:26:22*muffindrake quit (Ping timeout: 260 seconds)
02:28:20*muffindrake joined #nim
02:28:37*Senketsu quit (Quit: WeeChat 2.8)
02:31:49FromDiscord<Rika> hi
02:32:39FromDiscord<Rika> @KingDarBoja wat
02:45:35FromGitter<bung87> how to do seq equals?
02:48:01FromDiscord<Rika> ==?
02:50:33FromGitter<bung87> hmm, my bad , there's one item not equals.
03:01:59*zacharycarter quit (Ping timeout: 258 seconds)
03:12:36*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
03:13:54*zacharycarter joined #nim
03:48:06FromDiscord<KingDarBoja> Rika, I am back, sorry 😄
03:51:36*GabbyWest joined #nim
03:52:36FromDiscord<KingDarBoja> Was going to ask if it is possible to create methods at runtime
03:53:58*GabbyWest quit (Client Quit)
03:54:32FromDiscord<bedwardly-down> @Never Listen To Beef , so i spent part of the day learning how parsing works and some of the weird basic stuff that’s actually pretty intuitive
03:55:03FromDiscord<Rika> @KingDarBoja but?
03:55:52FromDiscord<KingDarBoja> Just that, 🙂
03:56:23FromDiscord<KingDarBoja> I swear I need another monitor
03:56:36FromDiscord<KingDarBoja> Can't look at multiple windows, only two max and it is still small
03:56:48FromDiscord<Rika> you cannot
03:57:32FromDiscord<KingDarBoja> Ah, okay
03:57:48FromDiscord<KingDarBoja> Right now comparison 3 different implementations of same module
03:58:11FromDiscord<KingDarBoja> The original in JS, the Python one and GO one, this last one seems intuitive as it is strong typed
03:58:48FromDiscord<Rika> go will be easiest to port i assume
04:00:14FromDiscord<KingDarBoja> But it is the longest one lol
04:01:16skrylar[m]Go is cute. I didn't mind writing some of it
04:01:40FromDiscord<KingDarBoja> https://github.com/graphql-go/graphql/blob/master/language/visitor/visitor.go
04:02:00FromDiscord<KingDarBoja> Source implementation in JS -> https://github.com/graphql/graphql-js/blob/master/src/language/visitor.js
04:02:12FromDiscord<KingDarBoja> I feel like it is a mess hahaha
04:02:15skrylar[m]when i tried to look up how graphql worked what i found was that apparently its just the whole query string jammed in a GET request o.O
04:02:41FromDiscord<KingDarBoja> Oh yeah
04:02:47FromDiscord<KingDarBoja> It is
04:03:05FromDiscord<KingDarBoja> The parser and lexer works, just need to get the rest of stuff done
04:03:09skrylar[m]should probably experiment with it some time; never actually got around to using it for anything. :X
04:03:16FromDiscord<KingDarBoja> And ofc use object variants
04:03:25skrylar[m]was thinking of toying around with beeflang but the ide is required for some hcr stuff, and the ide doesn't work on linux, so rip.
04:03:39FromDiscord<KingDarBoja> It is awesome as it will give u better error responses and type safety
04:04:30FromDiscord<KingDarBoja> Did you saw the visitor on JS?
04:04:57FromDiscord<KingDarBoja> They using Flow with JS, I really hope the Typescript migration happens on the short term
04:04:59FromDiscord<KingDarBoja> x.x
04:05:11skrylar[m]whats wrong with flow
04:06:00skrylar[m]i gave typescript a light poke and was not impressed waiting 5 seconds for hello world to 'build'
04:06:01FromDiscord<KingDarBoja> They had to rely on workarounds for some type definitions
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:32FromDiscord<KingDarBoja> Remember that TS does Type checking and transpile into JS
04:06:43*supakeen joined #nim
04:07:01FromDiscord<KingDarBoja> So everything will take a bit to transpile into JS then execute
04:07:04skrylar[m]yeah so does nim and v
04:07:31FromDiscord<KingDarBoja> You're right
04:07:53skrylar[m]i still need to check what the opengl module is doing because when i imported it my import stack exploded and my builds went from 1s to 5-7s ... which is weird because it SHOULD just be a pile of innocent getproc's
04:08:33FromDiscord<KingDarBoja> Anyway, I will try to port that module, seems messy lol
04:09:20skrylar[m]it looks pretty gnarly which is weird for a visitor
04:09:42FromDiscord<KingDarBoja> gnarly?
04:11:00FromDiscord<KingDarBoja> Also, what you guys recommend for exporting proc / vars on a module
04:11:12FromDiscord<KingDarBoja> use `*` or declare at top level using export ?
04:11:18skrylar[m]it looks like a hot mess to me; i'm used to seeing visitors just like. switch on a type and then call accept_foo to recurse
04:11:52skrylar[m]pretty sure `export` has to do with making it C accessible and `*` is about making it public in the module to other nim code
04:11:58leorize[m]@KingDarBoja: export at top level is not designed for exporting proc inside your module
04:12:03FromDiscord<KingDarBoja> Ah ok
04:12:08FromDiscord<KingDarBoja> Thanks
04:12:24FromDiscord<KingDarBoja> skylar: at some part (the visit function) seems to do that but very messy
04:13:10FromDiscord<KingDarBoja> Also, do you know Go right? I think you mentioned that few comments ago
04:13:33skrylar[m]i dunno enough about what they are doing. i've just seen very clean visitors in Pharo/Squeak and i write them the same way they did elsewhere. it might be more clogged looking because they have to do some extra reflecting or something :shrug:
04:14:21skrylar[m]closures in nim are very nice and its pretty easy to do sax style visitors with a struct of them and then just call those.
04:14:40*FromDiscord <KingDarBoja> Too bad I am still noobish
04:15:00FromDiscord<bedwardly-down> How noobish are you? Day 2 here
04:15:11FromDiscord<KingDarBoja> 1 month I think
04:15:18skrylar[m]https://github.com/Skrylar/skcbor/blob/master/skcbor.nim#L66 =p
04:15:38FromDiscord<KingDarBoja> 2 months to be honest
04:16:15FromDiscord<KingDarBoja> Ahhhh
04:16:22FromDiscord<bedwardly-down> Nothing wrong with that if you're willing to learn and improve
04:16:23FromDiscord<bedwardly-down> 😄
04:16:37FromDiscord<KingDarBoja> Skrylar: pretty clever approach
04:17:00FromDiscord<KingDarBoja> I am worried about the visit function as it returns `Any` on JS-base implementation
04:17:12FromDiscord<KingDarBoja> Python does the same and Golang defines interface{}
04:17:21FromDiscord<KingDarBoja> Which I have no idea what that means on GO lol
04:17:32skrylar[m]`interface{}` is basically `void*`
04:17:58FromDiscord<Rika> so nim's `pointer` xd
04:18:06FromDiscord<bedwardly-down> Is that the same as Void in most languages where it returns nothing and cannot be returned?
04:18:21FromDiscord<Rika> no
04:18:24skrylar[m]no the star makes it a pointer
04:18:30FromDiscord<bedwardly-down> Most languages like Java or Haxe
04:18:37FromDiscord<Rika> it is the same as "literally any data type"
04:18:53FromDiscord<KingDarBoja> Wait calm down
04:18:58FromDiscord<Rika> and "good luck figuring out what this type is"
04:19:01FromDiscord<bedwardly-down> I missed the pointer comment. I was refering to Void
04:19:08skrylar[m]go interfaces have automatic membership and `interface{}` is an interface with no required method, thus every struct is a valid member
04:19:34skrylar[m]although go still type checks casting from `interface{}` so there is some safety and runtime overhead
04:19:34FromDiscord<KingDarBoja> JS -> Any , Python -> Any (it is just a type hint), Go -> interface{}, Nim -> ?
04:19:45FromDiscord<Rika> `pointer`
04:19:48FromDiscord<KingDarBoja> Ok
04:19:50skrylar[m]not quite
04:19:58FromDiscord<bedwardly-down> How do you guys find time to understand as many languages as you do and then apply them in this context?
04:19:59FromDiscord<Rika> its the closest thing
04:20:04skrylar[m]i think we do have an "any" module but its a little screwy
04:20:17skrylar[m]nim's equivalent would be ref rootobj
04:20:24FromDiscord<Rika> just dont use it, convert it into a proper static typing system
04:20:30FromDiscord<KingDarBoja> I do know Python and TS
04:20:32skrylar[m]because if you put something in a pointer it doesn't inform the gc what you did
04:20:35FromDiscord<KingDarBoja> Rika: yup
04:20:55FromDiscord<KingDarBoja> So anything like skrylar shared
04:21:06FromDiscord<KingDarBoja> right? I mean -> https://github.com/Skrylar/skcbor/blob/master/skcbor.nim#L66
04:21:12skrylar[m]this problem is why that skcbor module has a box type
04:21:32*zacharycarter quit (Ping timeout: 272 seconds)
04:21:47skrylar[m]but nims equivalent to `interface{}` is `ref RootObj`
04:22:55FromDiscord<KingDarBoja> So the idea should be
04:23:20FromDiscord<KingDarBoja> Use the kind (object variants) and call a proc per kind
04:24:19leorize[m]skrylar[m]: Nim do have typesafe conversion between ref object types
04:27:52skrylar[m]unrelatedly should probably bother someone that `after_code_reload:` causes segfaults on windows in devel
04:28:20leorizecan you file an issue?
04:29:16FromDiscord<KingDarBoja> I like the Golang impl organization of the AST lol
04:29:42skrylar[m]go and v are cute.
04:29:51FromDiscord<KingDarBoja> https://github.com/graphql-go/graphql/blob/master/language/ast/node.go
04:30:07FromDiscord<KingDarBoja> I assume this is equivalent to the object variants
04:30:26skrylar[m]are you just parsing graphql?
04:30:51FromDiscord<KingDarBoja> By parsing what u mean?
04:30:54FromDiscord<KingDarBoja> Porting?
04:31:03leorizeparsing
04:31:16leorizelike read the language and understand it kind of thing :P
04:31:28*silvernode joined #nim
04:31:38FromDiscord<KingDarBoja> Yes
04:31:47FromDiscord<KingDarBoja> It does
04:31:52silvernodegood morning
04:32:03FromDiscord<KingDarBoja> Or not sure if you mean reading the spec and doing that
04:32:10skrylar[m]if you're just trying to get a nim program to read graphql queries you're probably better off looking at references for parsing in static languages (like npeg or mratsim's thing) than trying to copy how dynamic languages do it
04:32:40FromDiscord<KingDarBoja> That's why I started to look at Go
04:33:21FromDiscord<KingDarBoja> But the source implementation was done in JS so that's why it gets harder to understand things and how stuff got implemented
04:33:38skrylar[m]yea parsing used to be my nemesis
04:34:01leorizeif you write a parser, lexbase is an excellent base
04:35:14FromDiscord<KingDarBoja> It's not only a parser 😛
04:35:50silvernodeCan anyone explain what scenario I might want to use a reference object? Still trying to make my grid map for my game and someone here recommened making a position type that takes a reference to the grid type but I am not really sure how to approach this or why I would want to.
04:36:00FromDiscord<KingDarBoja> But been able to overcome some stuff and learn Nim on the way
04:36:08FromDiscord<KingDarBoja> Thanks to you guys ofc
04:36:26leorizesilvernode: you use a ref object when you need the reference semantics
04:36:42skrylar[m]well when it comes to ASTs they are purely there for the convenience of a program trying to understand stuff; there is often no point in trying to be exactly close to another AST
04:36:57leorizesilvernode: the "I want this to reference the same thing when I 'copy' it" and not "I want to optimize"
04:37:52skrylar[m]@silvernode references are pointers but garbage collected
04:39:06silvernodehmm, this all sort of makes sense to me but I'll be honest, I am still trying to comprehend the concept of pointers/refs.
04:40:07leorizethere's the low level and the high level aspect of them
04:40:57leorizelet me see if I can still find this documentation Zevv wrote
04:41:18silvernodeleorize: thanks
04:41:27FromDiscord<KingDarBoja> skrylar: https://graphql.org/code/ look at all the current graphql implementation languages
04:43:49leorizesilvernode: http://zevv.nl/nim-memory/
04:44:43silvernodeleorize: hopefully this will help me understand, thank you :)
04:46:06leorizeI don't think I remember how I understood pointers, but I think what I did was that I played a lot with them
04:46:22FromDiscord<KingDarBoja> That's a neat doc
04:46:26FromDiscord<KingDarBoja> Bookmarked
04:46:33leorize~memory
04:46:39leorizedisbot?
04:46:42FromDiscord<KingDarBoja> Rip
04:46:50leorizedisruptek: your bot is dead again
04:48:24*zacharycarter joined #nim
04:49:44leorizeplaying with pointers seem to be the way. I've just read some of the materials I used back when I step in programming and none of them fully explain the concept
04:50:24skrylar[m]beef has some interesting memory operators
04:50:55skrylar[m]mostly around letting you muck with custom mallocs for certain purposes
04:51:17skrylar[m]but they are explicitly gc-less so they can get away with more silly things easier
04:53:12*zacharycarter quit (Ping timeout: 272 seconds)
04:53:22leorizeRika: we do actually have a way to allocate a block of GC-ed memory
04:53:26leorizenot that I recommend it
04:53:37FromDiscord<Rika> which is
04:54:41leorizeunsafeNew
04:56:45leorizebut note that this is for allocating a block
04:56:54leorizenot for "a bunch of refs side by side"
04:57:27*silvernode quit (Ping timeout: 260 seconds)
05:02:05*chemist69 quit (Ping timeout: 240 seconds)
05:02:56leorizewhat would be a sane default for a process spawning interface?
05:03:01leorizewhat do people use the most?
05:03:18*chemist69 joined #nim
05:04:44FromGitter<bung87> `execCmdEx` seems good
05:06:04FromGitter<bung87> it return exitcode and stdout , quite common use case.
05:10:02FromDiscord<Never Listen To Beef> If i see another person talk about the beef programming language i think i have to change my name
05:10:10FromDiscord<KingDarBoja> Beeeef
05:10:24FromDiscord<KingDarBoja> I can't belive it is actually a language
05:10:28FromDiscord<KingDarBoja> With a beef logo lol
05:11:59FromDiscord<Rika> ref seqs are identical to seqs in memory?
05:12:00FromDiscord<Rika> cool
05:13:44FromDiscord<Rika> ah nvm, zev's article is outdated?
05:14:35leorizenot that outdated
05:15:15leorizeactually it's super up to date regarding old runtime
05:15:59FromDiscord<Rika> hmm, i think its just how nim's repr prints seqs now
05:16:13FromDiscord<Rika> i dont think repr for seqs show that its from a ptr anymore?
05:16:38leorize!eval echo repr @[ 0x30, 0x40, 0x50 ]
05:16:41NimBot0x563e87311860@[48, 64, 80]↵
05:18:05*NimBot joined #nim
05:25:46disruptek~memory
05:25:47disbotno footnotes for `memory`. 🙁
05:25:57disruptekwhen was that ever a thing?
05:27:29leorizeI was checking to see if it's free
05:27:30*zacharycarter joined #nim
05:28:09FromDiscord<Rika> so why doesnt nim show that seqs are pointers tho
05:28:13leorize~memory: The Nim memory model: https://zevv.nl/nim-memory/
05:28:13FromDiscord<Rika> in repr
05:28:14disbotno footnotes for `memory:`. 🙁
05:28:21leorize~memory The Nim memory model: https://zevv.nl/nim-memory/
05:28:22disbotno footnotes for `memory`. 🙁
05:28:22FromDiscord<Rika> its memory is
05:28:27leorize~memory is The Nim memory model: https://zevv.nl/nim-memory/
05:28:28disbotmemory: 11The Nim memory model: https://zevv.nl/nim-memory/
05:28:33leorizethanks :P
05:32:01*zacharycarter quit (Ping timeout: 265 seconds)
05:51:20FromGitter<dawkot> Is VSCode Nim extension popular?
05:51:23FromGitter<dawkot> Seems pretty inactive on github
05:51:39Yardanicowell it's ok
05:51:49YardanicoI think it's still the most popular choice for nim
05:52:31FromDiscord<Never Listen To Beef> Use gary's branch for nicer syntax highlighting
05:52:31FromDiscord<Never Listen To Beef> https://marketplace.visualstudio.com/items?itemName=garym.nim-alt
05:53:34Yardanicowell syntax highlighting isn't the main issue with it
05:54:28FromDiscord<Never Listen To Beef> Sure, well i didnt say it was, just saying it has better syntax highlighting 😄
06:13:27FromDiscord<KingDarBoja> Installing rightnow
06:15:16FromDiscord<KingDarBoja> Done, seems ok
06:15:18FromDiscord<KingDarBoja> good night
06:17:44*solitudesf joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:06FromGitter<bung87> how to do async test?
07:04:45*gmpreussner joined #nim
07:15:35*Vladar joined #nim
07:57:52*voltist joined #nim
08:07:04FromDiscord<Benumbed> Can anyone spot what I'm doing wrong here? https://play.nim-lang.org/#ix=2kqM as far as I undersood, default params are fine in templates...
08:15:32FromDiscord<Rika> @Benumbed `(ref exceptn)(class: class, meth: meth, code: code, msg: message)` becomes `(ref exceptn)(0: 0, 0: 0, 0: 0, msg: message)`
08:15:38FromDiscord<Rika> rename the variables to something ele
08:15:40FromDiscord<Rika> else*
08:17:43FromDiscord<Benumbed> oh my god I feel quite stupid, thanks @Rika
08:17:47*dddddd joined #nim
08:17:47FromDiscord<Benumbed> I should go to bed I think lol
09:26:00*Trustable joined #nim
09:34:11*fredrikhr joined #nim
09:39:12*dddddd quit (Ping timeout: 256 seconds)
09:46:20*krux02 joined #nim
09:48:42voltistIt seemed only fitting that my website, made with Nim, should use the Dracula theme: https://liamsc.com/
09:51:57*krux02 quit (Remote host closed the connection)
09:54:01*fredrikhr quit (Read error: Connection reset by peer)
09:54:26*fredrikhr joined #nim
10:04:30*fredrikhr quit (Read error: Connection reset by peer)
10:04:55*fredrikhr joined #nim
10:30:21*filcuc joined #nim
10:31:01*zacharycarter joined #nim
10:31:29*fredrikhr quit (Read error: Connection reset by peer)
10:31:54*fredrikhr joined #nim
10:35:43*zacharycarter quit (Ping timeout: 256 seconds)
10:36:40Prestigevoltist: bad gateway
10:37:20voltistPrestige: Seems fine to me
10:37:28Prestigehuh weird
10:37:30*fredrikhr quit (Read error: Connection reset by peer)
10:37:49Prestigehttps://0x0.st/i2qs.png
10:37:58*fredrikhr joined #nim
10:40:18solitudesf502 for me too
10:42:30*fredrikhr quit (Read error: Connection reset by peer)
10:42:55*fredrikhr joined #nim
10:45:17*zacharycarter joined #nim
10:46:16*filcuc_ joined #nim
10:46:28*filcuc quit (Ping timeout: 256 seconds)
10:48:38*waleee-cl joined #nim
10:48:58AraqYardanico: your bug is killing me... :P
10:49:52Araqah no
10:49:58*fredrikhr quit (Read error: Connection reset by peer)
10:50:12Araqfound it
10:50:14Araqlol
10:50:25*fredrikhr joined #nim
10:51:28*fredrikhr quit (Read error: Connection reset by peer)
10:51:56*fredrikhr joined #nim
10:54:28*fredrikhr quit (Read error: Connection reset by peer)
10:54:55*fredrikhr joined #nim
10:55:34*fredrikhr quit (Read error: Connection reset by peer)
10:56:00*fredrikhr joined #nim
11:00:52*filcuc_ quit (Ping timeout: 260 seconds)
11:14:14*lritter joined #nim
11:48:41*zacharycarter quit (Ping timeout: 258 seconds)
11:48:43*nsf joined #nim
12:02:13FromDiscord<Zed> is it faster to return a new object or edit the object passed into a proc as a variable?
12:02:31FromDiscord<Zed> is it bad practice to edit the parameter rather then returning a new object?
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:41*supakeen joined #nim
12:07:34Araqa good rule is that inplace mutation is fine if there is only a single owner
12:08:15Araqand in general inplace mutation is faster unless the optimizer can remove the spurious copies but it's hard to tell without seeing any code
12:08:57FromGitter<bung87> edit param is programming like c way, that depends, on the other hand programming like functional, just get input and put output, logical simple
12:09:44Araqin general optimizers in 2020 are still disappointing unless you're into heavy number crunching code
12:09:55AraqIME anyway, ymmv
12:10:39Araqon the other hand just today I fixed Nim's move optimizer to be less aggressive
12:11:54dom96good afternoon
12:12:00Prestigeo/
12:12:16FromGitter<bung87> optimizer? is it about compiler?
12:13:42Araqbung87: yes. Nim does optimize too, not only the C step, but you can't disable it
12:14:49dom96Why are we still arguing about disallowing `discard`?
12:14:55FromDiscord<Zed> thanks Araq!
12:15:28Araqdom96, we aren't, the discussion is over :P
12:15:29FromGitter<bung87> oh,I have no idea about compiler optimizer, I just know react and parcel's optimization
12:17:07dom96Araq, so your problem is with how it's implemented
12:17:18dom96I don't really care how, do you at least agree that discarding futures should be disallowed?
12:17:35dom96The bottom line is, either we disallow it or we make `asyncCheck` implicit
12:17:44AraqI don't agree that it should be disallowed
12:17:50Araqnot anymore.
12:17:58dom96I'm pretty sure the latter was tried and it caused bugs
12:18:21Araqit would only introduce a subtle case where 'let _ = f()' is not the same as 'discard f()' anymore
12:18:22dom96This is an obvious source of bugs
12:18:42dom96no, and that should be disallowed as well.
12:19:00AraqI don't agree, today I can write 'discard posix_api_call()' and it's a code smell too
12:19:02dom96but really if someone tries `discard future` and they see "Do not use this in async procs, it's a stupid thing to do"
12:19:09dom96then if they work around it then it's their own stupid fault
12:19:15FromGitter<bung87> discard async proc will make it like js behavior?
12:19:19dom96how is someone meant to know that discarding futures is bad without that message?
12:19:25Araqit's all their own stupid fault to begin with
12:20:11Araqit's like "'cast' needs more hand holding from the compiler", no it doesn't need that, it's a dangerous sharp weapon.
12:20:39dom96Okay, it's a fair argument to correlate it to discarding posix API return values (which can indicate errors)
12:23:20Araqhaving said that, can we improve the tooling in other ways? how about we add future leak detection at runtime. or "warn me for blocking calls" at runtime
12:25:30*zacharycarter joined #nim
12:25:48dom96I think in the end we may need to be pragmatic here. The compiler's current error messages are not good enough.
12:26:59FromDiscord<dom96> https://play.nim-lang.org/#ix=2kse
12:27:16FromDiscord<dom96> Error: expression 'foo()' is of type 'Future[system.void]' and has to be discarded
12:27:23FromDiscord<dom96> The compiler leads the user in the wrong path
12:27:37Araqaha
12:27:40FromDiscord<dom96> Implying the use of `discard`
12:27:48Araq'and has to be *used* '
12:28:11dom96ideally we should mention `asyncCheck`
12:28:29Araqthat's acceptable, library specific error messages / filters should be a thing
12:29:01zedeus+1 for a pragma to specify custom "dont discard" message as the reason can vary
12:29:27Araqbut in the general case replacing 'discarded' with 'used' would be a nice improvement
12:29:39dom96sure, seems like a quick and easy fix
12:30:35zedeus'discarded' serves as a hint to new users that may not be very familiar with the discard keyword
12:31:56Araqzedeus, yeah that was the idea but for async is counter productive advice
12:32:41zedeusyeah I agree, it's a pretty ironic error message :)
12:34:08dom96I updated #11912 to reflect what we discussed
12:34:24dom96disbot down?
12:34:49zedeuscan anything be done for cases where async is used, but the return value is optional and rarely used? example is Redis where for most commands 0 or 1 is returned, and you very rarely need it. {.discardable.} doesn't work since that would apply to the future. I'd like to avoid `discard await ..` everywhere, gets hairy quickly
12:35:17zedeusI guess it's less of a problem now with await being a template
12:35:33dom96how does `await` being a template affect this?
12:36:04zedeusyou could make a `dawait` template that just does `discard await`
12:36:05dom96yeah, that's a problem, because you want the result of future.read to be discardable not the result of the async call
12:36:14zedeusyep
12:36:15dom96which we have no way to model, and likely won't :/
12:36:25dom96zedeus, please don't do that :(
12:36:41Araqzedeus, do that, it's cool :-)
12:38:06zedeusI might.. it almost kept me from using redis because 10 lines of `discard await` isn't nice to read
12:39:37*filcuc joined #nim
12:39:47zedeusoh you're gonna love this one. for my chat bot I made a `safeAsync` proc that's basically `asyncCheck` but it ignores exceptions :)
12:41:46dom96yeah.. have fun with that
12:42:45dom96hopefully by "ignores" you mean it at least logs them
12:43:59zedeussure. the problem with asyncCheck exceptions is it crashes the program with nothing to catch them
12:45:01*zacharyc1rter joined #nim
12:45:26zacharyc1rteris it possible to do `amd64.macosx.gcc.linkerexe` in a nims file? or on a nim.cfg file?
12:45:42zacharyc1rtercan I just use - `switch("amd64.macosx.gcc.linkerexe", "clang++")` ?
12:46:43dom96zedeus, yep, the intention is actually to allow people to create their own `asyncCheck` variants
12:47:18dom96we should probably add some common ones, I for example have one in my game that uses the logging module to log the exceptions
12:47:54*filcuc quit (Ping timeout: 240 seconds)
12:48:00zedeusthat would be great, asyncCheck is useful as a way to say "go do that elsewhere", but also often useless because of the exceptions
12:48:58*fredrikhr quit (Read error: Connection reset by peer)
12:49:26*fredrikhr joined #nim
12:52:22dom96btw you could have defined a dawait before await became a template, you just need to use `yield` in the template
12:52:56Araqzacharyc1rter, I think so, yes, try it
12:53:24Araq'dawait', come on, it's awesome. it almost sounds like a real word
12:53:41zacharyc1rterAraq: I think I'm doing something wrong anyway as I'm trying to get clang++ to link my program but whether I use nim.cfg or config.nims it doesn't work
12:54:13Araquse 'nim cpp --cc:clang'
12:54:27zacharyc1rterwell I'm compiling with clang but I want to link with clang++
12:54:37zacharyc1rtersince I have an objectfile that was comiled with C++
12:54:45zacharyc1rtercompiled*
12:55:26zacharyc1rterI'm not sure it even matters because things seem to work even when I just link with clang
12:55:34zacharyc1rterbut I thought it would...
12:56:21Araqhad the same problem with DrNim and my solution was 'nim cpp'
12:57:06zacharyc1rterunfortunatley that breaks nimterop and what I"m using that for :/
12:57:36zacharyc1rterI guess I could compile that code separately and link it
12:57:36Araqyou can also link with C++'s stdlib, somehow
12:57:54zacharyc1rteroh yeah I'm doing that already `--passL:-lc++`
12:58:09Araqwell then you should be fine
12:58:13zacharyc1rterah okay - thanks
12:58:53*xcm quit (Ping timeout: 246 seconds)
12:59:26FromDiscord<bedwardly-down> Tbf, dawait sounds very catchy and rolls well off the tongue. It also describes how async can feel, since you have “the wait” until it hits
12:59:43*tane joined #nim
12:59:51FromDiscord<bedwardly-down> I like puns in code i read
12:59:59*idf joined #nim
13:00:03*xcm_ joined #nim
13:00:05Araq1 showstopper bug left :-)
13:00:10zacharyc1rter\o/
13:00:33disruptekthe bot isn't stable on orc/arc. 🙁
13:00:40FromDiscord<bedwardly-down> Nice. Morning all. O7
13:00:55Araqdisruptek, fixed an important bug
13:00:56zacharyc1rtermorning
13:01:17disruptekcool, i will try new builds.
13:01:26Araqwait until I merged my PR
13:01:37FromDiscord<bedwardly-down> Got a link? Disruptek was a pleasant host yesterday during his stream
13:01:40dom96Araq, you asked me a while ago about which Nimble to bundle with the new release
13:01:41disrupteki saw you fixed the cyclic error.
13:01:49dom96never replied to my questions, which version are you releasing?
13:02:05Araqdisruptek, it was not just a cycle error, it was a 'sink' parameter bug
13:02:17Araqdom96, read the top of koch.nim
13:02:26disruptekoh wow.
13:02:28Araqbut we already updated it
13:02:36disruptekthat's kinda critical.
13:02:45Araqdisruptek, I know :-)
13:03:00dom96you're bundling a non-released Nimble commit?
13:03:16Araqdom96, in devel
13:03:42dom96okay, what about the release, that was what your question was about AFAIK
13:03:43Araqnot in an official release
13:03:55Araqwell make a Nimble release please for us
13:04:24Araqgah, it's raining again. :-(
13:04:46Araqanyhow the real question I wanted to ask if we should ship the new cycle collector in 1.2.2
13:05:16*ftsf joined #nim
13:05:18dom96sure, why not?
13:05:36Araqdom96, because some might say it's a new feature
13:06:06dom96so release 1.4.0?
13:06:49dom96or 1.3.0 or however the versioning works these days
13:07:12disruptekif you don't cut a new minor then other software cannot easily /require/ your new feature.
13:07:18disruptekthat's the point.
13:09:19Araqdom96, it would be 1.4.0 indeed and the versioning works as it always worked
13:10:35disruptek"my async code leaks", "what ver?", "1.3", "use >=1.4.0 and --gc:orc", "ah, cool, thanks"
13:13:12FromDiscord<dom96> https://github.com/nim-lang/nimble/releases/tag/v0.11.2
13:13:29Araqdisruptek, *shrug* what about it, we never said --gc:arc is production ready for async. we're working hard to make it production ready
13:14:00disruptekcosts us nothing to use fresh integers; there are plenty left.
13:14:10dom96Araq, be sure to include that Nimble 0.11.2 in the new release.
13:17:34Araqwhat's new in Nimble 0.11.2?
13:17:51Araqnever mind, I was blind
13:19:15FromDiscord<mratsim> I'm really interested in your plans to make closures gc-safe so that we can pass them through channels.
13:20:32*filcuc joined #nim
13:25:13*nsf quit (Quit: WeeChat 2.8)
13:25:36FromDiscord<bedwardly-down> I love the changelog. It's slim enough that it's easy to parse and understand but detailed enough that I can decide whether or not to upgrade since it's such a minor release. \o/
13:26:19Araqmratsim: with orc we have a new tool 'proc isIsolated[T: ref|closure](x: T): bool' available. isolated subgraphs can be transferred to a different thread safely
13:26:41*Vladar quit (Quit: Leaving)
13:27:02Araqthat's the plan.
13:28:55dom96bedwardly-down: thanks, glad someone appreciates my changelogs :)
13:29:17zedeusit would be real nice if you could do a new jester release
13:29:41disruptekzacharyc1rter: anyone can make new rooms on the mumble server so they have low-latency voice chat on their stream.
13:29:53disrupteki
13:30:02disrupteki'm happy to see it get used by the community.
13:31:53zacharyc1rterthat's awesome thanks mannnnn
13:32:01zacharyc1rterI will do that today when I start streaming
13:32:10disruptekcool.
13:32:57zedeuswhat are you going to do on stream?
13:33:25zacharyc1rtercontinue working on game engine dev from yesterday - still trying to figure out why the f this code works in one project and not in this new one
13:33:37zacharyc1rterI don't want to bore users with this debugging
13:33:37zedeusah cool
13:33:54disruptekit's not that easy, is it?
13:34:06zacharyc1rterstreaming?
13:34:11disruptekyeah.
13:34:16FromDiscord<bedwardly-down> dom96, are you the core maintainer of nimble? I appreciate the TAB cycling approach for going through its interactive options. Not many devs have that down.
13:34:17zacharyc1rteryeah it's a task for sure
13:35:02dom96bedwardly-down: I'm the one that originally created it, nowadays I have very little time to maintain it, but I do what I can. That particular feature was contributes by our community :)
13:35:15dom96*contributed
13:35:50FromDiscord<bedwardly-down> Zachary, if you're streaming, I'd be interested in seeing some debugging stuff. Debugging is very much where I struggle in all languages I dabble in
13:37:03zacharyc1rterdisruptek: I think I need to be an admin to create channels
13:37:06zacharyc1rtercould you create one for me?
13:37:13zacharyc1rterbedwardly-down: wish granted - I'm about to start my stream
13:37:31FromGitter<dawkot> Is there a way to make compiler check if a method has been overloaded on all subclasses?
13:37:38disruptekyeah, i was hoping you'd figure it out for me. 🤣
13:37:43zacharyc1rterlol
13:38:18zacharyc1rterhttps://www.twitch.tv/zachary_carter
13:38:37FromDiscord<bedwardly-down> I'm there. Zach
13:39:11FromDiscord<bedwardly-down> @Zachary Carter https://gettc.xyz/ that's pleasantly easy to setup on Linux
13:39:46FromDiscord<bedwardly-down> It's a straight Appimage. Just make sure you close out the stream preview or else you'll get audio feedback
13:39:52*filcuc quit (Ping timeout: 256 seconds)
13:44:28*filcuc joined #nim
13:45:58*fredrikhr quit (Read error: Connection reset by peer)
13:46:26*fredrikhr joined #nim
13:49:45*Vladar joined #nim
13:51:08shashlick@zacharycarter why is nimterop breaking
13:51:16zacharyc1rterit only is when I'm using C++
13:51:19zacharyc1rteror at least it was in previous versions
13:51:46shashlickAny details you can share? Am curious
13:52:00zacharyc1rterI can put up an example later today
13:52:06zacharyc1rterwith sokol
13:52:56shashlickOk thanks
13:53:00zacharyc1rternp!
13:57:40*dddddd joined #nim
14:01:32Araqany love for type (Node, NodeKind) = ref object ?
14:01:42Araqsee https://github.com/nim-lang/RFCs/issues/219 for the context
14:01:45disbotObject variant kind field type inference ; snippet at 12https://play.nim-lang.org/#ix=2ksV
14:01:54disruptekthanks, i hate it.
14:04:16dom96no, if you want to improve it then go all the way and add some syntax inspired by sum types in other langs
14:04:47dom96maybe we can come up with something that feels like idiomatic Nim
14:05:15disruptekone field two branches is the more important feature.
14:05:30companion_cubesum types ♥
14:06:14Araqdom96, we can also simply add patty to the stdlib
14:06:26*filcuc_ joined #nim
14:06:31dom96disruptek, +1
14:06:35Araqbut it's worth exploring how to change today's syntax
14:06:45*filcuc quit (Ping timeout: 272 seconds)
14:07:18Araqtype
14:07:25Araq T = case kind
14:07:35Araq of intVal: x: int
14:07:43Araqmeh
14:08:12Araqthe ref vs non-ref distinction alone indicates the old syntax is good
14:10:12dom96heh, nice, we're actually mentioned in https://en.wikipedia.org/wiki/Tagged_union#2000s
14:11:18dom96Maybe we should copy Haxe's syntax: https://play.nim-lang.org/#ix=2ksZ
14:11:35companion_cubeit's a bit cheating because nim doesn't check for invalid field access :>
14:11:54dom96in fact, I really like that syntax
14:13:19Araqcompanion_cube, it does check, use warn[ProveField]:on
14:13:43FromDiscord<bedwardly-down> Amen to that, dom96. There are things that drive me nuts about Haxe and its development at times, but the syntax is spot on, at least to me
14:14:03FromDiscord<bedwardly-down> That's part of why I love using it as my main
14:14:08companion_cubeok, but why is it opt in?!
14:14:31*Zevv joined #nim
14:14:39Araqcompanion_cube, because a day only has 24 hours
14:14:56FromDiscord<bedwardly-down> dom, `/usercode/in.nim(3, 12) Error: identifier expected, but got '('`
14:15:08dom96The English language should have a word for "because a day only has 24 hours"
14:15:11FromDiscord<bedwardly-down> that's what running it as C gets me in the link
14:15:28dom96Many things are not so because they simply haven't been implemented yet
14:15:42disruptek~features
14:15:43disbotfeatures: 11begin in the unfortunate state of /unimplemented/ -- disruptek
14:15:44dom96bedwardly-down: it's a syntax proposal, of course it doesn't work
14:15:47companion_cubebut in this case it's implemented, right?
14:16:03dom96companion_cube, presumably it needs refining and testing
14:16:16dom96Araq, what do you think about that syntax?
14:16:38Araqit's implemented but probably needs more refinement if we enable it for everybody
14:16:40zedeusdom96: that syntax is pretty much what patty does, it's great. I think it doesn't support multiple branch values (of a, b: ...) and it makes it more strict since you can't have other shared fields in the object
14:17:21Araqdom96, as I said, how to make the 'ref object' vs object distinction with your syntax?
14:17:31dom96hm
14:17:34dom96`ref enum` :P
14:17:51AraqSwift uses 'indirect enum' fwiw
14:18:05Araq'ref enum' could work though
14:18:06dom96what does the `indirect` imply?
14:18:10disrupteki don't want to define both at once.
14:18:49Araqdom96, that it's a 'ref' ;-)
14:19:07disrupteki personally won't use the inference, either. i like that it's explicit, unambiguous.
14:19:21FromDiscord<bedwardly-down> Gotya, dom. 😓
14:20:09dom96Araq, yeah, meh, I prefer `ref`
14:20:23dom96but I suppose the point is that Swift also has this additional keyword
14:20:36dom96using `ref` for us would be nicely consistent
14:21:22Araqindeed, looks lovely
14:21:29dom96on the other hand, it would put the Nim philosophy of "Small core and macros" in the coffin :P
14:21:37dom96We have a macro for this, why don't we use it?
14:21:55dom96Language features are more official and therefore are easier to adopt
14:22:05*silvernode joined #nim
14:22:28Araqtrue but maybe it's time to grow up and accept that Nim is more about what is practical rather than theoretically perfect
14:22:42dom96yep
14:22:52disruptekwhat a lame argument.
14:22:59Araqand we don't do type system extensions via macros
14:23:17Araqwe never did that, it's too hard to let the macro writers do it
14:23:31Araqtype systems are beasts
14:23:42disrupteki'm doing it in my persistence project.
14:23:56disruptekand
14:23:58disruptek!repo nesm
14:23:59disbothttps://github.com/xomachine/NESM -- 9NESM: 11NESM stands for Nim's Easy Serialization Macro. The macro that allowing generation of serialization functions by one line of code! (It is a mirror of https://gitlab.com/xomachine/NESM) 15 40⭐ 2🍴
14:24:23disruptektechnically, that's not a type extension.
14:24:32Araqexactly
14:25:01Araqbut you're right, the big problem is how to do serialization of sum types in a composable manner
14:25:03disruptekwrite it as a macro.
14:25:36disruptekprove that it cannot be done correctly. 😉
14:25:37dom96that's not a problem
14:25:52Araqdom96, it is
14:26:04dom96what does "in a composable manner" mean?
14:26:17AraqI know code that uses .push fieldChecks: off in order to accomplish it
14:26:40Araqdom96, it means you can construct via 'obj.kind = X; obj.field = value'
14:26:58Araqinstead of 'obj = Constr(field: value)'
14:27:01dom96hrm
14:27:23zedeusjson's `to` can do it
14:27:47*filcuc_ quit (Ping timeout: 246 seconds)
14:27:53Araqzedeus, it can do it because Nim's case objects allow for it
14:28:15Araqwe need to be careful that the new, superior way can also do it...
14:28:30dom96json's `to` would be able to do it if you allowed expressions in these Constructor nodes
14:28:33*solitudesf quit (Ping timeout: 260 seconds)
14:28:39zedeushm, msgpack4nim can't do it so I'm a little confused
14:28:42dom96but json's `to` doesn't really scale well
14:29:28dom96but yeah, this does pose a problem
14:29:36Araqdom96, I cannot easily allow it if we're after more static checking
14:29:45dom96My thrift deserializer uses fieldPairs so it also suffers from this
14:30:04disrupteki'm all for improvements, but this isn't a priority right now and the community could make more progress with an RFC until the priority increases.
14:30:18Araqdisruptek, indeed. bbl
14:30:26dom96true
14:31:20FromDiscord<bedwardly-down> Nimble init does something goofy when a project directory has a '-' in it. It creates a subdirectory with the root directory's name but replaces '-' with '_'
14:31:46disruptekimports cannot contain '-'
14:31:47FromDiscord<bedwardly-down> Example: `nimble-echo` becomes `nimble-echo/nimble_echo`
14:31:52FromDiscord<bedwardly-down> Gotya
14:32:21disrupteks/imports/identifiers/
14:32:36FromDiscord<bedwardly-down> Substitute?
14:33:12FromDiscord<bedwardly-down> And in the global config I'm guessing?
14:34:55FromDiscord<bedwardly-down> Solved the issue by just passing it as an argument when initting
14:35:26FromDiscord<Zed> has anybody had any trouble using nim with emacs?
14:35:27FromDiscord<Zed> I cant seem to get indentation working properly
14:36:18zedeushey other Zed, yeah I'm using nim with emacs, you're probably missing the nimsuggest settings
14:36:47dom96bedwardly-down: you shouldn't force the naming, you will need to use underscores
14:36:53silvernodeSo I got a Raspberry Pi 4 and tried a Nim nightly version. I think 1.3.0, but it complained about my nimble file that works fine on earlier versions. Not a big deal, just wanted to share my experience. I can load it up again if someone wants the error.
14:36:56zedeus@Zed: http://ix.io/2kta
14:36:58FromDiscord<Zed> hey other zed :), i downloaded nim-mode from melpa, is it not included?
14:36:59FromGitter<Vindaar> @Zed: I'm using NIm with emacs without nimsuggest. Aside from a couple of cases where indentation is messed up it works well
14:37:07dom96silvernode, yes please
14:37:22FromGitter<Vindaar> @zedeus: does nimsuggest work well with emacs nowadays?
14:37:34zedeusyes, sometimes, sort of
14:37:38FromDiscord<Zed> ok you know whats creepy
14:37:42silvernodedom96: Oh ok, I should have it going in a few minutes here then. Will report back.
14:38:00FromDiscord<Zed> other zeds home directory is the same as mine
14:38:11dom96silvernode, please report such things on the issue tracker, I might not always be here to ask for details :)
14:38:12FromDiscord<Zed> are you my fbi agent?
14:38:17zedeusseeing a Zed here made me feel the same way, man
14:39:01silvernodedom96: I suspected the problem was just a known change between versions or something
14:39:18FromDiscord<Zed> lol, it's good to meet you, i have never met anybody else called zed before
14:40:08zedeusyeah, we're a rare breed
14:40:10FromDiscord<bedwardly-down> Maybe you two are twins from different parents? 😄
14:40:23FromDiscord<bedwardly-down> Or even clones? 😮
14:40:55FromDiscord<Zed> lol maybe
14:41:03zedeuswhat are you working on?
14:41:38FromDiscord<Zed> i am trying to build a ray tracer with nim and and set up bloody spacemacs to work with nim properly.
14:41:38FromDiscord<Zed> you?
14:42:07dom96when I see the name Zed I think of Zed Shaw. You're not that Zed right? :)
14:42:34zedeusoh cool. my main project is nitter.net but I'm working on a syncplay/cytube replacement (90% done), that supports mpv and a web client
14:42:46FromDiscord<Zed> no
14:42:52FromDiscord<Zed> i cna change my name if you want?
14:43:43FromDiscord<Zed> what is nitter.net?
14:43:54zedeushttps://github.com/zedeus/nitter
14:44:12zedeusafaik the most popular Nim project besides the compiler
14:44:26FromDiscord<Zed> damn that's impressive
14:44:47FromDiscord<Zed> looks really clean as well!!
14:45:01zedeusthanks :) i'll be back later, food is calling
14:46:26FromDiscord<Zed> haha, sleep is calling me
14:46:52zacharyc1rtershashlick: nimterop isn't working for me with sokol anymore, the latest version
14:47:05*solitudesf joined #nim
14:47:21zacharyc1rterI saw all of the overrides that get generated and passed to toast, but I"m running into an error that one of the overridden types is undeclared
14:47:28zacharyc1rterwill post an example later
14:49:08FromDiscord<Zed> hey @vindarr how have you got emacs setup?
14:55:08FromGitter<Vindaar> @Zed: pretty much close to default (regarding nim specific settings that is). Added a couple of minor modes, but other than that using just normal `nim-mode` and having set the `nimsuggest-path` to `""` via `M-x customize-variable`
14:55:40FromGitter<Vindaar> mostly rely on helm functionality to find stuff tbh
14:56:57FromGitter<Vindaar> my emacs settings are here: https://github.com/Vindaar/emacs.d/ ⏎ But probably rather check out @kaushalmodi's settings: https://github.com/kaushalmodi/.emacs.d
14:58:16dom96zedeus, got any nitter usage numbers you're willing to share? :)
14:59:52FromDiscord<Zed> awesome thanks, ill test them out and see what works
15:03:18*chapl joined #nim
15:04:00*chapl quit (Remote host closed the connection)
15:04:22*chapl joined #nim
15:16:11*filcuc_ joined #nim
15:18:30*fredrikhr quit (Read error: Connection reset by peer)
15:18:55*fredrikhr joined #nim
15:20:24shashlick@zacharycarter sounds good, will fix once we have some detail
15:21:47FromDiscord<bedwardly-down> I'm live at https://www.twitch.tv/bedwardly_down . I'm not really a streamer, but I'm trying to get back into it.
15:25:58shashlick@zacharycarter latest version of nimterop or sokol
15:26:04zacharyc1rtershashlick both
15:26:17shashlickHead?
15:26:23shashlickOf nimterop
15:26:24zacharyc1rterwhatever nimble installs
15:26:37shashlickOk that's old
15:26:58shashlickThen it sounds like a sokol change that's breaking
15:27:06shashlickBut 0.5.0 is coming very soon
15:41:11zedeusdom96: sure, according to nginx, since the 12th of april there has been 400k unique visitors, 36m requests
15:42:00*FromGitter quit (Remote host closed the connection)
15:42:18dom96zedeus, any DAU/MAU numbers?
15:42:20*FromGitter joined #nim
15:43:14*setenforce joined #nim
15:54:49*ChantalZale joined #nim
15:55:12*ChantalZale quit (Client Quit)
15:56:30*setenforce quit (Quit: WeeChat 2.8)
15:57:50*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
15:58:59FromDiscord<Broadwell> I'm trying to write unit tests for my macros, and it seems that I cannot (1) run unittest at compile time or (2) manipulate NimNodes at runtime. Are there any tools to facilitate this?
15:59:13*sagax quit (Excess Flood)
16:02:27zedeusdom96: about 15k daily
16:04:21FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2ktM is that go code the same as the nim one? (both in there)
16:05:58zedeusmaybe. depends on what "Unique visitors per day" means
16:06:24*Lord_Nightmare joined #nim
16:06:25dom96zedeus, I guess you don't have Google analytics on it?
16:06:31zedeusindeed
16:10:58*fredrikhr quit (Read error: Connection reset by peer)
16:11:23*fredrikhr joined #nim
16:17:03*filcuc_ quit (Ping timeout: 260 seconds)
16:27:52zedeusand ofc that doesn't include usage stats from the other 10 instances, I know some of them also get a nice amount of traffic
16:28:28*ptdel joined #nim
17:01:28*fredrikhr quit (Read error: Connection reset by peer)
17:01:55*fredrikhr joined #nim
17:14:47*ftsf quit (Ping timeout: 260 seconds)
17:19:36*filcuc_ joined #nim
17:25:59*NimBot joined #nim
17:34:20disruptekbroadwell: run your ct tests in a static: in your unittest file or w/e.
17:36:24FromDiscord<bedwardly-down> How types and variables of those types work with nim is definitely not something I've seen before. I'm going to have to stew on them a bit
17:36:47FromDiscord<bedwardly-down> Not terrible but definitely different to me
17:44:28zacharyc1rterhmm - so I'm importing a module in my host app and my plugin and now I get errors about a class being implemented in both places
17:44:55disrupteknodecl?
17:45:08zacharyc1rterwell the module being imported is using nimterop
17:46:03zacharyc1rteractually I'm importing a module that's importing a module that uses nimterop
17:46:12zacharyc1rterin the plugin
17:46:30zacharyc1rterI tried using `import except` but that doesn't solve the problem either
17:46:58zacharyc1rterbut yeah maybe I can just redefine the type with nodecl
17:50:10*fredrikhr quit (Quit: Client Disconnecting)
17:52:21shashlickany details?
17:52:54zacharyc1rterI have a single nimterop module that creates bindings for `sokol_app.h` and `sokol_gfx.h`
17:53:22zacharyc1rterI used one module because I need to compile the implementations for these header files - which are in the header files
17:54:16shashlickare both pulling in the same header
17:54:23zacharyc1rterso in the nimterop module i use `cCompile` and I have a `.m` file which includes those two header files and defines some preprocessor directives like `#define SOKOL_IMPL` so that the implementations are included when I compile the header files
17:54:54zacharyc1rterI included both APIs in a single nimterop module, because I only want to define `SOKOL_IMPL` once and breaking them up into two nim modules seems to break everything
17:55:18zacharyc1rterhere let me commit and I can point you to the relevant files
17:56:07zacharyc1rterhttps://github.com/zacharycarter/frag/blob/master/lib/sokol.nim
17:56:09shashlickbut what's the actual error
17:56:31zacharyc1rterthe way I have it now I don't get an error from nimterop
17:56:58zacharyc1rterthe problem is when I import a module in my plugin code that imports this module which uses nimterop
17:57:06zacharyc1rterI get an error about the same class being implemented twice
17:57:28zacharyc1rterI'd break the nimterop module into two modules and only import the one I need - except them the nimterop module fails to compile
17:57:34shashlickoutput
17:57:41zacharyc1rterone sec I need to redo splitting it
17:57:44zacharyc1rterwill take a moment
17:57:48shashlickno problem
18:03:45zacharyc1rterI think it was user error - I wasn't defining one of the preprocessor directives in both source files and I needed to - now it's compiling
18:05:50shashlickokay cool
18:05:56zacharyc1rterthanks for offering to help
18:06:02shashlickyou're still using v0.4.4 right? not nimterop@#master
18:06:09zacharyc1rter0.4.3 I think
18:06:20zacharyc1rterI'll try with master later today
18:06:27shashlickokay big release coming soon
18:06:31zacharyc1rterand report any issues I encounter
18:06:34shashlickneed to publish the changelog
18:06:34zacharyc1rterokay I'll just wait for that :)
18:08:55*krux02 joined #nim
18:10:45*jwm224 quit (Quit: WeeChat 2.8-dev)
18:13:06*filcuc_ quit (Ping timeout: 272 seconds)
18:14:21federico3https://github.com/nim-lang/Nim/wiki/BuildServices updated
18:29:38FromDiscord<Broadwell> disruptek: https://play.nim-lang.org/#ix=2kuP
18:33:51FromGitter<Vindaar> shashlick: just tried out nimterop for the first time. Have to say I'm *very* impressed!
18:35:59*lain quit (Quit: brb)
18:40:26disruptekbroadwell: you cannot use unittest for it; just write your tests differently. you can also check a result value at runtime after storing it in a const, etc.
18:41:13zacharyc1rterfirst example works with hot reloading now - https://github.com/zacharycarter/frag/blob/master/examples/00-minimal/minimal.nim - on osx anyway
18:49:29*chapl quit (Ping timeout: 272 seconds)
18:52:47*lain joined #nim
18:53:17FromDiscord<KingDarBoja> Hi guys
18:53:44*disruptek quit (Read error: Connection reset by peer)
18:54:05*disbot quit (Read error: Connection reset by peer)
18:54:59*disbot joined #nim
18:55:59*disruptek joined #nim
19:04:52*chapl joined #nim
19:05:35*chapl quit (Remote host closed the connection)
19:05:57*chapl joined #nim
19:09:54*chapl quit (Remote host closed the connection)
19:12:39*chapl joined #nim
19:25:37FromDiscord<Weaponized Lego> Hey guys. I'm s little curious about nim, i wanted to pick up a novelty language as i haven't really had the need to pick up a second one as JavaScript and node.js pretty much solves all my problems right now.
19:25:37FromDiscord<Weaponized Lego>
19:25:37FromDiscord<Weaponized Lego> What are some ideas / problems where nim can be applied? I prefer to work on issues presented and work from there rather than video tutorials.
19:26:10FromDiscord<clyybber> just work an what you want. I for example use it for gamedev
19:26:36FromDiscord<clyybber> its a general purpose language though, so you should be able to use it for pretty much everything
19:26:44FromDiscord<clyybber> from webdev to embedded
19:27:24FromDiscord<Weaponized Lego> I'll start with data manipulation then, I have a few CSV files I need to process
19:29:54FromDiscord<KingDarBoja> Welcome Zoiberg!
19:30:01*FromDiscord <KingDarBoja> I love your profile pic
19:30:08*def- quit (Quit: -)
19:30:16FromDiscord<KingDarBoja> And yeah, pretty much you can use it for whatever you want
19:30:19*def- joined #nim
19:30:42FromDiscord<KingDarBoja> Someone said it was the lego language as you can build powerful stuff using macros and all that
19:33:15*chaplchapl joined #nim
19:33:25*chaplchapl quit (Client Quit)
19:37:08FromDiscord<KingDarBoja> Arrghh I lost the example of nested object kinds, anyone can share it?
19:42:12FromDiscord<KingDarBoja> Nvm I think I got it
19:42:23planetis[m]Imo, case object syntax is fine as is. Biggest nuisance is not being able to define same object field for different branches. Can this ever be fixed?
19:43:10leorizecurrently it's fixable with a macro, as long as you different branches share the same type for that field
19:44:13leorizethere were proposed syntax but I think no one was bothered enough to actually work on it
19:44:14*nsf joined #nim
19:45:17*idf quit (Ping timeout: 260 seconds)
19:45:39planetis[m]Does patty implements it?
19:45:51planetis[m]Or any other macro
19:46:17zedeuspatty does not, but you can use the intended names with `match`
19:47:30zacharyc1rterstream is back online - https://www.twitch.tv/zachary_carter
19:47:47FromDiscord<Varriount> @Zachary Carter Are you on Mumble?
19:47:56FromDiscord<Varriount> Or zacharyc1rter
19:49:14FromDiscord<KingDarBoja> https://github.com/nim-lang/RFCs/issues/19
19:49:44FromDiscord<KingDarBoja> leorize: too bad you have to use the same type on the same field for different branches :/
19:54:50planetis[m]Oh my god, idont care about the syntax i want that 🥺
19:56:20*silvernode quit (Ping timeout: 272 seconds)
19:57:58*inv2004 joined #nim
19:58:29inv2004Hello, is it possible to point nimble requires to local directory ?
19:59:04FromDiscord<Never Listen To Beef> Why would you want to?
19:59:09zedeusrun `nimble develop` in the directory then add the package name to your .nimble
19:59:44*Trustable quit (Remote host closed the connection)
20:01:28*Trustable joined #nim
20:03:25FromDiscord<mratsim> inv2004: export NIMBLE_DIR=path/to/local/nimbledir
20:03:59FromDiscord<mratsim> ah sorry misunderstood, do as zedeus said
20:06:04inv2004`nimble develop` in package directory I am going to require ?
20:06:17zedeusyes
20:07:12leorize[m]KingDarBoja: it's a reasonable limitation
20:07:18leorize[m]same field of the same type with different type per branch is a nightmare
20:08:35FromDiscord<KingDarBoja> Still I like the suggestion of 4raq of shared fields, which seems to fit my need
20:08:39leorizeno strongly typed language have return type overloading for a good reason
20:09:23FromDiscord<KingDarBoja> Getting used to the strong typing, I like it
20:09:38FromDiscord<Never Listen To Beef> IIRC dont you come from python?
20:09:47FromDiscord<Never Listen To Beef> That's strongly typed 😛
20:09:59FromDiscord<KingDarBoja> I come from Python lol
20:10:09FromDiscord<KingDarBoja> I do TypeScript but ain't the same at all
20:11:20FromDiscord<Never Listen To Beef> I come from C# so i have the type system down, the big issue i have is C# is a heavy OOP language and nim is certainly not
20:11:29FromDiscord<KingDarBoja> right
20:11:54FromDiscord<Never Listen To Beef> *that and compile time vs runtime*
20:12:26FromDiscord<KingDarBoja> TS is more like C#
20:12:34FromDiscord<KingDarBoja> But ofc has the JS things
20:12:46FromDiscord<Never Listen To Beef> Yea i know what TS is, not that i've ever touched it
20:13:00FromDiscord<KingDarBoja> That's why they said "Composition oevr Inheritance"
20:13:09FromDiscord<KingDarBoja> Just saying 🙂
20:13:32leorizeI come from pascal, which has a lot of concepts in common with Nim
20:13:50*vqrs quit (Ping timeout: 246 seconds)
20:13:52leorizeI'd say that makes Nim really easy to pick up for me
20:14:09FromDiscord<Never Listen To Beef> I tend to write nim code like i would in C# then realize that C#'s OOP has more features so then have to reevaluate
20:14:29FromDiscord<KingDarBoja> Yeah, if you go OOP in Nim, you need to be careful with child types
20:14:41Yardanicowell nim OOP has it's advantages too
20:14:44Yardanicolike multimethods
20:14:55FromDiscord<Never Listen To Beef> I mean my biggest gripe is runtime interfaces, since im used to having runtime mutable things
20:14:58leorizemultimethods is deprecated
20:14:59FromDiscord<Never Listen To Beef> Yea but it's foreign to me
20:15:10*Hexeratops joined #nim
20:15:39*vqrs joined #nim
20:16:04*Senketsu joined #nim
20:16:22inv2004next question: the requires from nimble tries to compile the develop package, but cannot find .h header
20:16:26FromDiscord<KingDarBoja> I hate casting everytime I need to get a property of a child type as the code on cimpile time will thell me it doesn't exist
20:16:30inv2004Locally everything is ok in the package
20:16:40FromDiscord<KingDarBoja> But I know it does but it is using the base type
20:16:54leorizecasting? you means converting, right? :P
20:16:59*Senketsu quit (Client Quit)
20:17:38FromDiscord<KingDarBoja> Not really `cast` but doing `childType(myVarW)`
20:17:45leorizeyea
20:17:48FromDiscord<KingDarBoja> 😛
20:17:50Yardanicowell that's very different from "casting"
20:17:59FromDiscord<Never Listen To Beef> Coming from C# you're wrong 😛
20:18:20*Senketsu joined #nim
20:18:38leorizethe C family of language bundles all kind of conversion into one thing
20:19:13leorizeiirc only C++ have different operators for different kinds of conversions
20:20:39FromDiscord<KingDarBoja> As `myVarW` is truly `childType` butbeing recognized as the base type due to proc call
20:20:44FromDiscord<Never Listen To Beef> Yea idk why you get a compiletime error, i know my ECS converted components to their true type seemlessly
20:21:11YardanicoAraq: thanks, with #14159 fixed nimes works with sink inference on, although nimes for some reason generally doesn't perform that well with arc (it's like 2-3x slower than with default gc)
20:23:26Yardanicoalthough 70% of the time is still spent in __strstr_sse2 from libc
20:24:33FromDiscord<KingDarBoja> @Never Listen To Beef too lazy to explain now
20:25:01leorizenote that Nim's proc use static binding, so "seamless" conversion isn't a thing here
20:25:35FromDiscord<KingDarBoja> Pretty much what leorize said
20:25:49FromDiscord<KingDarBoja> Doing the object variant conversion now
20:26:05*Senketsu quit (Quit: WeeChat 2.8)
20:29:34FromDiscord<mratsim> you are supposed to use methods on inherited stuff
20:29:52Yardanicooh seems like strstr is called by isObj
20:30:37Yardanicohmm maybe it due to nimes using inheritance for different mappers, lemme try without them
20:32:25leorizeshashlick: #14180 is merged :)
20:33:35Yardanicolol wtf
20:33:39YardanicoI was right
20:33:42*sagax joined #nim
20:33:53Yardanicoafter removing inheritance for mappers it now performs like 3x better (same as with default gc)
20:34:43FromDiscord<7815> if i'd want to statically link with sdl2, what do i do?
20:35:05leorizewhat sdl2 wrapper are you using?
20:35:17FromDiscord<7815> the "standard one"
20:35:26leorizenim-lang/sdl2?
20:36:14FromDiscord<7815> the one that comes with `nimble install sdl2`
20:36:39leorizethen --dynlibOverride:SDL --passL:"<flags for linking with sdl2 here>"
20:36:49FromDiscord<7815> very thanks
20:38:46*lritter quit (Quit: Leaving)
20:39:44YardanicoAraq: sorry for pinging again, so is it expected that --gc:arc performs much slower with ref objects with inheritance than default GC? in nimes it's a hot path since for PPU and for some CPU addresses it has to call a [] method for Mapper (so for one of its inherited objects)
20:40:04Yardanicoa lot of time is spent in strstr (which is called from isObj) with that
20:40:33Yardanicowithout inheritance it performs just as well as in the default gc (I don't have specific benchmarks, but 5fps vs 30 fps can be noticed by a naked eye :D)
20:42:06Yardanicoalthough I guess it won't be hard to fully remove inheritance for mappers from nimes
20:42:45FromDiscord<Never Listen To Beef> Well leorize my components were just data holder so i was accessing the properties on child not using procs on them
20:43:15FromDiscord<KingDarBoja> Hey guys, how I can call a type which is going to be declared later on the object variant?
20:43:28Yardanicowdym "call a type"?
20:43:36Yardanicowell you can have recursive dependencies in types if you declare them in the same type block
20:43:55FromDiscord<KingDarBoja> I am using the same type block
20:43:57FromDiscord<KingDarBoja> But hold on
20:43:58leorizeYardanico: I think it's kinda unexpected. reading refs_v2 it seems that it's expected that the performance will be the same
20:44:22Yardanicoleorize: well yeah I was initially suprised too, literally 69% of the time was spent in __strstr_sse2 from libc
20:45:10FromDiscord<KingDarBoja> https://imgur.com/VprFPUu
20:45:11Yardanicoin C there are lines like "if (!((m) && (isObj((*m).Sup.m_type, "|nimes.mapper3.Mapper3:ObjectType|nimes.types.Mapper:ObjectType""
20:45:23Yardanicoand isObj does T1_ = strstr((*obj).name, subclass);
20:45:37leorizeturns out pointer tracing is still faster than substring search :P
20:45:47Yardanico@KingDarBoja then you'll have to declare these types separately
20:45:56Yardanicoyou couldn't do what you showed in a screenshot
20:46:04Yardanicocan't*
20:46:15FromDiscord<KingDarBoja> Ugh
20:46:31leorizeKingDarBoja: you can't enforce which variant goes where
20:46:44leorizeat least you can't do that in the type system
20:47:16FromDiscord<KingDarBoja> So I must declare them separately before using
20:47:23FromDiscord<KingDarBoja> On a separate object variant type
20:47:57leorizeyour type system is creepily complex
20:48:10Yardanicoleorize: it's a port from JS afaik
20:48:15Yardanicoof graphql
20:48:20FromDiscord<KingDarBoja> ye
20:48:29FromDiscord<KingDarBoja> It works with OOP as I mentioned
20:49:04*chapl quit (Quit: Leaving)
20:49:21FromDiscord<KingDarBoja> Just seeing if I can replace the OOP approach with the object variants
20:49:27leorizewell your system is just too complex
20:49:31leorizesimplify it to the barebones
20:50:39leorizeconversion from inheritance to variants requires rethinking some of the approach
20:51:09leorizedon't be overspecific, be "just specific enough"
20:51:39FromDiscord<Rika> its really hard for me to convert inheritance to variants
20:51:54Yardanicojust think in the nim way :P
20:52:01FromDiscord<KingDarBoja> How is the Nim way?
20:52:04leorizeyea, you don't "convert"
20:52:10FromDiscord<Rika> it'd be easier with the "same field same type" thing for 2 different variants
20:52:35FromDiscord<KingDarBoja> I am once again requesting your help 😄
20:52:38leorizeI can help with that
20:52:41FromDiscord<Rika> like, much easier for me
20:52:44FromDiscord<KingDarBoja> Hold on
20:52:46leorize"same field same type" thing
20:53:12FromDiscord<KingDarBoja> https://github.com/graphql/graphql-js/blob/master/src/language/ast.js#L135 scroll down and see what I can't see
20:53:41FromDiscord<Rika> leorize: see only "Individual" and "Overall"
20:53:41FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/706247061271740487/unknown.png
20:53:44FromDiscord<KingDarBoja> So far I made it with OOP but the drawback is that my proc calls are using the base type for some of them
20:54:05Yardanico@KingDarBoja I'm not saying it's easy, but do you really think that if Nim's own AST can be constructed with object variants, graphql's AST can't? :)
20:54:08FromDiscord<Rika> `column` and `column count` are intentionally (meant to be) different
20:55:30FromDiscord<KingDarBoja> Wdym Yard?
20:55:45*FromDiscord <KingDarBoja> reading it slowly
20:56:11FromDiscord<KingDarBoja> I mean, it can be, just probably lacking the thinking
20:56:27leorizeRika: yea I have an idea
20:56:56FromDiscord<Rika> other than renaming the two fields? ;;
20:57:02*Vladar quit (Quit: Leaving)
20:57:19FromDiscord<Rika> maybe ill just take the "rename the two fields" or smth
20:57:38leorizeRika: use genSym to generate a field that can't be accessed normally, then generate an accessor template that yield it for the fields you'd like
20:57:57FromDiscord<Rika> oh yeah, macros exist
20:58:01FromDiscord<Rika> what a big brain
20:58:10FromDiscord<Rika> forgive me for i am a brainlet
20:58:31leorizeI've seen no one actually attempted that path though
20:58:33FromDiscord<Rika> ill prolly even just do it manually...
20:58:49Araqaccessor templates are totally a thing
20:59:27*chapl joined #nim
21:01:26FromDiscord<7815> can you even link sdl2 statically? i'm getting tons of `__declspec(dllimport)` errors
21:01:50leorizeyes you can
21:02:07leorizehow did you link and what's the full output?
21:02:16Araqyou can also just ship software that consists of more than a single file though
21:02:44Araqstatic linking is the new cargo cult
21:03:05FromDiscord<7815> `--dynlibOverride:SDL2 --passL:-lSDL2`
21:03:05FromDiscord<7815> libSDL2 is in my directory
21:03:11FromDiscord<7815> `--dynlibOverride:SDL2 --passL:-lSDL2`
21:03:11FromDiscord<7815> libSDL2 is in my cwd
21:03:18Araqnumber of software I use daily consisting of a single file: 0
21:03:20FromDiscord<7815> `--dynlibOverride:SDL2 --passL:-lSDL2`
21:03:20FromDiscord<7815> libSDL2.a is in my cwd
21:03:58FromDiscord<7815> araq, i don't think you forcing your ideals on others is a helpful trait for anybody
21:04:09AraqI'm saving your time
21:04:19Araqand that's helpful for anybody
21:04:54FromDiscord<7815> dependencies are certainly fun to deal with
21:05:11Araqcopy sdl.dll next to your .exe, done.
21:05:13*Senketsu joined #nim
21:06:44FromDiscord<7815> https://hastebin.com/eyinoxurex.shell
21:06:58inv2004zedeus, Do you know what to do with C-header from develop package ?
21:07:51FromDiscord<Rika> how do i make a fail on compile time?
21:07:57Yardanico{.error.}
21:08:09FromDiscord<Rika> okay thanks
21:08:11Yardanico!eval {.error: "no".}
21:08:12NimBotCompile failed: /usercode/in.nim(1, 8) Error: no
21:08:23Yardanico@7815 well if you cross-compile for windows you should have a static version of SDL2 for windows
21:08:34Yardanicoalso you need to pass --os:windows
21:09:40FromDiscord<7815> it links correctly with my zig project
21:09:46Yardanicowell nim is not zig
21:09:52Yardanicoyou should also tell nim that you're compiling to windows
21:10:08Yardanicoand in the paste you only tell zig to compile to windows, and nim still thinks you're compiling for linux
21:11:12FromDiscord<7815> `--os:windows` doesn't stop it from compiling `src\timer\windows\SDL_*.c`
21:12:29FromDiscord<7815> `--os:windows` doesn't give `src\timer\windows\SDL_*.c` its necessary link symbols...
21:12:52YardanicoAraq: would you like a relatively short code example for inheritance where --gc:arc is ~5x slower?
21:13:11AraqYardanico, ok
21:13:13inv2004how to include imported c-header into package?
21:14:26YardanicoAraq: https://gist.github.com/Yardanico/61384b0fe3a7913eb231cc0c9d3b996a
21:14:35Yardanicothe slowest part there is ppu.mapper.step()
21:14:48Yardanico(for arc)
21:15:38Yardanicoalthough it's not so high priority since I think it can be reworked to avoid methods
21:15:52Araqany idea why it's 5x slower?
21:16:01YardanicoAraq: because it calls isObj for each step call
21:16:06Yardanicoand isObj calls strstr
21:16:49Yardanicoinv2004: it should work by default, is your header in the src folder too?
21:16:54YardanicoAraq: https://i.imgur.com/MdMqIki.png there
21:17:03shashlick@Vindaar: glad to hear
21:17:08shashlickwhat were you wrapping
21:17:13shashlickand which version of nimterop
21:17:13Yardanicoand full c src https://gist.github.com/Yardanico/6173219bfd29544087d055650e13388d
21:17:36inv2004@Yardanico, yep, here it is https://github.com/inv2004/kdb_nim
21:17:51inv2004I just removed bin in nimble if it matters
21:18:00AraqYardanico, 'won't fix'? :P
21:18:16YardanicoAraq: well I'm really not sure if that's intended behaviour or not :D
21:18:21Araqbut hmm my suspicion was that isObj is fast enough in practice
21:18:33Araqstrstr vs pointer chasing
21:18:41Yardanicowell nimes is using methods in an a bit surprising way
21:18:59Yardanicofor each PPU step or some CPU step it calls a method of a mapper (NES roms can have different mappers)
21:19:00Araqthough the old implementation also was tuned to remember the hot path
21:19:06Yardanicooh
21:19:40Araqmaybe it's time to embrace VTables
21:20:04FromDiscord<KingDarBoja> leorize, u around?
21:22:00Yardanicoinv2004: read https://forum.nim-lang.org/t/2668
21:22:05FromDiscord<Rika> man this new template thing idea works SWELL
21:22:09Yardanicohttps://forum.nim-lang.org/t/2668#22111
21:22:58inv2004@Yardanico, thx
21:23:01Yardanicoalso you don't have to do importc, header for every proc
21:23:11Yardanicoyou can just do {.push importc, header: "yourheader.h".}
21:23:24Yardanicoimportc by default uses the same nim proc name for the relevant C function
21:24:48FromDiscord<mratsim> Before embracing VTables I want private imports.
21:24:52Yardanico:P
21:25:03FromDiscord<mratsim> Having proc public just for testing is so so annoying when refactoring
21:25:20Araqso write an include file for testing
21:26:10Araq"I need X to be public for testing" is so far among my top ten of the least convincing issues ever brought up
21:29:19FromDiscord<mratsim> As I said, include hides generic bugs
21:30:39FromDiscord<mratsim> This bug is caught with import but not with include: https://github.com/nim-lang/Nim/issues/6387
21:30:58FromGitter<Vindaar> @shashlick: I wanted to call a function from the GNU scientific library and thought nimterop might make that easier. It certainly did.
21:31:02FromGitter<Vindaar> https://github.com/Vindaar/gsl-nim
21:31:38FromGitter<Vindaar> I'll turn that into a full wrapper when I have a better idea on how to properly use nimterop.
21:32:34FromDiscord<Rika> ???
21:32:34FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/706256845517619212/unknown.png
21:32:39FromDiscord<Rika> oops
21:32:46FromDiscord<Rika> it says "expected float"
21:33:07Yardanicoshow errors from the nim compiler itself :)
21:33:13Yardanicowhen compiling
21:33:13FromDiscord<mratsim> template + return is a recipe for bugs
21:33:22Yardanicoah you're in a template
21:33:26FromDiscord<Rika>
21:33:26FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/706257064120418334/unknown.png
21:33:27FromDiscord<mratsim> you should use a proc, otherwise you will return from the caller
21:33:27*tane quit (Quit: Leaving)
21:33:35Yardanicoyou can't call return in templates
21:33:38FromDiscord<Rika> i know
21:33:42Yardanicoit'll be inserted as-is to the original proc
21:33:57FromDiscord<Rika> but im unsure why it wouldnt give me the Duration w/o return
21:34:00FromDiscord<Rika> which is odd
21:34:01Yardanicoyou should remove "return" statements from the template
21:34:04Yardanicothen it might work
21:34:06FromDiscord<Rika> it just "expects a discard
21:34:42FromDiscord<mratsim> remove the "return" and replace discard by `@[]`
21:34:43FromDiscord<Rika>
21:34:43FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/706257388843565107/unknown.png
21:34:51FromDiscord<Rika> hmm
21:35:13FromDiscord<Rika> seems good
21:35:19FromDiscord<Rika> ill runtime error the discard instea
21:35:26Yardanicoyou can compile-time error it
21:35:29FromDiscord<mratsim> also template chaining via method call syntax is buggy because one of the template is not properly triggered
21:36:02FromDiscord<Rika> compile time erroring it doesnt work i dont think
21:36:08FromDiscord<mratsim> i.e. holdEndTimes.anyIt might give you undeclared identifier
21:36:11FromDiscord<Rika> i tried it and it doesnt work
21:36:19Yardanicowhat does it say?
21:36:34FromDiscord<Rika> it just compile time errors no matter correct usage or not
21:36:37FromDiscord<mratsim> are you writing a Stepmania clone?
21:36:40FromDiscord<Rika> no
21:37:18Yardanico@mratsim https://github.com/de-odex/circa
21:38:08FromDiscord<Rika> i really havent committed in a while
21:38:22FromDiscord<Rika> because i've been traumatized by git too much
21:38:42Yardanicowell I really see no issue with git even if you do spontaneous commits and stuff like that
21:38:49Yardanicojust commit at the end of the day lol
21:38:59Yardanicoit's still better than not commiting
21:39:01FromDiscord<Rika> i dont know, im not a fan of not properly using it
21:39:04Yardanicocommits help you discover regressions and stuff
21:39:26FromDiscord<Rika> if there were a good sourcetree equivalent on linux that isnt gitkraken
21:39:37FromDiscord<Rika> i'd deffo fix it up right now
21:39:49Yardanicoi don't think it's really hard to use git from terminal for simple commits
21:39:52FromDiscord<KingDarBoja> Having big brain time trying to figure out object variant simplification lol
21:39:53YardanicoVSCode has GitLens too btw
21:40:05FromDiscord<Rika> i can use TUI, not git TUI
21:40:13FromDiscord<Rika> git subcommand names make 0 sense to me
21:40:38Yardanicouse vscode with gitlens plugin then
21:40:42FromDiscord<Never Listen To Beef> I tend to use git cli and then use vscode's git tools to ensure im not pushing useless files cause it's a nice easy method imo
21:40:52FromDiscord<Rika> will do, just installed
21:41:03FromDiscord<Rika> does it have gitflow stuff?
21:41:11FromDiscord<Rika> not that i cant do it myself
21:41:15FromDiscord<KingDarBoja> Gitlens is awesome imo
21:42:19Araqmratsim: I don't see the connection as the symbol binding rules within generics do not depend on private vs public
21:45:52FromDiscord<exelotl> "git subcommand names make 0 sense to me" saaaame
21:46:24FromDiscord<exelotl> been using git for like 7 years now and I still have to google how to do the most basic things
21:46:34FromDiscord<Rika> struggle of a non-english native i guess?
21:46:55FromDiscord<exelotl> nah I'm a native speaker
21:47:03FromDiscord<Rika> :monkaHmm:
21:47:31FromDiscord<exelotl> it's actually ridiculous how bad the interface is
21:49:49*zacharyc1rter quit (Ping timeout: 246 seconds)
21:50:20*zacharycarter quit (Ping timeout: 272 seconds)
21:55:38FromDiscord<KingDarBoja> lol
21:59:47Araqexelotl: but it's pretty simple, 'git checkout' does everything ;-)
22:00:32Araqfor a system created by a guy who cannot stand GCs or overloading git's commands are surprisingly overloaded and git also has a GC...
22:00:38FromDiscord<Rika> i cant seem to stage a folder for some reason...
22:02:39*Senketsu quit (Quit: WeeChat 2.8)
22:05:58FromDiscord<Never Listen To Beef> I mean linus started git, he went pretty hands off rather quickly from my understanding
22:07:46*nsf quit (Quit: WeeChat 2.8)
22:08:30FromDiscord<Never Listen To Beef> No clue when the GC was implemented so my point is irrelevant yes
22:12:45leorizeto be fair, linus is not that against a gc
22:12:52leorizethe kernel have a gc itself
22:13:24leorizeKingDarBoja: you called?
22:14:01Araqleorize, which kind of GC does the kernel have?
22:14:24Araqso ... number of showstopper bugs: 0 :-)
22:14:41leorizesimple ref counting the last time I checked
22:14:55Araqleorize, doesn't count
22:15:16YardanicoAraq: new 1.2 release soon? :P
22:15:33leorize1.4 when? :P
22:15:52AraqYardanico, who knows. maybe we should make 'koch boot --gc:orc' work and release 1.4
22:15:58supakeengc:orc
22:16:00supakeenmrm
22:16:04supakeeni like it
22:16:10FromDiscord<KingDarBoja> Yeah, was going to ask something but I think I got it
22:16:15FromDiscord<KingDarBoja> The idea of simplify stuff
22:16:18shashlick@Vindaar: awesome - let me know when you need any help with nimterop
22:16:35shashlickAnd feedback obviously to make it easier to get up to speed
22:17:02FromDiscord<KingDarBoja> Instead of specifying the node kind on some child, I just put the base type
22:17:10FromDiscord<Rika> haa, pushed to temp-all branch now
22:17:16FromDiscord<KingDarBoja> `Node` and let the proc handle the leaf kind 🤔
22:17:45Yardanicoin the meantime I guess I'll fork nimes and replace inheritance with something else + use computedGoto for CPU opcodes to possibly speed it up even more (right now it uses an array of procedures, I guess that's already quite fast)
22:18:09Araqembrace computedGoto
22:18:23Yardanicoyeah it's a very cool optimization
22:18:26FromGitter<Vindaar> @shashlick: Thanks, will do!
22:18:49Yardanicobut why nim vm has it disabled? :P https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim#L543
22:19:13leorizeYardanico: have you reported the async bug with gc:orc for the irc module?
22:19:22Yardanicoleorize: it turns out it's a bug with sink inference
22:19:28Yardaniconot gc:arc or gc:orc themselves
22:19:32Yardanicoit works with --sinkInference:off
22:19:43leorizeso... did you report it? :P
22:20:14Yardanicono, actually lemme try to run it again, who knows, maybe it was solved by #14183
22:21:54Yardanicobtw what happened with disbot? :P
22:22:01Yardanicoit doesn't reference PRs now
22:22:09leorizeit bugs out once in awhile
22:22:13leorizeping disruptek I guess
22:22:35Araqdisbot was built with --gc:arc, that's why :-)
22:23:06Yardanicowell it's async, doesn't it leak memory this way
22:23:31Yardanicoalso yeah, irc module doesn't work in async mode with gc:orc, works with sink inference disabled
22:23:35Yardanicoalthough the error is different than before
22:23:46Araqwell we'll soon build it with orc
22:24:20leorizeguess you should report that bug now so we can tackle it
22:24:27AraqYardanico, produce a reduced test case please, it really speeds up our development
22:24:35Yardanicowell I'll try :P
22:24:41Yardanicoirc module itself is ~700 loc
22:24:57Araqlol but async is a big lib
22:25:02Yardanicoah xd
22:25:06Araqanyhow, good night
22:25:09Yardanicogood night
22:25:19leorizeg'night
22:25:39*Hexeratops quit (Quit: Take care :))
22:26:05leorizewhy does fork() on linux have to be so ridiculously inefficient...
22:26:51*inv2004 quit (Read error: Connection reset by peer)
22:32:09FromDiscord<Rika> huh, what does "expression has no address" mean now...
22:33:04leorizethat means you're trying to take an address of a const
22:35:29FromDiscord<Rika> but im not?
22:35:31FromDiscord<Rika> hm
22:36:15leorizecan I see the code?
22:36:40FromDiscord<Rika> https://play.nim-lang.org/#ix=2kwB
22:36:57FromDiscord<Rika> error at `case`
22:37:25FromDiscord<Generic> that is an unfortunate short coming
22:37:25leorizecan I have the typedef too?
22:37:59FromDiscord<Generic> https://github.com/nim-lang/Nim/issues/13033
22:38:01leorizethough this is probably just due to the `var` thingy
22:38:33leorizetry result =
22:38:36leorizeshould work
22:39:11FromDiscord<Rika> https://play.nim-lang.org/#ix=2kwD
22:39:31FromDiscord<Rika> bah, the result fixed it
22:40:09FromDiscord<Rika> i see
22:40:39leorizecan you merge maniaIndividual and maniaOverall?
22:41:01leorizethe diff seems to be the column thingy only :P
22:41:48leorizethough I'm for certain don't understand how this code work or what it's used for
22:42:07leorizewhy does this look like an osu! parser :P
22:42:30FromDiscord<Rika> it is.
22:44:58FromDiscord<KingDarBoja> 😄
22:45:08FromDiscord<KingDarBoja> From desperation comes innovation
22:45:26*solitudesf quit (Ping timeout: 272 seconds)
22:46:54leorizewell I still don't understand osu! beatmaps so I can't say much about this code :P
22:46:55FromDiscord<Rika> leorize: maniaIndividual and maniaOverall are totally separate
22:47:17FromDiscord<Rika> this isnt parsing the beatmap its the difficulty calculation code
22:47:29FromDiscord<Rika> im still having difficulty converting the heavy OOP of C#
22:47:55leorizeI don't know how the game work is the point actually :P
22:48:21FromDiscord<Rika> i see
22:48:52FromDiscord<Rika> i still dont know if this code will work
22:49:50Yardanicook I started minimizing it, now I managed to use expandMacros to get output of the async macro stuff
22:49:57Yardanicoand yes I managed to compile it after removing tons of `gensym things
22:53:46Yardanicoright now it's 600 lines but at least it only needs asyncdispatch for the dispatcher and asyncfutures for futures, now I need to start removing functionality :P
22:55:46Yardanicocompiled C is 6.4k lines though
22:56:27FromDiscord<KingDarBoja> I am mixing OOP with object variants
22:56:30FromDiscord<KingDarBoja> and so far, so good
22:56:40FromDiscord<KingDarBoja> Using it to group leaf types
22:56:52FromDiscord<KingDarBoja> And OOP to keep parent types inherit from a single base
22:57:34FromDiscord<KingDarBoja> Also, I noticed I can't declared shared fields using multiple kinds on same case then another different for a specific field
22:57:37FromDiscord<KingDarBoja> 🤔
22:58:01Yardanicohttps://github.com/nim-lang/RFCs/issues/19
22:58:23FromDiscord<KingDarBoja> Yeah I saw that
22:59:21*chapl left #nim (#nim)
22:59:30FromDiscord<KingDarBoja> https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 this comment is what I am looking for
22:59:34FromDiscord<KingDarBoja> But still RFC 😢
23:01:50FromDiscord<KingDarBoja> https://imgur.com/4met1K4 pretty much had to use a different name for that
23:02:33FromDiscord<KingDarBoja> But after running the test, I will get an error as I am trying to access `value` on `IntValueNode`
23:02:50FromDiscord<KingDarBoja> But the funny thing is that the terminal doesn't point me to the error :S
23:09:41FromDiscord<bedwardly-down> Not even with —verbose flag on?
23:09:55FromDiscord<KingDarBoja> Had no idea about that flag
23:09:57FromDiscord<KingDarBoja> Let me try
23:10:04FromDiscord<KingDarBoja> `nimble tests --verbose` ?
23:10:17FromDiscord<bedwardly-down> Should be
23:10:23FromDiscord<KingDarBoja> Nope
23:10:54FromDiscord<bedwardly-down> I’m not able to test but nimble —verbose c *somenimfile* works for me
23:11:12FromDiscord<bedwardly-down> That stinks.
23:11:40FromDiscord<KingDarBoja> I have defined it like `exec "nim c -r tests/language/test_parser"` on my packageName.nimble file
23:14:13FromDiscord<KingDarBoja> @bedwardly-down your approach works
23:14:15FromDiscord<KingDarBoja> Thank you 🙂
23:14:37FromDiscord<KingDarBoja> `Error: undeclared field: 'strValue' for type ast.NameNode` this is what I was looking for
23:15:17*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:15:26FromDiscord<bedwardly-down> Depending on what system you’re on, you could possibly create an alias for your shell where nim and nimble always run with that flag on when you call them
23:15:56FromDiscord<KingDarBoja> I use Windows
23:16:03*pbb joined #nim
23:16:09FromDiscord<KingDarBoja> All my tests are defined at the .nimble file with the above script
23:16:47FromDiscord<bedwardly-down> Using Powershell, you could possibly do the same. I’m just not sure on specifics there
23:19:01FromDiscord<KingDarBoja> using `nimble test --verbose` works lol
23:19:08FromDiscord<KingDarBoja> I had a typo
23:19:51FromDiscord<bedwardly-down> Did you put 1 - instead of 2?
23:22:49*zacharyc1rter joined #nim
23:22:49*zacharycarter joined #nim
23:23:49FromDiscord<KingDarBoja> It is 1 by default
23:32:33*Trustable quit (Remote host closed the connection)
23:42:25*stefantalpalaru quit (Changing host)
23:42:25*stefantalpalaru joined #nim
23:46:50*nim669 joined #nim
23:47:21*nim669 quit (Client Quit)
23:49:25FromDiscord<Rika> can i make an object variant based on a field of a field? i know the answer's pretty much no, but i'd like to know of alternatives
23:49:27FromDiscord<bedwardly-down> For -v in most apps yeah
23:49:39Yardanico?
23:49:54FromDiscord<bedwardly-down> @KingDarBoja
23:50:09Yardanico"object variant based on a field of a field" the only way to know that is to embed the other object variant in your own object variant if I understood you correctly
23:50:14Yardanicoshow code :P
23:50:17FromDiscord<KingDarBoja> Wait
23:50:36FromDiscord<KingDarBoja> Object variant based on a filed of a field ? Nested?
23:51:00FromDiscord<Rika> one moment
23:51:30FromDiscord<bedwardly-down> How deep can you even go with that anyway?
23:53:49FromDiscord<KingDarBoja> Deeper as long as you don't need previous object variant kinds
23:54:06FromDiscord<Rika> something like this? https://play.nim-lang.org/#ix=2kx0
23:55:23Yardanicoyeah as I said the only way for that is to embed modeHitObject definition inside of your DifficultyHitObject
23:56:06FromDiscord<Rika> but theyre separate objects
23:56:21Yardanicothen no
23:56:41FromDiscord<Rika> okay
23:57:56*krux02_ joined #nim