<< 03-01-2024 >>

00:04:22FromDiscord<Robyn [She/Her]> Would making bindings to a Rust discord library be a stupid idea? Hm...
00:05:42termerdoes it expose a C API
00:06:08termerit doesn't really matter what the lib is made in if it exposes a C API and isn't overly complicated to integrate
00:06:41FromDiscord<Robyn [She/Her]> In reply to @termer "does it expose a": Nope, I'd have to write it myself
00:07:12termerThere's a Nim Discord library already called Dimscord I believe
00:07:15FromDiscord<Robyn [She/Her]> I also had the stupid idea of making bindings to a Rust async runtime for Nim, which seems like an even worse idea
00:07:21termerdon't do that
00:07:41FromDiscord<Robyn [She/Her]> In reply to @termer "There's a Nim Discord": I'm aware, I just have ~~stupid~~ fun ideas at times
00:07:42termerunless you have a very deep knowledge of Nim async and tokio, that'll end in disaster
00:07:48termerwell do what you want
00:07:54termerbut I would just use dimscord
00:08:40FromDiscord<Robyn [She/Her]> In reply to @termer "unless you have a": I do not, which makes it lovelier :D↵I won't go that far though
00:08:54FromDiscord<Robyn [She/Her]> Not until I've at least got myself familiar with Rust in a serious way
00:09:12FromDiscord<Robyn [She/Her]> I will look into rewriting Nim's stdlib in Rust for no reason other than boredom, though :p
00:09:42termerif you're spending your time programming, you should work on something that you could reasonably finish and build on
00:09:50FromDiscord<Robyn [She/Her]> Would it be worth rewriting system.nim as an initial experiment first? Hm
00:10:04termersystem.nim is very large
00:10:09FromDiscord<Robyn [She/Her]> In reply to @termer "if you're spending your": I probably should
00:10:10termerand it includes other large files
00:10:20FromDiscord<Robyn [She/Her]> I like having stupid thought experiments :p
00:10:21termerif you wanna do something silly that's fun, write your own scripting lang
00:10:39termerThat's what I did back when I had time to make retarded experiments with programming
00:10:44FromDiscord<scipio_nl> In reply to @chronos.vitaqua "Would it be worth": To remain valuable to the Nim ecosystem wouldn't it make more sense to do the opposite? e.g. rewrite Rust Cargo (which is much more as Nimble) for Nim?
00:10:44termerit was pretty funny, highly recommend
00:10:47FromDiscord<Robyn [She/Her]> In reply to @termer "if you wanna do": That is also something I'm doing! Just procrastinating on the parser
00:11:16termerif you have time to fool around with those projects then you have time to write a parser lol
00:11:26FromDiscord<Robyn [She/Her]> In reply to @scipio_nl "To remain valuable to": It would for sure
00:11:42FromDiscord<Robyn [She/Her]> In reply to @termer "if you have time": It's not the time that's the issue, it's my brain aha
00:11:58termerAll programmers under 25 seem to have ADHD
00:12:00FromDiscord<demotomohiro> In reply to @saint.___. "<@288750616510201856> Did you ever": My Nim FAQ has a Macro section: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#frequently-asked-questions-about-nim-programming-language-macro
00:12:04termerit's the world we live in
00:12:04FromDiscord<Robyn [She/Her]> In reply to @scipio_nl "To remain valuable to": But I like doing non-serious stuff that'll go nowhere
00:12:19FromDiscord<Robyn [She/Her]> In reply to @termer "All programmers under 25": You'd be correct when talking about me, at least
00:12:28termerI could tell as much
00:14:10FromDiscord<Robyn [She/Her]> I'm not sure to take that as a compliment or an insult
00:14:36termerit's neither
00:14:42termerit's just an observation
00:14:48FromDiscord<Robyn [She/Her]> Fair enough
00:14:59FromDiscord<Robyn [She/Her]> I should really work on that parser
00:15:22termerdo it and put it on github
00:15:34FromDiscord<Robyn [She/Her]> I shall!
00:15:40termeryours will be better than mine, mine was in Java
00:16:07FromDiscord<Elegantbeef> > under 25↵Damn you sunk my battle ship
00:16:35termer8)
00:17:02FromDiscord<Robyn [She/Her]> In reply to @termer "yours will be better": Mine is in Python for the first version :p
00:17:12FromDiscord<Robyn [She/Her]> Get it working, then get it good, is what I'm going for :p
00:17:14termerdisregard my statement then
00:18:02FromDiscord<Elegantbeef> I'd argue that ADHD comment but I went from playing with exposing nimib to ffi, to making a header generator to playing with traits
00:18:07FromDiscord<Elegantbeef> All in the course of like 4 days
00:19:07FromDiscord<Phil> ... I'm trying to stick to my stuff, it's the stuff that keeps changing scope#
00:19:17FromDiscord<Phil> I just wanted to do "microservice"-like multithreading
00:19:29FromDiscord<Elegantbeef> `startProcess` already exists
00:19:31termerBest thing you can do is set a scope if you wanna get stuff done, even if the narrowness of the scope hurts
00:19:39FromDiscord<Phil> Somehow I'm ending up debugging memory leaks of thread local variables
00:21:04FromDiscord<Phil> In reply to @Elegantbeef "`startProcess` already exists": But that's more overhead than it has to be.↵I need a second thread, not a new process
00:21:37FromDiscord<Elegantbeef> Processes are better threads!
00:22:24FromDiscord<Phil> Processes make sense if I intend for there to be a different frontend application to my backend but I don't see that as a realistic assumption
00:22:58FromDiscord<Phil> For that to ever exist is what I mean
00:23:41FromDiscord<Phil> And then I'd still want sth to facilitate IPC calls just so that it's less of a hassle
00:24:39FromDiscord<Elegantbeef> Phil is really like "This guy makes hyperbolic comments all the time, let's spend time disproving them"
00:27:53FromDiscord<leorize> threads are just processes with the same address space
00:30:17FromDiscord<Phil (he/him)> I honestly just don't know enough/am not confident enough in my knowledge about thread to know when you're being hyperbolic
00:30:26FromDiscord<Elegantbeef> Always
00:36:19FromDiscord<leorize> you'll get there, but shouldn't you sleep?
00:44:49FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I'd argue that ADHD": XD
00:45:34FromDiscord<Phil> In reply to @leorize "you'll get there, but": Trying and failing. Honestly the topic is just keeping my brain active =/
00:45:47FromDiscord<Phil> General memory debugging etc.
00:46:07FromDiscord<leorize> you'll fall down further the more wins you got
00:46:11FromDiscord<leorize> sorry about that
00:46:35FromDiscord<leorize> and then once you discovered how to profile everything and get wins from those
00:46:37FromDiscord<leorize> the cycle continues
01:13:03*advesperacit quit ()
01:13:41FromDiscord<saint._._.> @Robyn [She/Her] What are you making your parser in
01:13:47FromDiscord<saint._._.> Do you have your own lexer I mean
01:13:59FromDiscord<saint._._.> Just handrolling it all yourself? Or using some library
01:14:40FromDiscord<Robyn [She/Her]> In reply to @saint._._. "Do you have your": Yep it's my own lexer, just need to work on the parser now, gonna be hand written most likely
01:15:57FromDiscord<saint._._.> Nice
01:16:16FromDiscord<saint._._.> Are there no nim lexer libr
01:16:17FromDiscord<saint._._.> (edit) "libr" => "libs"
01:20:42FromDiscord<Robyn [She/Her]> In reply to @saint._._. "Are there no nim": There is Nimly to be fair
01:42:08FromDiscord<leorize> use `lexbase` if you want a hand-rolled lexer
02:31:16FromDiscord<Robyn [She/Her]> I keep having stupid ideas after stupid idea, and it's kinda funny
02:31:39FromDiscord<Robyn [She/Her]> This time: Rust memory management (with the `Rc` type) but implemented on Nim types
02:31:54FromDiscord<Robyn [She/Her]> I'm not doing this by the way, just to reassure anyone :p
02:31:55FromDiscord<Elegantbeef> You mean `ref`
03:16:06FromDiscord<Robyn [She/Her]> Rust ref counting yeah, on ref types-
03:16:20FromDiscord<Robyn [She/Her]> I'm tired and don't know the correct vocabulary, sue me, ya won't get far-
03:34:31*azimut quit (Ping timeout: 240 seconds)
03:45:24FromDiscord<hlsee> is there any way to print full 64 bit float in this way? Thanks in advance.↵let y\: float64 = 3.1415926↵echo(fmt"y=\:.20f = {y\:.20f}")
04:04:42FromDiscord<leorize> what beef meant is that you just described the builtin `ref`↵(@Robyn [She/Her])
04:13:42FromDiscord<Robyn [She/Her]> In reply to @leorize "what beef meant is": Ref uses Nim's implementation though, I just have a stupid idea of hacking Rust's impl into Nim for some reason :P
04:23:26FromDiscord<JJ> In reply to @chronos.vitaqua "This time: Rust memory": oh god
04:23:38FromDiscord<JJ> worst of both worlds 💀
04:23:40FromDiscord<JJ> i love it
04:24:50FromDiscord<Robyn [She/Her]> :D
05:19:43FromDiscord<dddeserttt> Hello all
05:19:52FromDiscord<Elegantbeef> Hello
05:20:41FromDiscord<dddeserttt> I was wondering if anyone knows if any good resources to get into making some low level stuff with nim or just in general. I wanna make some drivers or something
05:21:10FromDiscord<Elegantbeef> It's generally just "refer to C docs"
05:21:37FromDiscord<Elegantbeef> Nim has codegendecl, emit and inline asm when things get iffy
05:21:38FromDiscord<dddeserttt> Damn alright
05:21:50FromDiscord<dddeserttt> Alright cool
05:22:00FromDiscord<dddeserttt> I figured that would be the answer but wanted to double check
05:26:41nmzhas anything that low level been made with nim?
05:30:11FromDiscord<scipio_nl> In reply to @hlsee "is there any way": You mean print all digits of Pi?
05:32:08FromDiscord<scipio_nl> In reply to @chronos.vitaqua "Escape characters don't work": hmm, I was just thinking (haven't looked at the implementation), maybe because fmt uses raw strings and `.replace(someString)` ?
05:32:40FromDiscord<Elegantbeef> Nah it's all down to `fmt"bleh"` vs. `fmt "bleh"`
05:32:46FromDiscord<Elegantbeef> The first is a generalised string call
05:32:49FromDiscord<Elegantbeef> the latter is a normal call
05:33:02FromDiscord<Elegantbeef> Generalised string calls do not keep escaped characters
05:33:22FromDiscord<Elegantbeef> `&` converts those literal characters back into their escaped form
05:34:30FromDiscord<scipio_nl> Well I also like the Python F-strings way to interpolate using f"{i}: {j}", but that is not possible using & ?
05:34:46FromDiscord<Elegantbeef> What?
05:34:47FromDiscord<scipio_nl> It requires fmt in strformat but without escapes?
05:35:28FromDiscord<odexine> What?
05:35:40FromDiscord<Elegantbeef> That's what i said
05:35:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
05:36:25FromDiscord<scipio_nl> You're using fmt not &
05:36:34FromDiscord<Elegantbeef> As does `&`
05:36:49FromDiscord<Elegantbeef> All `&` does is return escape characters
05:37:40FromDiscord<scipio_nl> hang on, I had an error just minutes ago with a concrete example like this but I had deleted it
05:38:11FromDiscord<Elegantbeef> Look where the egg is now
05:38:13FromDiscord<Garrett> Hey random question
05:38:15FromDiscord<Garrett> Does anyone know of any mental health servers on element
05:41:50FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
05:42:06FromDiscord<Elegantbeef> you do not need `$`
05:42:15FromDiscord<Elegantbeef> That defeats the point
05:42:29FromDiscord<scipio_nl> hmm indeed
05:43:15FromDiscord<scipio_nl> well I stumbled on this where I ws toying around with the implicit assigning of items and pairs on iterators
05:45:01FromDiscord<Elegantbeef> We believe you!
05:45:28FromDiscord<scipio_nl> In reply to @Elegantbeef "We believe you!": That is what matters!!! 🫶
06:26:37FromDiscord<Robyn [She/Her]> In reply to @Garrett "Does anyone know of": Probably better to ask in Nim's offtopic channel
06:35:04*advesperacit joined #nim
07:06:11*xet7 quit (Quit: Leaving)
07:10:47*PMunch joined #nim
07:16:02*rockcavera quit (Remote host closed the connection)
07:33:41FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:33:52FromDiscord<scipio_nl> (edit)
07:34:54FromDiscord<Elegantbeef> Well yea you need to import modules
07:39:31FromDiscord<scipio_nl> In reply to @Elegantbeef "Well yea you need": In the case of using `&` that isn't clear as string concatenation using `&` does work without importing
07:39:54FromDiscord<scipio_nl> In general btw I find the error messages in Nim not as clear as Rust cargo even remotely
07:42:00FromDiscord<scipio_nl> ^^^ Come to think about it, Nim being so incredibly flexible in its syntax (overloading, meta programming) in combination with "sub optimal" compiler error messaging (as compared to Rust Cargo), does make it somewhat unintuitive to figure out what is going on.
07:43:27FromDiscord<scipio_nl> Took me also 12 iterations to manually spot I made a typo in a function call which didn't matter due to being case insensitive yet on the other hand there is the `2 +1` vs `2 + 1` difference which does matter (space sensitive?)
07:44:24FromDiscord<scipio_nl> Nevertheless I like Nim so much I want to keep pushing on anyway
07:44:48FromDiscord<Elegantbeef> Tightly binding unary is nice
07:44:51PMunchscipio_nl, `+1` is a number literal
07:44:59FromDiscord<Elegantbeef> It's actually not
07:45:06FromDiscord<Elegantbeef> `+` is a `Call(+, 1)`
07:45:17FromDiscord<Elegantbeef> `-` is though
07:45:25PMunchOh, that's confusing
07:45:35PMunchThe result ends up the same though
07:47:19FromDiscord<Elegantbeef> I assumed both were prefix operators
07:47:26FromDiscord<Elegantbeef> But yea the parser special cases `-`
07:48:10FromDiscord<scipio_nl> In reply to @PMunch "Oh, that's confusing": That was my point yes
07:48:58PMunchOh no, I didn't mean that `2 +1` was confusing, that makes perfect sense
07:49:29PMunchBut that `+1` was treated as a call to unary `+` instead of just being parsed as part of the number literal is a bit odd
07:49:37PMunchSince it already does it for `-`
07:49:43FromDiscord<scipio_nl> It is confusing being a Nim beginner and an expert apparently, but due to different layers of complexity
07:50:06FromDiscord<scipio_nl> I do understand your explanations now tho
07:50:52FromDiscord<scipio_nl> But there is a lot to grok when still learning. I'm reading Dom96's book while interactively trying stuff out
07:53:06FromDiscord<Phil> In reply to @scipio_nl "It is confusing being": I feel that so bad
07:54:43FromDiscord<Phil> Knowing a decent chunk on a lot of Nim topics you start getting cocky and then memory analysis tools start handing your ass to you
07:55:13FromDiscord<Phil> Or an offside comment by beef/leorize/mratsim
07:55:51FromDiscord<Elegantbeef> Hey don't include me there
07:55:53FromDiscord<Elegantbeef> I'm a dullard with a keyboard
07:56:15FromDiscord<Phil> Then I'm a dog with a keyboard and glasses
07:56:55FromDiscord<Elegantbeef> You have glasses you're clearly intelligent
07:56:57FromDiscord<nnsee> I'm three kids in a trenchcoat
07:58:53FromDiscord<Phil> In reply to @nnsee "I'm three kids in": I'm not sure if three barely more than toddlers or three teens, one is significantly more terrifying than the other
07:59:49FromDiscord<Phil> In reply to @Elegantbeef "You have glasses you're": That's the secret, fake it till you make it.↵That's why I also wore glasses back when I was but an apple (the fruit)
07:59:57FromDiscord<nnsee> In reply to @isofruit "I'm not sure if": 1 newborn, 1 12-year old, 1 who's nearly an adult
08:00:27FromDiscord<Elegantbeef> Glad you told me an apple was a fruit
08:00:31FromDiscord<Elegantbeef> I thought it was a planet
08:00:52PMunchnnsee, hopefully not stacked in that order..
08:00:57FromDiscord<Phil> In reply to @Elegantbeef "Glad you told me": That's why I wear glasses and you don't
08:36:28FromDiscord<sOkam! 🫐> I'm trying to understand `nim jsondoc`↵Is this function creating an `html` json, or is it still just the raw comments at this stage?↵https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1164
08:37:07FromDiscord<sOkam! 🫐> I thought the output html of jsondoc wouldn't be process into html, but I guess i was wrong↵So trying to find somewhere earlier where the rst/md is not turned to html yet
08:37:21FromDiscord<sOkam! 🫐> (edit) removed "html"
09:10:50FromDiscord<Phil> In reply to @heysokam "I'm trying to understand": It is currently some movement towards making jsondoc a "proper" JSON output with the exact same information as gets rendered into HTML, and refactoring the HTML output to use that JSON output
09:11:12FromDiscord<Phil> I have it on my list as my next project once I get some grip on threadButler to push it out of alpha
09:11:57FromDiscord<Phil> It's a pretty significant kind of contribution so any kind of contribution towards that could be a boon, even if it is before I can find the time to tackle it
09:12:24FromDiscord<Phil> (edit) "It" => "There"
09:17:48FromDiscord<sOkam! 🫐> In reply to @isofruit "It's a pretty significant": I wish I could contrib, but my question was regarding how this function works↵It's really hard to contribute when you don't understand what you are even reading↵I would be more than happy to help, but need a bit more guidance than just a "hey, help is welcome" to be of any help
09:19:50FromDiscord<sOkam! 🫐> I was trying to find where the rst is even processed into the json file, to cut it short and stop it from happening, like I did with my compiler where I got the raw AST and went from there↵But in this case I cannot even find where that happens at all. Reading that function is like reading chinese to me right now, pretty much↵Does the html rendering happen on `%`, or on `$` or before that? or where? that's what got me stuck there
09:20:16FromDiscord<sOkam! 🫐> (edit) "there↵But" => "there on my own path, and use the compiler as a library↵But"
09:24:20FromDiscord<Phil> Haven't done a deep dive on this myself yet, for the most part this is mostly me thinking "I can do macros, this should be understandable to me"
09:24:37FromDiscord<Phil> (edit) "macros," => "macros and webdev,"
09:52:25FromDiscord<fosster> hiii folks
09:54:28FromDiscord<fosster> so I have a problem, basically I have an hash table that has a non-primitive type as key. the problem is that it returns a weird error everytime I try to access or add a field. after some searching I've found that I have to implement the hash function myself, and it is right but since the key is a distinct string, how do I inherit the hash proc from the string type?
09:55:05FromDiscord<Elegantbeef> `proc hash(yourType: YourString): Hash {.borrow.}`
09:55:22FromDiscord<Elegantbeef> Or `proc hash(yourType: YourString): Hash = Hash string(yourType)`
09:55:39FromDiscord<Elegantbeef> whoops that should be `hash(string yourType)` or any other variation
09:55:46FromDiscord<fosster> but I already tried to do that, and the error perserverates
09:56:05FromDiscord<fosster> wait I try again
09:56:07FromDiscord<fosster> thanks btw
09:56:08FromDiscord<Elegantbeef> You need your own `hash` and `==`
09:59:50FromDiscord<fosster> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:02:11FromDiscord<fosster> sent a long message, see <!doctype html>
10:02:31FromDiscord<Elegantbeef> You are lacking `import std/tables`
10:02:49FromDiscord<Elegantbeef> your `Env` type is an alias to a Table?
10:03:13FromDiscord<fosster> yes
10:03:15FromDiscord<fosster> oh you're right
10:03:19FromDiscord<fosster> sorry I am dumb
10:03:28FromDiscord<Elegantbeef> It also might not be `var`
10:04:09FromDiscord<fosster> what you mean?
10:04:31FromDiscord<Elegantbeef> You need to declare mutable variables/parameters with `var`
10:04:37FromDiscord<Elegantbeef> `[]=` requires them to be mutable
10:05:00FromDiscord<Elegantbeef> IE you might do `let x = ...; x[...] = ...`
10:05:11FromDiscord<fosster> env is a var not a let
10:05:28FromDiscord<Elegantbeef> Might was the operative word
10:05:46FromDiscord<fosster> thanks a lot
10:06:31FromDiscord<fosster> to be honest I sometimes get confused on when to use `var` over `let` 😅
10:06:38FromDiscord<fosster> but it's just me
10:07:17FromDiscord<sOkam! 🫐> In reply to @fosster "to be honest I": as a rule of thumb, use let unless the compiler screams at you that you need to modify the value but cant
10:07:27FromDiscord<fosster> I mean I know that var is mutable and let immutable, but sometimes sometimes I confuse on wether I should declare it as a var when I only need to change a specific field etc.
10:07:29FromDiscord<intellij_gamer> In reply to @heysokam "I was trying to": iirc the RST is generated for doc comments later on in this section https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1554
10:08:29FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "iirc the RST is": Oh, so you are saying that what I should capture is `d.jEntriesPre`?
10:08:40FromDiscord<sOkam! 🫐> (edit) "capture" => "capture, before its generated,"
10:08:55FromDiscord<sOkam! 🫐> I basically want the raw json with the comments but not html
10:12:24FromDiscord<intellij_gamer> Hmm might need to go further back inside `genJsonItem`↵Like this is just random brainwaves so it might not work↵But maybe if in here https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1179 you get the comment node and assign its string value directly to `json["description"]` (If some raw flag is set) and then just make sure it doesn't get overwritten later if already set
10:13:14FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Hmm might need to": why "later"?↵I was thinking of getting the data somewhere before its finalized
10:13:25FromDiscord<intellij_gamer> Might need to check where else `rstField` is set cause I'm kinda confused why the rendering is done later
10:13:41FromDiscord<sOkam! 🫐> (edit) "In reply to @intellij_gamer "Hmm might need to": why "later"?↵I was thinking of getting the data somewhere before its finalized ... " added "into html"
10:14:57FromDiscord<intellij_gamer> In reply to @heysokam "why "later"? I was": The later as in not getting overwritten later? Well if you are trying to implement [#21928](https://github.com/nim-lang/Nim/issues/21928) then you'll only want to skip rendering when a flag is set↵So you'll still what that rendering to happen if it hasn't been set yet
10:16:08FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "The later as in": i was asking about "later" because why would it be overwritten if I'm not completing the pass with the nim compiler, but rather with a tool that uses the functions as a library?
10:16:51FromDiscord<sOkam! 🫐> I had no idea bout this #issue, but it seems to be exactly what I was searching for yep
10:19:08FromDiscord<intellij_gamer> Well cause if you modify the json early on so that "description"/"comment" field has the raw comment but still let the compiler run then it will get overwritten here https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1555↵But if you are manually calling everything then I guess its not a problem
10:27:50FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:28:06FromDiscord<sOkam! 🫐> (edit)
10:28:31FromDiscord<sOkam! 🫐> (edit)
10:29:41FromDiscord<intellij_gamer> Wondering if just setting `entry.rst` to `nil` would be enough 🤔 ↵Since well you aren't trying to render rst so would make sense its `nil`
10:50:57FromDiscord<sOkam! 🫐> @intellij_gamer that doesn't work. if we skip this block, the output json lacks a "description" entirely
10:53:42*azimut joined #nim
10:54:30FromDiscord<intellij_gamer> Are you assigning description field yourself?
10:54:30FromDiscord<sOkam! 🫐> `renderRstToOut` is the real actual culprit, though
10:54:45FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Are you assigning description": no, just skipping the for with that snipped
10:54:53FromDiscord<sOkam! 🫐> (edit) "for" => "`for`" | "snipped" => "snippet"
10:54:57FromDiscord<sOkam! 🫐> (edit) "`for`" => "`if`"
10:55:39FromDiscord<intellij_gamer> Ah, well you'll need to assign something
10:55:41FromDiscord<sOkam! 🫐> i guess the rst needs to be sent to the json output directly in some way here, under the condition, in a separate if branch
10:56:01FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Ah, well you'll need": yeah but what, lol
10:56:37FromDiscord<sOkam! 🫐> does a `rst == nil` mean that there is no doc-comment for that block of code?
10:59:00FromDiscord<intellij_gamer> Yeah, cause in places like this it assigns a semi processed RST thingy https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1179 which then gets rendered later↵So if its nil then it won't try and render↵So in that same section I linked, if a raw flag is set then you should get the doc comment node (`getPlainDocstring` might do the trick) and assign the JSON field directly
11:00:39FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Yeah, cause in places": where is the `PNode` to get the plaindocstring from there?
11:00:54FromDiscord<sOkam! 🫐> there is no pnode in `renderItemPre`
11:01:11FromDiscord<intellij_gamer> `n` I think
11:01:29FromDiscord<intellij_gamer> Not `renderItemPre`, `genJsonItem`
11:03:56FromDiscord<sOkam! 🫐> you lost me there
11:07:38FromDiscord<intellij_gamer> So in here https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1178-L1180↵Is where it currently tries to originally set the RST↵By stopping it getting assigned here it wont get rendered later↵and so we can chuck in a `result.json["description"] = plainDocs` to get the original formatting
11:08:09FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:09:04FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "So in here https://github.com/nim-lang/Nim/blob/20d": but how
11:09:13FromDiscord<sOkam! 🫐> I don't even know how to get the description at all in there
11:09:52FromDiscord<intellij_gamer> Try calling [getEnv](https://nim-lang.org/docs/envvars.html#getEnv%2Cstring%2Cstring) with "USERPROFILE" to resolve that environment variable and then use that for the path. Don't think windows automatically interlops env variables in paths
11:12:10FromDiscord<intellij_gamer> In reply to @heysokam "I don't even know": Use this function https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L470↵Make sure it is called before `genRecComment` first though like https://github.com/nim-lang/Nim/blob/20d79c9fb0cd2e72473f5fb08134cf72d0fdd9e7/compiler/docgen.nim#L1050
11:12:30FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:13:05FromDiscord<intellij_gamer> Yeah try that
11:13:45FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Use this function https://github.com/nim-lang/Nim/b": there is only `PDoc` in that function
11:14:17FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:15:33FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:15:54FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:16:30FromDiscord<sOkam! 🫐> It solves the `/` vs `\\` problem for you, basically
11:16:36FromDiscord<eilerolrikpottestepper> Thanks
11:17:09FromDiscord<intellij_gamer> Damn, just starting tickering with this locally and `getPlainDocstring` is returning an empty string
11:18:15FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "Damn, just starting tickering": I've been chasing at this problem for 2h with literal zero progress myself, so... didn't expect a lot there myself 🙈
11:18:22FromDiscord<sOkam! 🫐> (edit) removed "myself"
11:19:02FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:19:13FromDiscord<eilerolrikpottestepper> (edit)
11:19:25FromDiscord<pmunch> Seems like USERPROFILE isn't set
11:20:00FromDiscord<sOkam! 🫐> `echo getEnv("USERPROFILE")`
11:20:32FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:21:04FromDiscord<sOkam! 🫐> In reply to @eilerolrikpottestepper "I am setting USERNAME:": your output is not clear, since you cut the snippet and edited its output
11:21:09FromDiscord<sOkam! 🫐> (edit) "output" => "text"
11:21:26FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=html>
11:21:28FromDiscord<sOkam! 🫐> we don't know what you mean by `[]` or `[USERNAME]`
11:21:30FromDiscord<eilerolrikpottestepper> Yes
11:21:40FromDiscord<eilerolrikpottestepper> In reply to @heysokam "we don't know what": just redacted username
11:21:49FromDiscord<sOkam! 🫐> In reply to @eilerolrikpottestepper "just redacted username": what does redacted mean?
11:22:00FromDiscord<odexine> Held back for secrecy
11:22:08FromDiscord<eilerolrikpottestepper> exatly
11:22:09FromDiscord<odexine> It’s just their username and they removed it
11:22:09FromDiscord<sOkam! 🫐> kk
11:22:17FromDiscord<eilerolrikpottestepper> (edit) "exatly" => "exactly"
11:22:28FromDiscord<intellij_gamer> Then I guess zippy doesn't let you overwrite stuff↵Maybe add a check to make sure the file doesn't already exist↵And then delete it and see if it works
11:22:48PMuncheilerolrikpottestepper: By the way, you can use `getHomeDir` from std/appdirs to get the home directory
11:22:57FromDiscord<sOkam! 🫐> so then your problem might be 1 of 2:↵- File is already there, zippy refuses to do anything with it↵- Folder already exists, zippy doesn't allow unzipping to existing folders (by design, i asked guzba)
11:23:18FromDiscord<eilerolrikpottestepper> Ahh thanks
11:23:55FromDiscord<sOkam! 🫐> you need to extract to a temp folder, copy the files over, and remove the temp folder, if you want to "extract here" like behavior
11:23:56FromDiscord<eilerolrikpottestepper> It's finally working now
11:24:01FromDiscord<eilerolrikpottestepper> thanks
11:24:20FromDiscord<eilerolrikpottestepper> Just hoping it doesn't get flagged as malware
11:28:06PMunchWell..
11:39:41FromDiscord<pengwyns> Question, does anyone know what finish.exe is? Like what source file is it built from?
11:39:57FromDiscord<pengwyns> I am trying to see if there is a specific module or thing that makes nim binaries get flagged.
11:42:13FromDiscord<intellij_gamer> Might be this file https://github.com/nim-lang/Nim/blob/devel/tools/finish.nim
11:49:58FromDiscord<intellij_gamer> sent a long message, see <!doctype html>
12:00:09PMunchintellij_gamer, are you working on documentation?
12:06:42FromDiscord<intellij_gamer> I do when I need a feature/fix
12:13:36PMunchWhat're you working on implementing now?
12:22:45FromDiscord<intellij_gamer> Originally I wanted the raw switch so that my discord bot (https://github.com/ire4ever1190/doccat) could have cleaner descriptions.↵But I couldn't solve it back then so I never got around to implementing it
12:52:58PMunchRaw switch?
13:12:51*azimut quit (Remote host closed the connection)
13:13:26*azimut joined #nim
14:02:35*rockcavera joined #nim
14:34:01*edr joined #nim
14:52:01FromDiscord<sOkam! 🫐> In reply to @PMunch "Raw switch?": your json docs gendocs function is dealing with a json object that contains html input, not rst
14:52:16PMunchAaah, I see
14:52:31PMunchSo you'd want the raw RST output instead
14:52:38PMunchMakes sense
14:52:49FromDiscord<sOkam! 🫐> that's what he means by raw, having the actual rst or markdown or w/e
14:53:59PMunchOne benefit of using the HTML output is that Nim has it's own flavour of RST/Markdown
14:54:08PMunchSo it could be hard to parse yourself
14:54:21FromDiscord<sOkam! 🫐> In reply to @PMunch "So you'd want the": except when you don't use it
14:54:22PMunchWhat we should really have is some kind of document IR
14:55:16FromDiscord<sOkam! 🫐> In reply to @PMunch "What we should really": maybe for generalizing, but if you don't use that markdown flavor then you are stuck
14:56:56PMunchWell that's my point, we should have some kind of document IR which could be used to parse documents from a wide variety of markup languages into a common format
14:57:52PMunchSo no matter what dialect one tool uses it can pass the IR on to another tool which would be able to make some kind of sense from it
14:58:39FromDiscord<sOkam! 🫐> I'm lost in how a doc IR would be like
15:01:32FromDiscord<sOkam! 🫐> In reply to @intellij_gamer "<@186489007247589376> https://github.com/nim-lang/N": what does that second link do?
15:01:36PMunchOh yeah I don't have any good ideas either :P
15:02:55PMunchI was just imagining something more descriptive than HTML which could then be converted into HTML, or perhaps into another markup language
15:14:41*PMunch quit (Quit: Leaving)
15:16:06FromDiscord<sOkam! 🫐> In reply to @PMunch "Oh yeah I don't": is that not trying to do too much, when the concept of raw output doesn't even exist?
15:17:29FromDiscord<sOkam! 🫐> mentioning because I feel like with tooling we are always landing on this type of thing↵> X needs a big rework, lots to do, lots to figure out, maybe Y will do it in N time↵Outcome, the tools is just as broken as always and continues to be
15:17:58FromDiscord<sOkam! 🫐> (edit) " broken" => "stuck"
15:18:06FromDiscord<sOkam! 🫐> (edit) "tools" => "tool"
15:31:25*khazakar joined #nim
15:33:47*deadmarshal_ quit (Ping timeout: 268 seconds)
15:34:06*cm quit (Quit: Bye.)
15:43:00*cm joined #nim
16:35:45*deadmarshal_ joined #nim
16:37:33FromDiscord<eilerolrikpottestepper> Is there anything like pillow but for nim? I am specifically looking for a library that can resize, convert to grayscale and do stuff on the pixel level (for an image to ascii converter)
16:38:38FromDiscord<Phil> In reply to @eilerolrikpottestepper "Is there anything like": I have 0 knowledge in terms of image management.↵I'm only aware that "pixie" (a treeform lib) is often used
16:38:51FromDiscord<Phil> (edit) "management.↵I'm" => "management/manipulation.↵I'm"
16:39:17FromDiscord<Phil> https://github.com/treeform/pixie↵Could see if that suits your needs
16:50:13*wheatengineer joined #nim
16:51:36NimEventerNew thread by pp: FrameOS, see https://forum.nim-lang.org/t/10842
16:55:42FromDiscord<djazz> Pixie is the one yeah
17:12:56FromDiscord<anuke> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:14:00FromDiscord<Phil> ... we have a capture thingy?
17:14:49FromDiscord<anuke> Yes, it's necessary for capturing, say, for-loop indices in closures that are invoked later
17:15:03FromDiscord<Phil> I am fascinated and am now searching docs
17:15:56FromDiscord<Phil> Ah, from sugar, hmmmm
17:18:25FromDiscord<anuke> If I had to guess, it's the fact that the closure that `capture` generates is of return type `auto`, which makes the return type `int`, which ignores the fact that the "real" return type is a discardable int
17:18:36*wheatengineer quit (Quit: Leaving)
17:23:43FromDiscord<Phil> What exactly is supposed to happen there?
17:24:02FromDiscord<Phil> The one example of closure that I could spot did an assigment within capture
17:25:40FromDiscord<anuke> In reply to @isofruit "What exactly is supposed": In my example? I'd say the closure should be marked discardable, or have the return type `void`, or anything that makes the behavior the same as a non-captured invocation of `test()`
17:40:56*khazakar quit (Quit: Connection closed for inactivity)
17:43:00*khazakar joined #nim
17:58:54*rockcavera quit (Remote host closed the connection)
18:10:59*wheatengineer joined #nim
18:26:55*wheatengineer quit (Ping timeout: 256 seconds)
18:38:33*rockcavera joined #nim
19:10:14FromDiscord<saint.___.> In reply to @demotomohiro "My Nim FAQ has": Thank you, I think this is what I was looking for!
19:13:37FromDiscord<asviest> Maybe nim asm stmt must allow volatile pragma ?
19:16:35*tiorock joined #nim
19:16:35*tiorock quit (Changing host)
19:16:35*tiorock joined #nim
19:16:35*rockcavera is now known as Guest9372
19:16:36*tiorock is now known as rockcavera
19:18:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
19:19:32*Guest9372 quit (Ping timeout: 252 seconds)
19:37:53FromDiscord<Phil> Turns out, nilling the variable suffices
19:56:05*flouer joined #nim
19:57:41*flouer_ quit (Ping timeout: 240 seconds)
20:11:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:12:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:13:40FromDiscord<Phil> sent a long message, see <!doctype html>
20:13:55FromDiscord<Phil> (edit)
20:15:24FromDiscord<leorize> > `/home/philipp/dev/threadbutler/examples/ex_stdinput.nim:63:2`
20:15:36FromDiscord<leorize> looks like it's at a later point now, but previously this pointed to the `new` line
20:16:01FromDiscord<leorize> or rather, that's the only place it could've pointed to
20:16:59FromDiscord<leorize> if you want a better view, try `--linedir:off`
20:17:13FromDiscord<leorize> then errors will point directly to the C code
20:17:22FromDiscord<leorize> which you can inspect to see where it actually came from
20:18:42FromDiscord<leorize> you could also just check the C file now by tracing the `#line` directives
20:18:48FromDiscord<Phil> Thaaaaat does not make things any clearer. Or rather the C output doesn't
20:19:04FromDiscord<leorize> do you mind sharing the C output here?
20:19:38*flouer quit (Remote host closed the connection)
20:19:55*flouer joined #nim
20:19:56FromDiscord<Phil> Er... I don't but that's 1000+ loc
20:20:07FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/1192200738835804333/message.txt?ex=65a83676&is=6595c176&hm=1249073e635c37d96e204b3ca28240e4e565cf82c4494eb3e346f505a8bb615b&
20:20:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:21:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:21:54FromDiscord<Phil> The stacktrace leads to the `main...` call and that's it, after that I'm in some interceptor_calloc thing
20:22:40FromDiscord<Phil> My current hypothesis is that the way I add channels is leaky
20:23:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:23:52FromDiscord<leorize> if you add some fillers to the top, does that move the line?
20:24:13FromDiscord<Phil> You mean if I just add newlines inside the C file?
20:24:33FromDiscord<leorize> no, like adding pointless `echo` before that line
20:25:48FromDiscord<Phil> Tried that, yes it does move the line in the stacktrace, assuming I'm not using --linedir:off
20:25:48FromDiscord<leorize> oh... why do you add your channels like that? can't you just like, allocate them properly on the heap?
20:25:49*flouer quit (Ping timeout: 260 seconds)
20:26:08FromDiscord<leorize> does that pin you somewhere closer?
20:28:04FromDiscord<Phil> IIRC the global variable assignment and fetching the pointer via addr from that was to guarantee that it's always a different pointer
20:28:54FromDiscord<Phil> Nevermind, trying to not use the global assignment nets me immediate binary runtime crashes
20:30:44FromDiscord<leorize> why does that matter?↵(@Phil)
20:31:04FromDiscord<leorize> you can allocate the storage on the heap, no?
20:31:37FromDiscord<Phil> Wait, you mean use a ref-table?
20:31:47FromDiscord<Phil> Or do you mean using ref-channels?
20:32:15FromDiscord<leorize> ref table certainly works, your channel is single-owner, right?
20:32:15*flouer_ joined #nim
20:32:25FromDiscord<leorize> there's also unique\_ptr in fusion if you want to enforce that
20:32:59FromDiscord<intellij_gamer> In reply to @heysokam "what does that second": Second link is another place where RST gets initially made
20:33:59FromDiscord<Phil> Wait, but that still doesn't work because this is about wanting a pointer-pointer table
20:34:09FromDiscord<Phil> And which addresses go into that table
20:36:25FromDiscord<Phil> If at all it'd need to be that I ref-allocate the individual channels
20:36:33FromDiscord<Phil> aka heap allocate
20:37:25FromDiscord<leorize> i'm not sure what you're trying to do with that code, but not allocating is pretty weird
20:38:06FromDiscord<Phil> Honestly it does get allocated because var, IIRC it was because trySend by default needs a "var Channel"
20:38:25FromDiscord<Phil> and I didn't want to go beyond that, but that goes into "clever" code territory which is bad, so I'll look about heap allocating
20:39:39FromDiscord<leorize> ah, so you did upload the full file
20:39:45FromDiscord<leorize> I'll see if I can find something
20:41:12FromDiscord<Phil> In reply to @leorize "I'll see if I": I'll try to jump to heap allocated channels in the meantime from which I then cast the refs to ptrs
20:41:47FromDiscord<leorize> if you're going `ptr` then just `create()` them directly instead of doing a round-about
20:42:26FromDiscord<Phil> You speak as if I know what that means
20:42:59FromDiscord<Phil> Is there a special create proc or sth?
20:43:15FromDiscord<leorize> or `alloc`, I don't remember the exact name
20:43:29FromDiscord<Phil> I have not once directly alloc'd anything in my life
20:44:16FromDiscord<leorize> https://nim-lang.org/docs/system.html#createShared,typedesc
20:44:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:44:54FromDiscord<Phil> (edit)
20:45:18FromDiscord<Phil> Note how channelInt is the same between both channels, which means it overwrote the channel gets overwritten all the time
20:45:28FromDiscord<Phil> (edit) removed "it overwrote"
20:45:40FromDiscord<Phil> That likely was why I didn't want to go ref because I screwed up every attempt
20:47:40FromDiscord<leorize> how did you go `ref`?
20:47:51FromDiscord<leorize> did you just discard the `ref`? then it'd get deallocated
20:48:29FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:49:11FromDiscord<spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1192208057497829517/image.png?ex=65a83d47&is=6595c847&hm=d0f41dac23a0ae65d8010480b88443bae1151dbe27199528e9dc0a422eabbb4a&
20:49:13FromDiscord<spacelucy> what does this mean?
20:49:23FromDiscord<spacelucy> i don't really understand what it's asking
20:49:39FromDiscord<spacelucy> from `nimble init`
20:49:41FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:49:47FromDiscord<Phil (he/him)> I assume this is from when you selected a license
20:49:56FromDiscord<spacelucy> yeah
20:50:02FromDiscord<Phil (he/him)> It helps to provide all information and not just random screenshots \:-P
20:50:15FromDiscord<spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1192208325132169236/image.png?ex=65a83d86&is=6595c886&hm=a94ecbd4cad4febd1b0a113a019f9eaeecf254c0f6997b844a335097306e6537&
20:50:16FromDiscord<spacelucy> sorry
20:50:24FromDiscord<spacelucy> I know its related to the license
20:50:34FromDiscord<spacelucy> but i don't really understand the prompt
20:51:07FromDiscord<Phil (he/him)> That's just specifying a license version. Basically "Will future GPL v4, 5 etc. automatically also satisfy the needs of your project for usage?"
20:51:25FromDiscord<spacelucy> oh, alright
20:51:27FromDiscord<leorize> I think you'll have to explain why is it that you erase the channel types
20:51:29FromDiscord<Phil (he/him)> It's "Is your project usable only under GPL v3 or maybe also under future GPL v4 etc."
20:51:40FromDiscord<spacelucy> ok, sounds good to me
20:51:58FromDiscord<Phil (he/him)> So I can have them all in a single Table, because channels are generics and the types that they are generics around are all different
20:52:02FromDiscord<Q-Master> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:52:40FromDiscord<leorize> createShared would let you remove that `sizeof()`
20:53:08FromDiscord<Phil (he/him)> Like the 2 Channels in the table in this example are 1 instance of `Channel[ServerMessage]` and 1 instance of `Channel[ClientMessage]`. ↵↵If I don't erase the types here via ptr it is impossible to store both of them in the same table
20:53:29FromDiscord<Phil (he/him)> And storing them all in one table is just so convenient everywhere else
20:54:09FromDiscord<leorize> then why don't you just use a `ref object`?
20:54:25FromDiscord<Phil (he/him)> For?
20:54:34FromDiscord<Phil (he/him)> Channels? The Table?
20:55:11FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:55:26FromDiscord<leorize> makes it a bit safer when you actually use the channel
20:56:12FromDiscord<Robyn [She/Her]> In reply to @isofruit "... how do I": Wouldn't that be `=destroy`(x) anyway?
20:57:14FromDiscord<Phil (he/him)> Ah, you mean using inheritance. I personally don't see the difference here.↵I'll still be typecasting afterwards... though I guess with ChanBase I at least can limit it to some form of Chan or sth
20:57:36FromDiscord<leorize> you get conversion checks, basically
20:59:48FromDiscord<leorize> for this one, `new()` allocated a new `ref`, but once it went out-of-scope, it gets deallocated
20:59:49FromDiscord<leorize> that's why you get the same one over and over again
21:00:52FromDiscord<leorize> if you don't want tracked refs, you should really commit to it
21:02:06FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:02:47FromDiscord<user2m> (edit)
21:03:20FromDiscord<spacelucy> oh yeah also `nim install` doesn't add to the .nimble file?
21:03:32FromDiscord<spacelucy> do i have to manually write them in there or am i doing this wrong?
21:03:56FromDiscord<leorize> yea it won't
21:04:01FromDiscord<leorize> nimble install is a global thing
21:04:57FromDiscord<spacelucy> alright thanks
21:06:56FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:07:09FromDiscord<leorize> remember to add something to close those channels and deallocate the pointers once you're done with your hub
21:07:18FromDiscord<Phil (he/him)> I'm currently rewriting the channelhub accordingly given that I have 3 implementations in there that I need to touch
21:07:28FromDiscord<Phil (he/him)> Give me a bit ^^
21:10:29FromDiscord<Phil (he/him)> And all the helper procs now also need to cope with containing ref types rather than value types
21:11:37FromDiscord<Phil (he/him)> Wait.... what? Why bother with the.... what?
21:12:05FromDiscord<Phil (he/him)> Oh, you jumped approaches, the above is not for the ChannelBase approach
21:13:29FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:13:53FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:16:33FromDiscord<Phil (he/him)> Oh wait I am dumb, forgot that the return type still had a "var" attached
21:17:29FromDiscord<leorize> yep, although you might want to not do that
21:18:04FromDiscord<Phil (he/him)> Not have the var? Yeah I removed it. Or do you mean not go to the inheritance approach?
21:18:11FromDiscord<leorize> yea this is annoying, `ref` doesn't work here
21:18:32FromDiscord<Phil (he/him)> What, why?
21:18:37FromDiscord<leorize> the problem is that when you lease the channel from the hub, that incurs a ref count operation
21:18:45FromDiscord<leorize> which basically forces you to use atomicArc
21:19:26FromDiscord<Phil (he/him)> Isn't that fine? The ref gets destroyed eventually and then I'm back to 1 ref held by table
21:19:48FromDiscord<leorize> what happens if more than one thread queries it?
21:20:13FromDiscord<Phil (he/him)> `type ChannelHub = object`↵↵Each thread has its own copy of the same pointers
21:21:55FromDiscord<leorize> the issue here is a potential data race
21:21:57FromDiscord<Phil (he/him)> Why? The channels are semaphores, if thread A tries to access a Channel at the same time as thread B, well one of them will be first and get the lock first
21:21:58FromDiscord<Phil (he/him)> They may have different copies of the pointer that leads to that channel, but the channel itself is still a locked datastructure and threadsafe afaik
21:22:04FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:22:15FromDiscord<leorize> i'm talking about the ref surrounding the channel, not the channel
21:22:46FromDiscord<leorize> so now you are short by one count and your channel could get deallocated
21:23:41FromDiscord<Phil (he/him)> Ohhh because multi access to the ref may fuck up the ref-counter of that ref and thus ... okay that sucks balls
21:23:59FromDiscord<leorize> you can just reimplement shared\_ptr in nim to handle that \:p
21:24:22FromDiscord<leorize> by reimplement I meant copy this\: https://github.com/nim-lang/fusion/blob/0b0a0273b8df860cd54e3fcca7bb4c617244ac77/src/fusion/smartptrs.nim#L62-L65
21:24:27FromDiscord<Elegantbeef> Or just `import threading/ptrs` or w/e
21:24:44FromDiscord<leorize> oh a copy is there
21:25:14FromDiscord<Elegantbeef> I think they're slightly modified
21:25:44FromDiscord<leorize> well but it doesn't look like you can downcast from it
21:28:59FromDiscord<leorize> hmm cloning the table wholesale means you don't have an actual owner of those channels
21:30:20FromDiscord<Elegantbeef> This relates to Phil's ChannelHub stuff being a struct instead of a `ref` on the owning thread and a `ptr` on the children?
21:31:19FromDiscord<leorize> something along those lines, yes
21:31:55FromDiscord<Elegantbeef> Yea I told him it'd be a problem!
21:38:50FromDiscord<e.e.7> Sad news: Niklaus Wirth died on Jan 1st - https://lists.inf.ethz.ch/pipermail/oberon/2024/016856.html
21:39:27FromDiscord<Elegantbeef> Best right a typesafe program
21:39:30FromDiscord<Elegantbeef> write\
21:45:49mhcatis the absence of atlas from the installed bits when using the bin archive install script (and choosenim) intentional?
21:46:13FromDiscord<Elegantbeef> Nope choosenim has not been updated to consider atlas
21:46:17FromDiscord<Elegantbeef> It builds it, it just does not move it
21:46:33FromDiscord<Elegantbeef> You likely should do `nimble install atlas@#head` regardless
21:46:38FromDiscord<graveflo> is nimscript unable to read files?
21:47:06mhcatright, I figured that choosenim was probably going to fade away since atlas provides a...better?.. model
21:47:29mhcatbut the actual nim distibution from nim-lang.org doesn't copy it
21:47:51mhcatso I will copy it myself, then use it to make workspaces that use a new version :)
21:48:25FromDiscord<Elegantbeef> atlas and choosenim are not really related
21:49:25NimEventerNew thread by khaledh-nim: Niklaus Wirth has died, see https://forum.nim-lang.org/t/10843
21:49:28FromDiscord<Elegantbeef> Whilst atlas can install the compiler, you still need a compiler to install atlas and it's only for a specific project
21:49:30FromDiscord<Elegantbeef> Grave it depends on which nimscript
21:49:35FromDiscord<Elegantbeef> The CT nimscript or the `nim e`?
21:50:00FromDiscord<graveflo> I'm using it to run build tasks like `nim someTask somefile.nims`
21:50:43mhcatatlas docs make a distinction between "workspace" and "project", which to me seems a bit more choosenim-like in its use cases
21:51:06mhcatbut also I guess it in some ways gets up in nimble's business too
21:51:19FromDiscord<graveflo> choose nim installs the compiler build tools. Atlas sets up dependency environments
21:51:27mhcatanyway, thanks!
21:52:01FromDiscord<graveflo> well the nim tool chain anyway. Ig the compiler build tools would be koch and stuff. bad wording
21:52:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:52:44FromDiscord<Elegantbeef> `std/os` has some procs that are hooked for the VM
21:53:16FromDiscord<graveflo> ah that is why I couldn't find it then! I was about to be a little disappointed
21:53:37FromDiscord<Elegantbeef> Assuming your target is an OS/platform that supports std/os
21:55:09mhcatatlas can install a set of compiler tools and gives you an activation script, like a virtualenv - maybe that's not the primary use case? I only discovered it yesterday :)
21:56:28FromDiscord<Elegantbeef> The primary usage for atlas is to install the dependencies required to build a project, which generally is not the compiler. The reason for choosenim to exist is to install the Nim toolchain
21:56:37FromDiscord<graveflo> oh yea. I guess it does. I've never tried to use that but it sounds like a pretty good idea
21:57:30FromDiscord<graveflo> atlas is still being worked on. It's def usable right now but I think it still needs some time to become robust
21:58:59FromDiscord<Elegantbeef> It also does not necessarily make packages that are compatible with nimble, so it's interesting
21:59:10mhcatI see - I saw in the docs that it shipped in 2.0, so I figured it was new - I couldn't tell where it was positioned wrt nimble and choosenim
21:59:28mhcatoh really? it updates nimble files with deps
21:59:44FromDiscord<Elegantbeef> It does do that of course
21:59:50mhcathow does it break nimble?
22:00:22FromDiscord<djazz> Nim project on HN https://news.ycombinator.com/item?id=38855337
22:00:30FromDiscord<djazz> https://frameos.net/
22:00:45FromDiscord<Elegantbeef> Cmon djazz there is a forum post!
22:02:19FromDiscord<Elegantbeef> I cannot at this very moment remember the issues that can arise in regard to Atlas \<-\> Nimble
22:03:12FromDiscord<djazz> oh sorry, was chatting with the creator
22:03:24FromDiscord<Elegantbeef> It's fine I was just kidding anyway
22:04:30mhcathmm, I can't seem to install atlas via nimble, oh well
22:04:57FromDiscord<Elegantbeef> Uhh
22:05:37FromDiscord<Elegantbeef> It's not in the nimble registry
22:05:40FromDiscord<Elegantbeef> you need to use the git url
22:05:50mhcataha
22:16:54FromDiscord<mariusandra> hi, author of FrameOS here 👋, thanks @djazz for the nudge!
22:17:52FromDiscord<mariusandra> guess I need to sign up to the forum now 😄
22:18:37FromDiscord<djazz> hay!
22:19:22FromDiscord<graveflo> looks impressive! good job
22:21:36FromDiscord<mariusandra> thanks! 😊
22:22:43FromDiscord<mariusandra> I'm pretty sure I still have a lot to learn, and made dumb errors along the way, like a few `{.gcsafe.}:` blocks that I'm unsure about... so any pointers towards best practices and other doh moments are very welcome. https://github.com/FrameOS/frameos/tree/main/frameos
22:23:16FromDiscord<mariusandra> I did rush through the implementation somewhat, and will now take some weeks to write tests and clean up parts
22:23:50systemdsuckslol i read that frameos headline but didn't think it was nim
22:24:04FromDiscord<Elegantbeef> No one uses Nim
22:24:35FromDiscord<mariusandra> I won't tell anyone if you won't
22:24:41systemdsucksnot the day of wirth's death
22:25:29FromDiscord<Elegantbeef> The gcSafe is sadly the correct idiom
22:25:31FromDiscord<Elegantbeef> Unless you want to pass the global state around
22:25:33FromDiscord<Elegantbeef> Which is more correct imo
22:25:35FromDiscord<Elegantbeef> Really your global state should likely be in a `object` and passed with `ptr YourObject`
22:25:42FromDiscord<Elegantbeef> And your lock should be inside that object, with your data `{.guard: yourLockFieldName.}`
22:27:14FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#guards-and-locks
22:28:08FromDiscord<luteva> Hi! Is there something like seq.flat in nim? that turns a sequence of sequences into a (one level) squence?
22:29:09FromDiscord<Elegantbeef> Not in the stdlib atleast that I know of, it's a fun metaprogramming problem though
22:31:26FromDiscord<Phil> I mean, `foldl`
22:32:05FromDiscord<Phil> Now back to not trying to go insane dealing with flipping pointers
22:32:20FromDiscord<Elegantbeef> I assumed they wanted nested sequences like a dullard
22:33:25FromDiscord<mariusandra> In reply to @Elegantbeef "And your lock should": interesting. I'll try it out when I'm modifying code around there again. And yeah, I thought the `gcsafe`-s are fine in any case, as the data below them is essentially immutable post creation, but I still have a lot to learn about the details behind all the keywords.
22:34:28FromDiscord<Phil> In reply to @mariusandra "I won't tell anyone": ~~You may have noticed he tends to lie a lot on non-technical stuff~~
22:35:02FromDiscord<Elegantbeef> Speaking hyperbolically is not lying!
22:35:21FromDiscord<djazz> Even I fall for it sometimes
22:40:11FromDiscord<Phil> TFW I can't figure out how to set the log level in chronicles
22:40:30FromDiscord<Phil> Ahhh there we go, -d:chronicles_log_level
22:42:23FromDiscord<Elegantbeef> @luteva just remembered if the `foldl` solution does not work for you https://github.com/beef331/nimtrest/wiki/Code-snippets#procedure-based-introspection has some inspiration
22:43:35FromDiscord<Phil> I'm going with ` let result = createShared(Chan[Msg])` going forward
22:43:47FromDiscord<Phil> createShared seems to work more easily than other approaches
22:43:49FromDiscord<luteva> oh yeah i see "flatten" 😄 thx a lot!
22:45:03FromDiscord<Elegantbeef> @mariusandra if the data is global but immutable after initialisation there is not much reason to do what I said, but I will say you should use the guard annotation on `globalLastImage` just to have the compiler cover your arse a bit
22:45:50FromDiscord<Elegantbeef> It's actually quite impressive how good type introspection can be just using procedures
22:46:58FromDiscord<mariusandra> In reply to @Elegantbeef "<@109381190187761664> if the data": the approach you suggested with a ptr does sound cleaner somehow, but yeah... I'm happy to leave as is and focus on the other todo items for now :). thanks for the globalLastImage suggestion
22:47:04FromDiscord<mariusandra> will get that done
22:51:40*azimut_ joined #nim
22:51:43*azimut quit (Ping timeout: 240 seconds)
22:53:45FromDiscord<nnsee> In reply to @mariusandra "hi, author of FrameOS": are you estonian? screenshot on the website says "Vannituba"
22:55:43FromDiscord<mariusandra> In reply to @nnsee "are you estonian? screenshot": yeah, left in an easter egg for people to find 🙈
22:56:07FromDiscord<nnsee> no tere siis
22:56:33FromDiscord<mariusandra> tere tere :D..
22:57:00FromDiscord<mariusandra> kahjuks tänapäeval ei saa sa olla veendunud, et ma ei ole GPT4 tõlge 😛
22:58:26FromDiscord<nnsee> your Estonian is too coherent for to be gpt 😅
22:58:50FromDiscord<nnsee> (edit) removed "for"
22:58:55FromDiscord<mariusandra> it is actually really good from my experience... but yeah 🙈
22:59:27FromDiscord<mariusandra> been living in Belgium for over a decade now though
22:59:41FromDiscord<mariusandra> (edit) "it" => "GPT4" | "GPT4is actually really good ... from" added "in it"
23:00:41FromDiscord<Phil> Note, for general chatter #offtopic is preferred.↵It's fine in #main as long as there's not too much going on or nobody is asking for help, but generally #offtopic is preferred
23:01:01FromDiscord<Elegantbeef> Scatter it's the police
23:01:20FromDiscord<nnsee> literally 1984
23:02:15FromDiscord<Phil> Nobody recognizes me until I bring up the channel descriptions or rules, every time
23:03:12FromDiscord<Elegantbeef> The funny thing is you think we recognise you, you're an apple for goodness sakes
23:03:13FromDiscord<Elegantbeef> Anyway back to Nim
23:03:30FromDiscord<djazz> Apple is a fruit
23:03:37FromDiscord<Phil> the douchebag fruit
23:03:59FromDiscord<mariusandra> who uses Nim?
23:04:02FromDiscord<Elegantbeef> Oh to upset you phil I had to remove the converters from traitor
23:04:10FromDiscord<nnsee> In reply to @mariusandra "who uses Nim?": just you and me
23:04:12FromDiscord<Elegantbeef> you now have to do `myValue.toTrait MyTrait` to conver
23:04:21FromDiscord<nnsee> In reply to @isofruit "*the douchebag fruit": don't be so hard on yourself! that's our job
23:05:06FromDiscord<Elegantbeef> It's now unusable!
23:05:13FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1192242287468621884/image.png?ex=65a85d28&is=6595e828&hm=27cf5c2ee1ff5e1376451f42cfa7051e1a7b9e99aaaf59d120c300013297b1ee&
23:13:50FromDiscord<luteva> sent a long message, see <!doctype html>
23:14:30FromDiscord<Elegantbeef> You should not even need to change much
23:14:49FromDiscord<Elegantbeef> `if` is fine inside `static`
23:14:53FromDiscord<Elegantbeef> `read` can work inside `static`
23:15:06FromDiscord<Elegantbeef> you really should be able to just do `static: compile(...)`
23:15:24FromDiscord<luteva> so
23:16:40FromDiscord<luteva> oh, i thought that if is a runtime branch while when is a compiletime branch 🙂 (same for read/static read)
23:16:53FromDiscord<luteva> (edit) "if" => ""if"" | "when" => ""when""
23:17:08FromDiscord<Elegantbeef> `when` is for dependent compilation
23:17:18FromDiscord<Elegantbeef> inside `static` everything is compile time
23:17:21FromDiscord<Elegantbeef> That's the point of static
23:17:39FromDiscord<luteva> ok, thanks a lot!
23:17:43FromDiscord<Elegantbeef> `staticRead` is also done at compile time, but inside a `static` `read` might be usable depending on target OS
23:19:28FromDiscord<Elegantbeef> `readFile` i mean works not all `read` procs will
23:42:14NimEventerNew thread by nsimha: Seq2 vs Unchecked Array performance difference , see https://forum.nim-lang.org/t/10844
23:48:10FromDiscord<Phil> In reply to @Elegantbeef "This relates to Phil's": Fun fact, I'm at the point now where I can turn that into a ref.↵That turns 1 leak of 32 bytes into 2 leaks of 32bytes + 56bytes
23:49:06FromDiscord<Phil> From... chronicles?
23:50:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
23:51:18FromDiscord<Phil> That stems from the timestamp it tries to have somehow
23:51:50FromDiscord<Phil> The 56 bytes are static though
23:53:45*advesperacit quit ()
23:59:17FromDiscord<Phil> Though it only occurs during debug logging... 🤷