<< 14-01-2021 >>

00:01:43*piron quit (Ping timeout: 246 seconds)
00:04:24*l1x quit (Quit: Connection closed for inactivity)
00:12:26*etothpiiminus1 joined #nim
00:22:57disruptekleorize: there are a couple major problems, but they might not bug you.
00:23:24*etothpiiminus1 quit (Remote host closed the connection)
00:34:39*piron joined #nim
00:40:35*xet7 quit (Quit: Leaving)
00:43:22*piron quit (Ping timeout: 246 seconds)
01:12:29*Tanger joined #nim
01:16:56*piron joined #nim
01:21:52*piron quit (Ping timeout: 256 seconds)
01:28:20*abm quit (Read error: Connection reset by peer)
01:28:40FromDiscord<Anonymous Poet> @dom96 https://pastebin.com/55enx11T↵Please help 😦 Same bad file descriptor error
01:29:31FromDiscord<Anonymous Poet> i dont know nearly enough about nim's async to fix it myself, but I feel like I also cant in good conscience use `discard` knowing that it _also_ discards the exception ...
01:30:36FromDiscord<Anonymous Poet> (also let me know if theres a better way of doing this than using cases, but the handler needed to be gcsafe, and the compiler was complaining about assigning to a global string var)
01:31:45FromDiscord<Anonymous Poet> mipri, any ideas?
01:35:58miprino, I'm not paying attention. Just pointing out that asyncCheck is a discard that doesn't discard exceptions.
01:40:25FromDiscord<Anonymous Poet> ah, thanks. Sadly, the issue is that something is raising an exception, but I don't know what nor why. I have code that works if you run it once, but will raise an exception if you copy paste it (effectively running it twice). Seems like maybe a race condition or something, but I don't know enough about how nim works to try to address it :/
01:44:42adnan338Honestly, searching for flatpak documentation is the hardest thing imaginable, I would rather solve NP-Hard problems than shooting into the dark that is flatpak
01:50:34*piron joined #nim
01:51:05leorizeadnan338: pretty sure this is not #flatpak :P but I do know a thing or two if you want some help :)
01:55:07*piron quit (Ping timeout: 246 seconds)
01:59:51leorizedisruptek: what is the most up-to-date written docs that you have about CPS and it's APIs as well as ergonomics atm?
02:10:38*zahary quit (Quit: Connection closed for inactivity)
02:29:38disruptekthe tests are very much up-to-date.
02:30:24disruptekit's pretty low-level right now, i'm afraid.
02:47:30*disruptek throbs.
03:00:12FromDiscord<shadow.> can cpp ffi handle functions that return cpp classes? how is that turned into nim?
03:03:24leorizedisruptek: so as far as I can tell there is no "base" continuation type?
03:03:37leorizeas in one provided by the library?
03:13:43*cgfuh quit (Quit: WeeChat 2.9)
03:14:53*lritter quit (Ping timeout: 260 seconds)
03:15:13*lritter joined #nim
03:15:17disruptekright; you can use anything with a fn ptr in it.
03:17:04FromDiscord<PizzaFox> what is the preferred way to run nim(ble) commands on github actions
03:17:19FromDiscord<PizzaFox> (edit) "preferred" => "recommended"
03:17:38disrupteki have many projects demo'ing this.
03:19:35disruptekleorize: you wanna see something hilarious?
03:19:59disrupteknimble in an infinite loop on my gitnim ci:
03:20:01disruptek-Here's a similar demo with `--define:danger` enabled to show the
03:20:42*muffindrake quit (Ping timeout: 260 seconds)
03:22:41*muffindrake joined #nim
03:24:16*lritter quit (Ping timeout: 256 seconds)
03:31:07*lritter joined #nim
03:40:02FromGitter<deech> Is there a `case` like equivalent of `when`?
03:44:07*Kaivo quit (Quit: WeeChat 3.0)
03:47:13saem@deech feels like I've seen it before but also feels like my imagination.
03:48:38saemLet me see if I can retrace my more than likely imaginary steps
04:13:12ForumUpdaterBotNew thread by Halloleo: Back on Nim: Understanding nimble, see https://forum.nim-lang.org/t/7383
04:20:12*spiderstew_ joined #nim
04:21:12ForumUpdaterBotNew thread by Halloleo: Silly scope shadowing question, see https://forum.nim-lang.org/t/7384
04:23:01*spiderstew quit (Ping timeout: 264 seconds)
04:23:26disruptek!repo emmy
04:23:27disbothttps://github.com/unicredit/emmy -- 9emmy: 11 15 30⭐ 1🍴
04:34:22adnan338Hello, 2 questions regarding installing nim from the source tarball. 1. the content generated bin
04:35:25adnan3381. the generated bin folder is to be added to the path. Why is .nimble/bin required to be added to the path too?
04:35:38disruptekso that you can run shit that nimble installs.
04:35:49adnan3382. Does the compilation process set any environment variables?
04:35:53disruptekit's just there to disrupt your quaint notion of "security".
04:36:16disruptekadnan338: export them? not afaik. why do you want to compile from source?
04:36:24disruptekthe nightlies are very reliable.
04:36:30disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
04:37:49adnan338This is because I am trying to ship a Nim application through flatpak and I prefer stable point releases. Oh wow gitnim looks quite interesting thank you
05:05:06*adnan338_ joined #nim
05:07:28*lritter quit (Quit: Leaving)
05:08:19*adnan338 quit (Ping timeout: 246 seconds)
05:08:19*adnan338_ is now known as adnan338
05:22:07*waleee-cl quit (Quit: Connection closed for inactivity)
05:26:00FromGitter<offbeat-stuff> Hi How to build 32bit static libs
05:27:13FromGitter<offbeat-stuff> Im trying to get raylib with nim
05:45:41FromGitter<offbeat-stuff> Got it working with custom nim.cfg using emscripten
06:00:40leorizeadnan338: are you adding an SDK to flatpak runtime?
06:02:19leorizedisruptek: oh lol
06:02:53leorizehttps://forum.nim-lang.org/t/7383#46760 <- someone already asking for lockfiles :P
06:03:11disruptekit's a fair request.
06:03:41disruptekthat doesn't really need lockfiles, though.
06:04:52leorizeI think they want easy upgrades or smt like that
06:05:24disruptekthe whole idea that "you run nimble to compile your code because who else but nimble can deliver the packages you need?" kinda falls down when nimble cannot do dependency analysis, differentiate between 10 and "10", or enters an infinite loop.
06:06:00leorizeI'll have to get in this package manager game eventually
06:06:11disruptekit's super fun.
06:08:02leorizeI just realised that adding an API to your nimble package can be a breaking change, though it's very rare
06:10:49leorizeyou import A, B where A.Foo is a type you use. B grew a B.Foo and now your code won't compile
06:10:58leorizethough probably this will never happen
06:11:42disruptekof course. any new symbol can break people.
06:12:07disrupteki had to break testes in 1.0. i wanted to do `check` differently.
06:12:12leorizecan you try out the minimal version selection thingy in nimph? it looks good in theory but I'm still unsure if it would work for Nim
06:12:30leorizedisruptek: well my code written for testes 0.7.1 still happily run with 1.1.9
06:12:41disruptekof course. you can just run `nimph downgrade` and you get mvs.
06:13:22disruptekor do you want me to test the entire ecosystem at once?
06:13:51leorizerust people tried and they have to held of MVS because of people never updating the minimum requirements
06:13:57leorizeheld off*
06:13:59disrupteka lot of people don't even supply versions, so a lot of people will balk.
06:14:34disruptekhell, scramper just PR'd dot output to gram and didn't have a tag on his dependency.
06:15:56leorizeyou just need tooling to automate it for the most part
06:16:09leorizegive people a migration path to a greater tool and they will happily follow
06:16:12disrupteki'm starting to realize that this is how dist works.
06:16:18*narimiran joined #nim
06:16:33disruptekwe will slowly gate it with more and more regular requirements.
06:17:37leorizeI will wait for the day that dist can just be a list of `requires`
06:17:46disruptekthat day is here, if you want it.
06:17:59disruptekthere's an open discussion just waiting for someone to show up with an opinion.
06:18:01leorizenot with our current tooling
06:18:05disruptekwhy not?
06:18:17leorizeyou see how nimble loops like hell there
06:18:38disruptekso use nimph ffs.
06:18:54disrupteki don't even remember which project that was.
06:18:56leorizeand your nimph has not been adopted by the user base afaict
06:19:12disruptekmaybe all the users are satisfied.
06:19:43leorizestatus is still fooling around with their makefiles and submodules because they can't get nimble to work
06:20:44disruptekwell, i don't understand that. i don't think i spent more than a couple days before i had something more useful than makefiles.
06:22:41disrupteki can almost understand why nimble might infinite loop.
06:22:50disruptekbut why does it keep downloading stuff, too?
06:22:55disruptekthis is just insane.
06:28:29disruptekif the interwebs are slow for any of you, i apologize: it's nimble trying to run my nightly CIs.
06:30:22leorizenimble was written in old nim and it stayed there
06:34:17disrupteki wish it had.
06:34:50leorizeI thought about your "directory as package" idea
06:35:35leorizestill doesn't solve versioning and dependency though
06:35:53disruptekfirst things first.
06:36:00disruptekwe have to agree on what the primitives are.
06:38:30leorizein my mind it's: package = versioned collection of modules
06:39:21disruptekokay, so .nimble files color new branches of the tree, right?
06:40:09disruptekso does this mean i can include any test with `include gram/tests/test` for example?
06:41:29adnan338leorize: No, I am building nim and compiling my toy project with it
06:42:36leorizedisruptek: sure, I don't think there's anything bad about that
06:44:24adnan338I am trying to use local nimbledeps folder so I don't have to worry about downloading transient dependencies
06:44:42disruptekyou sweet, summer child.
06:45:18leorizedisruptek: just to be sure, I believe you meant: .nimble = every module in the tree is a part of the package, until you see another .nimble. correct?
06:45:50leorizeok, I agree on that idea
06:46:37disruptektestes now knows how to test projects too simple to have tests.
06:48:00disruptekunfortunately, i cannot test ups using testes because testes depends upon ups and that just fuckin' blows nimbles mind.
06:48:59leorizewe might just have to add the "dev deps" idea for the most part
06:49:20leorizeor make "tasks" compatible with require but I don't see that happening
06:49:24leorizeanyway, gotta go
06:50:17disrupteki do `when not defined(release): require "... testes ..."` but that's meaningless to nimble, too, apparently.
06:52:05*adnan338 quit (Quit: adnan338)
06:52:24*adnan338 joined #nim
07:02:06FromGitter<StefanSalewski> nim c --threads:on --gc:arc appsink_src.nim
07:02:15FromGitter<StefanSalewski> for https://github.com/StefanSalewski/gintro/issues/108#issuecomment-759961654
07:02:17disbotGstreamer, appsink element new-sample signal seems missing ; snippet at 12https://play.nim-lang.org/#ix=2LW2
07:02:37FromGitter<StefanSalewski> seems to fix it as leorize pointed out.
07:03:02FromGitter<StefanSalewski> So maybe we should have --threads:on --gc:arc as default?
07:11:15FromGitter<StefanSalewski> Logout
07:14:36*vicfred quit (Quit: Leaving)
08:02:06*piron joined #nim
08:06:03*habamax joined #nim
08:21:10*letto quit (Quit: Konversation terminated!)
08:24:48*letto joined #nim
08:26:03*letto quit (Client Quit)
08:26:34*letto joined #nim
08:27:15*Tanger quit (Remote host closed the connection)
08:42:46FromDiscord<Footmade> sent a long message, see http://ix.io/2LZ4
08:50:48FromDiscord<ElegantBeef> Seems like something that'd be ok for the `community resources` section on the site, a searchable index of submitted urls
08:55:23FromGitter<gogolxdong> Is it possible to use a pattern matching expression as the key of a Table?
08:56:46FromDiscord<ElegantBeef> I imagine it's possible but it'd be but ugly
08:58:23*PMunch joined #nim
08:58:59FromDiscord<ElegantBeef> Although i'm uncertain what you mean, since an expression has a return value
08:59:52FromGitter<gogolxdong> a key like "something/*"
09:00:30FromGitter<gogolxdong> any key starts with "something/" matches.
09:02:11FromGitter<gogolxdong> otherwise have to iterate keys and check whether a new item starts with some key or not.
09:04:16FromDiscord<ElegantBeef> Well then your key would just be `"something/"` and you could make a distinct string hashing it to extract that pattern
09:09:36*NimBot joined #nim
09:15:47FromDiscord<Footmade> sent a long message, see https://paste.rs/3X4
09:16:04FromDiscord<haxscramper> gogolxdong: no, default tables does not support operations like this,
09:16:22FromDiscord<haxscramper> You would have to use trie to do this efficiently, otherwise just iterate over all keys
09:16:39FromDiscord<haxscramper> Though there was a module for prefix trees IIRC
09:17:14FromDiscord<haxscramper> You can probably create new page on nim github wiki, as it would be easier for other people to contribute
09:17:48FromDiscord<ElegantBeef> Yea i was being dumb and forgot there were more complicated things then just getting a single key for path 😄
09:28:02FromDiscord<Footmade> I'm actually arguing that maybe it's not the best that other people can contribute. I know a couple other discord servers that have resource-dedicated channels, and while the signal:noise ratio could be better it is still a quick, easy and accessible way to find user-added resources and people in other channels can refer to resources posted in that channel.
09:28:54*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:29:32FromDiscord<Footmade> The idea is to not decouple these things so much. So now there's an online chat space for Nim, there's the github wiki, and there's a community resources section, and they seem to be decoupled from each other. This space, for example, has no resource section.
09:29:42FromDiscord<Footmade> (edit) "contribute." => "contribute so easily."
09:31:01FromDiscord<Footmade> These are suggestions that I think are best left to be discussed by community veterans and decisions should be made by them at their discretion, in my opinion. I don't have much of a stake in this personally though 🙂
09:31:57FromDiscord<ElegantBeef> Probably smart to make a forum post about it, i keep putting off making mine about "This month with Nim" a community showcase
09:36:57*abm joined #nim
09:49:16*Vladar joined #nim
10:03:57ForumUpdaterBotNew thread by ElegantBeef: "This Month With Nim"- A Community Showcase, see https://forum.nim-lang.org/t/7385
10:08:33FromDiscord<haxscramper> I mostly suggestion something in form of https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 . maybe https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features
10:08:43FromDiscord<haxscramper> List of articles + short description
10:09:08*adnan338 quit (Remote host closed the connection)
11:01:44Oddmongerisn't «div» deprecated for entire divisions ?
11:03:28Oddmongerhum no it's still in the manual
11:04:18Oddmongerbut i still don't know why i can use «div» and not the C++ comment line //
11:04:54PMunchtemplate `//`(x, y: untyped): untyped = x div y
11:05:29PMunchAnd I guess the answer is that `div` is more obvious than `//`
11:05:43Oddmongeryes i rather like div
11:05:52Oddmongerbut i prefer % to mod
11:06:13Oddmongerthank you && bon appétit :)’
11:07:15FromDiscord<lqdev> % is a frickin' percentage sign, it doesn't signal modulo
11:07:22FromDiscord<lqdev> it signals percent
11:18:13*piron quit (Quit: leaving)
11:19:31*piron joined #nim
11:43:04FromDiscord<lqdev> any way i can pipe some output to `less` using nim?
11:44:28FromDiscord<lqdev> namely, i want to use `terminal.styledWriteLine` to output some help text to `less` and use it as a pager
11:44:42FromDiscord<lqdev> so here's what i have so far
11:44:52FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2LZQ
11:45:23FromDiscord<lqdev> problem is, i can't figure out how to make less output to the terminal but have its own stdin
11:45:29FromDiscord<lqdev> poParentStreams parents all stream
11:45:31FromDiscord<lqdev> (edit) "stream" => "streams"
11:45:47PMunchAh, hmm that might be tricky
11:47:27FromDiscord<Rika> Where did % become modulus anyway and how did it become modulus
11:51:10PMunch@lqdev, I mean you can start the process Unix style
11:51:23FromDiscord<lqdev> wdym?
11:51:43PMunchI mean start it like you would from C
11:52:29FromDiscord<lqdev> question is, how would i start the process from C
11:53:05PMunchThis might be helpful: https://stackoverflow.com/questions/51932881/calling-fzf-from-nim-doesnt-show-fzfs-tui
11:54:50PMunchAh, he cheats a bit and bakes the input into the command..
11:55:08FromDiscord<lqdev> yeah, that's something i'd like to avoid.
11:55:29FromDiscord<lqdev> oh well.
11:55:35PMunchI mean you can do `less /tmp/myfifo` and then write to /tmy/myfifo in your program
11:56:08*oculuxe quit (Ping timeout: 256 seconds)
11:56:09PMunchMaybe you'd have to pass a follow flag to less though, can't quite remember how it treats FIFOs..
11:56:48PMunchOr `less < /tmp/myfifo` I guess might work better
11:56:53FromDiscord<lqdev> hmm
11:57:08PMunchBasically it creates a new pipe, then assigns that the stdin of less
12:00:31FromDiscord<lqdev> hm do i really need a fifo though
12:00:43FromDiscord<lqdev> i think i can just get it to read from a file
12:01:35*oculux joined #nim
12:03:16FromDiscord<lqdev> does Nim have a binding to mkstemp?
12:03:58PMunchYup: https://nim-lang.org/docs/posix.html#mkstemp%2Ccstring
12:04:38FromDiscord<lqdev> huh. isn't mkstemp standard C?
12:04:48FromDiscord<lqdev> no
12:04:52*Torro joined #nim
12:04:59FromDiscord<lqdev> tmpfile is
12:05:04FromDiscord<lqdev> but i need the filename
12:05:14FromDiscord<lqdev> so it's a no-go
12:05:25FromDiscord<lqdev> i'll just disable pagination on windows then
12:07:43PMunchThis is the solution with mkfifo by the way: http://ix.io/2LZX
12:07:48PMunchIn case you're interested
12:08:29FromDiscord<lqdev> i don't like the jankiness of poEvalCommand
12:08:34FromDiscord<lqdev> i'll try with mkstemp
12:11:32*fanta1 joined #nim
12:12:02PMunchI think you can do it with freopen
12:12:30FromDiscord<lqdev> gah, almost got it
12:12:41FromDiscord<lqdev> it's just missing some lines for some reason
12:14:03FromDiscord<lqdev> huh, the file is broken
12:14:55FromDiscord<lqdev> ah i know why
12:15:07FromDiscord<lqdev> i was using echo in some places
12:15:14FromDiscord<lqdev> instead of file.styledWriteLine
12:19:35FromDiscord<lqdev> cool, it's working now. thanks for the help!
12:21:54PMunchHow did you do it?
12:24:56*Torro quit (Quit: bye)
12:29:08FromDiscord<lqdev> mkstemp
12:29:38FromDiscord<lqdev> writing to the file, and then passing the filename to less
12:30:07FromDiscord<lqdev> i also needed to pass `-fR` because it was interpreting my file as binary and i also needed color
12:31:32PMunchAh right
12:45:45AraqIC now fails because of the unimplemented patches! :D
12:46:48Araqthe good news is that my --ic:stress switch works very well, it found many bugs already
12:50:54*fanta1 quit (Quit: fanta1)
12:55:19*hmmm joined #nim
13:05:01*xet7 joined #nim
13:14:19ForumUpdaterBotNew thread by Halloleo: Any way to access the Documentation Comment of a procedure?, see https://forum.nim-lang.org/t/7386
13:17:40*anthonyy joined #nim
13:31:13FromDiscord<mratsim> @Araq, try IC with Constantine and Emmy to stress test the concepts.
13:31:32*Kaivo joined #nim
13:33:09PMunchHmm, this isn't quite right.. https://play.nim-lang.org/#ix=2M0h
13:33:41PMunchAnd even worse: https://play.nim-lang.org/#ix=2M0i<
13:33:59PMunchWhen using implicit return the getImpl body puts the doc-comment into the assignment..
13:35:00*abm quit (Quit: Leaving)
13:51:00*Tanger joined #nim
14:00:16*oculux quit (Ping timeout: 240 seconds)
14:08:51*oculux joined #nim
14:10:39FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2M0r
14:10:47FromDiscord<flywind> This works with `gc:arc`, is it intended?
14:12:37FromDiscord<flywind> Especially, why `chckObjAsgn` is disabled with `gc:arc`?
14:12:43FromDiscord<flywind> https://github.com/nim-lang/Nim/blob/94430a2e6de6a9079662db6f5677f978a94e7fce/lib/system/assign.nim#L116
14:17:13*fanta1 joined #nim
14:18:09FromDiscord<shadow.> https://hatebin.com/rspldffbvo↵i have a project here that is heavily using a library and the classes that go with it, as well as other cpp'ey stuff like <functional> and virtual methods and stuff. would it even be possible to do this in nim with ffi or a library for cpp interop, and how much of it would just be typing `importcpp`
14:18:11FromDiscord<shadow.> basically, does it make sense
14:18:18FromDiscord<shadow.> (edit) "https://hatebin.com/rspldffbvo↵i have a ... project" added "cpp"
14:35:59*fanta1 quit (Quit: fanta1)
14:43:19*PMunch quit (Quit: leaving)
14:48:05*oculux quit (Ping timeout: 240 seconds)
14:49:08*tane joined #nim
14:51:25*waleee-cl joined #nim
14:55:56*oculux joined #nim
15:00:44*Tanger quit (Quit: Leaving)
15:01:36Oddmongeri was sure there were a max() function in nim , in math module…
15:02:07Oddmongerof course, i can do it myself with a template, but if it exists already ?
15:02:44*hmmm quit (Quit: WeeChat 3.0)
15:04:26FromDiscord<Rika> it exists i beliee
15:04:46FromDiscord<Rika> but its in system
15:05:50*synshroud quit (Quit: ZNC 1.8.2 - https://znc.in)
15:06:39Oddmongeryes in system, thank you
15:07:55Oddmongerbut i was wrong, i was thinking of a saturation (max value to not go beyond)
15:08:04Oddmongernot the max value between two values
15:08:35FromDiscord<Rika> use min then lol
15:08:51FromDiscord<Rika> min(val, maxval)
15:08:54Oddmongerarf :) true :)
15:09:05FromDiscord<Rika> i am smort
15:17:45*habamax quit (Ping timeout: 240 seconds)
15:18:37FromDiscord<shadow.> or if you need both then use clamp
15:25:05Oddmongerclamp, i was searching this too
15:41:43FromDiscord<Rika> clamp exists in the stdlib?
15:41:49FromDiscord<Rika> well god damn
15:43:24FromDiscord<shadow.> yeah lol
15:43:26FromDiscord<shadow.> isnt it in system?
15:50:03*tane quit (Remote host closed the connection)
15:50:26*tane joined #nim
15:58:36ForumUpdaterBotNew post on r/nim by tsojtsojtsoj: How to guarantee immutability of ref object passed into function, see https://www.reddit.com/r/nim/comments/kx8dgo/how_to_guarantee_immutability_of_ref_object/
16:02:01*oculux quit (Ping timeout: 264 seconds)
16:04:08*hnOsmium0001 joined #nim
16:09:12*oculux joined #nim
16:19:29disruptekwhat a fucking prick.
16:24:26FromDiscord<Zachary Carter> who?
16:24:54FromDiscord<Zachary Carter> or were you complimenting someone?
16:26:24ozcome on, be nice :)
16:28:15leorizedisruptek: I got too many SIGSEGV with --incremental:on :/
16:28:44disruptekyes, i removed it in 1.1.1 or thereabouts.
16:29:07disruptekand there's a 1.0.1 that removes it but keeps the breaking check change.
16:29:13disruptekwhatfer cps reasons.
16:30:01disruptekzachary carter: fusion rfc.
16:30:05disruptek!rfc fusion
16:30:07disbothttps://github.com/nim-lang/RFCs/issues/265 -- 3versioned docs for nim and fusion 7& 15 more...
16:30:11disrupteknot that one.
16:30:20disruptekit's, what, 310?
16:30:25disruptek!rfc 310
16:30:26disbothttps://github.com/nim-lang/RFCs/issues/310 -- 5Fusion and stdlib evolution
16:44:18leorizeStatus folks really lives in their own bubble don't they
16:44:31leorizesome of them, at least
16:44:34leorizehopefully small
16:47:52oza crypto bubble
16:48:20oznow, I can't wait for std3
16:49:02FromDiscord<haxscramper> `Desktop`/`New Folder`, `New Folder (2)`, `New Folder (3)`
16:50:52leorizedisruptek: I upgraded testes and now it doesn't run my tests?
16:55:34FromDiscord<haxscramper> There was a PR for fixing variant object error message - I couldn't find, but I guess it hasn't been merged yet
16:55:56FromDiscord<haxscramper> discriminant value mismatch error message
16:57:25FromDiscord<haxscramper> Is it blocked by something - IIRC it was created in 2019, so there should be a reason
16:57:36FromDiscord<haxscramper> Or just nobody bothered&
16:57:42FromDiscord<haxscramper> (edit) "bothered&" => "bothered?"
17:01:02FromDiscord<haxscramper> Found it - https://github.com/nim-lang/Nim/pull/11955
17:01:04disbotproperly fix #10053 (more informative FieldError msg): report discriminant value + lineinfo; also improve for VM case ; snippet at 12https://play.nim-lang.org/#ix=2EBx
17:01:57leorizelooks like it's a timotheecour PR
17:02:10leorizeyep, it is
17:02:51reversem3The proc proc indexSection*(ctx: Context, posts: seq[seq[string]]): VNode =
17:02:51reversem3 result = buildHtml(main(class = "content")): posts is a seq and use strings in the seq?
17:03:12leorizehaxscamper: my guess would be that Araq still haven't look at it yet
17:03:27leorizehaxscramper: ^
17:03:47FromDiscord<haxscramper> sigh
17:04:20leorizecan't really blame him tbh
17:04:26FromDiscord<haxscramper> yes, I know
17:04:34leorizehe is like the only full time compiler dev afaict
17:05:10FromDiscord<haxscramper> No, I totally understand the reasoning, ist just these errors ...
17:05:22FromDiscord<haxscramper> it's
17:05:38leorizewell ping @Clyybber
17:07:10leorizein terms of users who can review this I can only think of clyybber and cooldome and araq
17:07:22leorizeso if you tag them there they might look into it
17:07:49FromDiscord<haxscramper> Well, you pinged Clybber on discord, so
17:08:26FromDiscord<haxscramper> Though I really just asked if there are any blockers or it is just that there are more important things
17:10:18leorizeit's usually because timothee stuff is extremely dense so it takes time to review
17:11:23*anthonyy quit (Remote host closed the connection)
17:14:02disruptekleorize: which project?
17:14:29leorizeI run testes and it does literally nothing
17:14:38leorizetestes 1.1.11 if you're wondering
17:14:53*beatmox quit (Read error: Connection reset by peer)
17:15:29disruptekleorize: well, you don't have any t*.nim in tests/
17:15:44disruptekam i supposed to recurse? i thought i fixed a bug. 🤣
17:16:00leorizeoh lol I was depending on that
17:16:18*beatmox joined #nim
17:16:19disruptekof course you were.
17:16:26disruptekbugs are api. 🙄
17:16:41disruptekit's up to you. just let me know.
17:17:04leorizeI like my categorized tests :P
17:17:14disrupteklemme see what nimble does.
17:17:40disruptekyeah, they don't run your stuff, either.
17:17:53disrupteklet's recurse on tests/ and not ./
17:18:03leorizeI got the habit from using testament :P
17:18:12disrupteki mean, it's not wrong, right?
17:19:04leorizerecently someone did a commit to testament makes it only run if it's used in the compiler source tree, and is determined at compile time
17:19:25leorizeso basically we now have a "tool for testing all nim projects, as long as its the compiler"
17:22:59disruptekleorize: 1.1.12 is what you want.
17:23:13disruptekthat's amazing.
17:23:36disruptekand i guess we have no users in important_packages using the test tool we claim is superior to unittests.
17:25:22FromDiscord<Clyybber> leorize: That PR is not ready
17:26:06leorizethen you should leave a review
17:26:23FromDiscord<Clyybber> it includes # PRTEMP
17:27:42leorizeugh, if there is any reason why I hate the "squashing" practice, it's that people never make PR that focus on one exact issue
17:28:28leorizeso now you have this commit saying that it only fixes this one issue, then proceed to randomly touch unrelated lines
17:30:34FromDiscord<Clyybber> I don't think timothee thinks its ready for review
17:31:18leorizeyou can leave a ping there then
17:31:29leorizehe wrote a comment saying "no one looked at it"
17:36:01*qwertfisch quit (Read error: Connection reset by peer)
17:36:49leorizedisruptek: the change that caused that bug got through 1.4.0 and no one noticed it
17:37:11leorizeI don't think anyone even used testament outside of the compiler
17:37:17disruptektestament is not an important package.
17:37:26disruptekbut, flywind uses it afaik.
17:38:12*qwertfisch joined #nim
17:41:18leorizelooks like they haven't noticed that `testament run` is completely broken if you run it outside of the compiler source
17:42:09disruptekmaybe prologue doesn't support 1.4.
17:45:23leorizei doubt it, they might just be using `testament all`, which doesn't have the check
17:46:13disruptekseems like it runs tests on 1.4.0 but, infrequently.
17:46:22*haxscramper joined #nim
17:46:31leorizetestament run is what you use when you're developing
17:46:53leorizeto run a single test in the case of a big test suite
17:47:11haxscramperStructure of `ProcDef` varies between compiler and macro ast - `PNode` one has eight elements, with last being `Sym result`. It is always present when procedure has return type?
17:47:18haxscramperOr some other edge cases exist
17:47:27disruptekit exists in typed macros.
17:48:39leorizeit will also exist if you inspect procs from `bindSym`
17:49:29FromDiscord<Clyybber> leorize: Ok, left a review
17:49:43leorizedisruptek: yea, because bindSym symbols are typed
17:49:58leorizeso it doesn't matter if you call it from an untyped macro
17:50:04disruptekthen they aren't untyped. 🥴
17:52:46leorize@Clyybber: this destructor https://github.com/alaviss/nim-sys/blob/master/src/sys/files.nim#L89 will bind to this type https://github.com/alaviss/nim-sys/blob/master/src/sys/files.nim#L39, right?
17:53:17FromDiscord<Clyybber> yes
17:54:00leorizewell it's not doing that right now
17:54:23leorizelet's see if I can make a test sample
17:55:47*etothpiiminus1 joined #nim
18:03:55*etothpiiminus1 quit (Ping timeout: 246 seconds)
18:19:08*Jesin quit (Quit: Leaving)
18:21:27*Jesin joined #nim
18:46:27*lritter joined #nim
18:53:28disruptekleorize: ready for more nimble antics?
18:53:56disrupteknimble demanded that i use `bin = @["some binary"]` in gitnim.
18:54:09disruptekso i added `bin = @["git-nim"]` (what else?)
18:55:02disruptekso now nimble thinks that the source must be named `git-nim.nim` ??? and that's not a valid module name so 💩
19:00:53*vicfred joined #nim
19:49:04haxscramperHow I can disable hints with `ConfigRef`? There is a `.options` field, which I removed `optHints` from, but it seems like lexer prints hint unconditionally
19:51:16*hmmm joined #nim
20:02:44haxscramperAlright, I figured this out - I need to set `parser.lex.errorHandler` callback, though for some reason it is being called less frequently (only one hint actually)
20:08:45*Kaivo quit (Ping timeout: 240 seconds)
20:12:43disruptekno, see how i do it in nimph. it's simpler than this.
20:13:16disrupteksee nimph/config.nim and excludeAllNotes, setDefaultsForConfig, etc.
20:28:05*haxscram` joined #nim
20:30:13*haxscramper quit (Ping timeout: 264 seconds)
20:31:30*haxscram` left #nim (#nim)
20:31:41*haxscram` joined #nim
20:46:20FromDiscord<rinfz> is there a function to encode a string to html entities in the stdlib?
20:47:19haxscram`Or you mean something like escaping string for use in html?
20:47:36FromDiscord<rinfz> something like > converts to &gt;
20:48:09FromDiscord<rinfz> ideal cheers!
20:52:25*narimiran quit (Ping timeout: 264 seconds)
20:52:34*haxscram` quit (Remote host closed the connection)
21:01:20disruptekscramper: did that help?
21:26:26FromDiscord<19> has anyone been using these new hooks from https://nim-lang.org/docs/destructors.html
21:27:21FromDiscord<19> im a bit confused: do we implement the hooks and then the compiler knows when to call them implicitly?
21:27:42FromDiscord<ElegantBeef> Yes, they're for the logic that was developed along side ARC/ORC
21:28:19FromDiscord<19> ok so compile with --orc and let the compiler do the rest
21:28:38FromDiscord<19> but we could also call them explicitly right?
21:28:42FromDiscord<19> sorry im new to move semantics
21:28:49FromDiscord<ElegantBeef> Well they're procs so yes
21:29:07FromDiscord<19> thanks beef
21:30:42*dilawar_uchiha[m quit (Ping timeout: 260 seconds)
21:30:43*mids quit (Ping timeout: 260 seconds)
21:31:03*dilawar_uchiha[m joined #nim
21:31:54*mids joined #nim
21:49:32FromDiscord<apollo> did all of you here learn nim from the documentation?
21:51:12FromDiscord<lqdev> that and lurking on #main
21:51:44FromDiscord<ElegantBeef> The best way to learn something on the internet is to do it wrong and show people that know how to do it
21:52:22FromDiscord<apollo> agreed just the documentation aren't that simplified but then again nim isn't meant to be a simple language for new programmers
21:53:13FromDiscord<ElegantBeef> The tutorial is
21:53:22leorizenim can be plenty simple
21:53:45FromDiscord<ElegantBeef> Nim is one of the most simple system programming languages imo
21:54:42FromDiscord<lqdev> i wouldn't agree with that but i would definitely agree if someone said it's simpler than C++
21:55:02leorize@19 note that those procs are not meant to be exported (ie. being called by someone else)
21:55:30leorizecurrently we have `reset()` == `=destroy` and `move()` == `=sink`
21:56:10leorizemove optimization is mostly automated, though
21:58:16FromDiscord<apollo> which tutorial ?
21:58:25FromDiscord<apollo> https://nim-lang.org/docs/tut1.html
21:58:27FromDiscord<apollo> this one yes
21:58:31FromDiscord<ElegantBeef> Yes
22:02:09FromDiscord<himu> is there any example where a certain code written in nim exposes a C header API with appropriate Data Structures?
22:02:18FromDiscord<himu> (edit) "Structures?" => "Structures for a library?"
22:04:33disruptek!repo gittyup
22:04:34disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level libgit2 bindings that build upon nimgit2 15 6⭐ 1🍴
22:04:52FromDiscord<himu> thansk
22:05:02FromDiscord<himu> (edit) "thansk" => "thanks"
22:15:37leorize@19 words of advice if you're using destructors. write your tests to check if they actually work
22:19:22leorize@Clyybber filed #16722
22:19:27disbothttps://github.com/nim-lang/Nim/issues/16722 -- 3`ref` of distinct object have destructor of base object bound instead of the distinct object's ; snippet at 12https://play.nim-lang.org/#ix=2M34
22:25:29FromDiscord<lqdev> using std/threadpool, if my proc returns `void` how do i await until it finishes execution? because in this case `spawn` returns `void`
22:25:40FromDiscord<exelotl> The documentation was too overwhelming for me (especially in 2018 when it was less thorough and organised), so I learned Nim from Dom's book
22:26:27leorizelqdev: it doesn't return FlowVar[void]?
22:26:37FromDiscord<lqdev> no, it returns void
22:26:42FromDiscord<lqdev> for some reason
22:26:52leorizewell this is the kind of time that you would want to switch to weave :P
22:27:28FromDiscord<lqdev> eh
22:27:46FromDiscord<lqdev> i don't really wanna pull in another dependency
22:27:49FromDiscord<lqdev> and weave is quite macro-heavy
22:28:11FromDiscord<lqdev> compilation is already slow and i don't want to slow it down even furthe
22:28:12FromDiscord<lqdev> (edit) "furthe" => "further"
22:31:22FromDiscord<shadow.> there are like two popular ffi packages im thinking of and
22:31:25FromDiscord<shadow.> one is nimterop
22:31:28FromDiscord<shadow.> i cant remember the other
22:31:29FromDiscord<ElegantBeef> c2nim?
22:31:32FromDiscord<shadow.> nope the other one
22:31:33FromDiscord<shadow.> lol
22:31:45FromDiscord<shadow.> well then 3 ig
22:31:49FromDiscord<shadow.> but ik nimterop and c2nim
22:31:56FromDiscord<shadow.> theres one other im thinking of but i cant remember ;-;
22:32:30leorizelqdev: it's not like the normal threadpool is any less macro heavy
22:32:48FromDiscord<lqdev> but it doesn't slow compilation to a crawl
22:32:49leorizedepends on what you're doing using normal threads might be simpler
22:33:38FromDiscord<lqdev> i'd prefer using a threadpool because i'm spawning many short-lived jobs
22:34:13leorizethen wouldn't weave be better? weave feature a much better scheduler
22:34:55FromDiscord<19> @apollo i found the “Nim in Action” book to be amazing. I couldn’t recommend it more.
22:34:58FromDiscord<shadow.> i'm trying to do cpp ffi, and i'm just wondering if there's a way to do stuff without a ton of importcpp calls everywhere
22:35:20leorizeusually you use c2nim to generate all that for you
22:35:23FromDiscord<lqdev> leorize: i'll try stdlib threadpool first and then weave, ok?
22:35:26FromDiscord<ElegantBeef> That's... literally how FFI works in nim
22:35:31FromDiscord<shadow.> hmm
22:35:38FromDiscord<shadow.> for c++ classes wouldnt i needa
22:35:39FromDiscord<lqdev> these jobs take probably around 100ms each
22:35:40FromDiscord<shadow.> define all of them?
22:35:46leorizeor you ping @haxscramper and ask him if his clang-based c++ binding generator finished
22:35:50FromDiscord<ElegantBeef> Everything that you need
22:36:02FromDiscord<shadow.> is in vanilla?
22:36:20FromDiscord<shadow.> would it be easier to show you what im tryna write in nim lol and you can lmk if it's viable to do with ffi?
22:36:31leorize@lqdev sure, just make them return a boolean :P
22:36:48FromDiscord<19> @leorize okay so these procs are automatically called. write once and forget. no manual moving stuff around. and yes, tests
22:36:50FromDiscord<ElegantBeef> Sure why not
22:36:58FromDiscord<lqdev> leorize: think i'll have to anyways as i wanna know whether the job succeeded or not
22:37:04FromDiscord<lqdev> it can fail, y'know.
22:37:20FromDiscord<shadow.> https://hastebin.com/umahirevuw.cpp
22:37:24leorizeand make sure it won't throw
22:37:34FromDiscord<lqdev> ik
22:37:35FromDiscord<shadow.> im just not sure considering it uses stuff like virtual methods, heavy oop, etc
22:37:51FromDiscord<hugogranstrom> @shadow. are you thinking about the c++ bindings generator Manteliero posted on the forum?
22:37:54FromDiscord<lqdev> just {.push checks: off.} and everything should work :^)
22:38:10FromDiscord<shadow.> hmm
22:38:12FromDiscord<shadow.> i don't think so
22:38:20FromDiscord<shadow.> it was a fairly big library i think?
22:38:43FromDiscord<hugogranstrom> It was new and written in python and not very featureful yet
22:38:48FromDiscord<shadow.> yeah not that
22:39:07FromDiscord<hugogranstrom> Ok, then I'll hide in the corner again :)
22:39:14FromDiscord<shadow.> lol dw im being vague
22:39:17FromDiscord<shadow.> bad memory
22:39:42FromDiscord<hugogranstrom> Need a garbage collector for the brain?
22:39:48FromDiscord<shadow.> preciselky
22:39:51FromDiscord<shadow.> still on refc
22:39:54FromDiscord<shadow.> havent gotten around to arc yet
22:40:07FromDiscord<shadow.> @ElegantBeef only reason im not sure is bc of virtual methods, heavy oop, etc
22:40:12FromDiscord<shadow.> just not sure how that would be handled in nim
22:40:49FromDiscord<hugogranstrom> Haha lol, convinient to forget things right after your brain has proven you will never need to recall it again
22:40:53FromDiscord<shadow.> i basically wanna interface with that `#include "bakkesmod/plugin/bakkesmodplugin.h"` library in nim
22:40:59FromDiscord<shadow.> exactly lol
22:43:31FromDiscord<lqdev> sigh
22:43:35FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2M3a
22:43:49FromDiscord<lqdev> leorize: any hints?
22:45:02leorize!repo threadpools
22:45:02disbothttps://github.com/yglukhov/threadpools -- 9threadpools: 11 15 17⭐ 6🍴
22:45:20leorize^ either use that or copy stdlib threadpool into your library and fix it
22:46:00FromDiscord<dom96> @lqdev when in doubt, search for examples using the proc you're trying to use
22:46:02FromDiscord<dom96> https://github.com/nim-lang/Nim/blob/662c5080755eb5a42df2c3acb84c044876571a46/doc/spawn.txt#L39
22:46:05FromDiscord<lqdev> screw this i'm trying weave
22:46:17FromDiscord<shadow.> lolll
22:46:41FromDiscord<lqdev> @dom96 do i really have to make two seqs, one for awaiting whether the flowvar is ready, and another for getting its value?
22:46:53FromDiscord<dom96> actually, here is a test even https://github.com/nim-lang/Nim/blob/devel/tests/parallel/twaitany.nim
22:47:17FromDiscord<shadow.> @ElegantBeef sorry to pester, would that be possible to do in nim?
22:47:29FromDiscord<dom96> i think your seq just needs to be a seq[FlowVarBase]
22:47:30FromDiscord<ElegantBeef> I'm the wrong guy to ask i dont do FFI stuff
22:47:58FromDiscord<dom96> guessing the compiler will allow you to add `FlowVar[system.bool]` into it
22:48:19FromDiscord<shadow.> ah fair enough
22:48:24FromDiscord<shadow.> is there an ffi master around here lol
22:48:42FromDiscord<dom96> @shadow. just use c2nim 🙂
22:49:05FromDiscord<ElegantBeef> Zachary does a lot of FFI stuff
22:50:07FromDiscord<shadow.> doesn't c2nim only do top level stuff? i tried it on a basic file using stuff like fopen() and printf() and obviously those weren't translated
22:50:18FromDiscord<shadow.> so if i wanna interface w a huge library how would that be possibly?
22:50:22FromDiscord<shadow.> (edit) "possibly?" => "possible?"
22:51:41leorize@shadow. your library is doable as long as you're not trying to implement a plugin in nim
22:51:58FromDiscord<dom96> libraries always expose their API "at the top level"
22:52:17leorizethe biggest C++ library wrapped in nim is probably wxwidgets
22:53:35FromDiscord<shadow.> @leorize wdym by plugin in this context?
22:54:35leorizeperforming C++ inheritance and overloading virtual functions in Nim is a pretty stupid process
22:54:41FromDiscord<shadow.> well
22:54:58FromDiscord<shadow.> in order to make the (mod / plugin) for the game you needa pass a class that inherits from the plugin class
22:55:11FromDiscord<shadow.> thats why im not sure if it's viable to do this in nim
22:55:50leorize@Zachary has done something similar iirc
22:55:51ForumUpdaterBotNew thread by Arnetheduck: Nlvm update 2020, see https://forum.nim-lang.org/t/7387
22:56:49FromDiscord<shadow.> hmm
22:56:55FromDiscord<shadow.> eh im not sure it's worth the effort
22:56:58leorizeyou can do it by declaring the class in c++, then write the implementation in nim
22:57:00FromDiscord<shadow.> c++ isn't that bad
22:57:07FromDiscord<shadow.> hmm that makes sense
22:57:10leorize`{.emit.}` should work
22:57:16FromDiscord<shadow.> ah yeah
22:59:42FromDiscord<shadow.> anywhere i can read up on how ffi works?
22:59:47FromDiscord<shadow.> haven't found a very thorough resource
22:59:47leorizeyou emit the class and you use a macro to turn your virtual function overload into two pieces: one written in C++ that calls the actual Nim implementation (use emit for this), and another is the implementation itself
22:59:51FromDiscord<shadow.> (specifically for cppp)
22:59:59FromDiscord<shadow.> (edit) "cppp)" => "cpp)"
23:00:12FromDiscord<ElegantBeef> I mean FFI works by emitting code that calls the given unmangled names 😄
23:00:30FromDiscord<shadow.> well
23:00:35FromDiscord<shadow.> i meant how to use it in nim lol
23:01:13FromDiscord<ElegantBeef> Did you already go to the manual?
23:01:20leorizehmm, with codegenDecl you might be able to write the overload completely in nim
23:01:38FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma if not here
23:02:49FromDiscord<shadow.> lemme try that
23:03:00FromDiscord<lqdev> @mratsim is there any chance of having something like `blockUntilAny` in weave? i want to add nice progress reporting for finished jobs, but right now i need to iterate all of my jobs and call isReady
23:03:07FromDiscord<lqdev> which is um, less than efficient
23:04:06FromDiscord<shadow.> would i have to importcpp declare every method i wanna use of an object?
23:04:12FromDiscord<shadow.> bc that could get a bit tedious
23:04:34FromDiscord<ElegantBeef> You can see why c2nim and the like were made eh?
23:05:26FromDiscord<shadow.> yep
23:05:47FromDiscord<ElegantBeef> Cant you cdecl all the procs which just causes the compiler to write their name out properly?
23:05:58FromDiscord<ElegantBeef> So then you could use the generated code from Nim
23:06:05FromDiscord<shadow.> im just not sure if c2nim would work for what im doing? the module uses headers of its internal stuff and doesnt c2nim not follow headers
23:06:41leorizeyou just need a script to translate them
23:06:47leorizesee wxnim that I linked above
23:06:49FromDiscord<shadow.> i see
23:08:54leorizeffi in nim via compiling to the target language is all about making nim generate the stuff that looks like what you would write yourself for the most part
23:09:12FromDiscord<shadow.> yeah
23:09:23FromDiscord<shadow.> i guess standard ffi is out of the question then since id have to importcpp basically everything
23:09:27FromDiscord<shadow.> so that leaves what, c2nim and nimterop?
23:09:45FromDiscord<lqdev> @mratsim also, any plans on releasing a new release of weave? i don't feel very confident having to use [email protected]#master
23:10:58*hmmm quit (Quit: WeeChat 3.0)
23:12:49*tane quit (Quit: Leaving)
23:13:57FromDiscord<Clyybber> leorize saw your issue, I think you should be able to work around it
23:14:13FromDiscord<Clyybber> by using a single field object instead of distinct
23:14:55leorizethat's dumb
23:15:51leorizeor I can add an `async: bool` in and drop asyncdispatch :P
23:18:04leorizejokes aside this bug prompted me to write more tests because I can't trust that the compiler will destroy my objects correctly
23:20:33FromDiscord<dom96> > or I can add an async: bool in and drop asyncdispatch 😛
23:20:39FromDiscord<dom96> what, context plz
23:21:29leorize#16722 is what I rely on to destroy my AsyncFile objects
23:21:30disbothttps://github.com/nim-lang/Nim/issues/16722 -- 3`ref` of distinct object have destructor of base object bound instead of the distinct object's ; snippet at 12https://play.nim-lang.org/#ix=2M34
23:21:55leorizebut I can also get rid of AsyncFile and go full CPS
23:24:04leorizeI would have to write a dispatcher for it though, so maybe not yet
23:27:45FromDiscord<dom96> ooof https://media.discordapp.net/attachments/371759389889003532/799419512671830016/unknown.png
23:30:26FromDiscord<ElegantBeef> I'm disappointed as i have no context to that 😄
23:36:24*wasted_youth joined #nim
23:36:31*wasted_youth left #nim ("Leaving")
23:36:38*wasted_youth joined #nim
23:54:03FromDiscord<shadow.> what's Status?
23:54:08FromDiscord<shadow.> is it a package manager lmao
23:54:11FromDiscord<shadow.> where's the repo
23:54:12FromDiscord<shadow.> !repo status
23:54:13disbothttps://github.com/status-im/nimbus-launch -- 9nimbus-launch: 11Jumpstart your Nim project at Status 15 12⭐ 4🍴 7& 10 more...
23:54:38FromDiscord<shadow.> hm
23:58:54*Vladar quit (Quit: Leaving)
23:58:55FromDiscord<ElegantBeef> A company that actively uses Nim and donates to it
23:59:19FromDiscord<shadow.> ah yikes
23:59:55FromDiscord<shadow.> who wrote the text?