<< 09-01-2021 >>

00:00:05FromDiscord<exelotl> I really didn't like stdtmpl when I first encountered it but I've warmed to it now lol, it's quite pleasant to use
00:22:26FromDiscord<shadow.> but yeah
00:46:03FromDiscord<Filipe Duarte> I’ve been using R and Python for more than two years for scientific research and Data Science. December 2020, I decided to start learning Nim and have been enjoying it a lot!
00:46:10*hmmm quit (Quit: WeeChat 3.0)
00:50:10FromDiscord<Avatarfighter> @Filipe Duarte welcome to the community hopefully you enjoy us as much as the language 🙂
00:52:49*krux02 quit (Remote host closed the connection)
00:53:17FromDiscord<shadow.> lmaoo
00:56:23*taprack joined #nim
01:08:56*shu41 joined #nim
01:09:57shu41hey guys, I am sure this is dumb but how do you get the fields of a ref object?
01:10:38shu41I get this Error: undeclared field: 'fields' for type tablereader.Record:ObjectType [declared in ..
01:11:49shu41since iterator.fields and fieldPairs accept object I don't know how to send a ref object
01:12:23FromDiscord<ElegantBeef> `refObjVar[].fields`
01:12:58shu41for [] I get this Error: undeclared field: 'fields' for type tablereader.Record:ObjectType
01:13:31shu41for simple access Error: undeclared field: 'fields' for type tablereader.Record
01:14:12shu41this is the definition of record: type Record = ref object
01:14:22shu41maybe I am defining it wrong
01:15:52FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Lnq
01:17:00shu41that is correct thank you ElegantBeef
01:17:06FromDiscord<ElegantBeef> No problem
01:17:27shu41did not understand the error, I was just trying to echo the result of the iterator im dumb
01:21:44shu41is there not a way to use map or mapIt?
01:22:54FromDiscord<ElegantBeef> There is an issue with sequtils they only work on openArrays, so you need to convert to a sequence. And there is an issue with `toSeq` since you have to call `toSeq(yourIterator)` 😄
01:25:11FromDiscord<ElegantBeef> And if you're applying `toSeq`to the result of the `fields` iterator you'll probably run into an issue that the fields arent all a uniform type
01:28:46FromDiscord<shadow.> anyone experiences with raytracers? after adding fuzzy reflection im getting white borders instead of black and im not sure why https://media.discordapp.net/attachments/371759389889003532/797275632106864671/unknown.png
01:29:13shu41I see, well I am using a single type for all members
01:29:28shu41tho I got this other issue Error: type mismatch: got <seq[RootObj], string>
01:30:02shu41let recseq = toSeq(record[].fields)
01:30:49shu41error in proc add[T](x: var seq[T]; value: sink T)
01:30:53FromDiscord<ElegantBeef> Yea
01:33:20FromDiscord<ElegantBeef> fields is a weird since it can return different types
01:34:44shu41well I might just loop then
01:34:45FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Lnv this is the best way i can think of doing it
01:35:39FromDiscord<Meowz> khchen isn't on discord is he?
01:35:45FromDiscord<shadow.> (edit) anyone experienced with raytracers? after adding fuzzy reflection im getting white borders instead of black and im not sure why https://media.discordapp.net/attachments/371759389889003532/797275632106864671/unknown.png
01:35:47shu41yes I'll wrap it like that in a function thank you
01:35:52FromDiscord<shadow.> someone has asked that before lol i forget who
01:36:11FromDiscord<ElegantBeef> Weirdly you're getting some rimlight effect shadow
01:36:18FromDiscord<ElegantBeef> How bad is your raytracing code
01:36:40FromDiscord<ElegantBeef> Put differently, is it readable 😄
01:38:09*a_chou joined #nim
01:40:38*grfork joined #nim
01:41:57FromDiscord<shadow.> uhh
01:41:59FromDiscord<shadow.> pretty readable yeah
01:42:02FromDiscord<shadow.> im using full variable names
01:42:06FromDiscord<shadow.> instead of .d .f .a .p
01:42:20FromDiscord<shadow.> .direction .fuzz .albedo .point
01:42:20FromDiscord<shadow.> etc
01:42:27FromDiscord<shadow.> i mean the fuzz code is tiny
01:42:38FromDiscord<shadow.> i just added that last line
01:42:40FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lnw
01:42:43FromDiscord<shadow.> and changed this one
01:42:50FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lnx
01:42:56*greenfork quit (Ping timeout: 240 seconds)
01:42:56FromDiscord<shadow.> the rim effect is typically rimshade idk why im getting rimlight lmao
01:43:15FromDiscord<ElegantBeef> just multiply the albedo by the fuzz 😄
01:43:33FromDiscord<shadow.> where?
01:43:43FromDiscord<shadow.> in the initializer or in the scattering function
01:43:46FromDiscord<ElegantBeef> Uhh
01:43:53FromDiscord<shadow.> scattering calculation
01:43:59FromDiscord<ElegantBeef> I dont do raytracers so i dont know that the process looks like, i'm used to shaders
01:44:03FromDiscord<shadow.> ahh fair fair
01:44:08FromDiscord<shadow.> lemme check mratsim's
01:45:36FromDiscord<shadow.> still rimlighting how odd
01:45:51FromDiscord<ElegantBeef> Well it seems you're adding instead of multiplying your stel
01:45:53FromDiscord<ElegantBeef> (edit) "stel" => "step"
01:46:27FromDiscord<ElegantBeef> if you think about it anywhere with white should be 0 and everything else should be 1
01:46:43FromDiscord<ElegantBeef> so yea i think you need to do ` (1 - scatterShadow)`
01:47:11FromDiscord<shadow.> `scattered = ray(rec.p, reflected + self.fuzz rng.random_in_unit_sphere(Vec3))`
01:47:13FromDiscord<shadow.> this is mratsims
01:47:32FromDiscord<shadow.> hm
01:47:50FromDiscord<shadow.> `result.fuzz = min(fuzz, 1)↵`
01:47:52FromDiscord<shadow.> same thing
01:55:00FromDiscord<shadow.> i wonder why it's buggin out
02:01:35FromDiscord<shadow.> @mratsim you've any idea?
02:16:53disruptekleorize: this this expected? /Error: Could not find any release named 'latest-version-1-4'. The provided branch (version-1-4) might not be tracked by nightlies, or is being updated./ via setup-nim 0.1.1
02:17:46leorize[m]yes
02:18:04leorize[m]try a re run, it's about time nightlies release a new build
02:18:16disruptekokay, so there's a blackout window?
02:18:56leorize[m]around 30s while the release is being republished
02:19:08disruptekah, i just got lucky. 😁
02:21:37*a_chou quit (Quit: a_chou)
02:23:32*taprack quit (Quit: Lost terminal)
02:23:52leorize[m]yep :p
02:24:34*Tanger joined #nim
02:27:43*opal quit (Ping timeout: 240 seconds)
02:28:48*opal joined #nim
02:28:53FromDiscord<exelotl> is there a way to require an additional .c or .s file to be added to the build in my config.nims?
02:30:05FromDiscord<exelotl> I guess I can add it to a .nim file and then --import the nim file
02:30:44*shu41 quit (Remote host closed the connection)
02:37:03*adnan338 joined #nim
02:37:15*adnan338 quit (Client Quit)
02:37:32*adnan338 joined #nim
02:37:56*Tanger quit (Remote host closed the connection)
02:41:37*adnan338 quit (Read error: Connection reset by peer)
03:13:07*NimBot joined #nim
03:25:15disruptekit's because of people like you that i carry a hammer when i go out in public.
03:29:42FromDiscord<Avatarfighter> lmao
04:12:11FromDiscord<exelotl> don't worry disruptek, I'll be sure to pass --warning[UnusedImport]:off to avoid clogging my users' consoles with annoying messages caused by the --import
04:13:21disruptekit's exactly the kind of shit that my test runner won't support.
04:15:56FromDiscord<exelotl> for real though, what I'm trying to do is guarantee that crt0.s gets added to the build
04:17:20FromDiscord<exelotl> it's absolutely crucial that the file gets compiled and linked, yet it doesn't feel like it's the job of any library to add it, nor is it the user's responsibility
04:18:05disruptekisn't this what the compile pragma is for?
04:18:58FromDiscord<exelotl> yeah exactly, but in what file should I put that compile pragma?
04:19:05disrupteki don't care.
04:21:15FromDiscord<exelotl> so say I put it in mylibrary.nim, but someone wants to only use a small part of my library, so their program only imports mylibrary/helpermodule.nim
04:21:32FromDiscord<exelotl> now their program won't compile because it no longer links crt0
04:21:49leorize[m]crt0.s? that's your c compiler responsibility
04:22:04leorize[m]and why do you need a custom crt0?
04:24:16FromDiscord<exelotl> GBA homebrew (it's a bare metal target)
04:26:13*spiderstew_ joined #nim
04:28:38*spiderstew quit (Ping timeout: 272 seconds)
04:50:58leorize[m]then shouldn't you configure your gcc to use it?
04:51:07leorize[m]it has to be linked first anyway
04:51:24leorize[m]you can't reliably do that from nim
04:52:33FromDiscord<ElegantBeef> What is the way to remove a variable from scope again, i swear i remember seeing someone do this previously
04:52:37*abm quit (Quit: Leaving)
04:53:36disrupteknah.
04:54:18disruptekthis is kinda cool: https://github.com/disruptek/testes/blob/master/docs/demo.svg
04:54:27disruptekwhere it says "checking some things: r == 3"
04:54:39disrupteknote the code block, "check r == 3"
04:55:12disruptekabove "checking some things:" you see the symbols from that block /and their values/ when the test failed.
05:03:29disruptekugh, this feature crashes cps.
05:03:39disruptekwell, the compiler, anyway.
05:05:22disruptekno good fucking deed.
05:07:16*rockcavera quit (Remote host closed the connection)
05:10:46FromDiscord<exelotl> leorize: I can use a specs file to ensure that crt0.o is linked first, but the .o file has to exist first.↵My goal is that you can just install arm-none-eabi-gcc, install nim, install my nim package, and that's all you need to compile for GBA with Nim.
05:16:35leorize[m]you can have gcc compile that file on install for you
05:19:19leorize[m]I think if you add an install task you can customize what will be installed
05:19:26leorize[m]see gintro for a package that perform post install stuff
05:19:50FromDiscord<exelotl> I was just wondering about that, but then wouldn't my library would fail to install if you didn't already have arm-none-eabi-gcc ?
05:20:17leorize[m]but I'm not sure if that's worth the hassle, remember that configuration don't compose between packages
05:59:19saemBlah, welp that was a waste of an evening... turns out vs code outline view can either support hierarchy or support symbols outside the document, but not both at the same time... bum
06:08:20*waleee-cl quit (Quit: Connection closed for inactivity)
06:18:28*clemens3 quit (Quit: rebot)
07:00:18*clemens3 joined #nim
07:22:30ForumUpdaterBotNew thread by Stefan_Salewski: Suggestions to reduce the number of compiler warnings for rtree module?, see https://forum.nim-lang.org/t/7357
07:52:23*narimiran joined #nim
08:05:37*^Q-Master^ quit (Ping timeout: 265 seconds)
08:37:45*Q-Master joined #nim
08:42:49*Q-Master quit (Ping timeout: 264 seconds)
09:09:33*Gustavo6046 quit (Ping timeout: 246 seconds)
09:21:03*Q-Master joined #nim
09:23:01*narimiran quit (Ping timeout: 264 seconds)
09:24:25*krux02 joined #nim
09:46:51*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:31:25*ofelas joined #nim
10:32:31*habamax joined #nim
10:44:28*hmmm joined #nim
10:49:49*hmmm quit (Ping timeout: 260 seconds)
11:02:24*keyle joined #nim
11:24:30FromDiscord<Meowz> Does anyone have some experience with ba0f3's subhook wrapper?
11:58:37*filcuc joined #nim
12:00:01filcucis there a reference implementation on how to add support for destructors/arc (optionally remaining backward compatible). The idea is to remove finalizers from my NimQml package.
12:08:32*Vladar joined #nim
12:08:33Vladarjoin #kui
12:08:45Vladaroops, sorry
12:14:30FromDiscord<mratsim> A wild Vladar appears
12:18:17FromDiscord<zetashift> To make use join kui!
12:35:33*keyle quit (Quit: Lost terminal)
12:36:13*superbia joined #nim
12:37:06*zedeus quit (Quit: zedeus)
12:37:52*filcuc quit (Ping timeout: 246 seconds)
12:38:03*filcuc joined #nim
12:40:37FromDiscord<dom96> oof https://blog.shitiomatic.tech/post/haskell-is-a-bad-programming-language/
12:40:47FromDiscord<dom96> I think we can learn something from this post
12:43:19FromDiscord<mratsim> > What’s even funnier is people saying that “Haskell doesn’t suck, the development environment does”. Haskell has had 30 years to improve itself and while there’s some headway, growth is ridiculously slow. Guess what? If people can work with C++ and create amazing tools with it, I don’t think that statement makes much sense.↵↵Give me better tools
12:43:32FromDiscord<Rika> ?
12:43:48FromDiscord<haxscramper> docgen
12:44:08FromDiscord<haxscramper> compiler messages too
12:44:16FromDiscord<Rika> oh you mean that
12:44:31FromDiscord<Rika> yeah nimsuggest + docgen + compiler errors are usually the main points i hear
12:44:35FromDiscord<mratsim> sent a long message, see http://ix.io/2LpR
12:44:46FromDiscord<Rika> yeah
12:44:53FromDiscord<haxscramper> I alreay have ~3k words for RFC on compiler errors
12:45:02FromDiscord<haxscramper> And I haven't even proofread it yet
12:45:11FromDiscord<dom96> yep
12:45:11FromDiscord<mratsim> The core Nim language is good and you can be very productive and build complex things already despite the rough edges
12:45:18FromDiscord<dom96> that is the lesson to take from this
12:45:25FromDiscord<haxscramper> docgen can (ans should) be implemented as external tool
12:45:34FromDiscord<dom96> we need to invest in tools
12:45:42FromDiscord<mratsim> btw, I happen to crash the compiler with an success exit code, no error, no message, no nothing, just plain exit :/
12:45:57FromDiscord<haxscramper> well, it seems like this year we will be doing this finally, at least it looks like this to me
12:46:04FromDiscord<haxscramper> hopefully
12:46:17FromDiscord<dom96> @mratsim is it a quit() at compile-time? lol
12:46:33FromDiscord<dom96> @haxscramper yes, hopefully
12:47:01FromDiscord<dom96> @haxscramper why do we need such a long RFC for this?
12:47:09FromDiscord<haxscramper> because this is a complex problem
12:47:11FromDiscord<dom96> Just copy Rust's approach and improve them
12:47:14FromDiscord<mratsim> It's this: https://github.com/SciNim/flambeau/commit/ec43ff1d8efc85830e6dd804f6c0a58c5b28df2f#diff-a2f8bf8c648b0ad661eb70aa132b260531251d5f97e6201701128f57748e0a46R8
12:47:20FromDiscord<haxscramper> huh, funny
12:47:37FromDiscord<mratsim> at first I thought it was CRTP, but CRTP works fine.
12:47:43FromDiscord<haxscramper> i mean I also need to address EDSL errors
12:47:43FromDiscord<dom96> 80% of good error messages is just handling all the edge cases
12:47:57FromDiscord<dom96> the rest is setting up a nice foundation to display them well
12:48:13FromDiscord<haxscramper> and also accounting for the fact we have UFCS, macros with embedded DSL, insane amount of codegen
12:48:20FromDiscord<mratsim> Rust approach begins by removing exceptions
12:48:22FromDiscord<dom96> So yes, you can write an RFC for this, but consider the word count of your RFCs too. We don't all have the time to read 3k words 🙂
12:48:32FromDiscord<haxscramper> I mean, I have tons `static assert` in pattern matching
12:48:44FromDiscord<mratsim> you should use static: doAssert
12:48:51FromDiscord<haxscramper> yes, i do this
12:48:54FromDiscord<haxscramper> This sucks
12:48:58FromDiscord<mratsim> otherwise they aren't checked if compiled without checks
12:49:21FromDiscord<mratsim> also it would be good to have this discussion before DrNim
12:49:37FromDiscord<haxscramper> Error messages should also be maching-readable, because pretty-printing is not a solution for tooling
12:49:47FromDiscord<haxscramper> I can't regex-parse compiler output, this is not an option
12:50:07FromDiscord<haxscramper> Largely this is a list of particular errors with suggestion on fixing them
12:50:13FromDiscord<mratsim> so we have an Error type and a default pretty print?
12:50:22FromDiscord<dom96> DrNim shouldn't even be planned right now
12:50:25FromDiscord<haxscramper> In addition to rust/elm-like errors of course
12:50:32FromDiscord<lqdev> oh really?
12:50:34FromDiscord<dom96> it's yet another feature that will be used by the minority
12:50:40FromDiscord<lqdev> then how am i pulling it off in lint+
12:50:57FromDiscord<mratsim> In Weave I have specific formatted assert because otherwise I can't know which thread threw what error: https://github.com/mratsim/weave/blob/master/weave/instrumentation/contracts.nim#L93-L103
12:51:00FromDiscord<dom96> yep
12:51:24FromDiscord<dom96> There isn't much to discuss IMO, just make them better 🙂
12:51:28FromDiscord<haxscramper> Well, I don't know? If you can regex-parse this https://media.discordapp.net/attachments/371759389889003532/797447445998731264/unknown.png
12:51:34FromDiscord<haxscramper> Good for you I'm amazed
12:51:38FromDiscord<haxscramper> At your regex skills, really
12:51:43FromDiscord<dom96> lol
12:51:47FromDiscord<lqdev> ok this.
12:51:56FromDiscord<lqdev> yeah i agree with you this is bad
12:52:01FromDiscord<haxscramper> I can write like two lines of `sequtils` that generate C++-level of template shit
12:52:02FromDiscord<mratsim> try "items"
12:52:18FromDiscord<haxscramper> Dont' get me started on callback signature mismatch type errors
12:52:23FromDiscord<dom96> the error messages given by Nim have largely been unchanged for like 10 years btw
12:52:23FromDiscord<mratsim> with generic sandwich and "toSeq" you're guaranteed to pull your hair
12:52:24FromDiscord<haxscramper> These are absolutely unreadable
12:52:28FromDiscord<lqdev> try causing a concept mismatch :)
12:52:41FromDiscord<haxscramper> https://media.discordapp.net/attachments/371759389889003532/797447751994179584/unknown.png
12:53:02FromDiscord<mratsim> no need, use toSeq on a hashset from a module that doesn't import sets directly ...
12:53:12FromDiscord<haxscramper> oh, yeah, something
12:53:18FromDiscord<lqdev> i remember like a 10000 lines long error i got from concepts one dat
12:53:32FromDiscord<lqdev> don't remember the exact number but buy it was a frickin' behemoth
12:53:39FromDiscord<lqdev> (edit) "buy" => "boy"
12:53:40FromDiscord<haxscramper> well
12:53:48FromDiscord<lqdev> (edit) "dat" => "day"
12:53:56FromDiscord<dom96> Another reason why concepts should be simplified...
12:54:02FromDiscord<lqdev> gosh, typing on mobile is a chore
12:54:10FromDiscord<dom96> And I'm hopeful Araq will get it done
12:54:16FromDiscord<lqdev> yeah
12:54:25FromDiscord<mratsim> that's not the issue of concepts here
12:54:33FromDiscord<lqdev> but imo fast IC is a bigger priority than new concepts
12:54:57FromDiscord<dom96> If it makes the compiler work better then yes
12:55:00FromDiscord<mratsim> it's the issue of the type system: generics concepts, distincts, static, being a very complex beast that was developed in an organic manner
12:55:12FromDiscord<dom96> if it's just for speed the IC is a silly effort (right now at least)
12:55:14FromDiscord<mratsim> oh, and range and varargs and openarray
12:55:18FromDiscord<dom96> (edit) "the" => "then"
12:55:33FromDiscord<mratsim> We do start to spend a lot of time compiling in Status codebase
12:55:45FromDiscord<lqdev> remember that the Nim IDE experience is hindered greatly by the compiler being slow
12:55:54FromDiscord<lqdev> "slow"
12:56:06FromDiscord<lqdev> slow to recompile your project every 100ms
12:56:28FromDiscord<dom96> I don't think that's the case. Nimsuggest already caches ASTs
12:56:33FromDiscord<mratsim> but why does the IDE needs to recompile
12:56:35FromDiscord<dom96> It just does it in a really poor way
12:56:49FromDiscord<dom96> so you get issues like infinite loops and high memory usage
12:56:54FromDiscord<dom96> it's already fast enough
12:57:03FromDiscord<lqdev> also, my game compiles in about 8s which makes fast prototyping a chore
12:57:14FromDiscord<haxscramper> I couldn't export outline for my RFC draft, but these are main topics that I want to address for compilation errors https://media.discordapp.net/attachments/371759389889003532/797448898507046912/unknown.png
12:57:25FromDiscord<dom96> > We do start to spend a lot of time compiling in Status codebase↵have you measured how long that is spent in the Nim compiler vs. c compiler?
12:57:35FromDiscord<dom96> same question to you lqdev
12:57:50FromDiscord<haxscramper> So these are /mostly/ specific encounters that I wrote down over the course of several months, with couple paragraphs of explanations for each one
12:57:57FromDiscord<lqdev> @dom96 C object files are cached, most time is spent on codegen
12:58:12FromDiscord<zetashift> Didn't Araq write in a RFC/issue that Nim compiler is usually the bottleneck, since C compiler is plenty fast?
12:58:12FromDiscord<lqdev> the C portion takes maybe .5-1s
12:58:15FromDiscord<dom96> @haxscramper those just sound like specific bugs, why do we need to discuss them as part of an RFC?
12:58:22FromDiscord<mratsim> When you have concepts and generics, which are key for serialization and it's only there that we use them, you're codebase gets very slow.
12:58:29FromDiscord<mratsim> (edit) "you're" => "your"
12:58:33FromDiscord<haxscramper> These are not "bugs"
12:58:41FromDiscord<haxscramper> I mean if you have one bad error we have a bug
12:58:42FromDiscord<lqdev> especially because concept instantiations aren't cached!
12:58:50FromDiscord<haxscramper> If all errors are bad
12:58:56FromDiscord<haxscramper> We have a systematic problem
12:59:04FromDiscord<haxscramper> That needs to be adressed in organized way
12:59:05FromDiscord<dom96> @haxscramper bad errors messages are bugs
12:59:22FromDiscord<mratsim> I agree, errors needs some kind of coherent vision
12:59:24FromDiscord<dom96> and yes, there is a systematic problem too
12:59:35FromDiscord<dom96> but you need to set up a system for tackling each specific case
12:59:36FromDiscord<lqdev> @dom96 outlining all bad errors in one RFC and discussing how we can improve them is better imo
12:59:48FromDiscord<mratsim> if people monkey patch errors each in a different way that will be a bazaar
13:00:06FromDiscord<dom96> @lqdev how do you expect people to engage with many tens of different error messages in an RFC setting?
13:00:07FromDiscord<haxscramper> I mean we can't talk about user-friendliness unless we have things like https://forum.nim-lang.org/t/7343
13:00:08FromDiscord<mratsim> better have a coherent whole
13:00:30FromDiscord<haxscramper> Where new user just got destroyed by this wall of text
13:00:34FromDiscord<lqdev> the question of error machine readability is also a good point that needs to be brought up
13:00:34FromDiscord<mratsim> Maybe we can use a PR for that RFC?
13:00:41FromDiscord<haxscramper> "this is obvious" you might say
13:00:45FromDiscord<mratsim> because with PR we have threads
13:00:57FromDiscord<dom96> > Didn't Araq write in a RFC/issue that Nim compiler is usually the bottleneck, since C compiler is plenty fast?↵I hope Araq showed some benchmarks to back this up 🙂
13:01:00FromDiscord<haxscramper> I'm aiming for something like error index
13:01:05FromDiscord<haxscramper> rust's error index
13:01:25FromDiscord<haxscramper> error code + example + explanation
13:01:40FromDiscord<zetashift> https://github.com/nim-lang/RFCs/issues/46 uhm, he did give reasoning if that suffices 😛
13:01:41disbotIncremental compilation
13:02:04FromDiscord<dom96> of course, you shouldn't just tackle each error as it comes. You need a better mechanism for these errors first.
13:02:14FromDiscord<dom96> But once you do, we should treat each subpar error message as a bug
13:02:24FromDiscord<lqdev> @dom96 i can't benchmark it for you right now as i'm not home but if it was trivial i could just tell you to compile planet overgamma and see how much time is spent on ........ and how much time is spent on CC:
13:02:30ForumUpdaterBotNew post on r/nim by justhanginuknow: A few questions about ptr, ref and function parameters, see https://www.reddit.com/r/nim/comments/ktqj22/a_few_questions_about_ptr_ref_and_function/
13:02:30FromDiscord<haxscramper> Fine by me
13:02:32FromDiscord<dom96> (we already do this, without yet having a better mechanism for showing the errors)
13:02:42FromDiscord<lqdev> unfortunately compiling PO isn't trivial so i'm not tellimg you to do it
13:02:51FromDiscord<lqdev> (edit) "tellimg" => "telling"
13:03:07FromDiscord<dom96> I mean. I can just check one of my projects I guess
13:03:22FromDiscord<lqdev> well it depends on how big the project is
13:03:29FromDiscord<haxscramper> And one important thing that needs to be adressed is support for user-defined error messages, in various DSLs
13:03:43FromDiscord<haxscramper> Because `std/macros.error` is just insufficient
13:04:17FromDiscord<haxscramper> And show me original source code please, not this mess that comes out of `join` or whatever
13:04:42FromDiscord<haxscramper> This is also related to automatic API breakage detection
13:04:52FromDiscord<haxscramper> If I cant' get compilation errors I can't reason about them
13:05:03ForumUpdaterBotNew thread by Stefan_Salewski: Calling destructors works fine, see https://forum.nim-lang.org/t/7360
13:05:33FromDiscord<dom96> 3.78 secs for Stardust without C compiler. 10.6 secs with C compiler. Then 4. 35 secs once the C cache is there.
13:05:39FromDiscord<dom96> (edit) "4. 35" => "4.35"
13:06:05FromDiscord<dom96> So yeah, I suppose the majority is in the Nim compiler. But how much can you actually speed that up with IC.
13:06:15FromDiscord<lqdev> the C cache improves a lot, but a Nim cache would help a lot too
13:06:57FromDiscord<lqdev> and that's what rodfiles are supposed to solve. last time i checked araq-ic6 compilation times weren't much better though
13:07:00FromDiscord<dom96> +1 on that
13:08:09FromDiscord<dom96> The funny thing is that rodfiles aren't a new thing, there was an attempt at this before. I hope it works out better this time.
13:08:27FromDiscord<dom96> But I would still prefer effort to be put into improving the developer experience + package management.
13:10:11FromDiscord<lqdev> i mean IC will solve a lot of existing nimsuggest issues so it's a good first step
13:11:41FromDiscord<dom96> There is a lot of risk involved though and the point is that there are more impactful things that can be done
13:11:55FromDiscord<dom96> For example, a solid compiler-less implementation of nimsuggest
13:12:14FromDiscord<dom96> It might not give 100% semantically correct suggestions, but it can make the job easier for 95% of use cases
13:12:17*superbia quit (Quit: WeeChat 3.0)
13:12:23FromDiscord<dom96> And it's also likely to be far faster and more stable
13:12:31FromDiscord<haxscramper> https://twitter.com/lzsthw/status/1326931878016901120 and we also need to consider that people are coming from different languages, and also make it easier to reiterate on error messages when needed
13:12:48FromDiscord<haxscramper> Rants like this are actually pretty valuable
13:13:21FromDiscord<haxscramper> http://al6x.com/blog/2020/nim-language or thing at the end
13:13:25FromDiscord<dom96> TIL async/await is a Haskell invention https://news.ycombinator.com/item?id=25699961
13:15:14*Q-Master quit (Ping timeout: 256 seconds)
13:19:20FromDiscord<mratsim> continuations existed in the 70s
13:20:08FromDiscord<dom96> Yes, it's really about where you draw the line
13:20:29FromDiscord<mratsim> https://www.cs.tufts.edu/~nr/cs257/archive/john-reynolds/histcont.pdf
13:20:52FromDiscord<mratsim> Also continuations can represent any monads: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.43.8213&rep=rep1&type=pdf
13:20:59FromDiscord<dom96> async/await specifically was still first present in C#
13:21:24FromDiscord<dom96> but you could argue that Haskell's monads were close enough to be considered the same
13:21:38FromDiscord<mratsim> async/await = continuation + storing the continuation in a scheduler
13:21:57FromDiscord<mratsim> or at least that's my understanding after reading dozens of continuation and coroutines papers
13:22:26FromDiscord<mratsim> that's why I think CPS is important. It reduces the difference between chronos, asyncdispatch, threadpool, weave to just the scheduler
13:22:40FromDiscord<mratsim> strip the scheduler and all is interoperable
13:30:49*filcuc quit (Ping timeout: 264 seconds)
13:31:11FromDiscord<0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2Lqa
13:32:10FromDiscord<mratsim> @0xc45 https://github.com/mratsim/photon-jit/blob/ef1954406d6f23677f702151397fcd6d3889aad3/photon_jit/photon_types.nim#L79-L93
13:33:16FromDiscord<dom96> > strip the scheduler and all is interoperable↵sounds like a great proposition, but what is it about CPS that makes it interoperable over closure iterators?
13:34:03FromDiscord<mratsim> CPS does the transformation and the closure instead of each scheduler having to do it themselves.
13:34:12FromDiscord<Recruit_main707> what was the reason a socket could get blocked when receiving x bytes, trying to read from it without having anything?
13:34:27FromDiscord<dom96> @mratsim the scheduler doesn't really do much of a transformation though
13:34:29FromDiscord<mratsim> furthermore besides closure iterators, you can represent IO as suspending proc directly
13:34:31FromDiscord<dom96> it just inserts yield calls
13:34:44FromDiscord<dom96> the compiler still does the bulk of the transformation
13:35:17FromDiscord<mratsim> you can reimplement closure iterators on top of continuations: https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/mratsim/ex06_coroutines.nim#L8-L12
13:35:27FromDiscord<mratsim> this allows a smooth transition
13:35:34FromDiscord<Meowz> @Recruit_main707 since I know you've did some similar stuff. Did you ever worked with a hooking library in nim?
13:35:43*opal quit (Ping timeout: 240 seconds)
13:36:19FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2Lqd
13:36:20FromDiscord<Recruit_main707> nope, i didnt get that far @Meowz
13:36:29*opal joined #nim
13:37:59FromDiscord<0xc45> Thanks, I'll look into that!
13:38:20FromDiscord<Meowz> Alrighty
13:42:19FromDiscord<dom96> @mratsim what specifically from this do they not allow?
13:43:03FromDiscord<mratsim> the {.suspend.} functions
13:43:07FromDiscord<dom96> resuming closure iterators across different threads?
13:43:30*Q-Master joined #nim
13:43:35FromDiscord<dom96> Actually, you're not even doing that there
13:43:42FromDiscord<mratsim> I am
13:43:43FromDiscord<dom96> Since each scheduled lives in its own thread
13:43:48FromDiscord<dom96> (edit) "scheduled" => "scheduler"
13:44:07FromDiscord<dom96> so you have a scheduler per thread
13:44:17FromDiscord<dom96> exactly how asyncdispatch operates
13:44:57FromDiscord<mratsim> you can have different schedulers on the same threads and pass continuations or coroutines between each other
13:45:35FromDiscord<mratsim> also ioScheduler is asyncdispatch or chronos
13:45:44FromDiscord<mratsim> cpuScheduler is threadpool or Weave
13:46:22FromDiscord<mratsim> but as I'm saying CPS removes all the packing into resumable closures part of any scheduler
13:46:59FromDiscord<mratsim> that's benefit 1, the second is simplifying suspending IO functions.
13:47:09FromDiscord<dom96> I think it's important to be clear what the differences here actually are
13:47:21FromDiscord<dom96> And right now it appears to just be the API that these are exposed under
13:49:13FromDiscord<mratsim> There are 2 things: closure iterators and async/await:↵↵CPS replaces closure iterators, closure iterators are basically coroutines, we can reimplement coroutines with continuations, in my PoC, a coroutine is a continuation with a promise: https://github.com/disruptek/cps/blob/mratsim-public-api-proposal/cps/core/spec.nim#L33-L66
13:50:08PMunchAre there seriously no-one who knows about the DLL packaging for Nim? https://forum.nim-lang.org/t/7353
13:50:10FromDiscord<mratsim> Using continuations directly instead of the closure iterators removes redundancy in schedulers, that needs to emulate continuations with closure iterators
13:50:17PMunchIt's starting to get a bit critical..
13:50:37PMunchWe're cutting a new release of our project which involves Nim code, and currently it doesn't build
13:50:47FromDiscord<mratsim> ping @Araq
13:50:53FromDiscord<dom96> huh, you're using NIm at work? 😮
13:50:56FromDiscord<dom96> (edit) "NIm" => "Nim"
13:51:00PMunchYup
13:51:08PMunchSnuck it in when no-one was looking :P
13:51:27*NimBot joined #nim
13:51:51FromDiscord<dom96> right, but then it's not even about CPS. It's just about exposing continuations in all contexts, which are more generic than closure iterators
13:51:59FromDiscord<dom96> CPS is just a way to implement continuations
13:52:13PMunchWe used some software that supported extension by Python code (Unbound DNS server). I made a PR to it to allow it to also support DLLs/.so files so I could rewrite our code in Nim and tell everyone it was now much faster.
13:52:31FromDiscord<dom96> And in fact, we already have a continuations implementation in Nim https://github.com/nim-lang/Nim/blob/devel/lib/pure/coro.nim
13:52:39FromDiscord<mratsim> I would be happy to explore other ways to implement continuations
13:53:12Zevvcoro
13:53:17FromDiscord<mratsim> That's not continuations though that's fibers
13:53:23Zevvis not portable, uses large stacks and is slow
13:53:25FromDiscord<mratsim> they need to have their own stack
13:53:39FromDiscord<dom96> @mratsim if you have the time it might be worthwhile to do research on other approaches
13:54:00FromDiscord<dom96> Including how other languages implement continuations
13:54:11FromDiscord<mratsim> you mean i didn't spend enough time or my research is incomplete? https://github.com/weavers-guild/weave-io/blob/master/research/README.md
13:54:12Zevvhe did *tons* of that dom96
13:54:12FromDiscord<dom96> I'd be interested to know how they implement it, if they even do so at all
13:54:13Zevvfor weeks
13:54:21Zevvdid you go through https://github.com/weavers-guild/weave-io/blob/master/research/README.md ?
13:54:52FromDiscord<dom96> huh? He just suggested exploring "other ways to implement continuations"
13:55:11FromDiscord<dom96> I'm not saying he hasn't done his research on CPS
13:55:25FromDiscord<dom96> I think it would be worthwhile to look into these other ways
13:55:32FromDiscord<mratsim> It has Scheme, Guile, Ocaml, abandoned C++ implementations, C++, Kotlin, failed Java, Rust and Go fibers, unreleased Swift proposals, Python, stackless Python
13:55:52FromDiscord<mratsim> I research them all
13:56:04FromDiscord<mratsim> C# F# as well
13:56:18FromDiscord<mratsim> I scourged the mailing lists for complaints
13:56:31FromDiscord<mratsim> academic papers
13:56:52FromDiscord<mratsim> I watched all the talks I linked in that readme
13:57:05FromDiscord<dom96> I was referring to this
13:57:05Zevvand evne made me watch and read a few!
13:57:13FromDiscord<dom96> Please do this if you have the time and will 🙂
13:58:05FromDiscord<mratsim> Yes, so CPS is the way to implement continuations for arbitrary languages
13:58:11FromDiscord<mratsim> in particular C and Javascript
13:58:26FromDiscord<mratsim> which are our limitations
13:58:37FromDiscord<mratsim> if we can't represent something in C or Javascript we can't use it.
14:00:13FromDiscord<mratsim> a small explanation of alternatives are here: https://wiki.c2.com/?ContinuationImplementation↵and here: file:///tmp/mozilla_beta0/Clinger1999_Article_ImplementationStrategiesForFir.pdf↵↵But they involve assembly
14:00:29FromDiscord<mratsim> ugh: https://link.springer.com/content/pdf/10.1023/A:1010016816429.pdf
14:00:33Zevvbecause you need to mess with the stack pointer.
14:00:49Zevvgood luck running that in JS
14:02:40FromDiscord<dom96> huh, how are you planning to use coroutines on JS?
14:02:52FromDiscord<mratsim> cps works on JS
14:03:02FromDiscord<zetashift> @PMunch I can't find anything in the commits that might indicate libssl requirements changed, I'm not sure how it got removed but don't people usually just ship their DLLs and the program in one go?
14:03:05Zevvdom96: really, try to spend an evening to understand how this works
14:03:12FromDiscord<dom96> @PMunch: I replied to your forum thread
14:03:17ZevvCPS is almost nothihng. IT is just a transformation
14:03:27FromDiscord<dom96> Zevv: I did. I understand how it works.
14:03:42Zevvok, cool
14:03:59Zevvbut then why do you ask about how it can work on JS
14:04:35Zevvbecause there is no black magic involved. It is just a transformation chopping a function in multiple functions and passing data around. It is 100% Nim
14:04:42FromDiscord<dom96> Well, I'm thinking about it in terms of the browser which already exposes it's IO through callbacks and promises.
14:04:49Zevvcoroutines != async I/O
14:04:55FromDiscord<dom96> I don't really see why you'd want it on the JS target
14:05:10Zevvbecause all the other benefits coroutines and CPS can bring
14:05:17FromDiscord<mratsim> I certainly want them to work in WASM
14:05:31Zevvcoroutines are so much more then a way to schedule I/O
14:05:42FromDiscord<dom96> well, WASM is a different beast altogether
14:06:12FromDiscord<dom96> I doubt you'd run into many limitations there
14:06:45FromDiscord<mratsim> I list several use cases for continuations here: https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md#motivation
14:07:30PMunchzetashift, which commits? I tried to look in the repo but I couldn't even find where the dlls.zip file comes from.
14:07:32FromDiscord<mratsim> sent a long message, see https://paste.rs/uTG
14:07:52PMunchAnd dom96 I replied back, where did windeps.zip come from?
14:08:01FromDiscord<mratsim> Basically, continuations are terrific for represention most producer -> consumer workflows
14:08:23*opal quit (Ping timeout: 240 seconds)
14:08:33FromDiscord<zetashift> @PMunch I mean I didn't find any commits! So I don't know how dlls changed, I thought the repo nim-website might give an indication
14:09:00FromDiscord<zetashift> https://nim-lang.org/install_windows.html UNder "other dependencies"
14:09:11FromDiscord<dom96> @mratsim right, well, all I really care about is the IO aspect of this. Everything else seems like fluff to me, I mean why would I use coroutines to serialize forms when 99.9999% of the web just serializes it to JSON or whatever
14:09:14FromDiscord<zetashift> (I think it's been there for a while)
14:09:19PMunchYeah I also went looking for them, but I couldn't figure out where that dlls.zip file came from..
14:09:25FromDiscord<dom96> PMunch: they're custom made
14:09:35FromDiscord<dom96> Just a set of DLLs zipped together
14:09:41FromDiscord<mratsim> for fast prototyping.
14:09:58PMunchzetashift, yeah the file itself has existed for a long time, and been linked to on the website. But I've never seen how it's made
14:10:07Zevvdom96: it can be fluff to you, interestingly enough it is one of my #1 missing features since I started in Nim
14:10:16*vicfred joined #nim
14:10:24FromDiscord<dom96> PMunch: imagine Araq downloading a bunch of DLLs and putting them into a zip. That's how it was made 😛
14:10:25FromDiscord<mratsim> if you only care about IO, just know that we can reimplement closure iterators in terms of CPS.
14:10:26PMunchdom96, so there's no record of why libssl was moved? And where did you find windeps.zip? I can't find a link to that anywhere..
14:10:44*opal joined #nim
14:10:44PMunchThat seems.. Brittle
14:10:51FromDiscord<mratsim> That seems unsafe
14:10:58FromDiscord<dom96> PMunch: I know it from memory. AFAIK dlls was meant to be replaced by it
14:10:59leorize[m]PMunch: Araq never revealed that. I can automate that eventually so we got an open source version, but not now :p
14:11:00FromDiscord<mratsim> and unreproduceable
14:12:08*hmmm joined #nim
14:12:47FromDiscord<dom96> Zevv: from my perspective it's a lot of effort and hype for something that when analysed is going to maybe enable some very niche use cases
14:12:53PMunchleorize[m], well it should at least not change without any mention in the changelog
14:12:59FromDiscord<dom96> (edit) "is" => "seems like it's"
14:13:55leorizeoh, that changed when I requested 4raq to update dlls
14:14:02FromDiscord<dom96> Ideally we would have .sha256 sums like we do for releases https://nim-lang.org/download/nim-1.4.2_x64.zip.sha256
14:14:24FromDiscord<mratsim> "very niche" is very condescending
14:14:30leorizehe just say to use windeps instead and I'm not sure what he did to dlls.zip
14:14:38FromDiscord<mratsim> interop between IO and CPU scheduler is not a niche usecase
14:14:52FromDiscord<dom96> It is when that interop is already possible
14:14:55leorizebut yea, eventually I'll make nightlies fully reproducible, and that includes dlls
14:14:58FromDiscord<dom96> with what we have today
14:15:09FromDiscord<dom96> Apologies if it comes off condescending, not my intention
14:15:10PMunchleorize, then maybe that file should be linked on the website?
14:15:20PMunchInstead of only dlls.zip
14:15:23FromDiscord<mratsim> There is no way to use closure iterators for CPU scheduling
14:15:39FromDiscord<mratsim> they are just plain wrong, they pollute your cache with GC things
14:15:42PMunchAnd how is windeps different from dlls? It's not like I'm using dlls on any other platform than Windows..
14:16:00leorize[m]PMunch: ping Araq I guess
14:16:23FromDiscord<mratsim> How do you pass streams across threads and await them?
14:16:38FromDiscord<mratsim> continuations simplifies that
14:17:01FromDiscord<mratsim> how do you handle low-level sessions and protocols
14:17:11FromDiscord<mratsim> you make them continuations that are suspended and resumed
14:17:23FromDiscord<mratsim> can't use closure iterators in cryptography or kernel mode drivers
14:17:53FromDiscord<mratsim> sure you can use state machines, but state machines needs a codegenerator or they quickly become hairy
14:18:36FromDiscord<dom96> well, let's go back to what prompted this discussiong:
14:18:37FromDiscord<dom96> (edit) "discussiong:" => "discussion:"
14:18:39FromDiscord<dom96> > that's why I think CPS is important. It reduces the difference between chronos, asyncdispatch, threadpool, weave to just the scheduler
14:18:54FromDiscord<dom96> I would argue that the difference is already just the scheduler
14:19:07FromDiscord<dom96> that's all
14:19:12FromDiscord<mratsim> And Futures and Timers, And Streams and everything that comes with them
14:19:48FromDiscord<dom96> You will have the same interoperability problems between asyncdispatch and chronos as you do now
14:20:12FromDiscord<mratsim> that doesn't need to be so. All of that can be represented via something Awaitable that is just "if not foo.isReady(): saveContinuation; foo.get()"
14:21:20FromDiscord<mratsim> this would make switching schedulers easier because there is less associated bagage to switch as well
14:21:44FromDiscord<dom96> okay, so you want to separate the Awaitable concept from these too
14:23:13*waleee-cl joined #nim
14:23:47FromDiscord<mratsim> Also from a theoretical point of view, as I said, continuations have been proven to be able to represent any Monads, and also any control flow. And scheme uses that to extend the language with new concepts when they appear in other languages, including async/await.
14:24:01FromDiscord<mratsim> They are the AST macros of control flow.
14:25:37FromDiscord<dom96> What is also always in my mind is the question of how long implementing this and making it stable will take. 2 months? a year? 5 years?
14:25:57Zevvwhat does it matter? Is something critical blocked by this?
14:27:48Zevvit's a research project that might bring a lot of good
14:28:00Zevvalso it might not, sure
14:28:33Zevvbut it's not something the core language is depending on. Not something that is part of the standard lib.
14:30:34FromDiscord<dom96> True, as long as the community is not holding off on investing time in Nim because they are anticipating that this will be a big change.
14:31:56FromDiscord<mratsim> It's not a big change for the transition, you reimplement closure iterators in terms of CPS, and done for step 0
14:31:58ZevvI don't think anybody is holding off anything. As far as I know, it has just been mratsin, disruptek and a bit of me actually spending time on this.
14:32:30ZevvThere have been very few people actually hopping on this train. I can't blame them, it's all pretty abstract
14:32:35FromDiscord<mratsim> the big changes would be for low-level developers of schedulers and IO, then functional programming.
14:32:59FromDiscord<mratsim> and maybe at one point it will flourish into CSP and Actors.
14:33:16FromDiscord<mratsim> ah and it will help streams as well
14:33:42FromDiscord<mratsim> but people using high-level features of Nim won't see a change to their day to day usage.
14:34:13FromDiscord<mratsim> We'll see in the survey why oeple don't invest in Nim but I expect it has to do with developer tools.
14:35:01FromDiscord<mratsim> personally I would love to do more tutorials, docs on how to use Nim for data science or cryptography or multithreading.↵But because I don't have what I expect, I'm just not doing it.
14:36:52PMunchZevv, I'm eagerly awaiting it, but haven't really read up on what it actually is :P
14:39:08FromDiscord<mratsim> Depending of the talk, it's either glorified callbacks or named gotos
14:39:28FromDiscord<0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2LqF
14:40:44FromDiscord<mratsim> In your code it does discard the return value. But does your called function require arguments??
14:41:03FromDiscord<mratsim> because the cast assumes that there is no need to pass anything
14:41:53FromDiscord<0xc45> Hmm that's odd. The function does not require arguments (in my case it's just shellcode for launching `calc.exe`)
14:42:05FromDiscord<mratsim> can you put your code in a function
14:42:45FromDiscord<mratsim> otherwise all variables are globals
14:42:51FromDiscord<mratsim> not sure but it might help.
14:43:30giacowar reading "norm" module docs, I've found 'some "Saaam"' line. What is 'some'?
14:43:36giaco*was
14:43:52PMunch`some` is from the `options` module
14:44:06PMunchBasically a value that can either be there or not
14:44:07giacothanks
14:44:12PMunchHmm, is there a way to see what would take up memory in my ESP8266 program?
14:45:28*Arrrrrrrr joined #nim
14:47:32PMunchI wrote this pretty simple Sodoku solver for fun http://ix.io/2LqI/nim
14:47:39FromGitter<gogolxdong> How to debug when programme failed `Error: execution of an external program failed: 'C:\Users\asus\nimcache\guiNode_d\guiNode.exe '`
14:47:47PMunchAnd the linker thing says it takes 32K of RAM
14:48:00PMunchWhich is a bit problematic since the thing only has 40K of RAM..
14:48:15FromGitter<gogolxdong> without more information
14:48:47PMunch@gogolxdong, well that meant a program that you code was calling crashed
14:48:51PMunchOr rather didn't return 0
14:49:07PMunchIs that the only message? Or do you get the command it tried to run as well?
14:49:52FromGitter<gogolxdong> it's a gui application , crashed after running for a while.
14:50:54PMunchOh wait
14:51:04PMunchSo you ran via Nimble?
14:51:23Clonkk[m]<PMunch "Hmm, is there a way to see what "> You can try using ``nm`` on Linux to see symbol and the size they take
14:51:27FromGitter<gogolxdong> nim r guiNode.nim
14:51:42PMunchAh, try compiling it, and then running it
14:51:53PMunchThat error is from the Nim compiler trying to run your binary
14:52:08PMunchClonkk[m], you can see how big they are as well?
14:54:46PMunchHmm, the "Blink" example in C++ takes 27k, so I guess it's just a lot of overhead in the libraries
14:56:10FromDiscord<0xc45> Wrapping it in functions didn't help, unfortunately, encountering the same error as @gogolxdong still. The nim program does hang during execution of the shellcode (which is good), but once the shellcode returns the Nim program exits with that error
14:56:46FromGitter<gogolxdong> nim c -r guiNode.nim it's the same, running for a while and crashed.
14:58:04Arrrrrrrris this a known bug? mutability in iterators https://wandbox.org/permlink/Rt5ZHPRFrmvLECfG#wandbox-resultwindow-code-body-6
14:58:33FromDiscord<shadow.> !repo cuda
14:58:33disbothttps://github.com/mratsim/Arraymancer -- 9Arraymancer: 11A fast, ergonomic and portable tensor library in Nim with a deep learning focus for CPU, GPU and embedded devices via OpenMP, Cuda and OpenCL backends 15 767⭐ 68🍴 7& 4 more...
14:58:43FromDiscord<shadow.> f
14:58:46FromDiscord<mratsim> !repo nimcuda
14:58:46disbothttps://github.com/unicredit/nimcuda -- 9nimcuda: 11Nim bindings for CUDA 15 17⭐ 7🍴
14:58:54FromGitter<gogolxdong> without any more information, there is no shellcode execution in my code
14:58:57FromDiscord<mratsim> though it uses Cuda 8 iirc
14:59:20FromDiscord<mratsim> @dom96 reproduced a minimal example that makes the Nim compiler bail out without any error: https://github.com/nim-lang/Nim/issues/16655
14:59:26disbotimportcpp + CRTP: Compiler exit without output or errors ; snippet at 12https://play.nim-lang.org/#ix=2LqO
15:00:41FromDiscord<mratsim> @0xc45 maybe `cast[proc(): cint {.nimcall.}](fn)
15:00:46FromDiscord<mratsim> (edit) "{.nimcall.}](fn)" => "{.nimcall.}](fn)`"
15:01:05FromDiscord<mratsim> it's possible that the return value of your function is overwriting a register
15:01:16FromDiscord<mratsim> so we need to tell Nim that there is a register used for return value
15:01:53FromDiscord<mratsim> and `cast[proc(): cint {.nimcall, discardable.}](fn)` if you want to be able to not check that return value
15:02:11FromDiscord<mratsim> not sure if that applies to your case as well @gogolxdong
15:07:22FromDiscord<0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2Lr1
15:10:03*opal quit (Ping timeout: 240 seconds)
15:12:05FromDiscord<mratsim> yeah it shouldn't matter
15:12:15giacois it possible to import/use a C preprocessor macro (#define)? I'm trying to use Gstreamer with nim, but to get raw data I need to comply with this line "We can retrieve the data pointer using the GST_BUFFER_DATA macro and the data size using the GST_BUFFER_SIZE macro in GstBuffer"
15:12:38*opal joined #nim
15:12:45FromDiscord<mratsim> I would run under gdb @0xc45, possible with --debugger:native if you want nim symbols but maybe C symbols are better
15:12:53FromDiscord<mratsim> @giaco, sure
15:13:33ZevvPMunch: you'll be *so* disappointed
15:14:28giacomratsim, would you share a manual page/keyword to follow?
15:14:31FromDiscord<mratsim> @giaco, here is an example #define macro wrapped in Nim: https://github.com/mratsim/weave/blob/2a1cf88aeef6c37bc772c0fe3cc6f957d6480e37/e04_channel_based_work_stealing/primitives/coz.nim#L21
15:14:38giacooh, thanks :D
15:14:52FromDiscord<mratsim> and the definition: https://github.com/mratsim/weave/blob/2a1cf88aeef6c37bc772c0fe3cc6f957d6480e37/e04_channel_based_work_stealing/primitives/coz.h#L79
15:16:03FromDiscord<0xc45> Thanks, I will try that when I have access to my desktop again. In the meantime, is there some way to tell nim to "ignore any errors in this section of code" or a similar workaround? I know that's horrible practice, but for my program it doesn't really matter at the moment
15:16:22FromDiscord<mratsim> try/finally
15:16:53FromDiscord<mratsim> though here you might have to "import signals" and do something, i'm not sure what kind of errors it is
15:17:13FromDiscord<mratsim> import signals allows you to catch Ctrl+C and SIGSEGV
15:20:31FromDiscord<mratsim> @giaco, it's now part of Nim wiki: https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#wrapping-c-define-macro
15:20:53*fputs joined #nim
15:20:56giacomratsim thanks a lot
15:22:40giacoIt gives me a kind of courage to meet the end of a page named "lesser-known-nim-features", but in reality I still can't write 3 lines without a syntax error :D
15:27:30FromDiscord<shadow.> if i only use macros from a module will it warn `imported and not used`
15:27:34FromDiscord<shadow.> because i'm certainly using macros
15:27:36FromDiscord<shadow.> from the module
15:27:47FromDiscord<Rika> i believe so
15:28:01FromDiscord<shadow.> ahh ok
15:29:28FromDiscord<0xc45> Thanks, no love with those methods as well. Currently thinking that it is because the shellcode calls an exit function that probably kills the current thread. I'll play with different payloads and debuggers at a later point
15:29:49FromDiscord<mratsim> good luck!
15:29:52FromDiscord<0xc45> Thanks a lot for now! +1 on what Giaco said, Nim can be a bit intimidating at times for a newbie but it's great that there are helpful people around 🙂
15:31:07FromDiscord<mratsim> you're welcome. In general when you need both scripting and low-level, I don't think any language comes close to Nim
15:31:15FromDiscord<mratsim> though I might have rose-colored glasses
15:31:16giacoI really like how it goes from safe and simple to shoot yourself gradually
15:31:40FromDiscord<whisperdev> Can you "slurp" a dll into the Nim binary and use it like that?
15:32:12FromDiscord<mratsim> can't you just link to it or use a .a/.lib static lib?
15:32:29FromDiscord<whisperdev> I dont know
15:32:54FromDiscord<mratsim> {.link: "mylibrary.o".} or {.link: "mylibrary.lib".} or {.link: "mylibrary.a".}
15:32:56FromDiscord<mratsim> done
15:33:12FromDiscord<whisperdev> But this is nix
15:33:19FromDiscord<mratsim> .lib is windows
15:33:37FromDiscord<mratsim> .lib is static library and .dll is dynamic
15:33:44PMunchZevv, haha let's hope not :P
15:34:03FromDiscord<whisperdev> That's cool I did not know you could do this
15:34:15FromDiscord<mratsim> otherwise maybe {.dynlib: yourlib.dll.} and the dynlibOverride pragma works but I'm not sure
15:34:25FromGitter<gogolxdong> yeah,very help
15:34:31FromGitter<gogolxdong> ful
15:34:53FromDiscord<whisperdev> I just need to figure out how to build fswatch on Windows
15:34:53FromGitter<gogolxdong> made in love
15:34:55FromDiscord<mratsim> https://nim-lang.org/docs/nimc.html#dynliboverride
15:35:13FromDiscord<mratsim> I think there is a repo for helping static builds.
15:35:24FromGitter<gogolxdong> mobile sorry
15:47:03*opal quit (Ping timeout: 240 seconds)
15:53:27Zevvdisruptek: ye awake?
15:56:40disruptekyeah.
15:58:21disruptekZevv: what is up my main man
15:58:33*Gustavo6046 joined #nim
15:58:49ZevvI'm trying to get acquinted with type macro stuff
15:59:00ZevvNim is taking my types too literally:
15:59:01ZevvnnkLetSection fds: distinct[int32] = sockBind(env_369101674(continuation).port_369101691)
15:59:21ZevvSo SocketHandle is a distinct[int32] somewhere
15:59:38disruptekhmm, that shouldn't be hard to fix.
15:59:39Zevvbut instead of throwing SocketHandle at me, it gets dissected all the way to distinct[int32]
16:00:12disruptekthere's a place where we add inferred types and we're probably unpacking them with the wrong getType call.
16:00:56disruptekthere's actually a much bigger problem on the horizon that is demonstrated by testes-1.1.0.
16:01:04Zevvdon't tell me
16:01:09disruptekokay.
16:01:13FromDiscord<mratsim> types in macro. You are better men than me. I wish you luck.
16:01:49disruptekthe types aren't the hard part; it's the /hidden/ types that are troublesome.
16:01:59Zevvok, tell me
16:02:15disruptektestes produces a macro now, `check`.
16:03:03disruptek`check x == 3` does the check you expect, but it also emits a comment like `let x: int = 5` when the check fails to show you what value provoked the failure.
16:03:23*opal joined #nim
16:03:28Zevvok
16:03:43disruptekdo produce this output at runtime and with respect for zevv's famously bland --define:testesDry, we bindSym a useColor(): bool predicate.
16:03:49disrupteks/^do/^to/
16:04:09disruptekcps erases the useColor() bindsym and turns it into an ident.
16:04:21disrupteknow, because it's not exported by my testes, it fails compilation.
16:04:28Zevvok
16:04:36disruptekwhich reveals a real problem: we cannot blindly desem symbols.
16:04:59FromDiscord<mratsim> but CPS will allow macro to compose 😉
16:05:31disrupteki dunno what that means.
16:05:38ZevvI was hoping you would say that before me
16:05:50disrupteknailed it.
16:05:59disrupteklemme get some coffee; bbiab.
16:13:39*Arrrrrrrr quit (Quit: Arrrrrrrr)
16:19:30*hmmm quit (Quit: WeeChat 3.0)
16:20:45FromDiscord<haxscramper> What is the best solution to map C++ concepts to nim? Things like `std::forward_iterator_tag` and others
16:20:53FromDiscord<haxscramper> Without going literally insane
16:21:28FromDiscord<haxscramper> Particularly I'm talking about C++ stdlib
16:22:37FromDiscord<haxscramper> Because the only thing that comes to mind is nim concepts, but this will probably just destroy me on spot
16:22:39FromDiscord<mratsim> Weren't they released like 1 month ago?
16:22:52FromDiscord<haxscramper> I'm not talking about C++20 concepts
16:22:59FromDiscord<haxscramper> More like the thing that preceded them
16:23:06FromDiscord<mratsim> !repo nimline
16:23:07disbothttps://github.com/sinkingsugar/nimline -- 9nimline: 11Wrapper-less C/C++ interop for Nim 15 74⭐ 3🍴 7& 2 more...
16:23:13FromDiscord<haxscramper> https://en.cppreference.com/w/cpp/iterator/iterator_tags
16:23:17FromDiscord<mratsim> there are iterators wrappers inside
16:24:03FromDiscord<mratsim> Nim's Bar = object of Foo will generate struct Bar: public Foo
16:24:07*narimiran joined #nim
16:24:12FromDiscord<mratsim> so inheritance?
16:25:32ForumUpdaterBotNew thread by Alexeypetrushin: Why Nim fails to convert from `float64` to `float`?, see https://forum.nim-lang.org/t/7361
16:26:06FromDiscord<haxscramper> Well, it's not like there is a better solution
16:26:08FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2LrC
16:29:08FromDiscord<haxscramper> IIRC new concept implementation is done and someone needs to review it, right? I think 4arq said something like that a while ago
16:30:53FromDiscord<Digitalcraftsman> sent a code paste, see https://play.nim-lang.org/#ix=2LrE
16:31:11FromDiscord<lqdev> import std/with
16:31:42FromDiscord<lqdev> https://nim-lang.org/docs/with.html
16:32:14FromDiscord<Digitalcraftsman> thank you. I've searched the docs, manual etc. because I knew that it exists. But I wasn't sure where to look specifically.
16:32:41disruptekscramper: new concepts can be tested, but they demand new syntax.
16:32:50FromDiscord<lqdev> yeah lib.rst should get an update someday
16:33:31disrupteki think std/with is underrealized. it should add the first arg to the first call of every subsequent statement.
16:33:32FromDiscord<lqdev> disruptek: wdym new syntax? do you want something different from araq's rfc?
16:33:34FromDiscord<haxscramper> disruptek: if I understand this new syntax vs non-working implementation
16:33:47FromDiscord<haxscramper> So this is fine by me
16:34:08disruptekthe impl works, but only with the new syntax. also, the impl may not be complete (ie. it doesn't handle obj fields).
16:34:34FromDiscord<lqdev> yeah object fields would be pretty cool to have
16:35:53saemdisruptek: I think we should mostly copy kotlin's with, let, apply, and returning set of functions, just change the names. And yeah, with being used for successive calls makes a lot of sense.
16:36:33disruptekit sorta works that way now, but i think it's just an oversight.
16:36:41FromDiscord<mratsim> too busy to review it :/
16:37:01FromDiscord<mratsim> the current concepts work for me mostly
16:37:07FromDiscord<mratsim> but where is that new implementation?
16:37:17disruptekaraq-concepts branch iirc.
16:37:24FromDiscord<haxscramper> https://github.com/nim-lang/Nim/pull/15251
16:37:25disbotnew-style concepts implementation, WIP
16:37:27disrupteki can't believe the current concepts work for you.
16:37:44FromDiscord<mratsim> I can't believe I made them work 😉
16:37:45disruptekthey are so broken that i think it's practically a miracle that they work in my code.
16:38:16FromDiscord<mratsim> I manage to create co-recursive concepts to represent algebraic relations.
16:38:24disruptekthey work for toy use and if you try to build upon them, pffbt, you're fucked.
16:39:22*vicfred quit (Ping timeout: 246 seconds)
16:39:23FromDiscord<mratsim> I don't think this is toy: https://github.com/mratsim/constantine/blob/master/constantine/tower_field_extensions/tower_common.nim#L26-L39↵↵It solves a big pain point in the corresponding Rust and C++ implementations
16:39:46FromDiscord<mratsim> but that produces hundreds of thousands of lines of duplicated code
16:40:18saemThere are many rough spots, it feels like. The docs are the first part. I think updating the docs to what concepts should be, then matching the implementation is the way to go. I hope the new syntax works backwards like that.
16:40:22FromDiscord<lqdev> https://github.com/liquidev/rapid/blob/master/src/rapid/game/tilemap.nim#L357 this tiny motherfucker of a concept caused me more headaches than i would've liked
16:40:31disrupteki can accept that it works, and i have concepts in my code that work, but the algebra is flawed such that it does not work as consistently as other algebras i've used. 😁
16:41:01FromDiscord<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/nn_dsl/dsl_types.nim#L63-L68
16:41:13FromDiscord<mratsim> I was surprised this one worked ^
16:41:23FromDiscord<mratsim> but debugging when it doesn't is a pain
16:41:34disruptekhttps://github.com/disruptek/nimph/blob/denimble/nimph/groups.nim#L188
16:43:42disrupteki expect my use to work, i don't expect your expr syntax to work.
16:43:48FromDiscord<mratsim> this one works and would make it easy to switch to continuations: https://github.com/mratsim/weave/blob/master/weave/datatypes/prell_deques.nim#L11-L20
16:44:00FromDiscord<mratsim> the expr syntax actually works 😄
16:44:17disruptekyes, but i don't expect it to work /in the new impl/.
16:44:23FromDiscord<mratsim> ah
16:44:23disruptekjust a heads-up.
16:44:35FromDiscord<mratsim> well I mentioned in the RFC that I want this to work
16:44:46FromDiscord<mratsim> or have an alternative
16:45:01disruptekwell, i could be wrong, but the idea is to get away from the compiles()-based impl.
16:45:27FromDiscord<mratsim> I'm fine with VTable based inheritance to replace that.
16:46:05FromDiscord<lqdev> speaking of vtables, vtable-based methods when
16:46:06FromDiscord<mratsim> but given that methods are broken with generics, I have no alternative
16:46:14FromDiscord<mratsim> I have to use concepts
16:46:29disrupteki don't know why vtables aren't impl'd, honestly.
16:46:40disruptekprobably just was never a paid priority.
16:47:13FromDiscord<mratsim> It's bacause concepts were released but debugging them took too much time
16:47:21FromDiscord<mratsim> so a stop was put until they were more stable
16:47:51FromDiscord<mratsim> and same thing for status
16:47:55FromDiscord<mratsim> sorry static
16:47:58*habamax quit (Ping timeout: 260 seconds)
16:48:14FromDiscord<mratsim> i.e. consolidate the existing features before burdening even more the type system
16:48:27disruptekyes, they are both pretty broken.
16:48:47disrupteki actually had to remove a concept from jason, of all places, to fix it against devel recently.
16:48:58disruptekabout as simple an impl as you could think of.
16:48:59FromDiscord<mratsim> We needed static at Status so we spend a lot of time to fix them in 2018.
16:49:11*filcuc joined #nim
16:49:14disruptekfor your use-case alone, i guess.
16:49:29FromDiscord<mratsim> No
16:49:39FromDiscord<mratsim> static enum works for everyone
16:49:44FromDiscord<mratsim> static int also
16:49:52FromDiscord<mratsim> static in macros as well
16:50:16disrupteki've found it an absolute crap shoot, but maybe i'm using them wrong.
16:51:05FromDiscord<mratsim> all the stuff here: https://github.com/nim-lang/Nim/issues?q=is%3Aissue+author%3Amratsim+label%3AStatic%5BT%5D+is%3Aclosed from 2018 were stuff we met at Status but are general problems
16:51:08disrupteklet's just say i don't consider static a tool i should leave on a lower shelf. i keep it in the back room, under lock and key, in a safe, rigged with dynamite.
16:51:25FromDiscord<mratsim> I assume that's why they don't work in Rust as well
16:51:40FromDiscord<mratsim> you need to design your type system with value as types from the ground up
16:51:46saemI've read your jason concept usage, your barely using them. Well they're used in a lot of places, but the amount that's actually declared is teeny tiny
16:51:56disruptekexactly.
16:52:06disruptekand i had to remove one use.
16:52:28saemI mean, it's a tutorial basically. I learned more about concepts from that then the docs at first.
16:52:40disruptekwhen i use something like this, i like to think that my use is as simple as can be.
16:53:12disruptekthe problem is that concepts are simple to use but hard to master, simply because they cannot compose.
16:53:26disruptekthis is a lesson for a lot of language design problems we argue about.
16:54:10saemI believe that, it's when two things try to work together often is where the fun begins.
16:55:03disruptekjason and frosty will probably just become demos of new concepts and cps.
16:55:08saemIt's why I think CPS is a big deal, but feel there are some lessons that likely need to be pulled out of it and into the base language to ensure its well enable (purely a hunch)
16:56:15disruptekit's teaching me a lot, definitely.
16:56:45disrupteki hope i'm putting enough of that into my comments but i guess it's easy to overlook stuff.
16:57:04disruptektestes has been instructional, too. they both have this thread-the-needle aspect.
16:59:37ForumUpdaterBotNew thread by Alexeypetrushin: Why proc behavior depends if it defined after or before another proc?, see https://forum.nim-lang.org/t/7362
17:00:04saemBy thread-the-needle, you mean the fine line of what can simply be written in the language, versus some deep down fundamental capability that should be part of the language. Learned through these sort of implementations?
17:00:26disrupteknothing that clever.
17:00:58*Zevv quit (Quit: leaving)
17:01:47disruptekmore like, the difference between what we believe is possible based on how we understand nim to straddle compile-time/run-time, and what is actually practically achievable with today's impl.
17:02:45saemAs in both aspirational and practical simultaneously.
17:02:54disruptekright.
17:03:10*Zevv joined #nim
17:04:00disruptekwe're usually right about one of the goal posts -- what we believe is possible -- but often wrong about how to get there using today's code.
17:05:44FromDiscord<mratsim> and how many moles you need to whack that the Nim compilers throw at you
17:06:26saemIn regards to concepts, I think I would prefer a lesser version of concepts based on row polymorphism than full blown concepts right now. More structural. For concepts themselves I should look at the new syntax, but I have a hunch it should feel more like generic generics.
17:07:34*haxscramper joined #nim
17:07:37saemViews might give me what I want, but last I read it didn't seem like it.
17:07:45giacoI'm trying to understand this error I'm getting while using gintro library: "nim-1.4.2/lib/core/macros.nim(558, 3) Error: undeclared identifier: 'scnew_sample'". I don't have that identifier in my code, nor is present in gintro library. What does it mean?
17:08:05disruptekprobably concatenation of two identifiers.
17:09:22FromDiscord<mratsim> ping ssalewski ^
17:10:22saemMratsim: I feel the whack-a-more, currently I'm trying to slowly build up a series of tests that capture behavior as a spec and fixing things along the way for nimsuggest.
17:11:16disrupteknice.
17:11:21saemWell, not currently. Currently I'm lying in bed not wanting to get up
17:14:24saemUnderstandably, it's steering my towards fixing sempass bugs. The next `con` one and I believe a `sug` one afterwards is like that. I'm just curious what happens as this stays bumping into IC.
17:14:49saems/stays/starts
17:15:24giacomratsim yeah I think gintro in editing the original names of the signals
17:16:53disrupteki wouldn't worry about ic yet; this feels like more of an effort to quantify the code before refactoring before switch to ic. to do it easily, you probably have a couple more passes to go.
17:17:06*bacterio quit (Ping timeout: 265 seconds)
17:17:53*bacterio joined #nim
17:19:25saemI know, it's just looking ahead and my brain is a jerk and likes to race ahead regardless of what I tell it to do.
17:20:37*lritter joined #nim
17:22:44disruptekfunny, we were just talking about what a jerk your brain is.
17:23:27saemI mean it deserves it
17:23:54disruptektotally.
17:24:00saemIt also doesn't let me read any of those messages so it remains immune to criticism
17:24:02*tane joined #nim
17:24:05saemTotal jerk
17:24:08disrupteklol
17:24:56*PMunch quit (Ping timeout: 240 seconds)
17:26:35saemThe nagging feeling I have is that shoving more of the versioning/caching concepts from nimsuggest into sem and those parts of the compiler would do much of the incremental part of IC, but not the heavy IO and mechanically sympathetic optimizations. So it'd be rod/sqlite agnostic and that could be fun competing priorities.
17:32:15saemOh well, for now the bugs.
17:32:30saemWell at least the getting up maybe
17:35:23FromDiscord<Anuke> Is there a simple way to export everything in a file w/o `include`, or do I have to write my own macro?
17:38:33*PMunch joined #nim
17:41:49FromDiscord<lqdev> `import module; export module`
17:42:15FromDiscord<Rika> i think they mean make all procs in a module exported
17:42:19FromDiscord<Rika> without putting markers
17:42:25FromDiscord<Anuke> yes, I mean all types/procs/type fields
17:43:03FromDiscord<Anuke> or, to phrase it another way, I have a public module and I don't want to put a star after everything
17:43:13FromDiscord<lqdev> well there isn't a way to do that
17:43:35FromDiscord<lqdev> c'mon, an asterisk is better than `public` or `export` everywhere
17:43:40FromDiscord<lqdev> it's a small price to pay
17:44:44FromDiscord<Rika> i think the issue is putting that star on every proc/field/type
17:44:45FromDiscord<Anuke> absolutely, but it could be even better
17:44:52FromDiscord<Rika> rather than how long the marker is
17:47:01disruptekmratsim: can you PR a patch to cps master to add type erasure only? without deleting everything and going full mutant?
17:47:23disruptek!repo disruptek/grok
17:47:24disbothttps://github.com/disruptek/grok -- 9grok: 11spelunking gear 15 0⭐ 0🍴
17:47:39disrupteksee the superstar file within.
17:51:40FromDiscord<treeform> disruptek, with CPS do you stitch back stack traces of cut up functions so that they are understandable?
17:51:44ForumUpdaterBotNew thread by Alexeypetrushin: How to write a template to call function with arbitrary number of arguments?, see https://forum.nim-lang.org/t/7363
17:52:22disruptekthe current impl just traces cps trampoline bounces and nothing else.
17:52:44disruptekis the output understandable? yes.
17:53:17disruptekhave i tested cpsTrace recently? no. 😉
17:53:44disrupteki think we're going to fix shadow F and then cut a minor today.
17:54:11disruptekwill try to make cpsTrace works in 0.1.0 or just cut it into 0.2.0 if it's too challenging.
17:55:25disruptekhow cps handles exceptions is an area of open research, but when type erasure goes in we'll have some new options for exceptions and return values.
17:56:15disruptekthe current impl of these features is a little meh.
17:57:46*haxscramper quit (Remote host closed the connection)
18:06:44*hmmm joined #nim
18:11:33giacoI'm trying to find out what "SCA" is in this source code: https://github.com/StefanSalewski/gintro/blob/master/gintro/gimplgobj.nim
18:11:45giacoit seems not declared anywhere
18:15:52*krux02 quit (Remote host closed the connection)
18:16:01giacois it an internal symbol or something?
18:17:32*krux02 joined #nim
18:18:52FromDiscord<Nisha|💻⭐> Heya everyone
18:19:14FromDiscord<Nisha|💻⭐> Is there a library for ØMQ in Nim?
18:19:25disruptek!repo zmq
18:19:26disbothttps://github.com/nim-lang/nim-zmq -- 9nim-zmq: 11Nimrod ZMQ wrapper 15 28⭐ 10🍴 7& 1 more...
18:19:28FromDiscord<mratsim> there is no type erasure in my branch, I decided that it was more important to nail the high-level ergonomic that fiddle with the low-level implementation.
18:19:33FromDiscord<Nisha|💻⭐> Thanks!
18:19:43FromDiscord<mratsim> than fiddle
18:20:01FromDiscord<mratsim> I can always do the type erasure later once we know that the high level work
18:20:19disruptekthat's a shame, because that's the part that we agree on.
18:20:34FromDiscord<mratsim> well that's why it's more important to focus on the rest no?
18:21:02disrupteki am.
18:21:08FromDiscord<mratsim> we also agree that CPS is the future
18:22:02disrupteki think i have shadow F solved, i just have some silly defect.
18:22:17disruptekor, at least, i have a temporary hack to work around it.
18:44:50Zevvexplain unhide to m,e
18:45:34disruptekif you turn it off, the code doesn't work. 😁
18:45:47disruptek# FIXME: a nutty hack to rewrite varargs conversions
18:46:05Zevvyeah I can read
18:46:10Zevvbut not understand
18:46:15disruptekwell, the copies remove the hidden types.
18:46:17Zevvthe why
18:46:28Zevvwhy is them hidden types hidden
18:46:53FromDiscord<mratsim> varargs are tricky because the AST stores them in nnkArg instead of nnkBracket
18:46:58disruptekthe problem is that typed notes are typed.
18:47:04Zevvhm I see
18:47:06FromDiscord<mratsim> and varargs typed, explicitly need nnkArg
18:47:16FromDiscord<mratsim> lost half a day on that
18:47:18Zevvwho made up this stuff
18:47:34disrupteksome chucklehead, no doubt.
18:47:39FromDiscord<mratsim> https://github.com/numforge/loop-fusion/blob/master/loopfusion.nim#L283
18:47:57FromDiscord<mratsim> I had a nnkBracket here
18:48:12FromDiscord<mratsim> try to reduce the example, change typed to untyped and vice-versa
18:48:18FromDiscord<mratsim> until the light hit me
18:48:44disruptekmaybe we can simplify it with this.
18:48:59disruptekbut anyway, copying nodes strips the .typ so it can be resem'd.
18:49:04FromDiscord<mratsim> this is the arg of the typed macro here: https://github.com/numforge/loop-fusion/blob/master/loopfusion.nim#L203
18:49:21FromDiscord<mratsim> there is copyNimTree that doesn't strip
18:49:31FromDiscord<mratsim> copyChildrenTo as well
18:49:38FromDiscord<mratsim> not sure what copyNim does
18:49:42FromDiscord<mratsim> or copy?
18:50:57disruptekcopy is the same thing but doesn't copy trees.
18:56:31disruptek/home/adavidoff/git/Nim/compiler/vm.nim(2316) evalMacroCall
18:56:31disruptek/home/adavidoff/git/Nim/compiler/vm.nim(1331) rawExecute
18:56:31disruptek/home/adavidoff/git/Nim/lib/system/fatal.nim(53) sysFatal
18:56:32disruptekError: unhandled exception: index out of bounds, the container is empty [IndexDefect]
18:56:37disrupteksuper unhelpful.
18:58:48disruptekit's actually a defect in the compiler; it's assuming that an unrelated exception is an index defect. 🤦
18:59:05grforkcould you advise me on how to make a test which only checks that all files from "examples/" directory are successfully compiled? I want to use testament. What is the general pattern to test for successful compilation in this case?
19:00:02*grfork is now known as greenfork
19:01:38greenforkI think it could be 1 test for per each example which includes it, I hope it is a correct pattern in this case
19:02:07Zevvdisruptek: tzevv.nim has been updated with a minimal example
19:02:18disruptekexample of what?
19:03:10*bacterio quit (Ping timeout: 256 seconds)
19:03:21FromDiscord<Anuke> How does one get the file a macro is called in, without using NimNodes? `instantiationInfo()` doesn't appear to be valid
19:04:15disruptekshadow F fix is pushed.
19:04:22*bacterio joined #nim
19:04:33Zevvalready?
19:04:39FromDiscord<mratsim> @Anuke you use template indirection
19:04:45FromDiscord<mratsim> I think
19:04:48disruptekwell, it's a work-around of sorts.
19:05:00disrupteknot sure it will survive.
19:05:07FromDiscord<mratsim> there are already a couple of issues and RFC to make instantiationInfo more useful
19:05:15disruptekwhat is this new red on my screen in tzevv?
19:05:20Zevvthe type error
19:05:23FromDiscord<mratsim> I find the lack of FILE really annoying as well
19:05:37Zevvwait what
19:06:04Zevvyour fix fixed my bu
19:06:05Zevvg
19:06:17disruptekthat's the idea.
19:06:29Zevvyeah but that was _my_ bug
19:06:48disruptekit was?
19:08:05FromDiscord<Anuke> By this, do you mean create a template that defines and invokes a macro?
19:08:24FromDiscord<mratsim> and passes the filename as a static string
19:08:36FromDiscord<Anuke> I see, thanks
19:08:41FromDiscord<exelotl> `with` really should be in sugar alongside dup...
19:10:33FromDiscord<mratsim> yeah std/enumerate should be in iterators with pairs and items
19:10:47disruptekZevv: what does this new bug mean? we need to rewrite conversions?
19:11:21ZevvI'm am again confused. I had this bug, I just rebased to master and it was fixed. But I'm on a different machine so I was probably not running what I was thinking
19:11:30Zevvsomething else: Why does compiling tzevv take +30 seconds for me at this time?
19:12:28Zevvwith -d:release, that is. And it's the C compiler or linker taking its time
19:13:01disruptekit's 35k lines of c.
19:13:14Zevvyeah I just noticed.
19:13:47disruptekit's usually the frontend that's slow for cps.
19:13:52Zevvfrom 231 lines of Nim. It's worse then npeg :)
19:13:54disruptektzevv takes me 17.5s.
19:14:06Zevvgood for you
19:14:13disrupteklol
19:14:13Zevvalso unacceptable
19:14:39disruptekcould also be my testes.
19:15:53disruptekso should we call this 0.1.0?
19:16:12disruptekwe don't even have a cpsTrace test do we.
19:16:40Zevv0.1.0? 1.0.0!
19:17:40disruptekeh it doesn't comingle with my freshest testes.
19:19:04FromDiscord<Avatarfighter> The testes are unsatisfied
19:23:39disruptekhmm, the shim almost works.
19:23:55disruptekit's kinda elegant actually.
19:24:02disruptek539 proc int(continuation: env_402658462): int {.cpsLift.} =
19:24:03disruptek540 env_402658462(continuation).result_402658461
19:24:23disruptekwho came up with this?
19:24:26disruptekit's genius.
19:24:43FromDiscord<Avatarfighter> lmao
19:25:00FromDiscord<Avatarfighter> Which intellectual of the high capacity came up with this computer science marvel
19:25:07FromDiscord<Avatarfighter> (edit) "high" => "highest"
19:25:24disruptekright? i would blow this guy if i could.
19:25:31FromDiscord<Avatarfighter> yeah
19:25:36FromDiscord<Avatarfighter> how are the ladies not lined up right now
19:25:42disruptekfor reals.
19:31:19FromGitter<StefanSalewski> 17:07:45 giaco I can not guess what this undeclared identifier: 'scnew_sample'" is. Please open issue on gintro issue tracker.
19:33:01giacoHi StefanSalewski! Thanks for your lib. I'm using it for gstreamer that surely isn't main topic, but it seems to work except for the missing parts. Opening issue right now
19:36:14FromGitter<StefanSalewski> giaco try grep SCA ~/.nimble/pkgs/gintro-0.8.5/gintro/*
19:36:26FromGitter<StefanSalewski> So you learn that SCA is a constant in gisup3.nim
19:36:37giacoyeah, I've found it later on
19:36:53giacoI guess I should add a line to that file to fix missing new-sample signal
19:37:27FromGitter<StefanSalewski> But of course you can not debug it yourself, it is to hard. Try to provide an example with that isue at github issue tracker.
19:38:09FromGitter<StefanSalewski> And tell us if you use mac, windows or linux, and if it is gtk4 or gtk3.
19:39:12FromGitter<StefanSalewski> And GTK version. We had a similar issue years ago when new symbols where introduced for a new windows GTK version.
19:39:47FromGitter<StefanSalewski> Unfortunately I have only Linux, but I can always ask Mr Bassi or Mr Droege. Bye.
19:40:52giacoStefanSalewski, gtk version? Do you mean gstreamer version? I'm using gtkdummy following your note in readme. I'm interested in linux too
19:42:33FromGitter<StefanSalewski> gtkdummy was created only for Mr Demo Hero who wants to use libnice with windows 8.1 without a real gtk install.
19:43:14FromGitter<StefanSalewski> That is really not recommended. When you use Windows, try to install gtk first.
19:44:00FromGitter<StefanSalewski> Foer him its seems to work, but he really only wants to use libnice two connect two computers.
19:44:08*hnOsmium0001 joined #nim
19:44:43FromGitter<StefanSalewski> I dont think that gstreamer can work without a real gtk install. And of course most of us use gtk on Linux.
19:44:55giacoStefanSalewski, I'm developing a command line tool, not really something that requires a gui, but yeah not a problem apt getting gtk
19:45:02giacohere's the issue https://github.com/StefanSalewski/gintro/issues/108
19:45:07disbotGstreamer, appsink element new-sample signal seems missing ; snippet at 12https://play.nim-lang.org/#ix=2LsK
19:45:21FromGitter<StefanSalewski> We have as least one sucessfull gtk windows project, was something to unlock a game.
19:46:50FromGitter<StefanSalewski> Yes please try full gtk install, gstreamer with dummygtk should really not work.
19:47:30FromGitter<StefanSalewski> And let me know your sucess on issue tracker. Bye.
19:47:35FromGitter<StefanSalewski> Logout
19:53:32giacosame identical problem with gtk, thanks for the feedback
20:06:43*opal quit (Ping timeout: 240 seconds)
20:07:50*opal joined #nim
20:13:40FromGitter<StefanSalewski> Yes, I already replied at issue tracker. You are using an invalid signal for an object.
20:14:33FromGitter<StefanSalewski> Each object has only a limited set of valid signal names, like "clicked" for a button.
20:14:39*leorize_ joined #nim
20:15:16FromGitter<StefanSalewski> We can not mixed them arbitrary. And you use casts, which really hate.
20:15:23*leorize quit (Ping timeout: 240 seconds)
20:16:32FromGitter<StefanSalewski> I have to investigate your issue more carefully tomorrow, have to study the C example. I don't know much about gstreamer.
20:16:40FromGitter<StefanSalewski> Logout!
20:29:40*a_chou joined #nim
20:34:02*a_chou quit (Client Quit)
20:36:20FromGitter<StefanSalewski> And for Araq: The issue is not the on the fly bindings generation.
20:36:55FromGitter<StefanSalewski> Issue is that we support only the Gst main module currently.
20:37:39FromGitter<StefanSalewski> And there are many, many modules in /usr/share/gir-1.0.
20:38:42FromGitter<StefanSalewski> One of them seems to have the "new_sample" signal, but it is not the main module .
20:39:18FromGitter<StefanSalewski> Test with /usr/share/gir-1.0 $ cat Gst-1.0.gir | grep "new-sample" # no output
20:39:53FromGitter<StefanSalewski> /usr/share/gir-1.0 $ cat Gs* | grep "new-sample" # some output
20:40:09FromGitter<StefanSalewski> Time to bed, bye. Logout.
20:46:21FromDiscord<irskep> I'm trying to set up vim in vscode after a long time not messing with nim. I have a `config.nims` file that works fine when I build the project, but VSCode doesn't seem to recognize the `nimscript` module identifiers like `put` and `switch`. I haven't changed any VSCode plugin settings. What could be going wrong?
20:47:20FromDiscord<irskep> It looks like maybe `nim check` is the real problem here
20:54:59FromDiscord<enimatek> i use vim for nim, normally i use vscode or intellij but both are very very flaky with nim, with vim the issues are better debuggable and you can (if you are used to vim) customize the 'issue' in vscode there are now 3 nim plugins, where i think the 'second' one works the best, but has a lot of processes that 'crash' evetually, i had te restart vscode each hour or so, did you test all three extensions?
20:56:31saemYou can try the one I maintain, I can give you a bit of help with it. The nimscript thing is an issue, but I haven't dug in super deep into that. Might be as simple as setting it as a project in the settings.
20:58:19FromDiscord<irskep> Switching to @saem's does at least get rid of the ugly squiggles, and autocomplete still works, so I guess problem solved for now
20:58:42saem"solved" :D
20:59:54saemAnyone dug around `sigmatch`, specifically `partialMatch and `matchesAux`? I have a dot expression being passed in but when it does the formal parameter matching it seems to ignore the preceeding parameter (thing before the dot). I'm not exactly sure what the semantics for it should be in this part of the code, so some guidance/rubber ducking would be appreciated.
21:00:27FromDiscord<enimatek> yes nimsaem is the one i use in vscode, seems to work best but the nimsuggest process pile up eventually
21:01:29saemenimatek: I strongly recommend setting up the `"nim.project": ["my.nim", "toplevel.nim", "nimfiles.nim"]`
21:08:46saemin lieu of direct sigmatch help, a hint as to what the `Aux` suffix is trying to convey might also be helpful. Presently, it mostly looks like "helper" or "do the actual work" type stuff, wondering if there is more to it.
21:08:51disrupteksaem: i dunno about sigmatch but i know the code is pretty crusty.
21:09:21saemdisruptek: OK, that makes me feel a bit better about saying OK the code is wrong. :D
21:09:52disruptekit wouldn't take a lot to convince me.
21:10:17saemThe only part that's a bit off is that this code is used in the non-suggest sem pass and it works, but I think that's because of a bunch of post-filter that's done in pick best candidate code.
21:11:10disruptekmakes some sense. i wish more of the compiler was side-effect free.
21:13:01saemYeah, clearer life times around what state things are in would be appreciated or even favour using more memory, if possible, where it's possible to avoid mutation.
21:14:07saemWow, awkward phrasing... that's what I get when most of my attention is staring at the debugger.
21:14:39disruptekstrictFuncs and notnil should help a lot, if compiler devs actually use them.
21:21:18*xet7 joined #nim
21:21:41saemFinding those first few parts where you can do some of the easier mechanical transforms that's the hardest part, it's hard to justify them on their own beyond a principle.
21:22:29saemBut if the noise doesn't go away it's really hard to act on meaningful stuff.
21:23:03saemI wonder what the appetite for those sorts of changes are.
21:27:03*opal quit (Ping timeout: 240 seconds)
21:34:32disruptekin my experience, slim.
21:35:12*opal joined #nim
21:36:15saemI see, but don't call me Slim.
21:36:25disruptekfair enough.
21:36:31*narimiran quit (Ping timeout: 246 seconds)
21:36:38saemCongrats, you've also dated yourself.
21:36:56disruptekand stop stealing monkeys?
21:37:36PrestigeI think disruptek would date himself
21:37:49disruptekif i knew i could get a hand-job at the end of the night.
21:37:53disruptekoh wait.
21:37:59PrestigeHaha.
21:38:12FromDiscord<ache of head> 😳
21:38:24disruptekit's just, we get along so well, i can hardly believe it.
21:38:41saemJust wait until the honeymoon period is over.
21:39:06saemHow'd you first meet?
21:39:22disruptekonline.
21:40:34*leorize_ is now known as leorize
21:44:18saemHow do you slide into your own dms?
21:44:41disruptekgingerly, the first time. go slow and pause frequently.
21:44:51saemsage advice
21:57:18FromDiscord<Avatarfighter> :disruptek: moment
22:21:31saemnothing like settling: https://github.com/nim-lang/Nim/pull/16657
22:21:32disbotfixes nim-lang/nimsuggest#103 con dot exprs
22:22:40leorizesaem: you figured out an use case for `con`? :P
22:23:41saemMediocre signature help, yes: https://github.com/saem/vscode-nim/blob/611bdb71a844b2816ec6492d09f0377c10b59203/src/nimvscode/nimSignature.nim#L7
22:23:42leorizeI have never figured out what are you supposed to do with that command
22:24:12saemI think with some more fixes to con and returning ranges and not just prefix positions, good signature help would be easy.
22:24:44leorizeyep, I need the range
22:25:43leorizeand a break down for the signature would be nice for implementing param template
22:25:44saemI think it's pretty close, I looked at the info code and it is a bit tricky, but it shouldn't be too bad.
22:26:46saemThe trick is operators to account for the back ticks, which don't appear when invoked, indexing operators such as `[]`, where the operator len is not really relevant.
22:27:41saemAnyhow, seems doable once I'm more comfortable with more of the compiler.
22:28:18giacois there any existing abstraction for masking threads into async functions (to move non-async login into async-based programs)
22:28:45leorizesaem: can `con` work for command call syntax?
22:29:23*opal quit (Ping timeout: 240 seconds)
22:29:37saemdunno, but I've seen spawn + async used together, giaco.
22:30:31saemleorize: you know what, that might be an easy thing to test and at worst it's an additional check to the conditional I added.
22:30:49giacosaem: thanks
22:31:30saemgiaco: that's not a great answer, I'm sure there is something better, and the not nearly complete CPS stuff is trying to help precisely with this, so it's important to many folks.
22:31:36*opal joined #nim
22:32:34giacosaem: sorry but, what CPS stands for?
22:32:58saemgiaco: continuation-passing style
22:33:13giacok thanks
22:33:16saemhttps://github.com/disruptek/cps#continuation-passing-style it's pretty cool.
22:33:40saemSome folks here are working on it, they're very cool.
22:34:31giacoyeah I wrote some haskell before nim and it is pretty common there
22:35:21saemgiaco: there is an example in asyncnet: https://nim-lang.org/docs/asyncnet.html#examples-chat-server that's with a more bare bones threadpool, not sure what the sentiment around spawn is.
22:39:51saemgiaco: this is the spawn example: https://github.com/dom96/nim-in-action-code/tree/master/Chapter3/ChatApp
22:39:59saemNow I'll stop spamming you with links. :D
22:40:30leorizesaem: during my experimentation with con for nim.nvim, I found that the signature help isn't really reliable
22:40:32giacoplease don't, I need them :D
22:41:37saemtoo late, you're cut off. ;)
22:41:52leorizeif you type out a variable/function it will catch on those symbol instead of the outer pro
22:41:57leorizeproc call*
22:42:08leorizeand also it just doesn't work when your cursor is in the space between `, `
22:42:12saemyeah, it needs some love, I'm treating this all like the types of queries that need to be supported so I don't want to kill too much.
22:42:21leorizegiven a fully specified call
22:43:00leorizewe really need a newer protocol :P
22:43:12leorizeyou can't add fields to the current one without breaking older stuff
22:43:19saemI don't disagree about the need, i disagree on the schedule/priority inversion. ;)
22:43:23leorizemakes me wonder if we should just write an lsp client instead :P
22:43:33saemYou mean LSP server?
22:43:33leorizelsp server*
22:43:46saemyeah.... I looked at that a whole lot.
22:43:55saemI want to, not against it.
22:44:46saemBut the "query engine" itself needs much fixing before it can really be useful and the protocol is a hard one to reason about before that's figured out.
22:45:23leorizefrankly I'm still waiting for IC to deliver its promises
22:45:44saemI do agree that an LS because the protocol has gone through trial by fire (many other languages) is probably going to hold up to our use cases and likely anticipates them and more.
22:45:47leorizethen I can figure if my pie in the sky idea that I outlined in nimsuggest#66 can be implemented
22:46:14saemI agree with 4raq, it can be done now, just needs a bit of punching.
22:46:53leorize(and yes I still want the project file to go away :P)
22:47:30saemI think a query context is a must, I'm not sure going stateless _too_ stateless is the right way to go.
22:48:12leorizemy idea is basically "very smart on demand but do best effort when you lack info"
22:48:51saemHmm, feels too implicit.
22:48:51leorizemy experiences with nim.nvim shows that the best effort scheme works 90% of the time, which should be useful for quick edits
22:49:17leorizeand that is working with much less data than what the compiler have
22:49:21saemYeah, but explicit needs to be king, because there are use cases that can't deal with 90%, so as long as we don't preclude those, I'm fine.
22:50:09leorizemore context is optional is what I'm striving for
22:50:25leorizeif the user need all the fancy stuff you're likely to have the data, which then you can forward to nimsuggest
22:51:04leorizebut for the normal use of "just quickly add/remove some code", a stateless impl that works well is appreciated
22:51:10saemYeah, that seems fine, then we can just argue about what the right default is. :D
22:55:15saemThe type of IC we need, putting speed aside for a moment, is more around versions of code, build configs, and all that jazz. If that starts influencing in the various existing data structures and phases, it'll be somewhat more complexity, but I think it'll drive better design that's useful for the regular compiler and other tools as well.
22:56:53*hmmm quit (Quit: WeeChat 3.0)
22:57:03*hnOsmium0001 quit (Quit: Connection closed for inactivity)
22:57:55*Vladar quit (Quit: Leaving)
23:02:12giacoI didn't know "spawn" and it seems great for what I need, but I'm not getting if threadpool's FlowVar is actually awaitable or not. I see that word "await" is present in threadpool module doc page, but not sure if I can simply "var myvar = await myflowvar" in async function
23:07:38*hmmm joined #nim
23:09:15saemleorize: command syntax is borked because the cursor tracking loses the plot me thinks.
23:10:36PMunchleorize, saem, did someone say LSP?
23:10:39saemgiaco: in the chat example it's a check and then return control to the dispatcher.
23:10:45saemPMunch: hahaha!
23:11:25saemI've mucked around a bunch with the LSP code base.
23:12:08PMunchOh neat, found anything? :P
23:12:09giacosaem: in example isReady is used outside an async context
23:12:09saemTesting is such a pain in the ass due to the simple fact that you can't reliably do non-blocking stdio
23:12:29PrestigePMunch: how is lsp atm anyway? Last I checked there were some PRs
23:12:34saemgiaco: d'oh, good point
23:12:56PMunchPrestige, well I'm using it every day
23:13:14PrestigeSame, I just have that one issue we talked about forever ago
23:13:26PMunchNot a whole lot of work being done on it right now though unfortunately..
23:14:12PMunchOh yeah, the changes across files thing is probably still an issue
23:14:20saemPMunch: yeah, there are a bunch of things I want to change, but without a reasonable test harness it hurts. I also burned waaaay too much time on trying to get that whole stupid process supervision thing working. The whole part where you can't kill threads... oof (I focused on testing and reliability)
23:14:22PMunchBut I think that's a nimsuggest thing..
23:14:26*Cadey quit (Quit: WeeChat 3.0)
23:14:36giacoside question: docs says "A project can also have a project-specific configuration file named $project.nim.cfg that resides in the same directory as $project.nim". Been trying in the last minutes but I think I'm not getting what $project is for nim
23:14:58PMunchsaem, that is one thing I've really wanted to do, a simple mock LSP client that would allow us to set up some testing
23:15:23*Xe joined #nim
23:15:34saemPMunch: I mean I did a bit there, if you can stand to look at ugly hack together code and abandoned experiments.
23:15:53saemgiaco: sorry, you can't get the config to be used or you don't know the point of it?
23:17:02PMunchsaem, I'd love to :)
23:17:12PMunchPretty much what I do at work anyways :P
23:19:40giacoI have a folder with many small independent nim experiments (a.nim, b.nim, ... z.nim) for some of them I need specific commands like --threads:on. So far I've been running manually the compiler for each of them, but now it feels time to use proper cfg for each one. I've been trying to create a.nim.cfg, b.nim.cfg, ... in same folder of nim file or in working directory of the compiler (or both) but they
23:19:42giacoseems not read (Hint line at compile time doesn't list it either)
23:20:46*vicfred joined #nim
23:22:14FromDiscord<ElegantBeef> If the `nim.cfg` file or the `.nims` is next to the nim file to be compiled it should load
23:25:13saemPMunch: this branch has all my half-baked crap, but this showed how to get nimsuggest process management working, I couldn't get rid of certain ambiguities, but it's less error prone than the original and has non-blocking IO IIRC: https://github.com/saem/nimlsp/blob/exp-rework-lsp/src/nimlsppkg/suggest.nim
23:26:34giacoit's it possible to have a separate nim.cfg for each .nim without separating them into folders?
23:26:46giaco*isn't it
23:26:51saemPMunch: I messed around a bunch with project scanning and IIRC fixed some uri encode/decode issues that I found in nimlsp's version.
23:26:53saemhttps://github.com/saem/nimlsp/blob/exp-rework-lsp/src/nimlsppkg/nimprojscan.nim
23:27:16PMunchsaem, ah so you're not using nimsuggest as a library
23:27:53saemPMunch: not entirely true, that was just trying to get that too work because I made the mistake of thinking that was a good idea, when killing threads is a better idea (if the stdlib supported it).
23:27:59FromDiscord<ElegantBeef> It should be possible giaco
23:28:11leorizegiaco: nim c file.nim will load `file.nim.cfg` and/or `file.nims`
23:28:32leorizesaem: please never kill threads
23:28:48leorizekilling threads won't release whatever that thread allocated
23:29:17saemThat's why I want something first class, so that's possible (assuming a few caveats).
23:29:40PMunchsaem, hmm that should be possible
23:29:51PMunchRunning nimsuggest in multiple threads and killing them I mean
23:29:58leorizegenerally I think the idea of killing a thread is dumb :P
23:30:12leorizeif you want that just use processes, they are not that hard
23:30:14saemSo is the idea of killing any execution context, then?
23:30:18giacook, so I think vscode is playing tricks on me.
23:30:20saemYes they are
23:30:28leorize(if you wait for long enough so my osproc replacement to complete)
23:30:33leorizefor*
23:30:38saemgiaco: yes, it could well be, especially if it's my extension, written by a total jerk
23:30:52PMunchI mean it wouldn't be terribly hard to implement some kind of cancellation system
23:31:06giaco:D
23:31:15saemOK, so I got proc management working, except when you realize the amount of protocol work you have to do to get an actual worthwhile experience it's bonkers.
23:31:45PMunchWhy do you think I went from procedures to integrating with nimsuggest directly?
23:32:08saemPMunch: it was the right call and thread management is a legit need. :)
23:32:12leorizegiven that IC is getting active work from Araq, maybe you should look into redoing nimsuggest altoghether? :P
23:32:21leorizegah, my grammar is all over the place
23:32:31saemsame, I'm not going to fault you for it. ;)
23:33:23saemRegardless, a totally new nimsuggest would be super duper and all but it'll have the same problem, you want to run tasks, if they misbehave you want to murder them, cancellation is a totally reasonable thing.
23:33:58leorizewhy would you ever want to run dangerous code in the same process?
23:34:29saemBecause you can keep making that argument until that code is on another computer
23:35:02leorizelol
23:35:05PMunchleorize, you can easily write a "malicious" macro that gets evaluated by the nimsuggest thing
23:35:22giacovscode is running my nim file (F6) with 'nim c -r "/home/giaco/nim/experiments/threadtest.nim"', terminal command line working directory is "/home/giaco/nim". If I write the config file as "/home/giaco/nim/experiments/threadtest.nim.cfg" it is not used. If I move same file to parent dir it doesn't work either. It only works if I rename it to nim.cfg
23:35:45leorizePMunch: not anymore
23:36:08leorizeAraq finally implemented a pseudo sandbox to prevent all that stuff
23:36:16saemgiaco: which extension are you using exactly, there are more extensions than community members at this point.
23:36:49PMunchleorize, wait really?
23:37:09giacothe one from Konstantin Zaitsev, the most downloaded I think (the first one that popped in extension list)
23:37:21leorizeyes, writeFile and staticExec has been banned from executing in nimsuggest
23:38:04leorizein Nim source the mode is referred to as nimcore
23:38:39leorizeor something "core", just in case you want to add more restrictions to the VM
23:39:11*NimBot joined #nim
23:40:20PMunchOoooh right
23:40:23saemPMunch: Here I separated out the language server state and modelled the lifecycles as separate procs so it would be amenable to unit testing. Also assumed that it would be both easier to reason about the protocol and server: https://github.com/saem/nimlsp/blob/exp-rework-lsp/src/nimlsppkg/languageserver.nim#L318 I find the existing code required having to remember lots of context all the time.
23:40:23PMunchThat's cool
23:40:59saemgiaco: you can try the one I wrote, it might work better, it's the second most popular?
23:41:16saemwell, ported more than wrote -- credit where credit is due.
23:41:56giacowhy not! +1 for saem
23:44:57giacosaem: yeah, it works
23:45:01giacothanks!
23:45:40saem\o/
23:46:06giaconow that you have full control of my machine, please can you fix my adsl?
23:46:27saemyeah... no it's goign to get worse with the botnet.
23:46:39giacodamn, again
23:46:39saemhope you have a gpu, need me more coins
23:48:30FromDiscord<ElegantBeef> Ah that explains why i've been getting a lot of gpu hitches recently
23:48:38saemI'm kinda leaning towards leorize's take, maybe just have nimls or something, make it part of the compiler for now until things settle enough and it can be separated out.
23:49:03saemElegantBeef: just think of them as little victories
23:49:21FromDiscord<ElegantBeef> I was thinking them more as opengl here
23:49:31*PMunch quit (Ping timeout: 246 seconds)
23:49:33leorizeto be fair 4raq is open in taking nimlsp in
23:49:48leorizethe compiler should start taking external deps instead of reinventing things
23:50:06leorizewell that kinda depends on a good package manager, which we don't have
23:52:28saempackage manager or .... https://github.com/disruptek/dist?
23:53:26leorizeyes
23:54:15saemI think dist + a collections concept would be pretty awesome.
23:54:20leorizeI consider `dist` a side-effect of not having a good package manager
23:54:39saemdist solve a cohesion problem as well.
23:55:39leorizecohesion problem?
23:56:52FromDiscord<exelotl> everything in dist is known to work together
23:56:54saempackage managers tend to be a big namespace, it's there if you can publish. dist is that but there are further standards and the things within work together and might even leverage each other.
23:58:20leorizedist is basically how a batteries-included stdlib is implemented everywhere
23:58:38leorizeother than Nim
23:58:54saemI think dist is a single collection, which is likely fine, but seeing the conversations go by, I suspect that people will want further collections, where certain things are guaranteed (works with arc, no dynamic allocations, ...) or whatever.
23:59:27leorizeand if we have a good package manager `dist` can be implemented as a `.nimble` file with only `requires`