00:09:09 | * | argonica joined #nim |
00:38:22 | * | NimBot joined #nim |
01:12:50 | * | argonica quit (Quit: Leaving) |
01:14:07 | * | argonica joined #nim |
01:43:24 | * | NimBot joined #nim |
01:50:02 | * | NimBot joined #nim |
02:50:14 | FromDiscord | <exelotl> In reply to @4zv4l "well I don't know": Give this tutorial a read, you should find it quite familiar https://castle-engine.io/modern_pascal |
02:51:06 | FromDiscord | <exelotl> it's like Nim but a lot wordier xD |
03:21:35 | * | sagax joined #nim |
03:23:57 | * | ltriant quit (Ping timeout: 268 seconds) |
04:13:31 | * | arkurious quit (Quit: Leaving) |
04:29:05 | FromDiscord | <Boston> Pascal 😭 |
04:30:32 | FromDiscord | <Boston> We have a test suite written in Delphi (most of the code was written in the late 90s) but because we sell to the military we have to maintain it, horrendous stuff |
04:34:51 | * | Jjp137 quit (Ping timeout: 248 seconds) |
04:35:10 | * | Jjp137 joined #nim |
04:52:30 | * | ltriant joined #nim |
06:14:53 | * | azimut_ quit (Ping timeout: 255 seconds) |
06:17:09 | * | tiorock joined #nim |
06:17:09 | * | tiorock quit (Changing host) |
06:17:09 | * | tiorock joined #nim |
06:17:09 | * | rockcavera quit (Killed (platinum.libera.chat (Nickname regained by services))) |
06:17:09 | * | tiorock is now known as rockcavera |
06:35:40 | * | argonica quit (Quit: Leaving) |
06:44:30 | FromDiscord | <qb> In reply to @enthus1ast "<@590220785029873674>\: a simple full": Well yea. All this hooking c libraries take pointers as parameters to install a hook. The one I'm using takes the function addresses. I've tried to use `parseHex(repr(someFunction), tointvar)` without success |
06:52:14 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
06:53:25 | * | ehmry joined #nim |
07:08:55 | rockcavera | qb are you trying to capture the address of a nim proc? |
07:13:35 | rockcavera | qb https://forum.nim-lang.org/t/1560 |
07:13:45 | rockcavera | https://forum.nim-lang.org/t/1560#9667 |
07:32:56 | * | argonica joined #nim |
07:52:31 | FromDiscord | <4zv4l> In reply to @exelotl "Give this tutorial a": I Will Check that ! |
08:04:30 | * | ltriant quit (Ping timeout: 260 seconds) |
09:09:12 | * | argonica quit (Quit: Leaving) |
09:09:50 | FromDiscord | <michaelb.eth> sent a long message, see https://paste.rs/bwP |
09:10:37 | FromDiscord | <Elegantbeef> Import where you can, include where you cannot |
09:11:20 | FromDiscord | <Elegantbeef> The way i look at cross platform libraries is that the OS implementations should be modular, in that they should have the same API then i can just import them and use them how i want, but this depends on the library and the code you're using |
09:11:49 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/4lON" => "http://ix.io/4lOM" |
09:12:14 | FromDiscord | <Elegantbeef> Mixins are for generics, so not really work for your purpose, as they're for moving the solution onto the user |
09:12:15 | FromDiscord | <Phil> In reply to @michaelb.eth "`include` statements in Nim": I'm struggling to imagine what part of dealing with OS code would make you have to deal with include |
09:12:43 | FromDiscord | <Elegantbeef> There isnt much of a reason it does |
09:13:10 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/kMR |
09:13:11 | FromDiscord | <Elegantbeef> https://github.com/treeform/hottie/blob/master/src/hottie.nim is a prime example of doing imports 'properly' |
09:14:10 | FromDiscord | <Elegantbeef> Treat modules as an interface, could even do some CT magic to ensure a module implements what you want |
09:15:02 | * | pro joined #nim |
09:15:15 | FromDiscord | <michaelb.eth> The C lib author has done some very clever stuff that affects what `string` you want to pass to `{. ..., importc: [computed-string], ... .}` |
09:16:14 | * | pro left #nim (#nim) |
09:16:59 | FromDiscord | <Elegantbeef> Oh phil it was you that wanted that whole "ensure module implements X" proc right? |
09:17:35 | FromDiscord | <michaelb.eth> so beyond `include`, and nothing I could figure out with `import` and `mixin` (not that `mixin` is actually an option in this case, but I was experimenting), my option is to reproduce many lines of hand-written wrapper code and the include instructions in some context or another: "make sure you make changes in both `.nim` wrapper modules" |
09:18:08 | FromDiscord | <michaelb.eth> (edit) removed "the" |
09:18:25 | FromDiscord | <michaelb.eth> (edit) ""make" => ""make" | "modules"" => "modules"" |
09:19:43 | FromDiscord | <Phil> In reply to @Elegantbeef "Oh phil it was": Yeah, but ideally in a manner that means I don't have to change my source code, only like import statements.↵In an ideal world, that'd be↵`import <someModule> implementing <Moduleinterface>` I think.↵I know ideally the entire "what interface a thing implements" would be within the module itself but that seems like even more of a pain |
09:19:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/m3T |
09:20:41 | FromDiscord | <Phil> In reply to @michaelb.eth "so beyond `include`, and": I am also slightly confused as to the mention of mixins, as the target usecase for the mixin keywords is generics, which don't necessarily have anything to do with platform specific code |
09:20:42 | FromDiscord | <michaelb.eth> because the string infects a pragma that needs to be replicated throughout the wrapper module |
09:21:07 | FromDiscord | <Elegantbeef> I dont follow |
09:21:35 | FromDiscord | <Elegantbeef> macro time 😛↵(@Phil) |
09:21:41 | FromDiscord | <michaelb.eth> In reply to @Isofruit "I am also slightly": yeah, `mixin` was a stretch, I was just trying to find a way to have the dependent module inject a symbol into the dependency |
09:21:49 | FromDiscord | <Elegantbeef> Do you have a more concrete example of the issue? |
09:22:28 | FromDiscord | <Phil> Me? |
09:22:36 | FromDiscord | <Elegantbeef> No michael |
09:29:53 | FromDiscord | <Try2Cry> How come that @Elegantbeef#0000 is just a bot ! |
09:30:04 | FromDiscord | <Elegantbeef> The matrix is a hell of a protocol |
09:32:51 | FromDiscord | <Phil> I programmed him |
09:32:53 | FromDiscord | <Phil> He is cheeky |
09:32:55 | FromDiscord | <Rika> Beef is from the matrix I see |
09:32:57 | FromDiscord | <Phil> Keeps denying it |
09:33:34 | FromDiscord | <Elegantbeef> I have as many cheeks as you |
09:33:58 | FromDiscord | <Try2Cry> Can i see his source code ? |
09:34:03 | FromDiscord | <Rika> In reply to @Elegantbeef "I have as many": Two up there and two down there? |
09:34:06 | FromDiscord | <Try2Cry> I really like it 🙂 |
09:34:12 | FromDiscord | <Phil> In reply to @Try2Cry "How come that @Elegantbeef#0000": All kidding aside, this discord server is bridged to IRC and matrix (another way of chatting that is more privacy focussed) |
09:34:14 | FromDiscord | <Elegantbeef> How come it's okay to say i'm cheeky but when i say you're assey it's wrong?! |
09:34:26 | Amun-Ra | :P |
09:34:43 | FromDiscord | <Elegantbeef> Damn someone really likes me, my mom is going to be livid when i tell here I have a friend, she said no one likes me! |
09:35:00 | FromDiscord | <Phil> So what happens basically is that folks on IRC and matrix write stuff and their messages get forwarded to the discord server and re-posted here via bots/a bot |
09:35:49 | FromDiscord | <Phil> And at the same time our messages here from discord get forwarded back to the IRC/matrix servers |
09:35:50 | FromDiscord | <Try2Cry> So he just person using another software for privacy |
09:35:59 | FromDiscord | <Try2Cry> Hmm am the bot here then 😂 |
09:36:04 | FromDiscord | <Phil> Not just another frontend, another frontend + another server |
09:36:12 | FromDiscord | <Elegantbeef> Privacy is a farce, given i'm talking to discord |
09:36:22 | FromDiscord | <Elegantbeef> They eat my data and then tell me "No you get nothing" |
09:36:29 | FromDiscord | <Elegantbeef> Even though i had a golden ticket |
09:36:33 | FromDiscord | <leetnewb> In reply to @Elegantbeef "They eat my data": You get to chat! |
09:36:37 | FromDiscord | <Phil> I'm playing around with webcord at the moment, its nice |
09:36:56 | FromDiscord | <Phil> Basically discord but you get to mess around with a few options that otherwise aren't exposed |
09:37:14 | FromDiscord | <Phil> In exchange you get the frontend crashing after around an hour of voice chat =/ |
09:37:22 | FromDiscord | <Phil> And only then, fascinatingly |
09:38:00 | FromDiscord | <Try2Cry> Hmm nice |
09:38:06 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4lOU |
09:38:07 | FromDiscord | <Elegantbeef> I dont want to chat, i want to own things! |
09:39:01 | * | argonica joined #nim |
09:39:09 | FromDiscord | <Try2Cry> You won't own things without chatting |
09:39:43 | FromDiscord | <Elegantbeef> Have fun modifying discords font, or theme without breaking TOS! 😛 |
09:39:48 | FromDiscord | <Phil> In reply to @michaelb.eth "Alright, I'll give a": I mean, that's basically what I've been doing with nimstoryfont the first 6 months |
09:39:58 | FromDiscord | <Try2Cry> Btw Since nim have a js backend why there isn't any repos that nim is being used with react , react native ? |
09:40:00 | FromDiscord | <Elegantbeef> Michael why can you not just move that conditional logic insied `abi/private`? |
09:40:14 | FromDiscord | <Elegantbeef> Cause karax exists |
09:40:21 | FromDiscord | <Phil> In reply to @Try2Cry "Btw Since nim have": For the most part because folks just use karax |
09:40:23 | FromDiscord | <michaelb.eth> karax? |
09:40:33 | FromDiscord | <Phil> Karax is nim's own SPA framework |
09:40:38 | FromDiscord | <Elegantbeef> Karax is a Single page application for web dev |
09:40:43 | FromDiscord | <Phil> the forum is written in karax IIRC |
09:40:46 | FromDiscord | <Elegantbeef> Almost wrote SPA properly |
09:41:02 | FromDiscord | <Elegantbeef> Sorry you fell trap to my dual conversation habit |
09:41:10 | FromDiscord | <michaelb.eth> eh, I think I got crosswise in the chat, nim-notcurses has nothing at all to do with jS |
09:41:18 | FromDiscord | <michaelb.eth> (edit) "jS" => "JS" |
09:41:25 | FromDiscord | <Elegantbeef> Yep of course |
09:41:30 | FromDiscord | <Try2Cry> Don't you think if that got some modified that will give a huge push to nim 🤔 |
09:41:46 | FromDiscord | <Phil> Define "some modified" |
09:41:52 | FromDiscord | <Phil> Also define "that" |
09:42:02 | FromDiscord | <Elegantbeef> Cause people want to use a bastardised tedious alternative version of react |
09:42:08 | FromDiscord | <Elegantbeef> Instead of a new program |
09:42:33 | FromDiscord | <Elegantbeef> Anyway like i said michael i dont see why that conditional logic is inside of `abi.nim` |
09:43:24 | FromDiscord | <michaelb.eth> because the string passed to importc is prolific through derivative pragma-statements |
09:43:45 | FromDiscord | <Elegantbeef> Yes, but you declare the string inside abi for no reason afaict |
09:43:58 | FromDiscord | <Elegantbeef> Why can it not recide in `private.nim`? |
09:44:03 | FromDiscord | <Elegantbeef> the fuck is that spelling |
09:44:09 | FromDiscord | <Elegantbeef> reside\ |
09:45:18 | FromDiscord | <michaelb.eth> `import notcurses` results in completely different compile/link-time behavior from `import notcurses/core` |
09:46:06 | FromDiscord | <michaelb.eth> and there are variants, help me to explain it, so that I can be rid of my.... misunderstandings or blindnesses |
09:46:14 | Amun-Ra | I wrote my own [n]curses module for my image viewer, I use dlopen/dlsym for everything |
09:46:30 | FromDiscord | <michaelb.eth> unrelated to n/curses |
09:46:35 | FromDiscord | <Elegantbeef> You also could use a delayed import |
09:46:50 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "You also could use": do tell |
09:46:53 | FromDiscord | <Elegantbeef> I might be tired and missing the issue completely |
09:48:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lOV |
09:48:49 | FromDiscord | <Elegantbeef> But i still dont quite see why you cannot just move the conditional logic from `abi.nim` to `private.nim` |
09:49:10 | FromDiscord | <Elegantbeef> As far as i can see the only usage is inside `private.nim` |
09:49:41 | FromDiscord | <michaelb.eth> `import notcurses` vs. `import notcurses/core` |
09:49:45 | FromDiscord | <michaelb.eth> or... |
09:50:00 | FromDiscord | <michaelb.eth> `import notcurses/cli` vs. `import notcurses/core/cli` |
09:50:48 | FromDiscord | <michaelb.eth> the C lib author is exceptionally clever; how you import the lib largely affects what gets linked |
09:51:05 | FromDiscord | <Elegantbeef> Ok so `abi` vs `cli` and `core` are different entry methods |
09:51:10 | FromDiscord | <michaelb.eth> yes |
09:52:16 | FromDiscord | <michaelb.eth> note: ignore what's on the `master` branch entirely, the only action is on the `version_3_revamp` branch |
09:54:18 | FromDiscord | <Elegantbeef> Some of your includes could just be a `import x` followed by `export x` |
09:54:28 | FromDiscord | <Elegantbeef> `include ./api/private/constants` for instance |
09:54:41 | FromDiscord | <Elegantbeef> Oh wait never mind |
09:54:45 | FromDiscord | <Rika> Oh shit someone wrapping not cursed |
09:54:46 | FromDiscord | <Elegantbeef> tired brain strikes again |
09:54:49 | FromDiscord | <Rika> (edit) "cursed" => "curses" |
09:54:51 | FromDiscord | <michaelb.eth> Even then, there's a big mess on `version_3_revamp`, but it's all artifact of an unexperienced Nim programmer inspired by Nick Black and rushing to make a wrapper. Since my start of it, I learned a lot and am cleaning it up, but figuring out the best way to deal with the `include` vs `import` + `export` stuff seemed like the best thing to tackl.e |
09:54:57 | FromDiscord | <michaelb.eth> (edit) "tackl.e" => "tackle now." |
09:57:44 | FromDiscord | <michaelb.eth> In reply to @Rika "Oh shit someone wrapping": My personal goals: successfully wrap it (finally), then provide a UI lib inspired by and rivaling https://github.com/gansm/finalcut (but using the wrapper and Nim concepts or whatever), then conquer the world |
09:57:57 | FromDiscord | <Elegantbeef> Yea seems include is the only solution here since you're using the module as a template practically |
09:58:19 | FromDiscord | <Elegantbeef> Ideally nim would treat modules as instantiateable and allow replacing symbols |
09:59:47 | FromDiscord | <Elegantbeef> There is not even a hacky i can think of to change logic based off importing a file aside from `{.define: notCursesUsingCLI.}` |
10:00:22 | FromDiscord | <michaelb.eth> alright, `include` it is |
10:00:37 | FromDiscord | <Elegantbeef> Not that anyone overly uses the define pragma, but it exists 😄 |
10:13:57 | FromDiscord | <michaelb.eth> In reply to @Isofruit "I mean, that's basically": 🙏 |
10:28:14 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lP4 |
10:30:11 | * | jjido joined #nim |
10:35:04 | FromDiscord | <Phil> In reply to @4zv4l "is there a better": You want to execute execShellCmd either way, right? |
10:35:38 | FromDiscord | <Phil> Wait, why is that a template not a proc? What benefit do you gain from it being a template? |
10:36:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lP6 |
10:38:04 | FromDiscord | <4zv4l> well template is code copy pasted in the place you call it right ? |
10:38:40 | FromDiscord | <Phil> Correct, but in the end all it achieves is a call to `execShellCmd` with a string, that same side-effect can be achieved by just a simple proc |
10:41:22 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lP8 |
10:41:33 | FromDiscord | <4zv4l> In reply to @Isofruit "Correct, but in the": I'll change it to be a proc then if it doesn't change much |
10:41:59 | FromDiscord | <Phil> Imo procs are always preferrable over templates unless you do with a template stuff that a proc can't do, like context managers |
10:43:20 | FromDiscord | <4zv4l> alright, I'll keep that in mind, thanks ! ^^ |
10:44:08 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lP9 |
10:44:31 | FromDiscord | <enthus1ast> @4zv4l\: https://nim-lang.org/docs/terminal.html#eraseScreen%2CFile |
10:46:35 | FromDiscord | <4zv4l> In reply to @enthus1ast "<@329196212282458112>\: https://nim-lang.org/docs/t": yeah I already checked this one but it never works as expected |
10:47:06 | FromDiscord | <4zv4l> it makes the time (what is printed) go down and down |
10:47:34 | FromDiscord | <4zv4l> like if putting the cursor at the right pos didn't work for this proc |
10:48:17 | FromDiscord | <enthus1ast> do you want to overwrite a line? |
10:48:27 | FromDiscord | <enthus1ast> for a progress indicator? |
10:48:47 | FromDiscord | <4zv4l> oh it's multiple lines |
10:49:00 | FromDiscord | <4zv4l> basically like this https://media.discordapp.net/attachments/371759389889003532/1066308426541584405/6c8d8207-6d4c-41fb-b227-b07d14ff9a42.png |
10:49:09 | FromDiscord | <4zv4l> supposed to clear and update the time |
10:49:33 | FromDiscord | <enthus1ast> i see+ |
10:50:19 | FromDiscord | <4zv4l> In reply to @4zv4l "basically like this": I tried↵`cursorUp` to get rid of the final newline↵but it didn't work either xD |
10:51:22 | FromDiscord | <enthus1ast> i looked at old code of mine how i did it back then |
10:51:27 | FromDiscord | <enthus1ast> but it used illwill |
10:51:29 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix= |
10:51:52 | FromDiscord | <enthus1ast> maybe illwill is an option for you as well |
10:52:12 | FromDiscord | <4zv4l> what is illwill ? |
10:52:14 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/muk/blob/bb65fa5d44adc62944d3240d83eefaa510b5e5de/src/muk.nim#L583 |
10:52:16 | FromDiscord | <4zv4l> a library ? |
10:52:33 | FromDiscord | <enthus1ast> its a little like curses |
10:52:46 | FromDiscord | <enthus1ast> https://github.com/johnnovak/illwill |
10:53:14 | FromDiscord | <enthus1ast> the code i linked above, tries to detect a terminal resize, and reprints the whole tui |
10:53:23 | FromDiscord | <4zv4l> oh yeah right↵I didn't plan to do something with curses↵I mean sure it would be like `tty-clock` but I wanted to do something simple xD |
10:54:09 | FromDiscord | <enthus1ast> yeah illwill is quite simple |
10:54:14 | FromDiscord | <4zv4l> In reply to @enthus1ast "https://github.com/johnnovak/illwill": actually I used it for another project, really nice lib |
10:55:30 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4lPc |
10:55:39 | FromDiscord | <4zv4l> because even if I call `defer: deinitIwill()` |
10:55:51 | FromDiscord | <4zv4l> if the guy hit `ctrl-c` or a kill signal or whatever |
10:55:56 | FromDiscord | <4zv4l> the cursor will be hidden |
10:56:20 | FromDiscord | <enthus1ast> yes i think you should put this in the ctrl-c handler |
10:56:53 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29 |
10:59:16 | FromDiscord | <enthus1ast> i'm not a terminal expert, but it could be that some terminal (in some modes) clear the screen by scrolling up (or emitting newlines) |
10:59:34 | FromDiscord | <enthus1ast> noticed this myself aswell |
11:04:18 | FromDiscord | <Phil> Its kinda annoying I currently can't build my project because ndb isn't useable with nim 2.0 =/ |
11:04:47 | FromDiscord | <Phil> And I can't figure out how to "go back" to a nim 1.7 version |
11:04:53 | FromDiscord | <Phil> (edit) "And I can't figure out how to "go back" to a nim 1.7 version ... " added "before the db_connector split" |
11:05:22 | FromDiscord | <enthus1ast> can you choosenim the correct version? |
11:06:11 | FromDiscord | <Phil> Nah because they're both devel versions and I can't go `choosenim 1.7.3` |
11:06:39 | FromDiscord | <enthus1ast> mh then check out the correct version and build it yourself |
11:06:45 | FromDiscord | <Phil> Can't use 1.6.10 because my project needs various fixes to the std lib that are only on devel.↵Can't use the most recent devel because 1.9 broke 2 of my dependencies |
11:08:45 | FromDiscord | <Phil> That's more knowledge limited on my end than anything else. ↵Aka the good old "how" question.↵I guess I can take a look at the compiler docs and hope I understand anything |
11:09:39 | FromDiscord | <enthus1ast> afaik you can use koch boot |
11:12:36 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/koch.html#commands-boot-command |
11:12:48 | FromDiscord | <Phil> I mean, it's basically ↵step 1) Figure out the commit hash of some commit that was valid before 1.7↵step 2) Figure out how to use koch to build the compiler from that hash |
11:12:55 | FromDiscord | <Phil> Sadly devel versions aren't tagged |
11:13:30 | FromDiscord | <enthus1ast> yeah annoying, one reason i stay on stable or even old stable.... |
11:14:11 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
11:14:27 | FromDiscord | <Phil> but then stable is missing so many important fixes |
11:14:47 | FromDiscord | <Phil> Its just uuuuggh until we get a decent nim 2.0 release and the libraries catch up |
11:14:57 | FromDiscord | <enthus1ast> maybe you can fix the issues in your dependencies? |
11:16:32 | FromDiscord | <Phil> I already have, but I also test my shit in CI/CD pipelines so it doesn't just work locally.↵And the PR for the fix on ndb is open since yesterday, after that it should solely be a matter of norm updating its ndb dependency and I'm good |
11:17:17 | FromDiscord | <enthus1ast> you could do a branch where you temporarly change the nimble dependencies on your fork |
11:17:22 | FromDiscord | <Phil> I guess I'm just somewhat frustrated because I finally have some spare time on my hands and my hands are basically tied behind my back unless I start dealing with building the compiler myself for an older devel version |
11:18:08 | FromDiscord | <Phil> Can you actually have nim requires clauses that point to a specific github repo instead of a published nimble package? |
11:18:18 | FromDiscord | <enthus1ast> yes |
11:18:24 | FromDiscord | <enthus1ast> you can put the whole url |
11:18:49 | FromDiscord | <enthus1ast> AAAND you can even pinpoint to a branch, but this i always must google \:) |
11:19:07 | FromDiscord | <enthus1ast> `url@#yourbranch` or similar |
11:20:02 | FromDiscord | <enthus1ast> if i recall correctly the syntax is a little different than on the commandline |
11:20:45 | FromDiscord | <Phil> Okay, so ↵step 1, make an ndb fork with an update custom ndb dependency... well I have that already, it's what I use for the current PR↵step 2, make a norm fork and update it to use the ndb fork↵step 3, use the norm fork instead of the real norm package |
11:21:00 | FromDiscord | <enthus1ast> yes |
11:24:14 | * | ltriant joined #nim |
11:45:10 | FromDiscord | <Try2Cry> In reply to @Isofruit "Define "some modified"": I meant some modification ↵And that was referring for the modification '''dont you think if nim got these modification that will end up with good impact on nim matket''' |
11:46:13 | FromDiscord | <enthus1ast> this discussion again? \:D |
11:46:30 | FromDiscord | <enthus1ast> do x then nim would be better recognized |
11:46:31 | FromDiscord | <Phil> You mean some kind of lib that makes react/react-native useable in nim? |
11:46:57 | FromDiscord | <Try2Cry> Yes |
11:46:58 | FromDiscord | <enthus1ast> last time it was gui |
11:47:19 | FromDiscord | <enthus1ast> the thing is someone must do it |
11:47:20 | FromDiscord | <Try2Cry> What last time ?🤔 |
11:47:23 | FromDiscord | <enthus1ast> must do it properly |
11:47:38 | FromDiscord | <enthus1ast> we had this discussion various times already↵(@Try2Cry) |
11:47:43 | FromDiscord | <Phil> It might, but it also might not. Either way I personally am not interested in writing a JS framework so 🤷 |
11:48:18 | FromDiscord | <Try2Cry> I mean while we can already compile it down to js so why do we even need a lib ? |
11:48:30 | FromDiscord | <Phil> It's the good old matter of "who writes it?".↵Because I'm writing for fun and myself, such a lib doesn't seem fun to me |
11:48:55 | FromDiscord | <Try2Cry> In reply to @enthus1ast "we had this discussion": Was i exist in that conversation 😅 |
11:48:56 | FromDiscord | <Phil> You'd need to ask that people that actually use the JS backend, I mostly use nim for the backend and Angular for the frontend |
11:49:08 | FromDiscord | <Phil> In reply to @Try2Cry "Was i exist in": Nah, was a different convo with a different person |
11:49:16 | FromDiscord | <Try2Cry> Why not to make a topics so if anyone have the same question so he can read it |
11:49:37 | FromDiscord | <enthus1ast> this idk, but the thing is, someone must write it (and do it properly) and someone must support it for various years to come↵(@Try2Cry) |
11:49:47 | FromDiscord | <Phil> But the topic was the same, "Why don't you have bindings for this lib/these frameworks".↵Well, because nobody made them yet, nobody is getting paid to make them and the rest doesn't find it fun to make them. |
11:49:48 | FromDiscord | <enthus1ast> and people have other interests as far as i can see |
11:50:29 | FromDiscord | <enthus1ast> and i can also imagine that this is a fast moving target |
11:50:43 | FromDiscord | <enthus1ast> when even js libs cannot keep up with other js libs |
11:50:47 | FromDiscord | <Phil> any JS framework would be a fast moving target |
11:50:57 | FromDiscord | <enthus1ast> yes |
11:51:21 | FromDiscord | <Try2Cry> In reply to @Isofruit "But the topic was": Is there a tutorial in how to make such a binding ? |
11:51:41 | FromDiscord | <Phil> My workplace is investing hundreds of thousands into developers each month for a webpage and even they only barely manage to get somewhat up to date on the angular half-year-per-version cycle |
11:52:13 | FromDiscord | <Phil> "investing" as in "paying salary to" |
11:52:44 | FromDiscord | <Phil> In reply to @Try2Cry "Is there a tutorial": You'd need to ask folks actually using the JS backend, @hotdog maybe since I recall him using karax (?) |
11:52:46 | FromDiscord | <Try2Cry> Hmmm yes it's a fast moving target but worth a try i can bit if it's done or even started there will be alot of interested ppl |
11:53:30 | FromDiscord | <Phil> I can tell you how to set up a backend webserver any day of the week, when it comes to JS backend or C bindings I'm out |
11:54:05 | FromDiscord | <Try2Cry> In reply to @Isofruit "My workplace is investing": Same goes here still in django 2.2 and react 1 year old i think ↵Ionic was 2 years old and we had problems in many projects |
11:55:06 | FromDiscord | <enthus1ast> and the other thing is, people want to write nim |
11:55:08 | FromDiscord | <Phil> `/home/philipp/.nimble/pkgs2/ndb-0.19.9-8227e7d747c90b21c282c4db64a3464aa356b31f/ndb/sqlite.nim(528, 29) Error: expression 'connection' has no type (or is ambiguous)`↵What the flying fish flipper |
11:55:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPo |
11:57:56 | FromDiscord | <Phil> God damnit, why does this have to be harder than just "change imports" |
12:03:41 | * | jkl quit (Quit: Gone.) |
12:05:15 | * | jkl joined #nim |
12:07:30 | FromDiscord | <Phil> What exactly is `RootEffect`? |
12:08:50 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/system.html#RootEffect |
12:11:29 | FromDiscord | <Phil> Okay, wth, did the move to db_connector also fundamentally change the contents of db_common or sth? |
12:13:05 | FromDiscord | <keks> Is there an equivalent in Nim of doing assignment of multiple variables at once, like in Python? This is useful for a swap function: `x, y = y, x`. |
12:13:46 | FromDiscord | <enthus1ast> there is swap |
12:13:46 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/system.html#swap%2CT%2CT |
12:18:26 | FromDiscord | <keks> I apologise - missed that in the search, thanks! |
12:18:46 | FromDiscord | <enthus1ast> let (a, b) = ("foo", "baa") |
12:20:11 | Amun-Ra | or: (a, b) = (b, a) |
12:24:45 | FromDiscord | <keks> right, I didn't try the parentheses |
12:30:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPD |
12:31:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPE |
12:32:05 | FromDiscord | <Phil> This all works flawlessly under 1.6.10 |
12:39:34 | * | sagax quit (Ping timeout: 268 seconds) |
12:42:20 | FromDiscord | <Phil> How do I show all symbols a module expports, I want to stare at this damn module and what it gives or not gives me |
12:42:59 | FromDiscord | <Phil> (edit) "expports," => "exports," |
12:43:01 | FromDiscord | <enthus1ast> maybe nim doc |
12:44:35 | FromDiscord | <Phil> I'm about this close to just go with the plan of compiling a 1.7, never moving to nim 2.0 and just fuck ndb alltogether, what the hell is this module, how does it not have types that db_common clearly exports, grrrrr |
12:44:45 | FromDiscord | <Phil> (edit) "1.7," => "1.7 compiler," |
12:45:17 | FromDiscord | <enthus1ast> was ndb not quite "abadonned" ? |
12:45:31 | FromDiscord | <Phil> It is, but norm uses it |
12:45:50 | FromDiscord | <enthus1ast> mh yeah |
12:45:55 | FromDiscord | <Phil> moigagoo has been contemplating a fork but god damn even then just trying to move this to 2.0 is a GIGANTIC pain in myass |
12:46:57 | FromDiscord | <ringabout> What's your Nim version and its compilation date? |
12:47:22 | FromDiscord | <Phil> jadghksfjldhglfjkdhgsfdüpskgfhägshkäfgf |
12:47:35 | FromDiscord | <Phil> It was because the damn dependency was missing in the effing nimble file |
12:47:39 | FromDiscord | <enthus1ast> cat on keyboard? |
12:47:41 | FromDiscord | <enthus1ast> \:) |
12:48:03 | FromDiscord | <Phil> Face roll of frustration over keyboard |
12:48:19 | FromDiscord | <Phil> a Frof if you will |
12:50:25 | FromDiscord | <Phil> Okay, I can compile the docs for the ndb package on 1.9.1 now, I take that as a sign it works there |
12:50:37 | FromDiscord | <Phil> Now to see if I can get norm to the point of compatibility |
12:55:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPL |
12:55:17 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4lPL" => "https://play.nim-lang.org/#ix=4lPM" |
12:55:59 | FromDiscord | <enthus1ast> should also start to test my stuff on nim v2 |
12:56:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPN |
12:56:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPO |
12:57:10 | FromDiscord | <enthus1ast> never used the effect system before so no clue |
12:58:02 | FromDiscord | <Phil> @ringabout Do you know anything about the effects system? The above feels like a bad thing, because it reminds of doing a try-catch with a base-exception class, effectively catching all Exceptions ever, which is generally an anti-pattern |
13:05:42 | FromDiscord | <ringabout> In reply to @Isofruit "<@658563905425244160> Do you know": I rarely use effect tracking system. Perhaps it is caused by stricteffects. What about using `--legacy:laxEffect`? |
13:07:11 | FromDiscord | <ringabout> I'm on the phone so I cannot look up the exact name of the legacy feature, something like laxEffect. |
13:07:21 | FromDiscord | <Phil> Check, I'll try one min |
13:13:27 | FromDiscord | <Phil> In reply to @ringabout "I rarely use effect": Didn't change the outcome.↵I ran:↵` exec "nimble doc --outdir:docs/apidocs --legacy:laxEffect --project --index:on src/norm"` |
13:13:44 | * | jjido joined #nim |
13:13:51 | FromDiscord | <Phil> Its currently what I use to test if the lib works at all or not |
13:14:02 | FromDiscord | <Phil> Once that works I figure out if the tests run |
13:15:07 | FromDiscord | <ShalokShalom> Do strictEffects still have to be activated in 2.0? |
13:15:12 | FromDiscord | <ShalokShalom> Or are they default then? |
13:15:51 | FromDiscord | <Phil> In reply to @ringabout "I rarely use effect": Wait! It was `legacy:laxEffects`, I don't think it's documented anywhere, I found via github search in a commit of yours:↵https://github.com/nim-lang/Nim/commit/090661d46cefdb62ff376fd2ce316c5a052752f3 |
13:15:56 | FromDiscord | <Phil> That one works |
13:17:11 | FromDiscord | <Phil> Now I'm not sure what to do with that information.↵Should all users be required to compile with `--legacy:laxEffects` (How long will that option even exist? Is it planned to have long-term support?), or do I have to start talking with somebody that can tell me if adding `RootEffect` everywhere is the right way to go? |
13:17:21 | FromDiscord | <Phil> (edit) "Now I'm not sure what to do with that information.↵Should all users ... be" added "of norm" |
13:17:57 | FromDiscord | <ringabout> I don't know the detail. It is probably a bug of stricteffects. |
13:19:54 | FromDiscord | <ringabout> I mean laxEffects are used to identify whether the problem is caused by stricteffects. It is not a fix. |
13:20:41 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
13:24:38 | FromDiscord | <ringabout> Probably start from tagging https://github.com/xzfc/ndb.nim/blob/d942f882c63e9abebe9b2dd8fa5be597c46763b1/ndb/postgres.nim#LL371 ReadDbEffect |
13:28:04 | * | argonica quit (Ping timeout: 256 seconds) |
13:29:17 | FromDiscord | <Require Support> are queues considered cyclical ? 🤔 idk what cyclical means |
13:36:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lPW |
13:36:05 | FromDiscord | <Phil> What is "Effect" here? Like SideEffect? |
13:44:22 | FromDiscord | <hotdog> In reply to @Isofruit "You'd need to ask": Hey 👋 @Try2Cry no tutorials that I know of, but if you have trouble please write on #webdev and I will try to help later on |
13:49:20 | FromDiscord | <Phil> Ohhhh so Effects are kinda like an arbitrary "Only procs from those specific groups are allowed in here, none from any of the other groups" |
13:49:35 | FromDiscord | <Phil> (edit) "Ohhhh so Effects ... are" added "in tags" |
13:59:25 | FromDiscord | <Phil> Alrighty, so `parseDate` introduced `TimeEffect`, which comes from the standard lib. All I had to do was correctly introduce that effect to all procs that make use of it |
14:01:41 | FromDiscord | <Phil> Does anyone actually use the effects system? If so, what's your usecase? What benefit does it provide you? |
14:02:35 | FromDiscord | <Phil> This actually seems like the kind of thing that could be useful for domain driven design I guess @ShalokShalom , since you can basically define a range of "acceptable procs" within your proc by defining which effects in a proc are allowed and which aren't. |
14:02:56 | FromDiscord | <Phil> (edit) "procs"" => "topics"" | "topics"within your proc ... by" added "whose procs are allowed to be used here" |
14:03:13 | FromDiscord | <Phil> (edit) "by defining which effects in a proc are allowed and which aren't." => "within said proc." |
14:03:56 | FromDiscord | <Rika> effects system is like a more granular version of func iirc |
14:05:28 | FromDiscord | <Phil> Isn't it mostly a mechanism of "excluding" unwanted effects?↵Like, they don't really have any component of actually running code.↵It's just "If your tag pragma defines you are allowed procs with effects X and Y, then the proc that has defined the effect Z is forbidden to be used in here" |
14:05:58 | FromDiscord | <Phil> And apparently you use objects for some reason to define a tag, which I don't fully get why that one is syntactically necessary |
14:06:56 | FromDiscord | <Rika> isnt func also technically meant for excluding side effects? |
14:08:39 | FromDiscord | <Phil> kiiiiiiiiiiiiind of?↵I dunno, in my head those side-effects feel more like "this does things changes state" which doesn't seem strictly necessary to have an effect ... it's just... wait so the effects system is just used to express that and basically is capable of way more than just that? |
14:08:49 | FromDiscord | <Phil> (edit) "kiiiiiiiiiiiiind of?↵I dunno, in my head those side-effects feel more like "this does things ... changes" added "that" |
14:09:21 | FromDiscord | <Phil> That seems like a powerful mechanism that I'm still not entirely sure what to do with ^^ |
14:11:31 | FromDiscord | <Phil> Anyway, what you could basically do is add tags to procs to mark them as part of a specific "domain" and thusly control that no interference between domains for example is possible |
14:11:34 | FromDiscord | <Rika> i think nowadays its mainly abandoned though, the system |
14:11:49 | FromDiscord | <Rika> In reply to @Isofruit "Anyway, what you could": "control that no interference between domains"? |
14:12:07 | FromDiscord | <Rika> no, its meant like raises:[] but not exceptions |
14:12:15 | FromDiscord | <Rika> so basically a more granular func |
14:12:17 | FromDiscord | <Rika> iirc |
14:12:59 | FromDiscord | <Phil> Ah, so if you used it like that it would mostly be a bastardization of the system. It'd be using it, but not as intended |
14:14:06 | FromDiscord | <Rika> basically you define what effects can be in a proc and if its not there the compiler would complain, just like raises |
14:14:09 | FromDiscord | <Phil> In reply to @Rika ""control that no interference": Domains as in Domain Driven Design. Where you divide your problem into specific "domains" between which you basically have limited to absolutely no communication. And what little communication you have is just stuff like passing a message from one to the other, that's it |
14:14:35 | FromDiscord | <Phil> Which is basically OO but thought in larger units of code than individual modules/classes |
14:16:12 | FromDiscord | <Phil> In reply to @Rika "basically you define what": Which you can kinda use to say "You shouldn't use this proc, this proc shouldn't have additional effects like this" |
14:16:34 | FromDiscord | <Rika> what exactly an effect is is fuzzy to me |
14:16:37 | FromDiscord | <Phil> But eh, I'm semi iffy on DDD either way not like I'm going to actually use it like that. |
14:16:56 | FromDiscord | <Phil> In reply to @Rika "what exactly an effect": TBH given what I've seen, an effect is pretty arbitrary. Just define an object and you can use it as effect. |
14:17:15 | FromDiscord | <Rika> yes |
14:17:16 | FromDiscord | <Phil> So far I've seen "TimeEffect" and "DbReadEffect" |
14:17:17 | FromDiscord | <Rika> i know |
14:17:22 | FromDiscord | <Rika> but the intention is what i mean |
14:17:29 | FromDiscord | <Rika> what an effect is supposed to intend, i do not know |
14:24:25 | FromDiscord | <Dexterdy> anyone here with some gintro experience? How do I make a gio.ListStore using a datatype defined by me? I can't find sufficient documentation about this. In the rust gtk bindings that is a wrapper class that inherits from GObject that allows you to put your own data in a ListStore, but I can't find anything like that, and you can't seem to be able to inherit from GObject directly yourself in the gintro library. any ideas? |
14:31:53 | * | jjido joined #nim |
14:43:59 | * | argonica joined #nim |
14:45:20 | FromDiscord | <Phil> No ginto experience on my end, sorry |
14:46:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lQb |
14:47:07 | FromDiscord | <Rika> `closure` likely |
14:47:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lQc |
14:48:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lQd |
14:49:01 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4lQd" => "https://play.nim-lang.org/#ix=4lQe" |
14:49:11 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4lQe" => "https://play.nim-lang.org/#ix=4lQf" |
14:49:13 | FromDiscord | <ringabout> Add `gcsafe`? |
14:49:38 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4lQg |
14:50:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lQh |
14:50:32 | FromDiscord | <Phil> The bigger question is: Does `{.cast(gcsafe).}` still work? |
14:50:33 | FromDiscord | <Rika> just ctrl-f SQLITE_POOL |
14:50:39 | FromDiscord | <Rika> sure it does |
14:52:14 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4lQi |
14:57:01 | FromDiscord | <ShalokShalom> sent a long message, see https://paste.rs/L3L |
14:58:19 | FromDiscord | <hdbg> How can I write term rewriting macro, which targets every line? Doing some internal things, so had to turn off stack tracing to avoid crashes. Now I wanna insert echo after every line for debugging purposes |
15:06:17 | FromDiscord | <Phil> In reply to @ShalokShalom "The ddd I mean,": More security maybe, but I did not really think it through that much |
15:06:31 | FromDiscord | <Phil> Also, yehaw, I can compile again! |
15:15:36 | * | azimut joined #nim |
15:26:08 | * | krux02 joined #nim |
15:29:37 | * | arkurious joined #nim |
15:34:50 | FromDiscord | <Phil> I'm running into `could not import: EVP_MD_size`, not sure what that is about, is this an openssl 3 issue? |
15:37:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lQu |
15:38:46 | FromDiscord | <Phil> Ugh, it got renamed with openssl 3 (https://github.com/dotnet/runtime/issues/67375#issuecomment-1084741700): ↵`EVP_MD_get_size` |
16:01:17 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
16:06:16 | FromDiscord | <Require Support> why when I add an object with a field of type `Deque` from `std/deques` I get `'myobect' not a concrete type` error |
16:10:16 | FromDiscord | <ShalokShalom> In reply to @Isofruit "More security maybe, but": Still recommend you that book 📖 |
16:10:27 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Also, yehaw, I can": 🥳 |
16:26:15 | FromDiscord | <Require Support> how come with `--stackTrace:off --stackTraceMsgs:off` message boxes still popup when errors happen 🤔 |
16:26:52 | FromDiscord | <Require Support> (edit) "how come with `--stackTrace:off --stackTraceMsgs:off` message boxes still popup when errors happen 🤔 ... " added "(in windows)" |
16:27:08 | FromDiscord | <Require Support> (edit) "how come ... with`-d:danger" added "building" | "`--stackTrace:off" => "`-d:danger --stackTrace:off" |
16:51:30 | * | jjido joined #nim |
17:11:52 | * | termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
17:13:04 | * | termer joined #nim |
17:35:50 | * | termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
17:39:32 | * | termer joined #nim |
18:10:18 | FromDiscord | <ShalokShalom> @Phil didn't you look for a debugger lately?↵↵https://github.com/epasveer/seer |
18:18:12 | * | nmz left #nim (Ploop) |
19:08:40 | * | Guest38 joined #nim |
19:09:50 | * | Guest38 quit (Client Quit) |
19:13:16 | * | krux02 quit (Remote host closed the connection) |
19:25:20 | FromDiscord | <Leftbones> FINALLY figured out how to get non-blocking input including special characters on both Windows and Unix |
19:25:37 | FromDiscord | <Leftbones> By reading and learning how Illwill and Snip do it, basically |
19:26:16 | FromDiscord | <Leftbones> Is it normal that `stdout.write` seems to act slightly different on different platforms? |
19:27:11 | FromDiscord | <michaelb.eth> Are you sure it’s not the terminal behavior that is different? |
19:29:31 | FromDiscord | <michaelb.eth> In reply to @Leftbones "FINALLY figured out how": As a fun test to check if it’s working correctly, try copy/pasting many KB of emoji mixed with other text |
19:32:14 | FromDiscord | <Leftbones> In reply to @michaelb.eth "As a fun test": Oh god I hadn't even considered unicode and emojis yet |
19:32:44 | FromDiscord | <Leftbones> In reply to @michaelb.eth "Are you sure it’s": I suppose it could be, now that you mention it. I've been testing using Windows Terminal on my PC, but using vscode's terminal on Mac. Though I do get the same behaviour in iTerm2 on mac. |
19:34:28 | FromDiscord | <michaelb.eth> Maybe also try in Kitty and Alacritty on macOS |
19:35:17 | FromDiscord | <Leftbones> sent a code paste, see https://play.nim-lang.org/#ix=4lRn |
19:36:11 | FromDiscord | <Leftbones> Full code is here https://github.com/leftbones/nancy |
19:38:28 | FromDiscord | <Leftbones> I haven't really looked too far into it yet but I don't yet understand why `stdout.write` and `echo` would work differently depending platform, I suppose it could have to do with the generated C code? |
19:38:37 | FromDiscord | <Leftbones> In reply to @michaelb.eth "Maybe also try in": I'll try this too |
19:41:46 | FromDiscord | <Ntsékees> Hello, I'm new to Nim.↵Which way would you recommend me to convert a HashSet into a Sequence? |
19:42:00 | FromDiscord | <Ntsékees> (which implies imparting an arbitrary ordering) |
19:42:25 | FromDiscord | <Ntsékees> (the ordering doesn't matter to me) |
19:44:28 | rockcavera | Ntsékees sequtils |
19:44:35 | FromDiscord | <Phil> Generally, import sequtils and use `toSeq` |
19:45:10 | FromDiscord | <Leftbones> Gotta say after a week in Nim, I'm loving all the various 'utils' packages (libraries? modules?) available |
19:45:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lRr |
19:45:30 | FromDiscord | <Ntsékees> Ah, I had found about `@` but it didn't support the Set type. I'll check out `toSeq`. |
19:45:55 | FromDiscord | <Phil> In reply to @Ntsékees "Ah, I had found": @ generally is for instantiating sequences, so for `let x: seq[int] = @[]` |
19:47:14 | FromDiscord | <Phil> If you want a shorthand for instantiating sets though, I honestly don't really know. I know `{}` works to instantiate a set based on nim-magic (so not based on a type from std/sets), but I'm not aware if that also works for Hashsets, never tried |
19:47:49 | FromDiscord | <Phil> In reply to @Ntsékees "Ah, I had found": As an aside, since I don't know if you're already aware of this:↵For quick prototyping a couple loc's or the like nim has a "repl-like"-piece of software called inim |
19:48:36 | FromDiscord | <huantian> if you want a "hashset literal", use `[1, 3, 4, 6].toHashSet()` |
19:48:42 | FromDiscord | <huantian> `{}` constructs a `set` |
19:48:53 | FromDiscord | <Phil> Helps with checking quickly if a particular syntax actually works or not. I also have a separate "playground" project for checking larger ideas and debugging larger code snippets, but for anything below 5 loc I tend to fire up inim real quick |
19:49:41 | FromDiscord | <Ntsékees> In reply to @Isofruit "As an aside, since": Ah, I didn't know about `inim`. I had web-searched “Nim REPL” but didn't find much (well, I found https://replit.com/languages/nim but I haven't tested it yet) |
19:50:09 | FromDiscord | <Phil> In reply to @Ntsékees "Ah, I didn't know": There's also "nim-secret", which is the VM that nim uses to evaluate macros and compile-time code etc. |
19:50:34 | FromDiscord | <Phil> It has like 80% of nim's capabilities, but various things like std/os and some other procs demanding interacting with the environment can't run in it |
19:51:05 | FromDiscord | <Phil> inim works around that by not actually being a repl, it secretly writes a file line by line and compiles it and prints the output.↵Not going to matter 99% of the time, just an interesting tidbit |
19:52:40 | FromDiscord | <Leftbones> In reply to @Isofruit "As an aside, since": Well this is just excellent. I was using repl.it for quick things, haha. |
19:53:02 | FromDiscord | <huantian> personally I just use `play.nim-lang.org` for prototyping lol |
19:53:08 | FromDiscord | <Phil> Happy to spam my intermediate knowledge here any day |
19:53:16 | FromDiscord | <Phil> play.nim-lang.org is really nice if you want to actually share your stuff |
19:53:29 | FromDiscord | <Phil> For troubleshooting in this chat |
19:53:52 | FromDiscord | <Phil> The tile it needs to output the compile results are too long for me to consider using it when I just want to check something for myself |
19:53:57 | FromDiscord | <Phil> (edit) "tile" => "time" |
19:54:50 | * | chmod222 joined #nim |
19:55:15 | FromDiscord | <Phil> In reply to @Leftbones "Gotta say after a": You mean the ones that basically give you new language constructs nim doesn't have by default? |
19:55:31 | FromDiscord | <Leftbones> Essentially |
19:55:45 | FromDiscord | <Leftbones> I like `strutils` |
19:55:55 | FromDiscord | <Phil> Yeh, that's pretty much one of nim's strengths.↵You can write stuff like custom context managers yourself pretty trivially |
19:55:57 | FromDiscord | <Leftbones> Like I said I've only been in Nim for a week so I'm still discovering a lot of stuff |
19:56:04 | FromDiscord | <Phil> Ohhh strutils I wouldn't say counts for that 😛 |
19:56:10 | FromDiscord | <Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lRv |
19:56:24 | FromDiscord | <Ntsékees> > Error: 'toHashSet' doesn't have a concrete type, due to unspecified generic parameters. |
19:56:27 | FromDiscord | <Phil> In reply to @Ntsékees "Something I didn't manage": Generic functions don't actually exist |
19:56:54 | FromDiscord | <Phil> They are blueprints for the compiler to copy around when it gets an explicit type for them at the site where the generic blueprint is used |
19:57:13 | FromDiscord | <Phil> Its a very elaborate "Control + C" command for the compiler |
19:57:58 | FromDiscord | <Phil> ~~It's also the reason why mocking generic procs is a complicated undertaking that I can only imagine folks like Elegantbeef could manage should they get the passion to want to do so, I tried that and failed~~ |
19:58:48 | FromDiscord | <Phil> So if you want to assign that proc, you need to "properly" instantiate it by providing nim with concrete types, basically nailing down that this proc is one for creating e.q. a hashet for strings or the like |
19:59:13 | FromDiscord | <huantian> you could also just deifne your own proc that calls toHashSet |
19:59:31 | FromDiscord | <huantian> ~~though please don't rename `toHashSet` to `toS` that'll just make your code more unclear~~ |
19:59:39 | FromDiscord | <Phil> Yeah, that solves the problem... maybe I should orient myself more towards looking for ways to solve the problem than explaining why they exist ^^' |
19:59:56 | FromDiscord | <Ntsékees> sent a code paste, see https://paste.rs/Cb8 |
20:00:03 | FromDiscord | <Ntsékees> but it's wordy |
20:00:04 | FromDiscord | <Ntsékees> (edit) "https://play.nim-lang.org/#ix=4lRz" => "https://play.nim-lang.org/#ix=4lRA" |
20:00:05 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
20:00:17 | FromDiscord | <Phil> Yeah, because toS is also a blueprint. It doesn't exist, it only exists once it gets used and copied into a "useable" form |
20:00:18 | FromDiscord | <Ntsékees> (edit) "https://play.nim-lang.org/#ix=4lRA" => "https://play.nim-lang.org/#ix=4lRB" |
20:00:29 | FromDiscord | <Phil> (edit) "Yeah, because toS is also a blueprint. It doesn't exist, it only exists once it gets used and copied into a "useable" form ... " added "with explicit types" |
20:00:50 | FromDiscord | <huantian> In reply to @Ntsékees "but it's wordy": It's mostly fine though, you won't be aliasing procs to other names often |
20:01:07 | FromDiscord | <Leftbones> In reply to @michaelb.eth "Maybe also try in": Tried now, it's definitely not the terminal, it's the platform |
20:01:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lRC |
20:01:40 | FromDiscord | <Leftbones> It's probably... fine? There doesn't seem to be a difference between `stdout.write` and `echo` at least in the way I'm using them, so I guess it's fine |
20:02:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4lRD |
20:03:21 | FromDiscord | <Phil> Some symbols are mostly taken by nim convention for the most part, $ is universally for "toString", % is universally for "toJson" for example |
20:05:45 | FromDiscord | <Ntsékees> Thanks for the help. |
20:06:15 | FromDiscord | <Phil> Oh and @ is for instantiating seq |
20:06:25 | FromDiscord | <Phil> % likely is modulo... hmmm whta's free |
20:06:32 | FromDiscord | <Phil> (edit) "whta's" => "what's" |
20:06:52 | FromDiscord | <huantian> In reply to @Isofruit "Oh and @ is": technically @ converts arrays to seqs |
20:07:29 | FromDiscord | <Phil> Oh hey, `?` is free |
20:07:36 | FromDiscord | <Phil> And of course 2-symbol combinations are as well |
20:07:39 | FromDiscord | <michaelb.eth> In reply to @Leftbones "It's probably... fine? There": So, I don't want to discourage you in any way, it's really good to experiment to learn how things work. That being said, terminals are tricky things, which is why historically and currently people put a lot of effort into software libraries such as ncurses (old and venerable) and notcurses (much newer), and there are many others as well for various languages, the point of which |
20:08:06 | FromDiscord | <Phil> (edit) "And of course 2-symbol combinations are as well ... " added "(not always but a lot of them aren't in use)" |
20:08:28 | FromDiscord | <michaelb.eth> Depending on your goals, you might consider using e.g. a Nim wrapper for ncurses |
20:08:52 | FromDiscord | <Phil> In reply to @huantian "technically @ converts arrays": I feel like you basically can't be wrong if you just associate @ with "a seq will get created in the process of this statement" |
20:11:16 | FromDiscord | <Leftbones> In reply to @michaelb.eth "So, I don't want": Honestly, I'm not really trying to do anything crazy. I'm just writing a nice wrapper around using ANSI escape codes, basically. Terminals are tricky, you're 100% correct.↵↵I was just going to implement true color support into Illwill and make a PR, but I ended up doing this instead. |
20:12:23 | * | argonica quit (Remote host closed the connection) |
20:12:40 | * | argonica joined #nim |
20:13:09 | FromDiscord | <Leftbones> I've used ncurses quite a bit myself, and as much as I am comfortable with it, I don't love the idea that we've been stuck with the same TUI library since the 90s just because "terminals are tricky" |
20:13:54 | FromDiscord | <pyolyokh> we haven't been, but slang died off |
20:14:30 | FromDiscord | <Leftbones> Plus, I'm a hobby programmer. I don't get paid to write code, I only do it for fun, and to learn. I'd like to know more about the inner workings of terminals, and this is a fun way to do it. |
20:14:52 | FromDiscord | <pyolyokh> there are lower-level libraries that know about terminal capabilities (termcap) and what codes you have to send for what feature. ncurses isn't about trickiness but efficiency: the main thing about terminals is that they are slow |
20:15:30 | FromDiscord | <Leftbones> This is true |
20:15:45 | FromDiscord | <Leftbones> Like I said though I'm just making nice ways to use escape codes, which isn't really slow by any means |
20:15:59 | FromDiscord | <Leftbones> My main gripe with curses is the way it handles color, which I despise |
20:16:22 | FromDiscord | <Leftbones> To the point where I wrote a whole-ass system around making the color system more usable in Python for a previous project of mine lol |
20:16:24 | FromDiscord | <michaelb.eth> slow, relatively, sure, but modern terminal can be made to do some crazy visual stuff that to human eyes isn't particularly slow feeling/looking |
20:16:39 | FromDiscord | <michaelb.eth> (edit) "terminal" => "terminals" | removed "" |
20:17:05 | FromDiscord | <michaelb.eth> e.g. https://www.youtube.com/watch?v=dcjkezf1ARY |
20:17:30 | FromDiscord | <michaelb.eth> demo in terminals starts about 0:15 |
20:19:12 | FromDiscord | <Leftbones> I've actually never used notcurses, I remember looking at it for Python stuff before I learned ncurses and deciding to go with ncurses instead for whatever reason |
20:25:10 | FromDiscord | <pyolyokh> sent a long message, see https://paste.rs/M2o |
20:26:44 | FromDiscord | <Leftbones> My only experience with anything curses is ncurses in Python, and I was happy to learn that it supported color, and then sad and confused to see how it supported color |
20:27:03 | FromDiscord | <michaelb.eth> The python bindings for notcurses were (and still are, I think) a bit of a mess; there were two different sets of bindings, one done by the notcurses' author and another by a contributor. I remember seeing bug reports that neither was fully working, but maybe that's been remedied. |
20:28:22 | FromDiscord | <Leftbones> I'm watching a vide of the creator talking about notcurses |
20:28:32 | FromDiscord | <Leftbones> I find it a bit odd that I can't seem to find ANY examples of it by doing basic searches |
20:28:57 | FromDiscord | <michaelb.eth> well it hasn't been around very long (only a few years) and isn't super well known |
20:28:58 | FromDiscord | <michaelb.eth> so... |
20:29:33 | FromDiscord | <pyolyokh> what are you searching? <https://github.com/search?q=notcurses> |
20:29:57 | FromDiscord | <Leftbones> Just googling "notcurses examples" |
20:29:59 | FromDiscord | <Leftbones> I found one example in Zig |
20:30:09 | FromDiscord | <michaelb.eth> https://github.com/dankamongmen/notcurses/tree/master/src/demo |
20:30:41 | FromDiscord | <michaelb.eth> more basic examples are in https://github.com/dankamongmen/notcurses/tree/master/src/poc |
20:32:18 | FromDiscord | <Leftbones> Ah nice, thanks |
20:32:53 | FromDiscord | <Leftbones> Maybe I'll look into it someday. I'm definitely not super interested in writing any substantial amount of C these days though, so it'd probably be Python or some other wrapper of notcurses. |
20:35:25 | * | genpaku quit (Remote host closed the connection) |
20:39:29 | * | genpaku joined #nim |
21:02:31 | FromDiscord | <Verdagon> hey all! fellow language dev here, i'm going to be writing an article soon about the next generation of languages and their memory safety approaches |
21:03:38 | FromDiscord | <Verdagon> ive had the (possibly incorrect) impression that nim isn't as much focused on memory management/safety innovations, and mostly is innovating in developer experience, making a stellar ergonomic language |
21:04:31 | FromDiscord | <Elegantbeef> It does allow fine control of memory, and does have multiple safety features, though many are experimental |
21:04:33 | FromDiscord | <Verdagon> ORC _appears_ to be reference counting with a cycle collector, which appears in some other languages (python), so i wonder if theres some interesting details in there that make ORC really shine |
21:04:50 | FromDiscord | <Verdagon> im also revisiting my impression from re-reading up on destructors, =sink, and so on |
21:04:58 | FromDiscord | <Phil> I mean, what counts as focused?↵You have ORC/ARC, refc, no memory management at all, you have move semantics for easier memory control and I'm pretty sure I'm forgetting an option |
21:05:01 | FromDiscord | <Verdagon> i would love to know what yall's favorite innovations are from nim, so i could include them in my article =) |
21:05:09 | FromDiscord | <Verdagon> (edit) "i would love to know what yall's favorite ... innovations" added "memory-related" |
21:05:34 | FromDiscord | <Elegantbeef> The interesting detail is that it's deterministic for non cycles, so you get RAII style memory management for most types, but cycles free still |
21:05:55 | FromDiscord | <Phil> TBH, combining ORC and enabling me to do memory optimization and dealing with it when I want to / when it actually matters for performance |
21:06:05 | FromDiscord | <Verdagon> In reply to @Elegantbeef "The interesting detail is": thats a really interesting angle, especially since im a big fan of deterministic destruction and destructors in general |
21:06:09 | FromDiscord | <Phil> 99% of the times the performance differences to me do not matter |
21:06:10 | FromDiscord | <Verdagon> do people make use of that in practice, with nim? |
21:06:14 | FromDiscord | <Pájaro.rs> Hi 👋 |
21:06:33 | FromDiscord | <Elegantbeef> If you use Orc your use that in practice |
21:06:40 | FromDiscord | <Elegantbeef> you use that\ |
21:07:04 | FromDiscord | <Phil> Orc is the upcoming default in nim2.0 and has been decently useable since... well I've been using it for a year now consistently |
21:07:15 | FromDiscord | <pyolyokh> ergonomic advantages are retrospective, from people looking at zig and rust and noticing that Nim has better ergonomics. I wouldn't call it a focus. There are too many idiosyncratic limitations for that. |
21:07:17 | FromDiscord | <Phil> Not sure how old it is |
21:07:29 | FromDiscord | <Verdagon> in your opinion, whats the best example of nim code that makes use of these custom destructors? (by default, ill probably look at the file-closing code, thats usually a good example of this kind of thing) |
21:08:00 | FromDiscord | <Elegantbeef> Using it for CFFI is nice |
21:08:12 | FromDiscord | <pyolyokh> In reply to @Verdagon "ORC _appears_ to be": You should say "in some other languages (lobster)" here, because the innovation you noted it has is very similar to arc. |
21:08:48 | FromDiscord | <michaelb.eth> might be good to point out that while `arc`/`orc` are available today, they're still not the default (`refc` is still the default), so I think the long-term impact on the language and its users will start to be seen after Nim 2.0 is released |
21:08:51 | FromDiscord | <Verdagon> iirc, lobster uses borrow-checker-like static analysis under the hood, what kinds of static analysis does nim use? |
21:09:01 | FromDiscord | <pyolyokh> In reply to @Verdagon "iirc, lobster uses borrow-checker-like": exactly that. |
21:09:05 | FromDiscord | <Verdagon> oh wow |
21:09:09 | FromDiscord | <Verdagon> ...oh no |
21:09:18 | FromDiscord | <Verdagon> now i feel bad for mentioning lobster every other article and not nim |
21:09:39 | FromDiscord | <Verdagon> ive been looking for reasons to promote nim hahah |
21:09:41 | FromDiscord | <pyolyokh> I noted that, but blamed nim-lang.org for only discussing Arc in blogposts |
21:09:48 | FromDiscord | <pyolyokh> Lobster has prominent documentation |
21:09:53 | FromDiscord | <auxym> to your defense it's not very well publicized. marketing is not nim's strong suit haha |
21:10:11 | FromDiscord | <auxym> (it's not even well documented) |
21:10:30 | FromDiscord | <Phil> TBH I wouldn't be able to understand that point even if it was brought up |
21:10:41 | FromDiscord | <Ntsékees> Are there already available min/max functions in the standard library or should I write mine? I don't see any in the math module. |
21:11:15 | FromDiscord | <Phil> In reply to @Ntsékees "Are there already available": There are, they're either in sequtils (since they go over iterables) or semi hidden.↵Generally for that the search bar in the nim docs is really helpful, I use it constantly |
21:11:15 | FromDiscord | <Verdagon> how big of a deal is `=sink` in practice? i think nim's the only one that does that, perhaps i could focus on that |
21:11:29 | FromDiscord | <pyolyokh> In reply to @Ntsékees "Are there already available": <https://nim-lang.org/docs/system.html#max%2CopenArray%5BT%5D> , the search box at the top left will find that |
21:11:29 | FromDiscord | <Verdagon> (edit) "`=sink`" => "`sink`" |
21:11:36 | FromDiscord | <Verdagon> (edit) "how big of a deal is `sink` in practice? i think nim's the only one that does that, perhaps i could focus on that ... " added "too" |
21:12:05 | FromDiscord | <Verdagon> also, is nim's static analysis primarily based on sink parameter inference, or a lot past that? |
21:12:24 | FromDiscord | <Phil> In reply to @Ntsékees "Are there already available": Turns out it's part of the systems lib, which you have by default |
21:12:32 | FromDiscord | <Phil> Dangit, pyolokh was faster! |
21:13:06 | FromDiscord | <Elegantbeef> Nim implicitly copies when a move cannot be done |
21:13:13 | FromDiscord | <Phil> But yeah, miniexample:↵`max([1,2,3,4,2,412])` |
21:13:38 | FromDiscord | <Phil> or if you wish:↵`[1,2,3,4,5,6,41234].max` |
21:14:52 | FromDiscord | <ShalokShalom> In reply to @Verdagon "ORC _appears_ to be": @Verdagon this may help↵↵https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html |
21:17:38 | FromDiscord | <Verdagon> its a great introduction, but its hard to find what really makes ORC special in that particular article |
21:18:19 | FromDiscord | <Verdagon> id love to be able to cite something that says nim uses static analysis to drastically eliminate RC ops |
21:18:32 | FromDiscord | <pyolyokh> In reply to @Verdagon "how big of a": it just lets you avoid the `=destroy`+`copyMem` that the compiler would insert in the alternate case, |
21:18:37 | FromDiscord | <Elegantbeef> It only uses RC ops on reference types |
21:19:02 | FromDiscord | <Verdagon> i also found this which will be a great quote:↵> The reference counting operations (= "RC ops") do not use atomic instructions and do not have to -- instead entire subgraphs are moved between threads.↵this puts it _way_ ahead of existing RC languages |
21:19:28 | FromDiscord | <michaelb.eth> @Verdagon maybe there's interesting/helpful info https://nim-lang.org/docs/destructors.html |
21:19:32 | FromDiscord | <pyolyokh> In reply to @Verdagon "id love to be": <https://nim-lang.org/blog/2020/12/08/introducing-orc.html> is the closest that I've found off-hand. |
21:19:44 | FromDiscord | <michaelb.eth> (edit) "@Verdagon maybe there's interesting/helpful info ... https://nim-lang.org/docs/destructors.html" added "in" |
21:19:57 | FromDiscord | <Phil> Yeh I'll check out of the discussion because at that point my knowledge is exhausted thrice over 😄 |
21:20:55 | FromDiscord | <pyolyokh> if you talk to Araq directly I'm sure he'll have something better. I've heard lines like "if 80% of RC is optimized out, is it really reference counting?" |
21:21:15 | FromDiscord | <Verdagon> In reply to @pyolyokh "<https://nim-lang.org/blog/2020/12/08/introducing-o": this is _perfect_! |
21:21:21 | FromDiscord | <Verdagon> this is exactly the kind of thing i was looking for |
21:24:16 | FromDiscord | <Verdagon> In reply to @pyolyokh "if you talk to": is there a benchmark or something i can cite, with the 80% figure? |
21:24:31 | FromDiscord | <Verdagon> oh wait, nevermind, its further down that same page |
21:25:07 | FromDiscord | <Elegantbeef> One thing that can arguably be great, is like I said move semantics in Nim do not get in your way, so if something was supposed to be moved it is copied implicitly not bugging the programmer with "Error\: X was supposed to be moved but is reused at line Y" |
21:25:46 | FromDiscord | <Elegantbeef> Copying can be disabled on a type basis, or you can enable a hint for this implicit copy so it's not a big problem if you know what you're doing |
21:26:15 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4lS7 |
21:26:38 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/4lS7" => "http://ix.io/4lS8" |
21:27:25 | FromDiscord | <michaelb.eth> so instead you need to do deep copies and take an immutable message passing approach |
21:27:26 | FromDiscord | <Verdagon> might be a nonsense question but: is there a way to mimic something like a mutex in a shared-nothing heap with just isolated subgraphs and channels? |
21:28:10 | FromDiscord | <michaelb.eth> (edit) "do" => "make" | "take" => "use" |
21:29:58 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/threading/blob/master/threading/channels.nim located here |
21:30:13 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/244 explains the isolated idea |
21:30:47 | FromDiscord | <michaelb.eth> I don't think my understanding is strong enough to be able to answer your question. But, with ARC/ORC, if my basic understanding is correct, there's just one heap so hopefully it will some things simpler. |
21:31:00 | FromDiscord | <Verdagon> got it, many thanks |
21:31:00 | FromDiscord | <Elegantbeef> It is generally simpler |
21:31:05 | FromDiscord | <michaelb.eth> (edit) "I don't think my understanding is strong enough to be able to answer your question. But, with ARC/ORC, if my basic understanding is correct, there's just one heap so hopefully it will ... some" added "make" |
21:31:15 | FromDiscord | <Verdagon> i think i have enough to write my article promoting nim and other new languages' memory approaches 😃 |
21:31:20 | FromDiscord | <Elegantbeef> There is still a complex issue with aliasing GC'd types |
21:31:36 | FromDiscord | <Verdagon> ill post a draft here and send it to araq before i publish, in case theres corrections or more things i can include in it |
21:31:36 | FromDiscord | <Elegantbeef> I say complex but it's resolved with one `{.cursor.}` |
21:39:21 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4lSb |
21:39:46 | FromDiscord | <ShalokShalom> I think Nim is a great showcase, since it has deep Oberon, and by that Pascal and Modula roots in it. |
21:42:00 | FromDiscord | <Verdagon> In reply to @ShalokShalom "<@337101146017497109> tbh, I always": thats a pretty good point |
21:42:24 | FromDiscord | <ted__> sent a code paste, see https://play.nim-lang.org/#ix=4lSd |
21:42:26 | FromDiscord | <Verdagon> mind if i DM you a draft when its done and you can tell me if any of the features seem familiar from past languages? |
21:42:37 | FromDiscord | <ShalokShalom> I am happy 😊 |
21:42:43 | FromDiscord | <Verdagon> thanks 😃 |
21:43:41 | FromDiscord | <Elegantbeef> Ted `[^1]` |
21:43:42 | FromDiscord | <ShalokShalom> Do you know Pharo? |
21:43:53 | FromDiscord | <Verdagon> nope, heard the name once or twice but thats all |
21:43:56 | FromDiscord | <ShalokShalom> Its a modern Smalltalk |
21:44:05 | FromDiscord | <ShalokShalom> And they have IDE and language rolled into one |
21:44:10 | FromDiscord | <ted__> In reply to @Elegantbeef "Ted `[^1]`": awesome, thanks! I knew there had to be something |
21:44:20 | FromDiscord | <ShalokShalom> The whole thing is VM that state you modify |
21:44:41 | FromDiscord | <ShalokShalom> So you don't save anything in the traditional sense. You live edit a mutable VM. |
21:44:52 | FromDiscord | <Elegantbeef> `^x` in Nim makes a `BackwardsIndex`, it's all in user space 😄 |
21:44:55 | FromDiscord | <ShalokShalom> Lots of genius ideas from Alan Kay. |
21:45:21 | FromDiscord | <ShalokShalom> And my personal favorite is F#, its the most modern SML |
21:46:21 | FromDiscord | <Gumbercules> In reply to @Verdagon "nope, heard the name": @Verdagon Vale lang might be of interest to you |
21:46:37 | FromDiscord | <Verdagon> In reply to @Gumbercules "<@337101146017497109> Vale lang might": funny story that, i'm the developer behind vale hahah |
21:46:41 | FromDiscord | <Gumbercules> If you haven't already found it |
21:46:48 | FromDiscord | <Verdagon> ive come across it a few times ;) |
21:46:49 | FromDiscord | <Gumbercules> Hahaha fair enough! |
21:47:13 | FromDiscord | <Gumbercules> I like what you're doing with Vale btw |
21:47:32 | FromDiscord | <Gumbercules> And the blog posts have been great! |
21:47:36 | FromDiscord | <Verdagon> thanks! hearing that always brings a smile to my face |
21:47:46 | FromDiscord | <Verdagon> hah and thank you for that too, there's been _quite_ the backlash against some of them |
21:48:14 | FromDiscord | <Verdagon> in my research today, i was delighted to hear that nim has shared-nothing heaps, we're did that approach in vale too and i think that decision can really launch languages into some interesting realms |
21:48:33 | FromDiscord | <leorize> nim is moving away from that unfortunately |
21:48:43 | FromDiscord | <Verdagon> oh no =\ |
21:49:23 | FromDiscord | <Verdagon> it enables some pretty stellar optimizations, especially when combined with a (java-like) `final` |
21:49:37 | FromDiscord | <Phil> java PTSD |
21:49:53 | FromDiscord | <Verdagon> it also enables the region borrow checker, something that could greatly benefit RC languages, not just gen-ref-based ones |
21:50:17 | FromDiscord | <Gumbercules> Nim at one point had an experimental region based memory management model but it never made it out of the experimental phase and was abandoned |
21:50:22 | FromDiscord | <Verdagon> when i talk to araq, i'll bring it up in case any of these things havent been considered |
21:51:15 | FromDiscord | <Gumbercules> https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim |
21:55:35 | FromDiscord | <Ntsékees> sent a code paste, see https://play.nim-lang.org/#ix=4lSh |
21:55:40 | FromDiscord | <Ntsékees> That's odd |
21:55:45 | FromDiscord | <Ntsékees> (edit) "https://play.nim-lang.org/#ix=4lSh" => "https://paste.rs/wRs" |
21:55:57 | FromDiscord | <Ntsékees> hmm maybe it's not ascii? |
21:56:48 | FromDiscord | <Ntsékees> (edit) "https://play.nim-lang.org/#ix=4lSi" => "https://play.nim-lang.org/#ix=4lSj" |
21:57:36 | FromDiscord | <Phil> I don't even know what character that is 😄 |
21:57:44 | FromDiscord | <Ntsékees> 0xB4 |
21:58:32 | FromDiscord | <Phil> Yeh no clue, accent going upwards? |
21:58:46 | FromDiscord | <leorize> it's probably multi-byte↵(@Ntsékees) |
21:59:02 | FromDiscord | <leorize> use a string to store that |
21:59:12 | FromDiscord | <Ntsékees> probably; the error message is a bit off |
21:59:37 | FromDiscord | <Ntsékees> "invalid character literal" would have been better |
22:00:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lSl |
22:00:33 | FromDiscord | <Elegantbeef> So i think the error message is 'correct' |
22:01:05 | FromDiscord | <ShalokShalom> In reply to @Verdagon "in my research today,": Why that? |
22:03:11 | FromDiscord | <ShalokShalom> @Verdagon how far goes Vale's type inference? |
22:14:27 | FromDiscord | <Verdagon> In reply to @ShalokShalom "<@337101146017497109> how far goes": im planning on doing full bidirectional type inference within the year, but right now its only one-way (think c++ or c#) |
22:14:47 | FromDiscord | <Verdagon> ive been doing gradual upgrades to the solver to eventually support it |
22:14:57 | FromDiscord | <ShalokShalom> In reply to @Verdagon "im planning on doing": Nice |
22:15:03 | FromDiscord | <Verdagon> you wouldnt _believe_ the nonsense involved in bidirectional lol |
22:15:12 | FromDiscord | <ShalokShalom> That's like in Crystal then |
22:15:17 | FromDiscord | <Verdagon> i assume nim has bidirectional? |
22:15:19 | FromDiscord | <ShalokShalom> And did you consider HM |
22:15:32 | FromDiscord | <Verdagon> i think im heading towards HM, yep |
22:15:51 | FromDiscord | <ShalokShalom> I heard sarcastic things being said about Nims type system |
22:15:54 | FromDiscord | <jtv> And "generational references" look like epoch-based memory management, what's the difference? |
22:15:58 | FromDiscord | <ShalokShalom> I think its one way |
22:16:36 | FromDiscord | <ShalokShalom> In reply to @Verdagon "i think im heading": And can you just implement that on the existing code base, by breaking little to nothing |
22:16:46 | FromDiscord | <ShalokShalom> Or do you just break, since its pre 1.0 |
22:17:10 | FromDiscord | <Verdagon> In reply to @jtv "And "generational references" look": i vageuly recall that term, link me? |
22:17:16 | FromDiscord | <ShalokShalom> I would be interested in your language, if you do HM |
22:17:37 | FromDiscord | <Verdagon> yeah i agree that HM is a huge boon to usability |
22:17:45 | FromDiscord | <jtv> It's one of the many techniques for memory management in the lock-free data structure world |
22:19:59 | FromDiscord | <jtv> For instance, if you look at my high performance lock-free data structure lib for my C code (https://github.com/viega/hatrack) it's the underlying memory management to ensure safety. |
22:28:15 | FromDiscord | <Gumbercules> https://github.com/viega/hatrack/blob/b5113e087b4ae4104803ff0969998438d39537b1/include/hatrack/mmm.h |
22:28:30 | FromDiscord | <Gumbercules> (edit) "https://github.com/viega/hatrack/blob/b5113e087b4ae4104803ff0969998438d39537b1/include/hatrack/mmm.h" => "https://github.com/viega/hatrack/blob/main/include/hatrack/mmm.h" |
22:31:53 | FromDiscord | <jtv> Yeah, most of the doc and impl is in the header, but the actual freeing happens here: https://github.com/viega/hatrack/blob/main/src/support/mmm.c |
22:32:07 | * | jjido joined #nim |
22:32:48 | FromDiscord | <Gumbercules> was looking for an example of region based memory management in C and of course DOOM has one |
22:33:10 | FromDiscord | <Gumbercules> https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/z_zone.h |
22:33:20 | FromDiscord | <Gumbercules> https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/z_zone.c |
22:36:31 | FromDiscord | <Gumbercules> https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/i_system.h↵and↵https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/i_system.c are also relevant |
22:36:32 | FromDiscord | <jtv> Yeah, there's been lots and lots and lots of work in memory management in the last 30 years 🙂 |
22:36:42 | * | chmod222 quit (Quit: leaving) |
22:37:28 | FromDiscord | <jtv> Yet most languages like Go still have really poor GC behavior 🙂 |
22:37:32 | FromDiscord | <Gumbercules> Yeah, Nim just needs custom allocators |
22:37:43 | FromDiscord | <Gumbercules> well, without having to ditch seq/string |
22:38:38 | FromDiscord | <ShalokShalom> In reply to @Verdagon "yeah i agree that": Rust uses it afaik for its borrow checker |
22:39:33 | FromDiscord | <Gumbercules> Cone's approach sounds interesting |
22:39:45 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix= |
22:40:09 | FromDiscord | <ShalokShalom> If you need help with HM, try to reach OvermindDL1. He is busy, and in case you catch him, you can find someone who is very knowledgeable about implementing it. |
22:45:39 | FromDiscord | <Gumbercules> @Verdagon sorry I'm not a PL designer / contributor so some of my questions may come off as naive - what's the plan for Vale and interop? Is it possible to write a Vale program today and interop with a C library? |
22:46:41 | FromDiscord | <Gumbercules> I know you blogged about the whole fearless FFI thing but with so many portions of the language in the design phase and the language development moving fast, it's difficult to know when I should pick up and start playing with the lanugage |
22:56:08 | FromDiscord | <sOkam!> If I have an enum like `type Kinds {.pure.} = enum One, Two`↵Is there a way to get the names of the values in string form? ↵aka `"One"` and `"Two"` |
22:58:46 | FromDiscord | <sOkam!> In reply to @Gumbercules "was looking for an": You might want to check out:↵https://github.com/heysokam/idtech3-modules/tree/master/src/mem↵Its the id-tech3 code, but extracted from the engine to use in any other project |
22:59:44 | FromDiscord | <michaelb.eth> In reply to @sOkam! "If I have an": try `$Kind.One` |
23:01:40 | FromDiscord | <Ntsékees> And now I'm stumbling on a compiler crash…↵> Error: internal error: genTypeInfoV1(tyNone)↵> No stack traceback available↵> To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details |
23:02:13 | FromDiscord | <arkanoid> how can I perform in nim same op as https://registry.khronos.org/OpenGL-Refpages/gl4/html/bitfieldInsert.xhtml ? basically I need something like bitops.bitsliced, but for writing and not for reading |
23:02:47 | FromDiscord | <sOkam!> In reply to @michaelb.eth "try `$Kinds.One`": oh, shoot! i thought that was going to say the value itself. that's handy af, ty |
23:02:58 | FromDiscord | <Elegantbeef> I'd say use bitsets, but idk |
23:04:17 | FromDiscord | <sOkam!> @Gumbercules The memory model is explained in `core.h` |
23:06:43 | FromDiscord | <sOkam!> And these are the zones where data is stored when allocated↵https://github.com/heysokam/idtech3-modules/blob/a5cd0d55a32f27fc97799ac46095933d1453f013/src/mem/state.h#L22-L32 |
23:12:56 | * | clemens3 joined #nim |
23:16:45 | * | argonica quit (Read error: Connection reset by peer) |
23:39:36 | FromDiscord | <Verdagon> In reply to @Gumbercules "I know you blogged": yeah, it is a hard thing to know when a language is ready to experiment with, especially one as new as vale |
23:40:23 | FromDiscord | <Verdagon> i wish i could say it's stable and rock solid, but we arent there yet, especially compared to great languages like nim ;) |
23:41:23 | FromDiscord | <Verdagon> one can successfully make a project with vale, but they might run into the occasional corner or hole, such as our lack of `match` statement, or unsupported linux distros |
23:41:46 | FromDiscord | <Verdagon> once i finish the first regions prototype, the next version's goal will be another ergonomics+stability sprint |
23:46:15 | FromDiscord | <arkanoid> solved with loop over testBit/setBit. Possibly the worst solution possible, but it passes my tests |