<< 10-01-2021 >>

00:03:07giacoI see that I landed into an hot topic. Awaiting a FlowVar seems something on the todo list https://forum.nim-lang.org/t/4952
00:03:42leorizewhy I hate asyncdispatch: "Error: can raise an unlisted exception: Exception"
00:04:01leorizeif you are writing an async function you can say goodbye to `{.raises.}`
00:05:18leorizeah, not that {.raises.} even do anything for those...
00:08:59saemFor me if nimble didn't muddy up bins, library code, and whatever artifacts, and instead scoped the requires and various declarations associated to them it'd be a big step in the right direction.
00:09:22leorizescoping requires compiler support
00:09:27leorizea lot of it, actually
00:09:27giacoactually more than on a to-do list, but don't really get if it is available ot not https://github.com/nim-lang/Nim/pull/11724/files
00:09:27disbotMake Flowvar compatible with Async
00:10:51saemleorize: that should be doable with a config file though, right?
00:10:52leorizeideally I would want nimble to be a tool to just download things that the compiler told it to, and we do all dependancy resolving in the compiler itself
00:11:57leorizeyou can scope it for the current project, but not projects that you depend on
00:12:10leorizenimble localdeps mode already do this
00:12:47*adnan338 joined #nim
00:12:54adnan338hi need help with htmlgen
00:12:56adnan338https://play.nim-lang.org/#ix=2Lu9
00:13:24adnan338The error message says something about me using '&' but I'm not
00:13:57FromDiscord<ElegantBeef> Spot the ex-python user 😄
00:14:42saemHmm, so you think it wouldn't be possible to have nimble output a big cfg that has explicit paths for everything?
00:15:14FromDiscord<ElegantBeef> It uses `&` internally
00:15:16adnan338nvm fixed it
00:15:20FromDiscord<ElegantBeef> So yea "you" are
00:15:28FromDiscord<ElegantBeef> what'd you do?
00:15:36FromDiscord<ElegantBeef> Didnt get to actually diagnose the problem 😄
00:15:53adnan338The 7 was an int literal, but I needed to put "7" as a string literal
00:17:03*hnOsmium0001 joined #nim
00:19:03*leorize quit (Ping timeout: 240 seconds)
00:20:17*leorize joined #nim
00:22:19giacoif pull requests appear as closed and approved, but not merged, what does it mean? How can I try it? https://github.com/nim-lang/Nim/pull/11724
00:22:20disbotMake Flowvar compatible with Async
00:25:53leorizesaem: the compiler doesn't support that :P
00:26:12leorizesupport scoping path-per-module is that I meant
00:28:07saemAh, I thought you could do it via `--nonimblepath` and then a bunch of explicit `--path`, but yeah, that wouldn't be per module so you couldn't have two versions of the same module as one of them would always win.
00:31:04leorizeas use cases get complicated I think we should just fold the package manager into the compiler itself, similar to go
00:31:51leorizeif we are wary of external deps like openssl, make nimble a downloader
00:32:05leorizethen the compiler would never access the internet
00:32:59leorizehaving an idea is one thing, writing the rfc to get this accepted is the time-consuming part :P
00:33:17saemyeah...
00:33:27saemI'm falling over tired just thinking about it.
00:34:36*tane quit (Quit: Leaving)
00:35:22saemnow to see if I can fix this one: https://github.com/nim-lang/nimsuggest/issues/110
00:35:27disbotCrashes when highlighting system.nim if nimsuggest is compiled with -d:release ; snippet at 12https://play.nim-lang.org/#ix=2Luf
00:36:40ForumUpdaterBotNew thread by Alexeypetrushin: How to pass around large immutable data? Copy-on-Write?, see https://forum.nim-lang.org/t/7364
00:42:40saemOK, well the cause is easy enough, it's reprocessing the magic types, since it's already defined, it gets sad.
00:44:44adnan338strformat is giving me an issue
00:44:46adnan338echo fmt"Test: {(if 1 == 1: "hello"; else: "world")}"
00:44:59adnan338says it's not being successfully parsed
00:45:30disruptekleorize: you don't think nimph is a good package manager? 😦
00:46:19disruptekdist solves some problems that a good package manager doesn't; at least, problems that araq has.
00:49:53saemwhy do you exist assert?
00:49:56*krux02 quit (Remote host closed the connection)
00:49:56*saem shakes fist
01:07:00adnan338pardon me if I'm missing something but cmp is not defined for times.DateTime?
01:07:45FromDiscord<shadow.> is there a way to list files / folders in a dir with glob patterns?
01:16:35*hmmm quit (Quit: WeeChat 3.0)
01:18:16FromDiscord<shadow.> !repo glob
01:18:17disbothttps://github.com/citycide/glob -- 9glob: 11Pure Nim library for matching file paths against Unix style glob patterns. 15 34⭐ 4🍴 7& 2 more...
01:18:19FromDiscord<shadow.> fair enough.
01:18:32FromDiscord<Avatarfighter> there truly is a library for anything
01:36:57FromDiscord<shadow.> can i list all files in a directory and its subdirectories (recursively infinite)?
01:36:59FromDiscord<shadow.> iterate
01:37:09FromDiscord<shadow.> walkDirRec
01:37:10FromDiscord<shadow.> yooo
01:39:10*jmiven quit (Quit: reboot)
01:40:04*jmiven joined #nim
01:40:37*grfork joined #nim
01:42:25*filcuc_ joined #nim
01:42:40*filcuc quit (Ping timeout: 265 seconds)
01:43:32*greenfork quit (Ping timeout: 272 seconds)
01:45:25laininterfacing with C, have unchecked array and length, what's the "best" way to turn that into a seq? I assume have to copy because seq is GC'd?
02:08:11FromDiscord<Avatarfighter> by copying, yeah
02:09:06lainjust a for loop I guess? or is there some cute shortcut?
02:09:29FromDiscord<Avatarfighter> for loop im afraid
02:09:36FromDiscord<Avatarfighter> newSeqofLen()
02:09:40FromDiscord<Avatarfighter> i think that's the method
02:09:41disruptekcreate a seq of the size you want and then copy to addr x[0].
02:09:51FromDiscord<Avatarfighter> ^
02:10:52lainawesome, thanks! :3
02:10:59FromDiscord<exelotl> presumably you use copyMem for the approach that disruptek mentioned
02:11:05disruptekyes.
02:11:19FromDiscord<exelotl> I think it's just newSeq, not newSeqOfLen
02:11:42*adnan338 quit (Remote host closed the connection)
02:11:55*adnan338 joined #nim
02:12:21FromDiscord<shadow.> yep
02:12:32FromDiscord<shadow.> (edit) "yep ... " added "^"
02:12:44disruptekyou'll want to give it a size because it needs to know that it's of len X.
02:22:28FromDiscord<Anonymous Poet> is there a way to prevent the compiler from applying a `converter`?
02:23:18FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2LuP
02:23:36FromDiscord<Anonymous Poet> but it gets resolved as a string, rather than an `HttpHeaderValues`, which is defined as `HttpHeaderValues = distinct seq[string]`
02:25:20FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2LuR
02:27:18leorizedon't write them, they're evil :P
02:27:54FromDiscord<Anonymous Poet> ok, but assuming the well-meaning people that have already written the stdlib arent wrong, what do i do? :/
02:28:14disrupteknever make that assumption; i know these people.
02:28:18FromDiscord<Anonymous Poet> haha
02:28:51FromDiscord<Anonymous Poet> well, heres the pr im working on: https://github.com/nim-lang/Nim/pull/16636
02:28:51disbotAdd support for Transfer-Encoding: chunked
02:29:00disrupteksee, you're one of them.
02:29:01FromDiscord<Anonymous Poet> im open to other suggestions on how to make the change
02:29:04disrupteka bunch of chuckleheads.
02:29:10leorizein that case just force the type by doing normal conversions
02:29:10FromDiscord<Anonymous Poet> i just want dom to approve it 😦
02:29:28disrupteki don't think dom has ever approved one of my PRs.
02:29:45FromDiscord<Anonymous Poet> oh 😭
02:30:09leorizewaiting for dom to approve PRs is the same as never having them merged :P
02:30:32FromDiscord<Anonymous Poet> i mean, araq gave me a rocket ship emoji, that has to count for something, right?
02:31:04leorizeI'm still waiting for dom to review #14556
02:31:05disbothttps://github.com/nim-lang/Nim/pull/14556 -- 3net, openssl: support setting the minimum supported SSL/TLS version
02:31:38FromDiscord<Anonymous Poet> can you ping him? maybe ive just been really lucky getting views ...
02:31:53disruptekdom96: your fans await.
02:32:00leorizeI don't just ping him on github
02:32:06leorizeI nagged him several times here too
02:32:41FromDiscord<Anonymous Poet> `let values: seq[string] = cast[seq[string]](request.headers[transferEncoding])` eww :/
02:32:51FromDiscord<Anonymous Poet> haha
02:33:22leorizenormal conversions exist
02:33:47FromDiscord<Anonymous Poet> but its a distinct type ... am i wrong in that its whole purpose is to be a pain to do what im trying to do?
02:34:04disruptekthat depends.
02:34:09disruptekare you trying to do something stupid?
02:34:18leorizenormal explicit conversions can be used to convert between distinct types
02:34:28leorizeit's used a lot in implementations of things
02:34:29FromDiscord<Anonymous Poet> i might be, im not smart enough to know :/
02:35:14FromDiscord<Anonymous Poet> how bad does `for encoding in cast[seq[string]](request.headers[transferEncoding]):` look?
02:35:25disruptekpretty bad.
02:35:48FromDiscord<Anonymous Poet> agreed, but ... do you have any suggestions?
02:35:57disruptekyes, remove the cast.
02:36:23FromDiscord<Anonymous Poet> but ... `func [](headers: HttpHeaders, key: string): HttpHeaderValues` and `HttpHeaderValues = distinct seq[string]`
02:36:39disruptekso what?
02:36:45FromDiscord<Anonymous Poet> it doesnt compile without it
02:36:56disruptekhave you read the manual?
02:36:58disruptek~manual
02:36:58disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
02:36:59disbotmanual: 11just good to Ctrl+F in cases like this
02:37:02FromDiscord<Anonymous Poet> because `converter toString(values: HttpHeaderValues): string`
02:37:23FromDiscord<Anonymous Poet> what am i looking for in the manual
02:37:34disruptekthe sections on `distinct` and `borrow`.
02:38:02disrupteki would encourage you to read the entire manual.
02:38:12leorizeIs the converter exported? If not I would get rid of it or turn it into a proc
02:38:34FromDiscord<Anonymous Poet> it sadly is
02:38:48disrupteklike i said: chuckleheads.
02:39:11FromDiscord<Anonymous Poet> i read the manual and i understand that i can get rid of the cast though
02:39:14FromDiscord<Anonymous Poet> so thats a win
02:39:51FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2LuU
02:40:58FromDiscord<martinium> is func an alias for proc? or
02:41:13FromDiscord<ElegantBeef> proc with `{.noSideEffect.}`
02:41:14disruptekit's an alias for a proc with .noSideEffects.
02:44:45FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2LuV
02:49:52leorizeI'd say that converter is dumb
02:50:21leorizemaybe you can PR one in the future getting rid of it
03:00:18FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Lv0
03:00:53FromDiscord<Anonymous Poet> maybe make an overload that returns a single string? but it seems counter intuitive to me to return only the first string in any case ... either return all of the strings but joined with spaces or something, or return a list
03:03:11FromDiscord<Anonymous Poet> but while we're on this topic, when are converters good style (if ever?)
03:03:58disruptekgrandfathering types, boxing, and one other that i can never remember.
03:04:26disruptekat least, i have three that i think are okay and i can only ever remember two. 😁
03:04:50disruptekFFI maybe.
03:12:49*Jesin quit (Ping timeout: 264 seconds)
03:17:08*vicfred quit (Quit: Leaving)
03:22:34*lritter quit (Ping timeout: 256 seconds)
03:22:56*lritter joined #nim
03:34:55FromDiscord<Anonymous Poet> ok, i can kind of see it ... thanks
03:41:13*Xe is now known as Cadey
03:51:14*lritter quit (Ping timeout: 265 seconds)
04:17:12*vicfred joined #nim
04:22:46saemConverters feel like scala implicit conversions, in which case I would only use them when dealing with code I can't change and I can't get an equivalent effect by slapping a bunch of procs/templates on the type. But even then, I'd prefer doing the conversion with a proc in one or two places. They can be handy during a mechanical refactor.
04:23:21saemI used a converter when I was first learning nim, it was a bad idea.
04:25:11*spiderstew joined #nim
04:26:05*spiderstew_ quit (Ping timeout: 240 seconds)
04:31:09FromDiscord<shadow.> `let key <- stdin.readLine()` is there an arrow operator in nim system?
04:31:33FromDiscord<shadow.> i found this in yardanico's manual memory management writeup and im not sure what it is
04:31:33disruptekyou can make your own.
04:32:01FromDiscord<shadow.> well yeah of course
04:32:12leorizedisruptek: just added rw api for nim-sys, can you review it? https://alaviss.github.io/nim-sys/files.html
04:32:29FromDiscord<shadow.> i never saw it defined so i assumed it was system
04:32:35disruptekif you tell me what you don't like about nimph. 😉
04:32:44FromDiscord<ElegantBeef> Nope it's not
04:32:59disruptekFlags that controls file behaviors. Source Edit
04:33:05disrupteksingular `control`.
04:33:22disruptekeither use a period or don't.
04:34:10leorizedisruptek: I sometimes forgot about its existance :P
04:34:22disrupteki don't believe it.
04:34:39leorizethough I dislike the "bundle-only" approach
04:34:53disruptekbundle-only?
04:34:57leorizeI like `nimble install` in that it gives you a quick way to prototype
04:34:59FromDiscord<ElegantBeef> Does `ffAppend` allow reading and writting?
04:35:13disruptekah, well dist will give you that.
04:35:22FromDiscord<ElegantBeef> Or does it require `{ffAppned, ffWrite, ffRead}`
04:35:45disruptekyeah, we need set constants for these.
04:36:16disruptekf multiple references to the same file is wanted -> /are/ wanted
04:36:19leorizeffAppend lets you add more data into the file
04:36:43FromDiscord<ElegantBeef> Well i know what it says next to it, i was just curious
04:36:46leorizeffWrite is write-only and no append afaik
04:36:46leorizegotta look up OS ref manual a bit more
04:39:39disruptekmaybe it would be better to compose these flags with/without truncate so it's more clear.
04:41:15leorizeso ffWriteTruncate? and ffAppend can be standalone or with ffWrite?
04:41:54disrupteki don't remember what the os provides, but i think we can make the behavior more obvious, right?
04:42:10disrupteklike, Write could be a set of WriteOnly and Truncate.
04:42:33disrupteki think write is truncate by default but it's been so long since i gave a single fuck.
04:42:56leorizeyea, but people also voiced that it's confusing
04:43:02disruptekNote: No attempts are made to verify whether the file handle has been opened in asynchronous mode.
04:43:08disruptekis this really that hard to do better?
04:43:39disruptekThe returned FD will stay alive for the duration of f.
04:43:47disruptekno idea what this means. "alive"?
04:43:55disruptekvalid, right?
04:44:06leorizestay open/valid
04:44:06leorizeyea
04:44:25disruptekpick alive/dead or valid/invalid and use only one set of words.
04:44:32leorizeI can do verification, but that would cost 2-3 syscalls depending on the OS
04:44:51disruptekyou cannot determine this at the open?
04:44:59leorizealso usually when you work with FD you are assumed to already know what you're doing
04:45:05disruptekmaybe you need a converter. 😁
04:45:54leorizeoh, those functions are low-level stuff, the actual open stuff is implemented elsewhere
04:45:58leorizeI only make one for pipes atm though
04:46:04leorizefile system is a pain so that will come later
04:46:57disruptekmaybe what you really want is a separate type for async fd.
04:47:11*sixtyten quit (Quit: Leaving)
04:47:21disruptekthen people can use conversion of the distinct.
04:47:45leorizecurrently fd has to be split into because of windows
04:47:48leorizein two*
04:47:59leorizeI don't want to multiply that by two just for async
04:48:33disruptekhmm.
04:48:45leorizeso currently I just make the tradeoff that: if you are using fd-based interfaces, you probably know what you are doing
04:49:13disrupteki dunno, i think types are pretty cheap insurance.
04:49:27disruptekthey really work well, y'know?
04:49:33leorizeand I may expect yet another fd split for windows because they can't stand having one close() function
04:50:23disruptekThe IOError thrown will contain the number of bytes read then.
04:50:28disrupteks/then/thus far/
04:50:53disruptekData will be written into b even when an error occurs.
04:50:59disruptek/may/ be written
04:51:31disruptek the function /will return 0/ (what else?)
04:52:16disruptekThe function shall read until b.len bytes has been read or the end-of-file has been reached.
04:52:31disruptekThe function will read until b.len bytes are read or the end-of-file is reached.
04:53:31disruptekso are we saying that uint8 is wrong?
04:53:59leorizebyte is an alias for uint8
04:54:15leorizeI just use bytes because it's friendlier
04:54:24FromDiscord<ElegantBeef> Why are we even saying "The function" 😄
04:54:31disrupteki agree, but some people are weird about this.
04:54:52disrupteki think if you say Returns the number of bytes read from f.
04:55:03disruptekthen you can omit any other reference to the return value.
04:55:35disrupteki don't understand `takeFD`.
04:55:51disruptekalso not sure about FD as a type. 😁
04:56:33leorizetakeFD give the ownership back to the caller
04:56:48leorizeas in that `f` destruction afterwards will not cause the returned fd to close
04:57:05leorizeyea I need better wording there
04:58:01leorizedisruptek: FD as a type give me a cheap way to define destructors for them
04:58:15leorizeor do you mean I should return Handle[T] instead?
04:58:49disruptekno, just that two capital letters look strange in nim.
04:59:01disruptekthe use of fd is correct afaict.
04:59:27disruptekfile.fd isn't exported, right?
04:59:44disruptekyeah, looks fine.
05:00:19leorize[m]I thought of calling it "FileHandle", but because Windows doesn't agree on that so I just shorten it :p
05:00:57disrupteklooks good.
05:01:10disrupteki'm sure others will bikeshed the fuck outta it.
05:01:34disrupteki probably would try to really nail the flags.
05:02:30leorize[m]the flags are temporary for now, Windows and POSIX each have a bunch that I need to sort through and figure out a middle ground
05:03:28disruptekmakes sense.
05:03:57leorize[m]and will your cps let me have openArray as params? I still hate that I have to force string/seq for async procs
05:04:09disruptekwhy not?
05:04:53disruptekyou mean a generic?
05:05:47leorize[m]I just need to be able to use openArray[char or byte] for example
05:06:10disrupteki don't think it's a problem but i should add a test or two soon.
05:06:31leorize[m]though I suppose the limitation is rooted in Nim's closure itself
05:06:59leorize[m]I expect to have to wait until views mature
05:07:14disruptekwe may have a parse bug in the identdefs or something but that should be the only issue. we shouldn't care.
05:07:53leorize[m]now, how much of concepts can I use before the compiler burst into flames?
05:08:00disrupteki doubt you will wait long. araq always uses close omission as a primary use-case for destructors. 😁
05:09:05disrupteki have a similar thing in frosty; a concept for a container of char-sized types with a len and whatnot.
05:09:38disrupteksetLen is sometimes a thing you need, too.
05:09:48*Jesin joined #nim
05:10:33leorize[m]statically sized containers are what my apis target atm
05:10:51leorize[m]these are low-level and I expect streams to fill in the high-level ones
05:11:09leorize[m]too bad we don't have one for async
05:14:35*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:14:45*njoseph joined #nim
05:29:13*keyle joined #nim
05:30:10disruptekwe don't have an asyncstream?
05:32:13FromDiscord<Avatarfighter> we do
05:32:13FromDiscord<Avatarfighter> https://nim-lang.org/docs/asyncstreams.html
05:33:20disrupteki think he's whining that he can't pass a var seq into async or some shit.
05:33:43*keyle quit (Quit: brb)
05:33:49FromDiscord<Avatarfighter> oh
05:33:54disruptekleorize: what do you think about reworking gitnim so that it operates against the nightlies repo instead?
05:34:02*keyle joined #nim
05:34:24leorize@Avatarfighter not that asyncstreams, that one is useless
05:34:45disruptekanything with async in it is useless. 🤣
05:34:52leorizeI want an async analouge of std/streams
05:35:33leorizedisruptek: sure but you would need me to implement this first: https://github.com/nim-lang/nightlies/issues/49
05:35:33disbotProduce JSON manifests for nightlies
05:35:49FromDiscord<Avatarfighter> @leorize like much of the current async library
05:36:47leorizeand I still have to write code for it because there are no immediate successor atm
05:37:45disrupteknot sure i need any of that.
05:38:28disruptekif the user downloads gitnim for their platform, it can have the arch built into it.
05:39:14leorizenightlies releases can be in the "uploading stage" or "this particular arch failed to build"
05:39:27leorizewhich mean you gotta skip that release
05:39:33disruptekso what?
05:39:49disrupteki mean, if the url is missing, meh.
05:40:21disruptek"try again in 30 seconds. 😘"
05:40:54leorizeif you don't have a github token iterating two or three times will get you throttled
05:41:20disruptekyou mean a `wget`?
05:41:56disruptekwhy don't you wait until the assets are done to cut the tag, anyway?
05:42:36*waleee-cl quit (Quit: Connection closed for inactivity)
05:42:39leorizesometimes they can fail, especially for experimental archs
05:43:07disruptekso cut tags for each arch.
05:43:11leorizeand non-native archs take 3x the time to build, so that slows things down
05:43:24leorizeI can't change the tag format
05:43:26leorizetouch it and tools go boom
05:44:00leorizewe have people outside of nim relying on nightlies too
05:44:01disruptekokay, so gitnim will wait for the tags to cool.
05:45:21disruptekhonestly, we practically have this licked.
05:46:48disruptekwait, you can't even add new tag formats?
05:46:58disruptekthat's fucked up.
05:47:19leorizethe last time I touched the asset names choosenim go boom
05:47:28disruptekno, not the assets.
05:47:31disruptekjust tags.
05:47:41leorizeI expect the same thing for tags tbh
05:47:48disruptekokay, well whatever.
05:48:01disrupteki am smarter than choosenim, thank fucking $DEITY.
05:48:25*cvoxel joined #nim
05:48:44leorizethis is why I wanted a new metadata system, custom parsing go nowhere
05:49:33leorizealso it would let me cut a lot of code from future setup-nim :P
05:50:06disruptekif you build it, i will use it.
05:51:34leorizecurrently drawing inspiration from zig's json: https://ziglang.org/download/index.json
05:52:30disrupteki still don't really understand it, but whatever.
05:52:52disruptekto me, i just put assets into git and i get all this crap for free.
05:53:15disruptekbut like i said, if it helps, i'll use it.
05:53:52disruptekit seems that no one wants to collaborate on gitnim, so it's time to make it more monolithic i guess.
05:54:04leorizewith that said, you can try to interface with current nightlies release system
05:54:25disruptekyeah, that's what i do now.
05:55:09disrupteki was just ruminating on how i cannot use the tag to determine the filename.
05:56:15leorizeI hate that too :P
05:57:17disruptekthe easiest solution might be to parse the version for the commit from the compiler source. 😆
05:57:26leorizeI thought about adding a json-formatted footer into the description, but there are concurrency issues
06:05:37disrupteki think we'll have a way to hint the version or we'll just guess, but this will be a corner case that we'll probably make rather hard to use.
06:05:49disruptekwe want people to just pull down the latest release for the branch.
06:06:41saemdisruptek: what kinda collaboration are you looking for
06:07:57disruptekhttps://github.com/disruptek/gitnim/commits/1.4.3/gitnim
06:08:01disrupteksomething more than this, i guess.
06:08:44disruptekbut i think the monolithic idea makes more sense now.
06:12:38saemwhat's the monoliTHICC idea?
06:21:33disruptekit won't be collaborative per se.
06:21:50disruptekmore similar to gitnim, but reflective of the nightlies repo.
06:21:55disrupteker, choosenim.
06:22:16disruptekgitnim currently has this idea that people might want to manage their own distributions, share them, etc.
06:22:27disruptekno one gives a shit about that, turns out. no one else, i mean.
06:22:46disruptekso this'll just point at github and give you the freshest shit, all the time.
06:22:52disruptekthat's it.
06:23:36saemI think when folks are trying to clean room builds and crap they definitely will.
06:23:39FromDiscord<ElegantBeef> I dont dislike the idea, though the way i see it it makes more sense to just point it to a repo/commit and give it a name
06:24:04FromDiscord<ElegantBeef> So users can do whatever they want with whatever nim fork, and give it whatever name they want
06:24:17disruptekyeah, that's how it works.
06:24:19saemI mean could try popping it into the extension and seeing how much uptake there is for it?
06:24:38FromDiscord<ElegantBeef> That's not how it works from the readme
06:24:40disruptekright now gitnim requires the user to update it.
06:25:28disruptekthe monolithic version will just work the same for everyone; you can still share repos and whatnot, but by default it will feature updates from the mainline nim branches.
06:25:38FromDiscord<ElegantBeef> `git nim gitUrl -b branch -c commit -n name` is basically what i'm suggesting
06:25:44saemgitnim itself or the list of possible nims it could install?
06:26:09FromDiscord<ElegantBeef> name allowing you to give it a nice name so you could switch between them like `git nim thatSillyFork`
06:26:10disruptekbeef: you can set the gitnim url at compile-time or in the environment.
06:26:23disruptekyou do that with tags, chucklehead.
06:26:25disruptek~gitnim
06:26:26disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
06:26:34disruptekthe web-site shows the deets.
06:27:25disrupteki don't want to support build-from-source, though. like, ever.
06:28:56FromDiscord<ElegantBeef> Well then there's where my suggestion falls apart 😄
06:29:15disruptekyeah, i don't want those users.
06:30:00disruptekmore important to have the product tight and deliver success universally, correctly, with no support burden.
06:30:16disruptekif you want a from-source compiler, you'll build it yourself. it's not /that/ hard.
06:30:24FromDiscord<ElegantBeef> Oh i know it's not
06:30:26*def- quit (Quit: -)
06:30:37FromDiscord<ElegantBeef> I'd probably just fork choosenim for it
06:30:51disruptekterrible.
06:31:22FromDiscord<ElegantBeef> Well it already does what i suggested just only for the nim repo
06:31:38FromDiscord<ElegantBeef> I'd just be adding user defined repos
06:32:05disruptekgo nuts.
06:32:13*def- joined #nim
06:32:42saemIt does... I thought you can point it to a pre-built thing, but it doesn't really do anything else except point the shims there... which honest they don't expose all the binaries and the gdb stuff is broken.
06:33:27*muffindrake joined #nim
06:33:47FromDiscord<ElegantBeef> It doesnt let you point it to a git url/branch and give it a name
06:34:00FromDiscord<ElegantBeef> It does let you point to it locally
06:34:14disruptekjust do that in your nim fork, bozo.
06:34:22disruptekwhy do you need choosenim to fuck it all up?
06:34:38FromDiscord<ElegantBeef> What?
06:34:41disruptekthis is why remotes and tags exist.
06:36:40FromDiscord<ElegantBeef> Well manually managing a repo is a tad annoying and having `choosenim upgrade yourNamedFork` being an alias to that repo which also rebuilds is just nicer
06:36:42disruptekfor a good time, get high and read some of the bug reports in the nimble and choosenim repos.
06:36:48disruptekit's absolutely hilarious.
06:44:14FromDiscord<Avatarfighter> that does not sound fun tbf
06:59:02*cvoxel quit (Remote host closed the connection)
07:00:13*j-james joined #nim
07:01:27*j-james left #nim (#nim)
07:01:55*j-james joined #nim
07:02:28*j-james quit (Client Quit)
07:15:04*cvoxel joined #nim
07:18:34*habamax joined #nim
07:19:50*adnan338 quit (Ping timeout: 272 seconds)
07:36:03*opal quit (Ping timeout: 240 seconds)
07:39:37*Cthalupa quit (Ping timeout: 260 seconds)
07:42:47*Cthalupa joined #nim
07:45:59*bouzu_ joined #nim
07:56:58*narimiran joined #nim
08:02:23*opal joined #nim
08:10:15FromDiscord<mratsim> AsyncStreams are really easy with coroutines, Streams as well.
08:10:22FromDiscord<mratsim> @leorize^
08:21:24*cvoxel quit (Ping timeout: 240 seconds)
08:22:11saemvery much looking forward to that or rather that plus faststreams. :D
08:28:54FromDiscord<mratsim> What I'm impressed by is what with can do with nanoseconds context switches:↵- http://www.vldb.org/pvldb/vol11/p1702-jonathan.pdf↵- http://www.vldb.org/pvldb/vol11/p230-psaropoulos.pdf↵- https://arxiv.org/pdf/2010.15981.pdf
08:29:42saemThat last paper is a local university.
08:29:47saemNeat
08:34:56FromDiscord<ElegantBeef> Look at you with all your educational institutes
08:35:26saemLoL, UoA is a fantastic university in a number of different areas.
08:35:51FromDiscord<mratsim> the second one is from EPFL in Switzerland
08:36:05FromDiscord<ElegantBeef> I generally know nothing about post secondary
08:36:10*bouzu__ joined #nim
08:36:11FromDiscord<ElegantBeef> So i'll take your word for it
08:36:23*Gustavo6046 quit (Quit: ZNC 1.7.5 - https://znc.in)
08:36:28saemI know a bit but mostly because hiring, never got a degree.
08:36:37*Gustavo6046 joined #nim
08:36:56FromDiscord<mratsim> Most of the time I see Stanford or MIT or ETH Zurich
08:37:19saemWe read different papers. :D
08:37:49FromDiscord<thulahn> Do any major companies support nim? Like Apple with rust, Google with golang etc
08:37:51saemIn fairness a fair bit of MIT and ETH in the stuff I've read.
08:37:53FromDiscord<ElegantBeef> I cant even read
08:38:42saemAFAIK, none of FAANG or whatever it is these days supports nim internally.
08:38:47*bouzu_ quit (Ping timeout: 260 seconds)
08:39:15FromDiscord<ElegantBeef> Also Apple supporting rust?
08:39:21FromDiscord<thulahn> I thought they might be
08:39:27FromDiscord<thulahn> Think I read it somewhere
08:39:31FromDiscord<ElegantBeef> Doesnt apple have it's hands all over swift?
08:39:33saemInternally, I've heard they have a rust team.
08:39:35FromDiscord<mratsim> Microsoft has a couple of Rust internal dev.
08:39:53saemThey're using it in a few places, IIRC.
08:40:03FromDiscord<mratsim> @thulahn dom96 is working at Facebook if that counts :p
08:40:21FromDiscord<ElegantBeef> Well status is funding Nim's development iirc
08:40:22FromDiscord<mratsim> (the author of Nim in Action book)
08:40:46FromDiscord<ElegantBeef> You'd know better than me mratsim 😛
08:40:50FromDiscord<mratsim> yes Status is sponsoring Nim, and has the largest Nim team out there.
08:41:05FromDiscord<mratsim> https://nim-lang.org/sponsors.html
08:41:08FromDiscord<thulahn> A whole team wrote that
08:41:12FromDiscord<thulahn> Book?
08:41:24FromDiscord<ElegantBeef> Nope just dom did
08:41:31FromDiscord<mratsim> https://www.manning.com/books/nim-in-action
08:42:01FromDiscord<ElegantBeef> Ah finally found the sponsors thanks to that link https://www.rust-lang.org/sponsors
08:42:06FromDiscord<mratsim> I think we're over 20 people working in Nim now?
08:42:29FromDiscord<mratsim> at Status
08:43:21FromDiscord<ElegantBeef> Based of aoc2020 we're steadily growing
08:43:30FromDiscord<ElegantBeef> 1% of people used Nim
08:43:45FromDiscord<ElegantBeef> Atleast on the unofficial survey 😄
08:43:53FromDiscord<mratsim> that's nice
08:44:14FromDiscord<mratsim> I remember learning about esoteric languages like J and K on project euler :p
08:44:38FromDiscord<mratsim> otherwise I think some of the Codewars or what not game competition can be a good showcase
08:46:24FromDiscord<ElegantBeef> Yea, also if we can get the VM to be faster that'd be nice 😄
08:47:54FromDiscord<ElegantBeef> It getting faster and having libffi you could get a fairly usable scripting language
08:48:11*cvoxel joined #nim
08:48:20FromDiscord<thulahn> Is that book worth getting?
08:48:26FromDiscord<thulahn> I'm thinking about trying nim
08:48:29FromDiscord<ElegantBeef> Most people that get it dont regret it
08:48:58FromDiscord<thulahn> I'm a DevOps type guy who's best at python so that's the draw for me
08:49:12FromDiscord<ElegantBeef> the draw?
08:49:55FromDiscord<haxscramper> @thulahn for some opinion on devops/system administration for nim see https://www.reddit.com/r/nim/comments/knt1o7/advice_is_nim_worthy_of_time_to_master/
08:50:07FromDiscord<haxscramper> Not sure it is 100% relevant, but you might find something interesting there
08:50:15FromDiscord<ElegantBeef> I can be quite stupid at times you know
08:54:03FromDiscord<thulahn> Yes it's interesting
08:54:12FromDiscord<thulahn> Someone said to stop before the metaprogramming
08:54:29FromDiscord<thulahn> I thought a good place to start would be some simple library to contribute to nimble
08:55:02FromDiscord<ElegantBeef> Well most of what i've contributed is metaprogramming related 😄
08:56:02ForumUpdaterBotNew thread by Srbga: What's the preferred way to compile nim to WebAssembly?, see https://forum.nim-lang.org/t/7365
08:57:19FromDiscord<lantos> how can you stagger iterators?↵https://play.nim-lang.org/#ix=2Lwk
08:57:59FromDiscord<mratsim> you can't because no inline iterator chaining
08:58:25FromDiscord<mratsim> you need to for loop inside or use timotheecour aliassym patch or use closure iterators or use templates or use zero-functional
08:59:07FromDiscord<mratsim> complain on the tracker, there is an issue about this open, bonus point if you have a compelling use-case.
08:59:41FromDiscord<mratsim> ah, apparently you can use that as well: https://gist.github.com/mratsim/92f069c652eb1704e1a7bfc376941919
09:00:02FromDiscord<mratsim> and https://github.com/nim-lang/Nim/issues/4516
09:00:12disbotCannot pass inline iterator to inline iterator ; snippet at 12https://play.nim-lang.org/#ix=2Lwm
09:00:21*ee7[m] quit (Quit: Idle for 30+ days)
09:02:16FromDiscord<ElegantBeef> AliasSym seems nice 😄
09:06:01*bouzu__ left #nim ("Leaving")
09:06:54FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=2Lwr
09:07:36FromDiscord<lantos> ^ dont think that is enough to argue for it, that and it I guess it was just something I thought nim could do
09:10:03ForumUpdaterBotNew thread by Jasonfi: How to add a parameter based on a variable?, see https://forum.nim-lang.org/t/7366
09:11:23FromDiscord<mratsim> @lantos Python uses yield from
09:11:31FromDiscord<mratsim> Haskell has chaining
09:13:15FromDiscord<mratsim> you can also do fusion in Python using partial function application/catamorphisms: https://github.com/mratsim/Biostatistics-CSVtoGraphPad/blob/master/ExceltoGraphPad_asinh_tumorsphere.py#L17-L20
09:22:28FromDiscord<lantos> v
09:22:31FromDiscord<lantos> (edit) "v" => "https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3ca22f16659e33ef67a6ead71b724f27"
09:23:39*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:26:14FromDiscord<mratsim> Rust also has fusion with iters() and into_iters() + collect
09:31:14FromDiscord<lantos> collect is nim's toSeq?
09:33:44FromDiscord<mratsim> kind of, but Nim has collect in sugar now
09:50:05*cvoxel left #nim ("Killed buffer")
09:53:24FromDiscord<andeee> sent a code paste, see https://play.nim-lang.org/#ix=2LwK
10:00:39*NimBot joined #nim
10:00:58*adnan338 joined #nim
10:01:13*adnan338 quit (Client Quit)
10:01:23*adnan338 joined #nim
10:02:08ForumUpdaterBotNew thread by Mratsim: Google Summer of Code, Feb 19, 2021, see https://forum.nim-lang.org/t/7367
10:34:43*opal quit (Ping timeout: 240 seconds)
10:36:56*opal joined #nim
10:50:12*Vladar joined #nim
10:50:18*waleee-cl joined #nim
11:00:40*Tanger joined #nim
11:02:18*Q-Master quit (Ping timeout: 260 seconds)
11:08:25*krux02 joined #nim
11:22:06FromDiscord<dom96> > if pull requests appear as closed and approved, but not merged, what does it mean? How can I try it? https://github.com/nim-lang/Nim/pull/11724↵giaco: you can just clone https://github.com/rayman22201/Nim/tree/asyncFlowVar (git clone that repo then git checkout `asyncFlowVar`). I've done some work to revive this over the Christmas holidays actually, plan to work some more towards that soon 🙂
11:22:07disbotMake Flowvar compatible with Async
11:24:18ForumUpdaterBotNew thread by Greenfork: NimraylibNow! - The Ultimate Raylib gaming library wrapper , see https://forum.nim-lang.org/t/7368
11:24:41FromDiscord<dom96> (edit) > if pull requests appear as closed and approved, but not merged, what does it mean? How can I try it? https://github.com/nim-lang/Nim/pull/11724↵giaco: you can just clone https://github.com/rayman22201/Nim/tree/asyncFlowVar (git clone that repo then git checkout `asyncFlowVar`). I've done some work to revive this over the Christmas holidays actually, plan to work some more towards that soon 🙂
11:24:42disbotMake Flowvar compatible with Async
11:28:41FromDiscord<dom96> @leorize supporting raises in async would be cool. It might not even be that difficult to fix, instead of complaining consider giving a fix a try 😉 https://github.com/nim-lang/Nim/issues/6639#issuecomment-604733536
11:28:42disbotCan I make {.async.} and {.raises:[].} works together?
11:30:06FromDiscord<thulahn> What's the reasoning behind case insensitive (apart from the first character) and under score insensitive variables?
11:30:17FromDiscord<zetashift> Woah another raylib binding
11:30:48grforkthe ultimate one (tm)
11:30:55*grfork is now known as greenfork
11:31:17FromDiscord<zetashift> This one looks great tho
11:31:33FromDiscord<zetashift> `Idiomatic Nim naming and conventions so you write Nim code, not C` I love it
11:31:41*Q-Master joined #nim
11:32:01FromDiscord<thulahn> Surely it's not just to make it unique to nim
11:32:48FromDiscord<dom96> @thulahn https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#why-is-it-caseunderscore-insensitive
11:33:22FromDiscord<zetashift> IIRC the previous good raylib wrapper used raylib conventions which makes it a lil less Nimish, and I like it Nimish
11:33:48FromDiscord<zetashift> Also the readme of this wrapper is great 😄
11:33:58FromDiscord<dom96> One practical outcome of these rules is that it's easier to use C libraries with differing style conventions
11:34:02FromDiscord<thulahn> Thanks.
11:34:14FromDiscord<thulahn> You don't have a discount code for your nim in action book do you? 😄
11:34:31FromDiscord<zetashift> Now that's hustling
11:34:58greenforkthe problem with C is that in Raylib it uses first capital letter so that one can't write `initWIndow` from C `InitWindow` even with case-insensitive rules because the first letter still counts
11:35:01FromDiscord<dom96> hehe
11:35:05FromDiscord<dom96> @thulahn you can try fccpicheta
11:35:11FromDiscord<dom96> dunno if it still works though
11:35:29FromDiscord<dom96> It's usually much cheaper on Amazon though
11:36:58FromDiscord<zetashift> @greenfork the one and only! Thank you, I'm currently on Linux but if you want I can boot into my Windows and try it out
11:37:54greenforkzetashift, thank you! sure you can, I will be here if you have any questions
11:44:43*hmmm joined #nim
11:45:44FromDiscord<dom96> @leorize regarding https://github.com/nim-lang/Nim/pull/14556 I'm no expert in SSL. So that's why I skipped it. Next time I will write a comment to say that I'll let someone else take a look to make it clearer 🙂
11:45:45disbotnet, openssl: support setting the minimum supported SSL/TLS version
11:53:25FromDiscord<thulahn> Does nim have one line if-statements?
11:53:29FromDiscord<thulahn> Like the ternary operator
11:55:02greenforksure: nexti = if i == crownSides - 1: 0 else: i + 1
11:56:32FromDiscord<thulahn> Cool.
12:00:54*habamax quit (Quit: leaving)
12:10:39FromDiscord<thulahn> Sorry for these newb questions, but I'm still learning. The `strformat` library, I know that you can do something like `echo fmt{1/3: .2f}` to get `0.3` but what is the meaning of the curly parens?
12:10:51FromDiscord<thulahn> (edit) "`0.3`" => "`0.33`"
12:11:07FromDiscord<mratsim> it's a domain specific language
12:11:36FromDiscord<mratsim> fmt creates a small domain specific language to apply {value: formatting}
12:11:41FromDiscord<thulahn> (edit) "fmt{1/3: .2f}`" => "fmt"{1/3: .2f}"`"
12:12:14FromDiscord<mratsim> It choose to use curly bracket, just like python does for the f-string or AngularJS for HTML codegen
12:12:22ForumUpdaterBotNew thread by Sdmcallister: Resize window events karax, see https://forum.nim-lang.org/t/7369
12:14:06FromDiscord<thulahn> In f-strings, you can do `f"{abc} def {ghi}"` - can `strformat` do that too?
12:14:58*keyle quit (Ping timeout: 272 seconds)
12:15:53FromDiscord<dom96> !eval import strformat; let abc = 42; let ghi = "hi"; echo(fmt"{abc} def {ghi}")
12:15:56NimBot42 def hi
12:28:23ForumUpdaterBotNew thread by Jasonfi: Feedback request: todo.network, see https://forum.nim-lang.org/t/7370
12:41:21filcuc_my nim program crash inside the GC_fullCollect proc ...probably is a caused by a double free or some weird allocation due to C interop procs. Gdb is not helping me too much. Any hint?
12:42:31FromDiscord<Meowz> https://play.nim-lang.org/#ix=2LxB
12:43:04FromDiscord<Meowz> How could I get that template to work? Currently fails with `got <glEndDef> but expected 'None'`
12:43:58*PMunch joined #nim
12:44:48FromDiscord<dom96> filcuc: if your program works with arc/orc you can get it running under valgrind
12:45:02FromDiscord<jasonfi> Hi, in Karax, does anyone know the default value of the autofocus param for input()?
12:46:46filcuc_dom96: i tried to use arc..after fixing some errors due to finalizers i get /home/filippo/Projects/NimProjects/NimQml/src/nimqml.nim(8, 9) Error: internal error: environment misses: message`gensym12786110
12:47:15filcuc_and i'm on nim 1.2.8
12:48:39FromDiscord<dom96> @jasonfi if that's a DOM param then it'll be whatever the DOM's default is
12:48:52FromDiscord<dom96> filcuc: you could try 1.4.x I guess
12:49:33FromDiscord<jasonfi> I want to say autofocus = my_autofocus_value, but I can only do that if I know what the default is, to leave it out if I don't want it "set"
12:50:29FromDiscord<jasonfi> in Karax source autofocus is defined as a bool, so.. strange. Possibly the JS string equivalent of false?
12:51:50FromDiscord<dom96> https://www.w3schools.com/jsref/prop_text_autofocus.asp
12:51:57FromDiscord<dom96> looks like it's false by default
12:52:18FromDiscord<jasonfi> ok thanks I'll try that
12:56:13FromDiscord<jasonfi> it doesn't work.. if I set the value to "false" it still thinks autofocus is enabled
12:58:05FromDiscord<jasonfi> Is Karax using some kind of template magic or something?
13:04:00*adnan338_ joined #nim
13:04:34filcuc_dom96: ok with arc it doesn't crash
13:04:36filcuc_:|
13:04:45filcuc_dom96: but thanks anyway
13:04:58giacodom96: super! Thanks a lot for the link
13:06:31giacoI saw your work on topic, I wish I could be more independent for such tests, but yet I'm too young with nim. Need more time!
13:07:01FromDiscord<0xc45> Hi all, quick question - is it possible to store a variable (executable code in my case) in the `.text` segment of the binary using Nim?
13:07:20*waleee-cl quit (Quit: Connection closed for inactivity)
13:07:55*adnan338 quit (Ping timeout: 256 seconds)
13:07:58*adnan338_ is now known as adnan338
13:11:02FromDiscord<lqdev> hm, you can definitely store it in .rodata by making a const
13:11:17FromDiscord<lqdev> not sure why'd you need to store a variable in .text
13:12:04FromDiscord<0xc45> Yeah indeed, I'm specifically looking for ways to store it in, or move it to, .text in my case. Reason is that .text is executable by default, and I'm trying to avoid calling APIs to make memory regions executable 🙂
13:12:55FromDiscord<mratsim> @0xc45 search for "PROGMEM" in the forum or issue tracker
13:13:19FromDiscord<mratsim> I think someone asked for putting const in specific program areas for embedded
13:13:25filcuc_other thing that i see it's that nim compiler line numbers are wrong even with debuginfo:on and debugger:native
13:14:07FromDiscord<mratsim> ah yes it was this: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
13:14:08FromDiscord<0xc45> Thanks again @mratsim! Will do that
13:14:21FromDiscord<0xc45> Oh awesome
13:19:17filcuc_mh i remember that i've to do something to register a foreign thread, correct?
13:19:25filcuc_in order to make GC works
13:20:58FromDiscord<mratsim> setupForeignThreadGC()
13:21:23FromDiscord<mratsim> otherwise don't use ref, strings, seqs, disable stacktraces and disable checks on integer (to avoid exceptions)
13:21:29FromDiscord<mratsim> on that thread
13:21:39FromDiscord<mratsim> you will SIGSEGV otherwise
13:22:20FromDiscord<mratsim> you can use push stacktrace:off and push checks:off for that
13:23:16filcuc_i'm crossing finger that setupForeignThreadGC will fix my sigsegv
13:23:21FromDiscord<mratsim> Example: https://github.com/status-im/nim-blscurve/blob/master/blscurve/bls_batch_verifier.nim#L170-L189↵and for attaching thradlocal GC https://github.com/status-im/nim-blscurve/blob/master/blscurve/openmp.nim#L48-L70
13:25:08FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ffb00349632f63d870aa6a9]
13:25:22FromDiscord<dom96> I wonder if we could do something to give a nicer error when setupForeignThreadGC is not invoked
13:27:19FromGitter<gogolxdong> GUI application crashed out of memory after running for couple of hours , how to debug
13:27:33PMunchIs there program size overhead when using ARC if you don't use any garbage collected structures?
13:27:46FromDiscord<mratsim> nop
13:27:49PMunchLike if I compiled a project that was using gc:none with gc:arc, would it grow in size?
13:27:53PMunchOh nice
13:27:54FromDiscord<mratsim> neither is there for the default GC
13:27:57FromDiscord<mratsim> ah
13:28:03FromDiscord<mratsim> a bit
13:28:13PMunch bit?
13:28:21FromDiscord<mratsim> Nim still does initialization of the GC for potential ref Exceptions thrown
13:28:40FromDiscord<mratsim> but maybe if you only use uint and stack objects you'll have nothing inside.
13:28:55PMunchOh right
13:29:30PMunchHmm, I have enabled exceptions:quirky though as well
13:29:37*hmmm quit (Ping timeout: 264 seconds)
13:29:40PMunchAs otherwise I couldn't get it to work
13:29:50filcuc_dom96: mratsim: crash solved..thank you
13:29:55FromDiscord<lantos> https://play.nim-lang.org/#ix=2LxV
13:30:10filcuc_is was playing with interfacing QThreads in NimQMl
13:30:17FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=2LxV" => "https://play.nim-lang.org/#ix=2LxV↵trying using .closure. ↵is this even a valid timing"
13:30:22FromDiscord<lantos> (edit) "timing" => "comparison?"
13:30:37FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=2LxV↵trying ... using" added " itter: itter: int"
13:30:44*hmmm joined #nim
13:31:07PMunch@gogolxdong, out of memory? Have you changed the GC? Or are you interfacing with an external C framework and not freeing things?
13:32:05filcuc_regarding arc/orc i successfully compiled NimQml. But i had to basically move the new statements (that have finalizers) at the top and basically forward declare some proc (in order to disable generation of default nim deleter). Is this the way to go?
13:32:27FromGitter<gogolxdong> I'm using nim-libp2p with go-libp2p-daemon as a progress, it's based on the chat example of nim-libp2p
13:32:32FromDiscord<mratsim> {.experimental: "codeReordering".}
13:32:49FromDiscord<mratsim> might help for the forward declaration part
13:33:09FromDiscord<mratsim> the finalizers probably still need to be moved by hand
13:33:16FromGitter<gogolxdong> wNim + nim-libp2p
13:33:47FromDiscord<mratsim> are you cancelling futures?
13:34:08filcuc_mratsim ok then..given that i've to take the long route for finalizers i'll add forward declarations too
13:34:15FromGitter<gogolxdong> default gc, devel latest , I think it's orc right?
13:34:39FromDiscord<mratsim> Note that we didn't test nim-libp2p or chronos with arc/orc yet
13:34:45FromDiscord<mratsim> default gc is refc
13:34:50FromDiscord<mratsim> arc/orc are opt-in
13:35:30FromGitter<gogolxdong> Is refc default gc for devel latest ?
13:35:46PMunchYou could try to add some profiling and see where the memory goes
13:37:08FromGitter<gogolxdong> I thought default GC is orc after 1.4
13:38:13FromDiscord<mratsim> it would be easier if refc supported -d:useMalloc ...
13:41:56*filcuc_ quit (Ping timeout: 240 seconds)
13:42:14*filcuc_ joined #nim
13:51:04giacosealmove I've tested some template operations plugins of binarylang and it works nicely! Thanks
13:51:52FromGitter<gogolxdong> Is refc still the default GC for now
13:55:49FromDiscord<Rika> yes
13:56:54FromGitter<gogolxdong> oh, I made a big mistake. Should I change it to ARC/ORC and try again?
13:59:00PMunchThe default GC shouldn't have a memory leak
13:59:08PMunchSo changing is not very likely to fix your issue
13:59:57PMunchLeaks in general mean you've done something wrong, somewhere you're either holding on to data you're not using any longer so it can't be collected, or you're interfacing with C and forgetting to clean up something.
14:00:20FromGitter<gogolxdong> it doesn't even compile for ARC/ORC
14:00:30PMunchReally the only way to fix it would be to figure out where memory goes missing, and then figure out why
14:10:13FromGitter<gogolxdong> There is some work to port nim-libp2p for ARC/ORC, and will check how to debug or profile.
14:11:53*keyle joined #nim
14:12:38*FromDiscord quit (Remote host closed the connection)
14:12:57*FromDiscord joined #nim
14:14:42FromDiscord<mratsim> chronos has futures tracking flag
14:15:27FromDiscord<mratsim> https://github.com/status-im/nim-chronos/blob/d3018ae908f61253efc0f260f425f192904e6104/tests/testutils.nim#L22-L32
14:15:38FromDiscord<mratsim> -d:chronosFutureTracking
14:15:56FromGitter<gogolxdong> yes, noticed that. Is there much to do, first encounter `libp2p\vbuffer.nim(44, 4) Error: expression cannot be cast to ptr SeqHeader`
14:16:25*keyle quit (Ping timeout: 240 seconds)
14:17:43*filcuc_ quit (Ping timeout: 260 seconds)
14:18:33FromGitter<gogolxdong> Is there a guide for porting to ARC/ORC?
14:19:13FromDiscord<mratsim> no, because we can't even update to 1.2.8
14:19:26FromDiscord<mratsim> so for now we only consider 1.2.6
14:21:19*ofelas quit (Quit: shutdown -h now)
14:21:36FromGitter<gogolxdong> It's time for me to spare time to investigate ARC/ORC .
14:22:55FromGitter<gogolxdong> I need to a guide in case my community ask me. :) , some asked me what's ARC/ORC, I just post the blog.
14:29:23FromGitter<gogolxdong> I feel lucky to work with experts like you all.
14:30:48FromDiscord<shadow.> have you read the blog post from yardanico?
14:30:48FromDiscord<shadow.> https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
14:31:06FromDiscord<shadow.> there are other writeups on the bottom
14:31:40PMunchgogolxdong, if you're trying to port to ARC/ORC to fix your memory leak I can almost guarantee you it won't work
14:33:38*D_ quit (Ping timeout: 264 seconds)
14:34:56FromGitter<gogolxdong> @PMunch I am aware of that. Deterministic memory management is important for me. As for the crash, it ok if it doesn't crash when I show to customers.
14:35:50FromGitter<gogolxdong> @shadow thanks for helping, I will check further.
14:38:12FromDiscord<thulahn> Holy shit, there are cloud libraries in nimble
14:38:19FromDiscord<thulahn> Very happy about that
14:38:38ForumUpdaterBotNew thread by Alexeypetrushin: Any plans for syntactic sugar for parameter unpacking?, see https://forum.nim-lang.org/t/7371
14:39:21*waleee-cl joined #nim
14:40:06*letto quit (Quit: Konversation terminated!)
14:41:55FromGitter<gogolxdong> About a moth ago, someone found me and said if weak ref can apply to ARC, cycle ref won't be a problem.It's shame that I didn't know what it means and couldn't respond as soon as possible.
14:42:47*letto joined #nim
14:44:33PMunchHmm, does anyone have a nice figure to explain syntax trees?
14:46:18Oddmongeri've made a « nimble refresh » and « nimble install sdl2_nim » , but i still get 2.0.12 and not 2.0.14
14:46:39FromDiscord<haxscramper> https://gist.github.com/haxscramper/4eec029cdd71573bb0d10fdde796c0d9
14:46:52FromDiscord<haxscramper> PMunch: I made this when I started nim
14:47:12FromDiscord<haxscramper> Not sure if this is really helpful or working or whatever, but it certainly was useful for me
14:47:36PMunchOoh, that is perfect
14:47:51FromDiscord<haxscramper> Also tree-sitter has nice playground with as representation so you might also want to use this for direct code-AST comparison
14:52:03PMunchHmm, it orders the nodes quite poorly..
14:55:04FromDiscord<haxscramper> You can try different layouts of introduse invisible edges on the same rankdir
14:55:39greenforkOddmonger, you might be getting 2.0.14 but it says it's 2.0.12 because nimble file has 2.0.12 https://github.com/Vladar4/sdl2_nim/blob/master/sdl2.nimble and git tag is 2.0.14
14:56:06Oddmongerah
14:56:56Oddmongerthat must be something like this, because it was downloaded with git
14:57:35greenforkrun nimble install with --verbose, it should say which git tag it is cloning
14:57:45Oddmongeri've grepped 2.0.14, and got some 2.0.14
14:57:58Oddmongerbut thanks for --verbose
14:59:06Oddmongeryes, « cloning latest tagged version 2.0.14 »
14:59:52*Q-Master quit (Ping timeout: 246 seconds)
15:00:45greenforkeverything's fine then
15:02:15*Q-Master joined #nim
15:04:46Oddmongeryes, thank you for the info
15:04:53FromDiscord<mratsim> mmmh, I assume there is no way to force {.emit.} code to be before other part of the code?
15:04:53ForumUpdaterBotNew question by Alex Craft: Why two different macros functions share variable namespace in Nim?, see https://stackoverflow.com/questions/65654687/why-two-different-macros-functions-share-variable-namespace-in-nim
15:05:26FromDiscord<mratsim> I have a type that I must {.emit.}, but when i use it, Nim creates types dependency before it's declared :/
15:09:00FromDiscord<mratsim> for the stackoverflow question that's because the "a" are global variables. Not sure if it's intended or not, this works: https://play.nim-lang.org/#ix=2Lyu↵↵What's strange is that unittest doesn't exhibit this behaviour.
15:10:09FromDiscord<haxscramper> But shouldn't `block:` introduce new scope anyway?
15:11:41FromDiscord<mratsim> yes
15:11:50FromDiscord<mratsim> and I think unittest does it that way
15:12:08FromDiscord<mratsim> so I don't understand what unittest does differently here
15:12:43FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Lyx
15:12:51FromDiscord<haxscramper> The code in SO question expands to same output
15:13:09FromDiscord<haxscramper> Well, with `expandMacros` and renamed second `let a` to `let b` it does
15:14:23leorize[m]the bug looks familiar
15:14:59leorize[m]i think it's reported but not fixed
15:20:26Oddmongerok, i have installed sdl2_nim , and now nim compiler said it cannot find « sdl2 » ( « import sdl2 »)
15:21:07Oddmongerand i have screenshots available for the scepticals
15:22:56*D_ joined #nim
15:24:18PMunch@hax, how do you add an invisible edge?
15:25:21greenforkOddmonger, you should probably import it as `import sdl2_nim`
15:25:35PMunchHmm, I feel like I've made a graph like this before..
15:25:37Oddmongeri've tried this already :)
15:26:07Oddmongeri've looked at ~/.nimble/pkgs , and it seems that the correct import is the name until the first '-' separator
15:26:17Oddmongeri tried « import ttf » and it worked
15:26:24greenforkOddmonger, you can try same command as in examples https://github.com/Vladar4/sdl2_nim/blob/master/examples/ex101_init.nim#L7
15:27:00*abm joined #nim
15:27:30Oddmongerah yes, that's it
15:27:40Oddmongerthanks again greenfork (are you the author ?)
15:28:09greenforkno, I was just checking this library lately
15:31:22Zevvdisruptek: I was able to get my attention span to reach over 5 mins. Added tests/ttypes.nim
15:32:16disruptekoh shoot.
15:34:40disruptekdamn, who needs more failing tests?
15:36:33disruptekare you going to fix these?
15:37:24*lritter joined #nim
15:38:45Zevvwho, me?
15:39:50*PMunch quit (Quit: leaving)
15:41:17*leorize quit (Remote host closed the connection)
15:42:01*leorize joined #nim
15:42:03FromDiscord<haxscramper> PMunch: IIRC something like `{ rank="same"; nodeA -> nodeB [style=invis]}`
15:42:15FromDiscord<haxscramper> To get invisible directed edge between two nodes
15:42:21FromDiscord<haxscramper> On the same level
15:53:27disruptekscramper: you should add dot output to gram.
15:54:28FromDiscord<haxscramper> I can do this, but how I should handle conversion from edge/node types to dot representation?
15:54:31FromDiscord<haxscramper> !repo hasts
15:54:31disbothttps://github.com/haxscramper/hasts -- 9hasts: 11Statically typed wrappers for various markup lanuages - grapvhiz, svg, openscad, latex & more 15 2⭐ 0🍴
15:54:52FromDiscord<haxscramper> I have this, which has separate DotGraph type
15:55:11disruptekup to you; i'm not picky, but i've been planning to do it so i can generate dependency graphs for projects via nimph.
15:55:19Zevvdisruptek: I'm not sure yet. It says Conv(Ident "int16", intLit(1)) is void
15:55:27FromDiscord<haxscramper> So I can mixin/pass as callback `dotRepr` that will either return string or type from this library
15:55:54disruptekZevv: yeah, conversions don't work right yet.
15:56:01Zevvok cool
15:56:06FromDiscord<haxscramper> Good, I will look into implementing it then because I will need something like that sometimes later
15:56:11disruptekyou can just rewrite them as newCall(int16, intlit 1)
15:56:22disruptekin our normalizing pass.
15:56:41disruptekhaxscramper: awesome, thanks. i will help however i can.
15:57:43disruptekZevv: that makes sense, right?
15:58:07Zevvsure, I was just fiddling with that, but I dont' really grok where it comes from and why it is not correct as it is
15:58:22ZevvBecause it comes from the original typed ast, we don't construct it, do we?
15:58:53disruptekno, but we lose the types pretty easily.
15:59:54disruptekthere are hidden .typ fields that get omitted in copies.
16:00:01Zevvsigh
16:00:14disruptekwe need to do this to get the typed symbols to re-sem.
16:00:21*fputs quit (Quit: WeeChat 3.0)
16:00:45disruptekbut it means that we get cases like this where the compiler expects to not need to sem the ast since it's nominally typed.
16:00:53disruptekwhatfer empty room reasons.
16:01:24*fputs joined #nim
16:05:32FromDiscord<haxscramper> actually I think I can do something even more interesting for gram
16:05:39FromDiscord<haxscramper> In addition to dot repr I mean
16:06:15FromDiscord<haxscramper> I finally close enough with hcparse to make some meaningful wrappers and I wanted to first wrap sourcetrail
16:07:34FromDiscord<haxscramper> It is meant to be used with C++ code analysis, but converting graph to interactively viewable/searchable representation is not that hard
16:08:08FromDiscord<haxscramper> Just an idea for now
16:10:13FromDiscord<mratsim> it's strange, I thought I had all the typed AST issues I could ever meet but it seems like you uncovered more 😮
16:11:17Zevvmaybe we should drop the ast and do this at the text source level instead
16:12:30disruptekthe carnac bug can be solved, in theory, it's just that, y'know, it hasn't been.
16:15:45leorizedisruptek is better at finding nim bugs than nim's test suite
16:15:50disruptekwe need a foreign-module bindsym test and also some generics tests.
16:16:28FromDiscord<flywind> please merge this to fix broken CI
16:16:32FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/16663
16:16:33disbotRef #15919 fix broken CI
16:17:10leorizewhy did we not notice it?
16:17:28leorizeah, because dom merged it while it was failing...
16:18:28disruptekjust revert it, then.
16:19:59leorizeflywind: merged
16:20:21FromDiscord<flywind> thanks
16:26:36Zevvdisruptek: https://github.com/disruptek/cps/pull/49
16:26:36disbotconv
16:27:28Zevvbut of course Error: Cannot satisfy the dependency on testes 0.10.0 and testes 1.0.0
16:30:41FromDiscord<thulahn> Possibly stupid question, but is there a way to run and write nim code on a Chromebook?
16:31:38leorizeif you manage to use chrome os' built-in linux sandbox probably
16:32:23*tane joined #nim
16:38:34FromDiscord<thulahn> That's great, I will give it a shot
16:48:46*Q-Master quit (Ping timeout: 256 seconds)
16:52:22*opal quit (Write error: Connection reset by peer)
16:52:23*leorize quit (Remote host closed the connection)
16:57:41Zevvdisruptek: I fixed some, but don't understand your unhide enough to fix the last one I just added to the test.
16:57:54ZevvThat might be the last one before I got my standalone tcp server up again
16:58:26FromDiscord<mratsim> jinx
17:11:41*Tanger quit (Remote host closed the connection)
17:15:06*Q-Master joined #nim
17:19:27*leorize joined #nim
17:20:20*Q-Master quit (Ping timeout: 265 seconds)
17:39:28*Q-Master joined #nim
17:43:40*abm quit (Quit: Leaving)
17:48:58FromDiscord<exelotl> question about term rewriting macros: would "adding constraints to the way a certain symbol is used" be a valid use-case?
17:49:22FromDiscord<exelotl> e.g. on the GBA there are certain IO registers which are write-only
17:50:17FromDiscord<exelotl> so I want to allow `foo = 5` but not `foo += 5` or `foo = foo + 5`
17:50:39FromDiscord<exelotl> but I also want to allow `addr foo`
17:52:27FromDiscord<haxscramper> I would just make `` func `+=`(t: GBA, arg: any): {.error: "Not allowed".}``
17:53:00FromDiscord<haxscramper> And `+` too
17:53:23FromDiscord<haxscramper> Term rewriting macros should be able to do this, yes, and actually good for this
17:57:51*a_chou joined #nim
17:59:06FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Lzs
17:59:23FromDiscord<0xc45> Does anyone have experience importing both `winim/clr` and `nimcrypto`? There's a naming clash somewhere and I can't seem to find it to exclude that import. Importing both errors out with `Error: call depth limit reached in a debug build (2000 function calls). You can change it with -d:nimCallDepthLimit=<int> but really try to avoid deep recursions instead.`
18:06:58FromDiscord<dom96> > ah, because dom merged it while it was failing...↵↵Oops. Apologies. I need to learn to trust the Nim CI more these days 🙂
18:12:02leorize0xc45: naming clash can't cause recursion overflow
18:12:13leorizethe compiler will force you to qualify if any clash happens
18:13:30FromDiscord<0xc45> @leorize Hmm, that's odd. Any guess on what could trigger this? My decryption code compiles with no issues, but if I import `winim/clr` (even without calling it) this recursion error starts occurring
18:14:22leorizethe stacktrace should tell you what was called, no?
18:14:28FromDiscord<haxscramper> And what is the problem? Make it unredable by disallowing all operations that use it's content like `+` or `+=`
18:15:17FromDiscord<haxscramper> And it plays better with external codegen, because I'm not sure if term rewriting will help if you have some template that expands into assign
18:16:13FromDiscord<0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2LzA
18:16:24saem0xc45: the stacktrace afaik requires a compiler built with it enabled. In case you're not sure how to get that going.
18:17:15FromDiscord<exelotl> for correctness I should prevent `foo = foo` since the RHS involves reading foo.
18:17:18FromDiscord<0xc45> Oh rly 😅
18:17:39FromDiscord<0xc45> Ah I see, let me try that
18:17:50leorize0xc45 winim might have some initialization code that depends on recursion
18:17:59leorizeand it recursed too much I guess?
18:19:17disruptekZevv: you have push; you don't need to create PRs unless you think they might be creepy for some reason.
18:20:41FromDiscord<haxscramper> I'm not sure, but does `let a = init()` count as `=`? If not you could disallow assign altogether
18:21:02FromDiscord<haxscramper> But I guess you should try term rewriting macros then
18:21:26FromDiscord<haxscramper> Because it is getting into a similar level of weirdness relatively speaking
18:22:08FromDiscord<0xc45> Yeah something like that, but it's somehow triggered by the import. Stacktracing only seems to result in an empty `profile_results.txt` lol
18:23:05saemDoes Nim VM itself support debugging?
18:24:01FromGitter<bung87> how to convert a table to js object when compile to js ?
18:24:01FromDiscord<haxscramper> no
18:24:09leorize0xc45: looks like a generic resolving bug...
18:24:14leorizeso not your fault but the compiler
18:24:42FromGitter<bung87> I use toJson, toJs none of them work
18:25:24FromDiscord<0xc45> That's comforting 😄. I tried changing the imports to "from winim/clr import nil" which works, but then it starts complaining about how I'm referencing a class method, even if I prepend "clr."
18:25:31saembung87, I believe the generic parameters play a role in that. What's the precise type?
18:25:44leorize0xc45: walkaround is to ```import winim/clr except `[]` ``` from what I'm seeing
18:25:55FromGitter<bung87> it's `var words:Table[int, string]`
18:26:59saemIIRC the int is the issue, there was a forum topic about this, can't precisely recall. When I was in the situation I wrote a quick proc.
18:27:37saemThis is what I'm remembering: https://forum.nim-lang.org/t/7121#44875
18:27:51FromGitter<bung87> if it's not int , what method you'd pick?
18:28:05leorize0xc45: what version of nim are you using?
18:28:24FromGitter<bung87> I always get nim internal structure.
18:29:17saemThis is what I've done: https://github.com/saem/nimlsp/blob/exp-rework-lsp/src/nimlsppkg/nimprojscan.nim#L342
18:29:29FromDiscord<0xc45> 1.4.2 on windows. I'll try the [] exclusion when I'm back at my pc, thanks a lot!
18:30:10disruptekZevv: Zevv: why doesn't the first test of ttypes pass?
18:30:21disruptekZevv: Zevv: Zevv: does it work for you?
18:31:01saemWhoa, a level 3.
18:31:36leorize0xc45: is your import order regarding nimcrypto and winim?
18:31:39leorizewhat is*
18:33:07FromDiscord<0xc45> First nimcrypto, then winim/clr. No other imports either
18:34:12FromGitter<bung87> hmm I have no idea now , I use ` % $` still get {kind:4....}
18:36:15Zevvdisruptek: disruptek: disruptek: It breaks with Error: Expected a node of kind nnkBracket, got nnkIntLit
18:36:24Zevvsomething in unhide
18:37:08leorize0xc45: I can't seem to be able to produce a failing sample :( if you have the time please share your nim file
18:37:42leorizefeel free to reduce it into a smaller file. It's fine as long as it produce the issue
18:38:36greenforkwhy does it take for nim twice as long to generate bindings with {.header.} pragma than with {.dynlib.}?
18:38:40FromDiscord<0xc45> Sure thing, I'll send you my file after dinner!
18:39:53greenforkgenerate bindings - meaning generate C code with -c switch
18:40:22greenforkis it logical in any way?
18:43:54FromDiscord<mratsim> @exelotl use term-rewriting macros sparingly because they cause the compiler to recheck your AST a couple of times, increasing compilation-time
18:45:11FromDiscord<mratsim> @greenfork, does your header contains C/C++ macros or templates?
18:45:35FromDiscord<mratsim> with header there is the linker cost as well.
18:46:08FromDiscord<enthus1ast> @greenfork wrapping raylib?
18:46:51FromDiscord<nikki> greenfork: which part is taking twice as long? compiling?
18:47:15FromDiscord<nikki> in any case yeah with dynlib it pushes almost everything to runtime
18:47:22greenforkmratsim, C macros, it's 1 h file header+implementation. But I don't understand why it should matter. I only do `nim c -c` which should just generate C code, no linking or anything else
18:47:32greenforkenthus1ast, right :D
18:48:24FromDiscord<enthus1ast> i got physac compiling and the demo "working" but i crashes after a few seconds, so yeah
18:48:41FromDiscord<0xc45> @leorize Your `except '[]'` workaround works! Thanks a million :D. If you're still interested in reproducing, here's a piece of code that crashes for me: https://pastebin.com/mNqfyWNZ
18:49:04FromDiscord<enthus1ast> (edit) "i" => "it"
18:50:21FromDiscord<enthus1ast> i'm fighting with nimterop not sure if the approach is correct that i'm trying to do :/
18:50:57FromDiscord<enthus1ast> maybe wrapping by hand will produce better results
18:52:33FromDiscord<exelotl> uuuh is `[]` (pointer dereferencing) not an overloadable operator?
18:52:45greenforkenthus1ast, will try this too in some time after I figure out how this actually works
18:53:11FromDiscord<enthus1ast> if you like i can publish the stuff i have in a branch
18:53:34FromDiscord<enthus1ast> but it's mostly try and error
18:54:04FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2LzI
18:54:33FromDiscord<mratsim> @exelotl it is, but with care
18:55:04greenforkenthus1ast, sure, it would be helpful
18:55:16FromDiscord<enthus1ast> @mattrb you can generate procs with macros
18:56:02FromDiscord<mratsim> @exelotl You can overload: https://github.com/mratsim/Arraymancer/issues/185↵And I try to have some kind of dispatch to allow deref to work https://github.com/mratsim/Arraymancer/pull/270/files#diff-0e2fc33125e8fd7e68fe9c25f5331ce4442dab29cc9e8da0d34d9c4c1b4868cdR192 but was stuck on a Nim limitation
18:56:03disbot[Pending upstream] Allow dereference of Variables
18:56:58FromDiscord<exelotl> ah I see, it uses varargs
18:57:17FromDiscord<mratsim> make your template return untyped or typed or proc (value: int32) {.nimcall.}
18:57:20FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2LzL
18:58:10FromDiscord<mratsim> I don't see an issue in the const block part so I assume it's the template that doesn't compile
18:58:39FromDiscord<mratsim> actually it should be untyped
18:59:05FromDiscord<mattrb> I'm currently seeing an error on the paren in the proc
18:59:42FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2LzM
18:59:47FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2LzN
19:00:15FromDiscord<mratsim> something like this might work, it's just a matter of fiddling with identifier construction and then returning the proc identifier from the template
19:00:57FromDiscord<mattrb> Ah, that makes sense. Is there a way to do it with anonymous procs? I don't actually have any need for the proc to exist in any scope other than in the `lut` array
19:01:10FromDiscord<mratsim> it's anonymous
19:01:19FromDiscord<mratsim> their names will be name0, name1, name2 here
19:01:27FromDiscord<mratsim> and they only exist in the template
19:01:28disruptekZevv: what do you think about the sluggish yield test? its always been weird. should we remove it?
19:02:16FromDiscord<mattrb> Ah gotcha. What does Nim do if I create multiple with the same name there? I assume it doesn't care then?
19:02:18ZevvI don't know, shouldn't we understand & solve it instead?
19:02:36FromDiscord<mratsim> Nim will create unique identifiers
19:02:41FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2LzQ
19:03:19FromDiscord<mratsim> the real identifier will be name1_a1iuyez254 something
19:03:31FromDiscord<mratsim> so not a problem
19:04:46FromDiscord<enthus1ast> @greenfork https://github.com/enthus1ast/raylib/tree/physac i suspect a gc error, because the physic works fine for a few seconds then it crashes with nil access; also when i try to create a `seq[PhysicsBody]` i get c errors, it seems that the order of imports in the generated c file is wrong and i do not know how to fix this
19:05:43FromDiscord<enthus1ast> (edit) "@greenfork https://github.com/enthus1ast/raylib/tree/physac i suspect a gc error, because the physic works fine for a few seconds then it crashes with nil access; also when i try to create a `seq[PhysicsBody]` i get c errors, it seems that the order of imports in the generated c file is ... wrong" added "(then)"
19:06:19*Jesin quit (Quit: Leaving)
19:06:48greenforkenthus1ast, thanks again! that is helpful
19:08:36FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2LzT
19:09:08FromDiscord<exelotl> ffs
19:09:29FromDiscord<mratsim> let me try
19:09:38FromDiscord<exelotl> playground died and I lost an hour of experiments :(
19:09:57FromDiscord<shadow.> are fields stored contiguously in an object?
19:10:01FromDiscord<shadow.> (edit) "are fields stored contiguously in ... an" added "memory in"
19:10:09FromDiscord<mattrb> (edit) "https://play.nim-lang.org/#ix=2LzT" => "https://paste.rs/DKc"
19:10:25FromDiscord<exelotl> there may be padding
19:10:40FromDiscord<enthus1ast> @shadow with {.packed.} yes i guess
19:10:44FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LzU
19:10:59FromDiscord<enthus1ast> (edit) "@shadow" => "@shadow. "
19:11:17disruptekZevv: eh i guess. it's low priority, though.
19:11:25FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LzW
19:11:43FromDiscord<shadow.> i can just change my code if not
19:11:54FromDiscord<InventorMatt> If you turn it into a named Tuple you should be able to
19:12:00FromDiscord<shadow.> ohhh fair fair
19:12:08FromDiscord<shadow.> `tuple[x, y, z: float]`?
19:12:09FromDiscord<InventorMatt> And still keep fields
19:12:10FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2LzY
19:12:18FromDiscord<shadow.> smart
19:12:18FromDiscord<shadow.> ty
19:12:35FromDiscord<InventorMatt> No problem
19:13:03Zevvdisruptek: fair enough, throw it out then
19:13:26FromDiscord<mratsim> @shadow, or store them as array[3, float] and create x and `x=` overloads
19:13:32FromDiscord<mratsim> @shadow. ^
19:13:33disruptekjust gonna skip it for now.
19:13:50FromDiscord<mattrb> Does this compile for you?
19:14:09FromDiscord<shadow.> @mratsim couldn't i just make them methods and use ufcs?
19:14:18FromDiscord<shadow.> but i think the tuple works perfectly for me actually
19:14:53FromDiscord<mratsim> @mattrb yes https://media.discordapp.net/attachments/371759389889003532/797906319968436284/unknown.png
19:16:03FromDiscord<mratsim> note that if you do an interpreter I've given an example of various dispatch methods here: https://github.com/status-im/nimbus-eth1/wiki/Interpreter-optimization-resources#nim-implementation-benchmark
19:16:57FromDiscord<mratsim> also you might want to wrap your "block" in a function if it doesn't compile in you nim version
19:17:35FromDiscord<mattrb> I'm on version 1.4.0 and I get this error. I'll take a look at your docs! https://media.discordapp.net/attachments/371759389889003532/797907001685311518/unknown.png
19:18:18FromDiscord<mratsim> ah but so it passes compilation and do badcodegen
19:18:26FromDiscord<mratsim> I can't test that since my lut is unused
19:18:36FromDiscord<mratsim> it will be dead-coe eliminated.
19:18:49FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2LA1
19:19:17FromDiscord<mratsim> can reproduce
19:19:22FromDiscord<mratsim> you can raise that on the tracker
19:20:03FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2LA2
19:20:34FromDiscord<mratsim> you are doing foo mod 2 instead of value mod 2
19:21:05FromDiscord<mratsim> the proc captured the `foo` from the template which doesn't exist at runtime/in C
19:21:25*Jesin joined #nim
19:21:37FromDiscord<mattrb> That's the behavior I'm hoping to achieve, actually. I'd like different versions of the proc to be compiled so that that condition doesn't have to get evaluated at runtime, if possible
19:21:41FromDiscord<mattrb> Is there another way to do that?
19:21:57FromDiscord<mratsim> when foo mod 2
19:23:13FromDiscord<mratsim> mmmh, it needs a bit of rearch because in a const, i is not static, let's see
19:23:35FromDiscord<mattrb> Thanks for the help on this, btw
19:28:41leorize0xc45: I managed to reduce your example into 6 lines, and now I don't know if this is a compiler bug or not :P
19:30:29FromDiscord<thulahn> OK, can confirm that you can compile and run nim code in the chromebook linux sandbox
19:30:57leorizearguably it could be winim/clr bug for defining a generic unary `[]`, which overrides the default `[]` used for ptr/refs
19:32:11leorizebut you can also argue the other way that the stdlib is supposed to implement `[][T: ref | ptr](x: T)` so that it has a higher binding than `[][T](x: T)`...
19:32:30leorizeAraq: ^ so stdlib or winim bug?
19:33:49FromDiscord<0xc45> Heh, that's a good question. Afraid it's beyond me, I'm just a noob trying to pick up Nim 😅
19:34:32FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2LA8
19:35:02FromDiscord<mratsim> there is a execution error at the end, not sure why but it compiles and display stuff
19:35:45saemugh, absolute paths really mess up sourcemaps it seems.
19:36:03FromDiscord<mratsim> (edit) "https://play.nim-lang.org/#ix=2LA8" => "https://play.nim-lang.org/#ix=2LA9"
19:36:55FromDiscord<mratsim> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2LAb
19:37:16FromDiscord<mratsim> ah it's the unimplemented quit 1
19:41:10FromDiscord<mattrb> Do you know if there's any way to do this without duplicating the logic for `branchImpl`? Effectively in this use case, a lot of information about the instruction can be determined at compile-time (from the value of `i`), so ideally I'd be able to template the proc across that information at compile-time. I'm mostly hoping to reduce the code written here, so it'd be ideal if I could template `branchImpl` with that compile-time knowledge ra
19:41:36FromDiscord<mratsim> sure, I did that for my own interpreter
19:42:57FromDiscord<shadow.> `std::sort(objects.begin() + start, objects.begin() + end, comparator);`↵how can i recreate this in nim?, the start and end sorting iterators
19:43:03FromDiscord<shadow.> (edit) "iterators" => "pointers"
19:43:03FromDiscord<mratsim> static allows you to enforce compile time evaluation of part of a function: https://github.com/status-im/nimbus-eth1/blob/master/nimbus/vm/interpreter/gas_costs.nim#L312-L341
19:44:02FromDiscord<mratsim> https://github.com/SciNim/flambeau/blob/master/flambeau/raw_bindings/data_api.nim#L284-L315
19:44:26FromDiscord<mattrb> Hmm, this doesn't seem immediately intuitive to me. I'll take a look into it some more
19:44:42FromDiscord<mratsim> no it's not intuitive because it's a complex VM
19:44:43FromDiscord<shadow.> @mratsim can i sort with that?
19:45:13FromDiscord<mratsim> Unsure, it all depends if you can go backwards in your iterators
19:45:22FromDiscord<shadow.> hmm
19:45:33FromDiscord<shadow.> this is for raytracing ill just check how you did it 💀
19:45:36FromDiscord<mratsim> but I think in std/algorithm you have a sort that takes var openarray no?
19:45:41FromDiscord<shadow.> yep
19:45:46FromDiscord<shadow.> that's what im using
19:45:51FromDiscord<mratsim> I didn't do the AABB 😉
19:46:04FromDiscord<mratsim> I don't remember sorting
19:46:15FromDiscord<shadow.> ah fuck
19:46:18FromDiscord<shadow.> you didnt do aabb
19:46:18FromDiscord<shadow.> right
19:46:26FromDiscord<shadow.> im doing bvh nodes rn
19:46:26FromDiscord<shadow.> lol
19:47:28*PMunch joined #nim
19:51:32FromDiscord<Quibono> Mratsim was like “F sorting I’ve got paralllllllelism”
19:56:14*filcuc_ joined #nim
19:59:47FromDiscord<mratsim> kind of, I just wanted to test Weave on unbalanced workload
20:00:15FromDiscord<mratsim> AABB or BVH would accelerate 1000+x though by making everything logarithmic instead of linear
20:00:25*filcuc_ quit (Ping timeout: 240 seconds)
20:15:19FromDiscord<haxscramper> Is it possible to force `converter` inlining? Or `{.inline.}` is the same as in C where it does not guarantee anything
20:15:24FromDiscord<shadow.> yep im just not sure how to sort a section of a list
20:15:24FromDiscord<shadow.> aahh
20:15:28FromDiscord<shadow.> i suppose i could slice it
20:15:30FromDiscord<shadow.> sort that
20:15:32FromDiscord<shadow.> then reinject it
20:15:35FromDiscord<shadow.> but that'd be slow asf
20:18:02disruptekhaxscramper: no guarantees for .inline.
20:20:49FromDiscord<inv> Are there any flags or something like that which could help to see structs during compilation
20:20:54FromDiscord<inv> (edit) "compilation" => "compilation?"
20:22:04FromDiscord<Avatarfighter> I just realized but I havent seen Yard in a while
20:23:30*greenfork quit (Quit: Leaving)
20:27:22FromDiscord<Avatarfighter> disruptek: what’s the stalking command to see the last time someone breathed on IRC?
20:27:36FromDiscord<Avatarfighter> the last seen command
20:28:25leorize!seen Avatarfighter
20:28:26disbotAvatarfighter spoke in 12#nim 48 seconds ago 12https://irclogs.nim-lang.org/10-01-2021.html#20:27:36
20:28:54*hnOsmium0001 joined #nim
20:31:18*adnan338 quit (Quit: adnan338)
20:32:10FromDiscord<juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2LAp
20:32:17FromDiscord<juliuskiesian> Excerpt from arraymancer, btw.
20:32:43FromDiscord<juliuskiesian> And why not use `Tensor[T]` as the result type instead of `untyped`?
20:48:40FromDiscord<dom96> hmmm https://media.discordapp.net/attachments/371759389889003532/797929929064054784/SPOILER_unknown.png
20:52:22Zevvcontext?
20:54:53*narimiran quit (Quit: leaving)
20:56:14FromDiscord<ElegantBeef> None
21:04:33FromDiscord<mratsim> result is captured from the template invocation context
21:05:31FromDiscord<mratsim> I don't remember the origin of that proc but I got really annoyed at "varargs[int] or Metadata" and various semcheck issue
21:05:55FromDiscord<mratsim> so, it's a "don't do this at home" template
21:07:12FromDiscord<mratsim> import lenientops
21:23:50FromDiscord<acek7> how is everyone
21:27:17FromDiscord<shadow.> with cmp for algorithm sort does it have to be `-1` or `1` or can it just be any negative / positive number
21:28:08FromDiscord<lqdev> it can be any negative/positive number
21:28:44FromDiscord<shadow.> hmm
21:28:56FromDiscord<shadow.> can i have a generic as a static int in a function
21:29:06FromDiscord<shadow.> `proc boxCompare[A](a, b: Hittable): int =`↵like that where A is an integer?
21:29:31FromDiscord<lqdev> yeah
21:29:37FromDiscord<lqdev> `proc boxCompare[A: static int]`
21:29:37FromDiscord<shadow.> do i have to change anything?
21:29:39FromDiscord<shadow.> ah
21:29:39FromDiscord<shadow.> thanks
21:29:48FromDiscord<shadow.> ah wait does A have to be known at compile-time?
21:30:08FromDiscord<lqdev> um… yeah?
21:30:13FromDiscord<shadow.> that would
21:30:13FromDiscord<lqdev> that's what static means
21:30:14FromDiscord<shadow.> make sense
21:30:15FromDiscord<shadow.> yeah
21:30:15FromDiscord<shadow.> lmao
21:36:44*NimBot joined #nim
21:37:23*keyle joined #nim
21:38:51giacowhat's the downside of using --gc:arc in 1.4.2 today?
21:42:13*keyle quit (Ping timeout: 264 seconds)
21:46:00*u0_a216 joined #nim
21:46:20disruptekit doesn't work reliably.
21:46:33Zevvneither do I
21:46:45Zevvbut I just fake it
21:46:59disruptekgiaco: it's no worse than using zevv.
21:48:41giaco--gc:zevv, so, great. There will also be zovv for cycle collecting stuff?
21:49:02FromDiscord<mratsim> --gc:vvze for cycling
21:49:30giacothanks
21:51:05Zevvthis will not end well
21:51:40*letto quit (Quit: Konversation terminated!)
21:52:04FromDiscord<mratsim> A cycle doesn't end
21:53:47FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LAT
21:53:51giaco*valgrind joins the conversation*
21:53:55Zevvi was able to compile the compiler with orc
21:54:10Zevvnot that it works, but it does compile
21:54:35*letto joined #nim
21:59:05*a_chou quit (Remote host closed the connection)
22:04:09leorizedisruptek: does testes let me declare test dependencies? (ie. compile this file first)
22:04:28leorizeor do I have to switch to an another test runner?
22:05:34*u0_a216 quit (Ping timeout: 260 seconds)
22:07:55disruptekno, but i don't understand the use-case.
22:08:07disruptektestutils does that, iirc.
22:08:26disruptekdoesn't `import firstfile` do what you want?
22:10:02leorizeto test things like file handle inheritance I have to launch a helper program
22:10:28leorizeto I need to declare that I want my helper program to be compiled before I run my test
22:10:40leorizeso*
22:11:30disrupteki think i would have a test that both compiles and runs the helper, but maybe what we really want is to test nims files, too.
22:12:19disrupteka hack might be to name the help t0helper or similar.
22:12:34*u0_a216 joined #nim
22:12:58disrupteksubtext: i'm really loathe to put any kind of configuration into the test runner.
22:16:08*fputs quit (Ping timeout: 265 seconds)
22:19:51leorizei guess i will use your hack for now
22:20:40leorizeand have you ever tried to write a concept that match any type V = distinct T?
22:22:40FromDiscord<that_dude> What would you guys say are good projects to properly learn how to use nim? The last time I did stuff, it felt like I was just throwing things against the code checker and calling it good it if passed
22:23:38disrupteksounds like /all/ of my projects.
22:23:44FromDiscord<shadow.> lmao
22:23:48FromDiscord<shadow.> try advent of code 2020
22:24:39FromDiscord<shadow.> what stuff do you like to code?
22:24:48leorizeexercism.io have a good nim track too
22:25:52disruptekleorize: re: concept, i don't think so. but isn't this what distinctBase is for?
22:26:37leorizeI tried but my types doesn't match
22:26:46disruptekpaste?
22:26:55FromDiscord<mratsim> @that_dude that sounds like my Rust experience :p
22:27:12FromDiscord<that_dude> idk tbh, I usually work on something that interests me at the moment, whether it be file manipulation, game overlays, or tetris engines
22:27:34FromDiscord<that_dude> I'll check out advent of code thanks
22:28:01leorizedisruptek: https://play.nim-lang.org/#ix=2LB1
22:33:53disruptekhuh, i dunno.
22:34:32disrupteki don't usually use the `type` qualifier, for one thing.
22:34:44disruptekshouldn't matter here, though.
22:35:07disruptekoh i'm dumb.
22:35:34*u0_a216 quit (Ping timeout: 246 seconds)
22:35:37disruptekdistinctBase for SocketFD is probably int; i bet the compiler unwraps /all/ abstract types.
22:36:12disruptekor distinctBase does. whatever.
22:36:19disruptekyou might need to write your own predicate.
22:36:56FromDiscord<shadow.> !repo shadowninja55/advent-of-code
22:36:56disbothttps://github.com/shadowninja55/advent-of-code -- 9advent-of-code: 11my attempt at advent of code 2020 in nim. 15 2⭐ 0🍴
22:37:01FromDiscord<shadow.> if you wanna compare
22:37:05FromDiscord<shadow.> most of my code is decent
22:37:13FromDiscord<shadow.> ignore day 4 please
22:37:46leorizedisruptek: yea, though I gotta drop that idea
22:38:18disruptekwhy is that?
22:38:33leorizeI just read some more docs and handles are showing themselves to be a pain on Windows
22:39:22leorizenow I would want the new concepts to be a thing, assuming that I can have private implementation :P
22:40:10leorizeso on windows, not all handles use the same `close()`, not all handles use the same `setInheritance()`, not all handles use the same `duplicate()`
22:40:20disruptekfun.
22:41:24leorizeand funny enough, some handle can be set to be "inheritable", but they break the moment the child process got hold of them
22:42:26disruptekyeah, that's a laugh riot.
22:42:46disruptekthat balmer, he sure has a sense of humor.
22:42:58*keyle joined #nim
22:48:13*keyle quit (Ping timeout: 264 seconds)
22:50:14*tane quit (Quit: Leaving)
22:57:09FromDiscord<Avatarfighter> @seen Yardanico
22:57:13FromDiscord<Avatarfighter> im an idiot
22:57:17FromDiscord<Avatarfighter> !seen Yardanico
22:57:18disbotYardanico spoke in 12#nim 2 weeks ago 12https://irclogs.nim-lang.org/23-12-2020.html#10:26:13
22:59:59FromDiscord<Avatarfighter> I managed to read what disruptek said and still used the wrong trigger
23:00:53disruptekdisbot: should we just ban Avatarfighter?
23:00:54disbotreply hazy, try again.
23:00:58disruptekdisbot: should we just ban Avatarfighter?
23:00:59disbotoutlook good.
23:01:02disrupteknice.
23:01:07FromDiscord<Avatarfighter> no no
23:01:15FromDiscord<Avatarfighter> Bad bot
23:14:36*PMunch quit (Quit: leaving)
23:14:46*Vladar quit (Quit: Leaving)
23:17:44*Gustavo6046 is now known as [Gustavo6046]
23:18:34*grobe0ba joined #nim
23:19:11*[Gustavo6046] is now known as Gustavo6046
23:41:55*u0_a216 joined #nim
23:43:41*keyle joined #nim
23:44:40*abm joined #nim
23:45:31*hmmm quit (Quit: WeeChat 3.0)
23:46:29*u0_a216 quit (Ping timeout: 260 seconds)
23:48:34giacoObject-relational mapping for Nim? Io Norm the only lib out there?
23:48:49*keyle quit (Ping timeout: 260 seconds)
23:51:55*u0_a216 joined #nim
23:56:24*u0_a216 quit (Ping timeout: 260 seconds)
23:58:24*u0_a216 joined #nim
23:59:57FromDiscord<exelotl> giaco: there's this new one https://github.com/enimatek-nl/torm