00:04:22 | FromDiscord | <Robyn [She/Her]> Would making bindings to a Rust discord library be a stupid idea? Hm... |
00:05:42 | termer | does it expose a C API |
00:06:08 | termer | it 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:41 | FromDiscord | <Robyn [She/Her]> In reply to @termer "does it expose a": Nope, I'd have to write it myself |
00:07:12 | termer | There's a Nim Discord library already called Dimscord I believe |
00:07:15 | FromDiscord | <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:21 | termer | don't do that |
00:07:41 | FromDiscord | <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:42 | termer | unless you have a very deep knowledge of Nim async and tokio, that'll end in disaster |
00:07:48 | termer | well do what you want |
00:07:54 | termer | but I would just use dimscord |
00:08:40 | FromDiscord | <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:54 | FromDiscord | <Robyn [She/Her]> Not until I've at least got myself familiar with Rust in a serious way |
00:09:12 | FromDiscord | <Robyn [She/Her]> I will look into rewriting Nim's stdlib in Rust for no reason other than boredom, though :p |
00:09:42 | termer | if you're spending your time programming, you should work on something that you could reasonably finish and build on |
00:09:50 | FromDiscord | <Robyn [She/Her]> Would it be worth rewriting system.nim as an initial experiment first? Hm |
00:10:04 | termer | system.nim is very large |
00:10:09 | FromDiscord | <Robyn [She/Her]> In reply to @termer "if you're spending your": I probably should |
00:10:10 | termer | and it includes other large files |
00:10:20 | FromDiscord | <Robyn [She/Her]> I like having stupid thought experiments :p |
00:10:21 | termer | if you wanna do something silly that's fun, write your own scripting lang |
00:10:39 | termer | That's what I did back when I had time to make retarded experiments with programming |
00:10:44 | FromDiscord | <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:44 | termer | it was pretty funny, highly recommend |
00:10:47 | FromDiscord | <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:16 | termer | if you have time to fool around with those projects then you have time to write a parser lol |
00:11:26 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "To remain valuable to": It would for sure |
00:11:42 | FromDiscord | <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:58 | termer | All programmers under 25 seem to have ADHD |
00:12:00 | FromDiscord | <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:04 | termer | it's the world we live in |
00:12:04 | FromDiscord | <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:19 | FromDiscord | <Robyn [She/Her]> In reply to @termer "All programmers under 25": You'd be correct when talking about me, at least |
00:12:28 | termer | I could tell as much |
00:14:10 | FromDiscord | <Robyn [She/Her]> I'm not sure to take that as a compliment or an insult |
00:14:36 | termer | it's neither |
00:14:42 | termer | it's just an observation |
00:14:48 | FromDiscord | <Robyn [She/Her]> Fair enough |
00:14:59 | FromDiscord | <Robyn [She/Her]> I should really work on that parser |
00:15:22 | termer | do it and put it on github |
00:15:34 | FromDiscord | <Robyn [She/Her]> I shall! |
00:15:40 | termer | yours will be better than mine, mine was in Java |
00:16:07 | FromDiscord | <Elegantbeef> > under 25↵Damn you sunk my battle ship |
00:16:35 | termer | 8) |
00:17:02 | FromDiscord | <Robyn [She/Her]> In reply to @termer "yours will be better": Mine is in Python for the first version :p |
00:17:12 | FromDiscord | <Robyn [She/Her]> Get it working, then get it good, is what I'm going for :p |
00:17:14 | termer | disregard my statement then |
00:18:02 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> All in the course of like 4 days |
00:19:07 | FromDiscord | <Phil> ... I'm trying to stick to my stuff, it's the stuff that keeps changing scope# |
00:19:17 | FromDiscord | <Phil> I just wanted to do "microservice"-like multithreading |
00:19:29 | FromDiscord | <Elegantbeef> `startProcess` already exists |
00:19:31 | termer | Best thing you can do is set a scope if you wanna get stuff done, even if the narrowness of the scope hurts |
00:19:39 | FromDiscord | <Phil> Somehow I'm ending up debugging memory leaks of thread local variables |
00:21:04 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> Processes are better threads! |
00:22:24 | FromDiscord | <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:58 | FromDiscord | <Phil> For that to ever exist is what I mean |
00:23:41 | FromDiscord | <Phil> And then I'd still want sth to facilitate IPC calls just so that it's less of a hassle |
00:24:39 | FromDiscord | <Elegantbeef> Phil is really like "This guy makes hyperbolic comments all the time, let's spend time disproving them" |
00:27:53 | FromDiscord | <leorize> threads are just processes with the same address space |
00:30:17 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> Always |
00:36:19 | FromDiscord | <leorize> you'll get there, but shouldn't you sleep? |
00:44:49 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I'd argue that ADHD": XD |
00:45:34 | FromDiscord | <Phil> In reply to @leorize "you'll get there, but": Trying and failing. Honestly the topic is just keeping my brain active =/ |
00:45:47 | FromDiscord | <Phil> General memory debugging etc. |
00:46:07 | FromDiscord | <leorize> you'll fall down further the more wins you got |
00:46:11 | FromDiscord | <leorize> sorry about that |
00:46:35 | FromDiscord | <leorize> and then once you discovered how to profile everything and get wins from those |
00:46:37 | FromDiscord | <leorize> the cycle continues |
01:13:03 | * | advesperacit quit () |
01:13:41 | FromDiscord | <saint._._.> @Robyn [She/Her] What are you making your parser in |
01:13:47 | FromDiscord | <saint._._.> Do you have your own lexer I mean |
01:13:59 | FromDiscord | <saint._._.> Just handrolling it all yourself? Or using some library |
01:14:40 | FromDiscord | <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:57 | FromDiscord | <saint._._.> Nice |
01:16:16 | FromDiscord | <saint._._.> Are there no nim lexer libr |
01:16:17 | FromDiscord | <saint._._.> (edit) "libr" => "libs" |
01:20:42 | FromDiscord | <Robyn [She/Her]> In reply to @saint._._. "Are there no nim": There is Nimly to be fair |
01:42:08 | FromDiscord | <leorize> use `lexbase` if you want a hand-rolled lexer |
02:31:16 | FromDiscord | <Robyn [She/Her]> I keep having stupid ideas after stupid idea, and it's kinda funny |
02:31:39 | FromDiscord | <Robyn [She/Her]> This time: Rust memory management (with the `Rc` type) but implemented on Nim types |
02:31:54 | FromDiscord | <Robyn [She/Her]> I'm not doing this by the way, just to reassure anyone :p |
02:31:55 | FromDiscord | <Elegantbeef> You mean `ref` |
03:16:06 | FromDiscord | <Robyn [She/Her]> Rust ref counting yeah, on ref types- |
03:16:20 | FromDiscord | <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:24 | FromDiscord | <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:42 | FromDiscord | <leorize> what beef meant is that you just described the builtin `ref`↵(@Robyn [She/Her]) |
04:13:42 | FromDiscord | <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:26 | FromDiscord | <JJ> In reply to @chronos.vitaqua "This time: Rust memory": oh god |
04:23:38 | FromDiscord | <JJ> worst of both worlds 💀 |
04:23:40 | FromDiscord | <JJ> i love it |
04:24:50 | FromDiscord | <Robyn [She/Her]> :D |
05:19:43 | FromDiscord | <dddeserttt> Hello all |
05:19:52 | FromDiscord | <Elegantbeef> Hello |
05:20:41 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> It's generally just "refer to C docs" |
05:21:37 | FromDiscord | <Elegantbeef> Nim has codegendecl, emit and inline asm when things get iffy |
05:21:38 | FromDiscord | <dddeserttt> Damn alright |
05:21:50 | FromDiscord | <dddeserttt> Alright cool |
05:22:00 | FromDiscord | <dddeserttt> I figured that would be the answer but wanted to double check |
05:26:41 | nmz | has anything that low level been made with nim? |
05:30:11 | FromDiscord | <scipio_nl> In reply to @hlsee "is there any way": You mean print all digits of Pi? |
05:32:08 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> Nah it's all down to `fmt"bleh"` vs. `fmt "bleh"` |
05:32:46 | FromDiscord | <Elegantbeef> The first is a generalised string call |
05:32:49 | FromDiscord | <Elegantbeef> the latter is a normal call |
05:33:02 | FromDiscord | <Elegantbeef> Generalised string calls do not keep escaped characters |
05:33:22 | FromDiscord | <Elegantbeef> `&` converts those literal characters back into their escaped form |
05:34:30 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> What? |
05:34:47 | FromDiscord | <scipio_nl> It requires fmt in strformat but without escapes? |
05:35:28 | FromDiscord | <odexine> What? |
05:35:40 | FromDiscord | <Elegantbeef> That's what i said |
05:35:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:36:25 | FromDiscord | <scipio_nl> You're using fmt not & |
05:36:34 | FromDiscord | <Elegantbeef> As does `&` |
05:36:49 | FromDiscord | <Elegantbeef> All `&` does is return escape characters |
05:37:40 | FromDiscord | <scipio_nl> hang on, I had an error just minutes ago with a concrete example like this but I had deleted it |
05:38:11 | FromDiscord | <Elegantbeef> Look where the egg is now |
05:38:13 | FromDiscord | <Garrett> Hey random question |
05:38:15 | FromDiscord | <Garrett> Does anyone know of any mental health servers on element |
05:41:50 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:42:06 | FromDiscord | <Elegantbeef> you do not need `$` |
05:42:15 | FromDiscord | <Elegantbeef> That defeats the point |
05:42:29 | FromDiscord | <scipio_nl> hmm indeed |
05:43:15 | FromDiscord | <scipio_nl> well I stumbled on this where I ws toying around with the implicit assigning of items and pairs on iterators |
05:45:01 | FromDiscord | <Elegantbeef> We believe you! |
05:45:28 | FromDiscord | <scipio_nl> In reply to @Elegantbeef "We believe you!": That is what matters!!! 🫶 |
06:26:37 | FromDiscord | <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:41 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
07:33:52 | FromDiscord | <scipio_nl> (edit) |
07:34:54 | FromDiscord | <Elegantbeef> Well yea you need to import modules |
07:39:31 | FromDiscord | <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:54 | FromDiscord | <scipio_nl> In general btw I find the error messages in Nim not as clear as Rust cargo even remotely |
07:42:00 | FromDiscord | <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:27 | FromDiscord | <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:24 | FromDiscord | <scipio_nl> Nevertheless I like Nim so much I want to keep pushing on anyway |
07:44:48 | FromDiscord | <Elegantbeef> Tightly binding unary is nice |
07:44:51 | PMunch | scipio_nl, `+1` is a number literal |
07:44:59 | FromDiscord | <Elegantbeef> It's actually not |
07:45:06 | FromDiscord | <Elegantbeef> `+` is a `Call(+, 1)` |
07:45:17 | FromDiscord | <Elegantbeef> `-` is though |
07:45:25 | PMunch | Oh, that's confusing |
07:45:35 | PMunch | The result ends up the same though |
07:47:19 | FromDiscord | <Elegantbeef> I assumed both were prefix operators |
07:47:26 | FromDiscord | <Elegantbeef> But yea the parser special cases `-` |
07:48:10 | FromDiscord | <scipio_nl> In reply to @PMunch "Oh, that's confusing": That was my point yes |
07:48:58 | PMunch | Oh no, I didn't mean that `2 +1` was confusing, that makes perfect sense |
07:49:29 | PMunch | But 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:37 | PMunch | Since it already does it for `-` |
07:49:43 | FromDiscord | <scipio_nl> It is confusing being a Nim beginner and an expert apparently, but due to different layers of complexity |
07:50:06 | FromDiscord | <scipio_nl> I do understand your explanations now tho |
07:50:52 | FromDiscord | <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:06 | FromDiscord | <Phil> In reply to @scipio_nl "It is confusing being": I feel that so bad |
07:54:43 | FromDiscord | <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:13 | FromDiscord | <Phil> Or an offside comment by beef/leorize/mratsim |
07:55:51 | FromDiscord | <Elegantbeef> Hey don't include me there |
07:55:53 | FromDiscord | <Elegantbeef> I'm a dullard with a keyboard |
07:56:15 | FromDiscord | <Phil> Then I'm a dog with a keyboard and glasses |
07:56:55 | FromDiscord | <Elegantbeef> You have glasses you're clearly intelligent |
07:56:57 | FromDiscord | <nnsee> I'm three kids in a trenchcoat |
07:58:53 | FromDiscord | <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:49 | FromDiscord | <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:57 | FromDiscord | <nnsee> In reply to @isofruit "I'm not sure if": 1 newborn, 1 12-year old, 1 who's nearly an adult |
08:00:27 | FromDiscord | <Elegantbeef> Glad you told me an apple was a fruit |
08:00:31 | FromDiscord | <Elegantbeef> I thought it was a planet |
08:00:52 | PMunch | nnsee, hopefully not stacked in that order.. |
08:00:57 | FromDiscord | <Phil> In reply to @Elegantbeef "Glad you told me": That's why I wear glasses and you don't |
08:36:28 | FromDiscord | <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:07 | FromDiscord | <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:21 | FromDiscord | <sOkam! 🫐> (edit) removed "html" |
09:10:50 | FromDiscord | <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:12 | FromDiscord | <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:57 | FromDiscord | <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:24 | FromDiscord | <Phil> (edit) "It" => "There" |
09:17:48 | FromDiscord | <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:50 | FromDiscord | <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:16 | FromDiscord | <sOkam! 🫐> (edit) "there↵But" => "there on my own path, and use the compiler as a library↵But" |
09:24:20 | FromDiscord | <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:37 | FromDiscord | <Phil> (edit) "macros," => "macros and webdev," |
09:52:25 | FromDiscord | <fosster> hiii folks |
09:54:28 | FromDiscord | <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:05 | FromDiscord | <Elegantbeef> `proc hash(yourType: YourString): Hash {.borrow.}` |
09:55:22 | FromDiscord | <Elegantbeef> Or `proc hash(yourType: YourString): Hash = Hash string(yourType)` |
09:55:39 | FromDiscord | <Elegantbeef> whoops that should be `hash(string yourType)` or any other variation |
09:55:46 | FromDiscord | <fosster> but I already tried to do that, and the error perserverates |
09:56:05 | FromDiscord | <fosster> wait I try again |
09:56:07 | FromDiscord | <fosster> thanks btw |
09:56:08 | FromDiscord | <Elegantbeef> You need your own `hash` and `==` |
09:59:50 | FromDiscord | <fosster> sent a code paste, see https://play.nim-lang.org/#ix=html> |
10:02:11 | FromDiscord | <fosster> sent a long message, see <!doctype html> |
10:02:31 | FromDiscord | <Elegantbeef> You are lacking `import std/tables` |
10:02:49 | FromDiscord | <Elegantbeef> your `Env` type is an alias to a Table? |
10:03:13 | FromDiscord | <fosster> yes |
10:03:15 | FromDiscord | <fosster> oh you're right |
10:03:19 | FromDiscord | <fosster> sorry I am dumb |
10:03:28 | FromDiscord | <Elegantbeef> It also might not be `var` |
10:04:09 | FromDiscord | <fosster> what you mean? |
10:04:31 | FromDiscord | <Elegantbeef> You need to declare mutable variables/parameters with `var` |
10:04:37 | FromDiscord | <Elegantbeef> `[]=` requires them to be mutable |
10:05:00 | FromDiscord | <Elegantbeef> IE you might do `let x = ...; x[...] = ...` |
10:05:11 | FromDiscord | <fosster> env is a var not a let |
10:05:28 | FromDiscord | <Elegantbeef> Might was the operative word |
10:05:46 | FromDiscord | <fosster> thanks a lot |
10:06:31 | FromDiscord | <fosster> to be honest I sometimes get confused on when to use `var` over `let` 😅 |
10:06:38 | FromDiscord | <fosster> but it's just me |
10:07:17 | FromDiscord | <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:27 | FromDiscord | <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:29 | FromDiscord | <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:29 | FromDiscord | <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:40 | FromDiscord | <sOkam! 🫐> (edit) "capture" => "capture, before its generated," |
10:08:55 | FromDiscord | <sOkam! 🫐> I basically want the raw json with the comments but not html |
10:12:24 | FromDiscord | <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:14 | FromDiscord | <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:25 | FromDiscord | <intellij_gamer> Might need to check where else `rstField` is set cause I'm kinda confused why the rendering is done later |
10:13:41 | FromDiscord | <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:57 | FromDiscord | <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:08 | FromDiscord | <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:51 | FromDiscord | <sOkam! 🫐> I had no idea bout this #issue, but it seems to be exactly what I was searching for yep |
10:19:08 | FromDiscord | <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:50 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
10:28:06 | FromDiscord | <sOkam! 🫐> (edit) |
10:28:31 | FromDiscord | <sOkam! 🫐> (edit) |
10:29:41 | FromDiscord | <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:57 | FromDiscord | <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:30 | FromDiscord | <intellij_gamer> Are you assigning description field yourself? |
10:54:30 | FromDiscord | <sOkam! 🫐> `renderRstToOut` is the real actual culprit, though |
10:54:45 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "Are you assigning description": no, just skipping the for with that snipped |
10:54:53 | FromDiscord | <sOkam! 🫐> (edit) "for" => "`for`" | "snipped" => "snippet" |
10:54:57 | FromDiscord | <sOkam! 🫐> (edit) "`for`" => "`if`" |
10:55:39 | FromDiscord | <intellij_gamer> Ah, well you'll need to assign something |
10:55:41 | FromDiscord | <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:01 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "Ah, well you'll need": yeah but what, lol |
10:56:37 | FromDiscord | <sOkam! 🫐> does a `rst == nil` mean that there is no doc-comment for that block of code? |
10:59:00 | FromDiscord | <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:39 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "Yeah, cause in places": where is the `PNode` to get the plaindocstring from there? |
11:00:54 | FromDiscord | <sOkam! 🫐> there is no pnode in `renderItemPre` |
11:01:11 | FromDiscord | <intellij_gamer> `n` I think |
11:01:29 | FromDiscord | <intellij_gamer> Not `renderItemPre`, `genJsonItem` |
11:03:56 | FromDiscord | <sOkam! 🫐> you lost me there |
11:07:38 | FromDiscord | <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:09 | FromDiscord | <eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:09:04 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "So in here https://github.com/nim-lang/Nim/blob/20d": but how |
11:09:13 | FromDiscord | <sOkam! 🫐> I don't even know how to get the description at all in there |
11:09:52 | FromDiscord | <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:10 | FromDiscord | <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:30 | FromDiscord | <eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:13:05 | FromDiscord | <intellij_gamer> Yeah try that |
11:13:45 | FromDiscord | <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:17 | FromDiscord | <eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:15:33 | FromDiscord | <intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:15:54 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:16:30 | FromDiscord | <sOkam! 🫐> It solves the `/` vs `\\` problem for you, basically |
11:16:36 | FromDiscord | <eilerolrikpottestepper> Thanks |
11:17:09 | FromDiscord | <intellij_gamer> Damn, just starting tickering with this locally and `getPlainDocstring` is returning an empty string |
11:18:15 | FromDiscord | <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:22 | FromDiscord | <sOkam! 🫐> (edit) removed "myself" |
11:19:02 | FromDiscord | <eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:19:13 | FromDiscord | <eilerolrikpottestepper> (edit) |
11:19:25 | FromDiscord | <pmunch> Seems like USERPROFILE isn't set |
11:20:00 | FromDiscord | <sOkam! 🫐> `echo getEnv("USERPROFILE")` |
11:20:32 | FromDiscord | <eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:21:04 | FromDiscord | <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:09 | FromDiscord | <sOkam! 🫐> (edit) "output" => "text" |
11:21:26 | FromDiscord | <intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:21:28 | FromDiscord | <sOkam! 🫐> we don't know what you mean by `[]` or `[USERNAME]` |
11:21:30 | FromDiscord | <eilerolrikpottestepper> Yes |
11:21:40 | FromDiscord | <eilerolrikpottestepper> In reply to @heysokam "we don't know what": just redacted username |
11:21:49 | FromDiscord | <sOkam! 🫐> In reply to @eilerolrikpottestepper "just redacted username": what does redacted mean? |
11:22:00 | FromDiscord | <odexine> Held back for secrecy |
11:22:08 | FromDiscord | <eilerolrikpottestepper> exatly |
11:22:09 | FromDiscord | <odexine> It’s just their username and they removed it |
11:22:09 | FromDiscord | <sOkam! 🫐> kk |
11:22:17 | FromDiscord | <eilerolrikpottestepper> (edit) "exatly" => "exactly" |
11:22:28 | FromDiscord | <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:48 | PMunch | eilerolrikpottestepper: By the way, you can use `getHomeDir` from std/appdirs to get the home directory |
11:22:57 | FromDiscord | <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:18 | FromDiscord | <eilerolrikpottestepper> Ahh thanks |
11:23:55 | FromDiscord | <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:56 | FromDiscord | <eilerolrikpottestepper> It's finally working now |
11:24:01 | FromDiscord | <eilerolrikpottestepper> thanks |
11:24:20 | FromDiscord | <eilerolrikpottestepper> Just hoping it doesn't get flagged as malware |
11:28:06 | PMunch | Well.. |
11:39:41 | FromDiscord | <pengwyns> Question, does anyone know what finish.exe is? Like what source file is it built from? |
11:39:57 | FromDiscord | <pengwyns> I am trying to see if there is a specific module or thing that makes nim binaries get flagged. |
11:42:13 | FromDiscord | <intellij_gamer> Might be this file https://github.com/nim-lang/Nim/blob/devel/tools/finish.nim |
11:49:58 | FromDiscord | <intellij_gamer> sent a long message, see <!doctype html> |
12:00:09 | PMunch | intellij_gamer, are you working on documentation? |
12:06:42 | FromDiscord | <intellij_gamer> I do when I need a feature/fix |
12:13:36 | PMunch | What're you working on implementing now? |
12:22:45 | FromDiscord | <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:58 | PMunch | Raw 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:01 | FromDiscord | <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:16 | PMunch | Aaah, I see |
14:52:31 | PMunch | So you'd want the raw RST output instead |
14:52:38 | PMunch | Makes sense |
14:52:49 | FromDiscord | <sOkam! 🫐> that's what he means by raw, having the actual rst or markdown or w/e |
14:53:59 | PMunch | One benefit of using the HTML output is that Nim has it's own flavour of RST/Markdown |
14:54:08 | PMunch | So it could be hard to parse yourself |
14:54:21 | FromDiscord | <sOkam! 🫐> In reply to @PMunch "So you'd want the": except when you don't use it |
14:54:22 | PMunch | What we should really have is some kind of document IR |
14:55:16 | FromDiscord | <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:56 | PMunch | Well 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:52 | PMunch | So 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:39 | FromDiscord | <sOkam! 🫐> I'm lost in how a doc IR would be like |
15:01:32 | FromDiscord | <sOkam! 🫐> In reply to @intellij_gamer "<@186489007247589376> https://github.com/nim-lang/N": what does that second link do? |
15:01:36 | PMunch | Oh yeah I don't have any good ideas either :P |
15:02:55 | PMunch | I 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:06 | FromDiscord | <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:29 | FromDiscord | <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:58 | FromDiscord | <sOkam! 🫐> (edit) " broken" => "stuck" |
15:18:06 | FromDiscord | <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:33 | FromDiscord | <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:38 | FromDiscord | <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:51 | FromDiscord | <Phil> (edit) "management.↵I'm" => "management/manipulation.↵I'm" |
16:39:17 | FromDiscord | <Phil> https://github.com/treeform/pixie↵Could see if that suits your needs |
16:50:13 | * | wheatengineer joined #nim |
16:51:36 | NimEventer | New thread by pp: FrameOS, see https://forum.nim-lang.org/t/10842 |
16:55:42 | FromDiscord | <djazz> Pixie is the one yeah |
17:12:56 | FromDiscord | <anuke> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:14:00 | FromDiscord | <Phil> ... we have a capture thingy? |
17:14:49 | FromDiscord | <anuke> Yes, it's necessary for capturing, say, for-loop indices in closures that are invoked later |
17:15:03 | FromDiscord | <Phil> I am fascinated and am now searching docs |
17:15:56 | FromDiscord | <Phil> Ah, from sugar, hmmmm |
17:18:25 | FromDiscord | <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:43 | FromDiscord | <Phil> What exactly is supposed to happen there? |
17:24:02 | FromDiscord | <Phil> The one example of closure that I could spot did an assigment within capture |
17:25:40 | FromDiscord | <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:14 | FromDiscord | <saint.___.> In reply to @demotomohiro "My Nim FAQ has": Thank you, I think this is what I was looking for! |
19:13:37 | FromDiscord | <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:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:19:32 | * | Guest9372 quit (Ping timeout: 252 seconds) |
19:37:53 | FromDiscord | <Phil> Turns out, nilling the variable suffices |
19:56:05 | * | flouer joined #nim |
19:57:41 | * | flouer_ quit (Ping timeout: 240 seconds) |
20:11:14 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:12:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:13:40 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
20:13:55 | FromDiscord | <Phil> (edit) |
20:15:24 | FromDiscord | <leorize> > `/home/philipp/dev/threadbutler/examples/ex_stdinput.nim:63:2` |
20:15:36 | FromDiscord | <leorize> looks like it's at a later point now, but previously this pointed to the `new` line |
20:16:01 | FromDiscord | <leorize> or rather, that's the only place it could've pointed to |
20:16:59 | FromDiscord | <leorize> if you want a better view, try `--linedir:off` |
20:17:13 | FromDiscord | <leorize> then errors will point directly to the C code |
20:17:22 | FromDiscord | <leorize> which you can inspect to see where it actually came from |
20:18:42 | FromDiscord | <leorize> you could also just check the C file now by tracing the `#line` directives |
20:18:48 | FromDiscord | <Phil> Thaaaaat does not make things any clearer. Or rather the C output doesn't |
20:19:04 | FromDiscord | <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:56 | FromDiscord | <Phil> Er... I don't but that's 1000+ loc |
20:20:07 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1192200738835804333/message.txt?ex=65a83676&is=6595c176&hm=1249073e635c37d96e204b3ca28240e4e565cf82c4494eb3e346f505a8bb615b& |
20:20:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:21:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:21:54 | FromDiscord | <Phil> The stacktrace leads to the `main...` call and that's it, after that I'm in some interceptor_calloc thing |
20:22:40 | FromDiscord | <Phil> My current hypothesis is that the way I add channels is leaky |
20:23:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:23:52 | FromDiscord | <leorize> if you add some fillers to the top, does that move the line? |
20:24:13 | FromDiscord | <Phil> You mean if I just add newlines inside the C file? |
20:24:33 | FromDiscord | <leorize> no, like adding pointless `echo` before that line |
20:25:48 | FromDiscord | <Phil> Tried that, yes it does move the line in the stacktrace, assuming I'm not using --linedir:off |
20:25:48 | FromDiscord | <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:08 | FromDiscord | <leorize> does that pin you somewhere closer? |
20:28:04 | FromDiscord | <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:54 | FromDiscord | <Phil> Nevermind, trying to not use the global assignment nets me immediate binary runtime crashes |
20:30:44 | FromDiscord | <leorize> why does that matter?↵(@Phil) |
20:31:04 | FromDiscord | <leorize> you can allocate the storage on the heap, no? |
20:31:37 | FromDiscord | <Phil> Wait, you mean use a ref-table? |
20:31:47 | FromDiscord | <Phil> Or do you mean using ref-channels? |
20:32:15 | FromDiscord | <leorize> ref table certainly works, your channel is single-owner, right? |
20:32:15 | * | flouer_ joined #nim |
20:32:25 | FromDiscord | <leorize> there's also unique\_ptr in fusion if you want to enforce that |
20:32:59 | FromDiscord | <intellij_gamer> In reply to @heysokam "what does that second": Second link is another place where RST gets initially made |
20:33:59 | FromDiscord | <Phil> Wait, but that still doesn't work because this is about wanting a pointer-pointer table |
20:34:09 | FromDiscord | <Phil> And which addresses go into that table |
20:36:25 | FromDiscord | <Phil> If at all it'd need to be that I ref-allocate the individual channels |
20:36:33 | FromDiscord | <Phil> aka heap allocate |
20:37:25 | FromDiscord | <leorize> i'm not sure what you're trying to do with that code, but not allocating is pretty weird |
20:38:06 | FromDiscord | <Phil> Honestly it does get allocated because var, IIRC it was because trySend by default needs a "var Channel" |
20:38:25 | FromDiscord | <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:39 | FromDiscord | <leorize> ah, so you did upload the full file |
20:39:45 | FromDiscord | <leorize> I'll see if I can find something |
20:41:12 | FromDiscord | <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:47 | FromDiscord | <leorize> if you're going `ptr` then just `create()` them directly instead of doing a round-about |
20:42:26 | FromDiscord | <Phil> You speak as if I know what that means |
20:42:59 | FromDiscord | <Phil> Is there a special create proc or sth? |
20:43:15 | FromDiscord | <leorize> or `alloc`, I don't remember the exact name |
20:43:29 | FromDiscord | <Phil> I have not once directly alloc'd anything in my life |
20:44:16 | FromDiscord | <leorize> https://nim-lang.org/docs/system.html#createShared,typedesc |
20:44:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:44:54 | FromDiscord | <Phil> (edit) |
20:45:18 | FromDiscord | <Phil> Note how channelInt is the same between both channels, which means it overwrote the channel gets overwritten all the time |
20:45:28 | FromDiscord | <Phil> (edit) removed "it overwrote" |
20:45:40 | FromDiscord | <Phil> That likely was why I didn't want to go ref because I screwed up every attempt |
20:47:40 | FromDiscord | <leorize> how did you go `ref`? |
20:47:51 | FromDiscord | <leorize> did you just discard the `ref`? then it'd get deallocated |
20:48:29 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:49:11 | FromDiscord | <spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1192208057497829517/image.png?ex=65a83d47&is=6595c847&hm=d0f41dac23a0ae65d8010480b88443bae1151dbe27199528e9dc0a422eabbb4a& |
20:49:13 | FromDiscord | <spacelucy> what does this mean? |
20:49:23 | FromDiscord | <spacelucy> i don't really understand what it's asking |
20:49:39 | FromDiscord | <spacelucy> from `nimble init` |
20:49:41 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:49:47 | FromDiscord | <Phil (he/him)> I assume this is from when you selected a license |
20:49:56 | FromDiscord | <spacelucy> yeah |
20:50:02 | FromDiscord | <Phil (he/him)> It helps to provide all information and not just random screenshots \:-P |
20:50:15 | FromDiscord | <spacelucy> image.png https://media.discordapp.net/attachments/371759389889003532/1192208325132169236/image.png?ex=65a83d86&is=6595c886&hm=a94ecbd4cad4febd1b0a113a019f9eaeecf254c0f6997b844a335097306e6537& |
20:50:16 | FromDiscord | <spacelucy> sorry |
20:50:24 | FromDiscord | <spacelucy> I know its related to the license |
20:50:34 | FromDiscord | <spacelucy> but i don't really understand the prompt |
20:51:07 | FromDiscord | <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:25 | FromDiscord | <spacelucy> oh, alright |
20:51:27 | FromDiscord | <leorize> I think you'll have to explain why is it that you erase the channel types |
20:51:29 | FromDiscord | <Phil (he/him)> It's "Is your project usable only under GPL v3 or maybe also under future GPL v4 etc." |
20:51:40 | FromDiscord | <spacelucy> ok, sounds good to me |
20:51:58 | FromDiscord | <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:02 | FromDiscord | <Q-Master> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:52:40 | FromDiscord | <leorize> createShared would let you remove that `sizeof()` |
20:53:08 | FromDiscord | <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:29 | FromDiscord | <Phil (he/him)> And storing them all in one table is just so convenient everywhere else |
20:54:09 | FromDiscord | <leorize> then why don't you just use a `ref object`? |
20:54:25 | FromDiscord | <Phil (he/him)> For? |
20:54:34 | FromDiscord | <Phil (he/him)> Channels? The Table? |
20:55:11 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:55:26 | FromDiscord | <leorize> makes it a bit safer when you actually use the channel |
20:56:12 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "... how do I": Wouldn't that be `=destroy`(x) anyway? |
20:57:14 | FromDiscord | <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:36 | FromDiscord | <leorize> you get conversion checks, basically |
20:59:48 | FromDiscord | <leorize> for this one, `new()` allocated a new `ref`, but once it went out-of-scope, it gets deallocated |
20:59:49 | FromDiscord | <leorize> that's why you get the same one over and over again |
21:00:52 | FromDiscord | <leorize> if you don't want tracked refs, you should really commit to it |
21:02:06 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:02:47 | FromDiscord | <user2m> (edit) |
21:03:20 | FromDiscord | <spacelucy> oh yeah also `nim install` doesn't add to the .nimble file? |
21:03:32 | FromDiscord | <spacelucy> do i have to manually write them in there or am i doing this wrong? |
21:03:56 | FromDiscord | <leorize> yea it won't |
21:04:01 | FromDiscord | <leorize> nimble install is a global thing |
21:04:57 | FromDiscord | <spacelucy> alright thanks |
21:06:56 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:07:09 | FromDiscord | <leorize> remember to add something to close those channels and deallocate the pointers once you're done with your hub |
21:07:18 | FromDiscord | <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:28 | FromDiscord | <Phil (he/him)> Give me a bit ^^ |
21:10:29 | FromDiscord | <Phil (he/him)> And all the helper procs now also need to cope with containing ref types rather than value types |
21:11:37 | FromDiscord | <Phil (he/him)> Wait.... what? Why bother with the.... what? |
21:12:05 | FromDiscord | <Phil (he/him)> Oh, you jumped approaches, the above is not for the ChannelBase approach |
21:13:29 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:13:53 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:16:33 | FromDiscord | <Phil (he/him)> Oh wait I am dumb, forgot that the return type still had a "var" attached |
21:17:29 | FromDiscord | <leorize> yep, although you might want to not do that |
21:18:04 | FromDiscord | <Phil (he/him)> Not have the var? Yeah I removed it. Or do you mean not go to the inheritance approach? |
21:18:11 | FromDiscord | <leorize> yea this is annoying, `ref` doesn't work here |
21:18:32 | FromDiscord | <Phil (he/him)> What, why? |
21:18:37 | FromDiscord | <leorize> the problem is that when you lease the channel from the hub, that incurs a ref count operation |
21:18:45 | FromDiscord | <leorize> which basically forces you to use atomicArc |
21:19:26 | FromDiscord | <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:48 | FromDiscord | <leorize> what happens if more than one thread queries it? |
21:20:13 | FromDiscord | <Phil (he/him)> `type ChannelHub = object`↵↵Each thread has its own copy of the same pointers |
21:21:55 | FromDiscord | <leorize> the issue here is a potential data race |
21:21:57 | FromDiscord | <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:58 | FromDiscord | <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:04 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:22:15 | FromDiscord | <leorize> i'm talking about the ref surrounding the channel, not the channel |
21:22:46 | FromDiscord | <leorize> so now you are short by one count and your channel could get deallocated |
21:23:41 | FromDiscord | <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:59 | FromDiscord | <leorize> you can just reimplement shared\_ptr in nim to handle that \:p |
21:24:22 | FromDiscord | <leorize> by reimplement I meant copy this\: https://github.com/nim-lang/fusion/blob/0b0a0273b8df860cd54e3fcca7bb4c617244ac77/src/fusion/smartptrs.nim#L62-L65 |
21:24:27 | FromDiscord | <Elegantbeef> Or just `import threading/ptrs` or w/e |
21:24:44 | FromDiscord | <leorize> oh a copy is there |
21:25:14 | FromDiscord | <Elegantbeef> I think they're slightly modified |
21:25:44 | FromDiscord | <leorize> well but it doesn't look like you can downcast from it |
21:28:59 | FromDiscord | <leorize> hmm cloning the table wholesale means you don't have an actual owner of those channels |
21:30:20 | FromDiscord | <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:19 | FromDiscord | <leorize> something along those lines, yes |
21:31:55 | FromDiscord | <Elegantbeef> Yea I told him it'd be a problem! |
21:38:50 | FromDiscord | <e.e.7> Sad news: Niklaus Wirth died on Jan 1st - https://lists.inf.ethz.ch/pipermail/oberon/2024/016856.html |
21:39:27 | FromDiscord | <Elegantbeef> Best right a typesafe program |
21:39:30 | FromDiscord | <Elegantbeef> write\ |
21:45:49 | mhcat | is the absence of atlas from the installed bits when using the bin archive install script (and choosenim) intentional? |
21:46:13 | FromDiscord | <Elegantbeef> Nope choosenim has not been updated to consider atlas |
21:46:17 | FromDiscord | <Elegantbeef> It builds it, it just does not move it |
21:46:33 | FromDiscord | <Elegantbeef> You likely should do `nimble install atlas@#head` regardless |
21:46:38 | FromDiscord | <graveflo> is nimscript unable to read files? |
21:47:06 | mhcat | right, I figured that choosenim was probably going to fade away since atlas provides a...better?.. model |
21:47:29 | mhcat | but the actual nim distibution from nim-lang.org doesn't copy it |
21:47:51 | mhcat | so I will copy it myself, then use it to make workspaces that use a new version :) |
21:48:25 | FromDiscord | <Elegantbeef> atlas and choosenim are not really related |
21:49:25 | NimEventer | New thread by khaledh-nim: Niklaus Wirth has died, see https://forum.nim-lang.org/t/10843 |
21:49:28 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> Grave it depends on which nimscript |
21:49:35 | FromDiscord | <Elegantbeef> The CT nimscript or the `nim e`? |
21:50:00 | FromDiscord | <graveflo> I'm using it to run build tasks like `nim someTask somefile.nims` |
21:50:43 | mhcat | atlas docs make a distinction between "workspace" and "project", which to me seems a bit more choosenim-like in its use cases |
21:51:06 | mhcat | but also I guess it in some ways gets up in nimble's business too |
21:51:19 | FromDiscord | <graveflo> choose nim installs the compiler build tools. Atlas sets up dependency environments |
21:51:27 | mhcat | anyway, thanks! |
21:52:01 | FromDiscord | <graveflo> well the nim tool chain anyway. Ig the compiler build tools would be koch and stuff. bad wording |
21:52:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:52:44 | FromDiscord | <Elegantbeef> `std/os` has some procs that are hooked for the VM |
21:53:16 | FromDiscord | <graveflo> ah that is why I couldn't find it then! I was about to be a little disappointed |
21:53:37 | FromDiscord | <Elegantbeef> Assuming your target is an OS/platform that supports std/os |
21:55:09 | mhcat | atlas 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:28 | FromDiscord | <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:37 | FromDiscord | <graveflo> oh yea. I guess it does. I've never tried to use that but it sounds like a pretty good idea |
21:57:30 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> It also does not necessarily make packages that are compatible with nimble, so it's interesting |
21:59:10 | mhcat | I 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:28 | mhcat | oh really? it updates nimble files with deps |
21:59:44 | FromDiscord | <Elegantbeef> It does do that of course |
21:59:50 | mhcat | how does it break nimble? |
22:00:22 | FromDiscord | <djazz> Nim project on HN https://news.ycombinator.com/item?id=38855337 |
22:00:30 | FromDiscord | <djazz> https://frameos.net/ |
22:00:45 | FromDiscord | <Elegantbeef> Cmon djazz there is a forum post! |
22:02:19 | FromDiscord | <Elegantbeef> I cannot at this very moment remember the issues that can arise in regard to Atlas \<-\> Nimble |
22:03:12 | FromDiscord | <djazz> oh sorry, was chatting with the creator |
22:03:24 | FromDiscord | <Elegantbeef> It's fine I was just kidding anyway |
22:04:30 | mhcat | hmm, I can't seem to install atlas via nimble, oh well |
22:04:57 | FromDiscord | <Elegantbeef> Uhh |
22:05:37 | FromDiscord | <Elegantbeef> It's not in the nimble registry |
22:05:40 | FromDiscord | <Elegantbeef> you need to use the git url |
22:05:50 | mhcat | aha |
22:16:54 | FromDiscord | <mariusandra> hi, author of FrameOS here 👋, thanks @djazz for the nudge! |
22:17:52 | FromDiscord | <mariusandra> guess I need to sign up to the forum now 😄 |
22:18:37 | FromDiscord | <djazz> hay! |
22:19:22 | FromDiscord | <graveflo> looks impressive! good job |
22:21:36 | FromDiscord | <mariusandra> thanks! 😊 |
22:22:43 | FromDiscord | <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:16 | FromDiscord | <mariusandra> I did rush through the implementation somewhat, and will now take some weeks to write tests and clean up parts |
22:23:50 | systemdsucks | lol i read that frameos headline but didn't think it was nim |
22:24:04 | FromDiscord | <Elegantbeef> No one uses Nim |
22:24:35 | FromDiscord | <mariusandra> I won't tell anyone if you won't |
22:24:41 | systemdsucks | not the day of wirth's death |
22:25:29 | FromDiscord | <Elegantbeef> The gcSafe is sadly the correct idiom |
22:25:31 | FromDiscord | <Elegantbeef> Unless you want to pass the global state around |
22:25:33 | FromDiscord | <Elegantbeef> Which is more correct imo |
22:25:35 | FromDiscord | <Elegantbeef> Really your global state should likely be in a `object` and passed with `ptr YourObject` |
22:25:42 | FromDiscord | <Elegantbeef> And your lock should be inside that object, with your data `{.guard: yourLockFieldName.}` |
22:27:14 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#guards-and-locks |
22:28:08 | FromDiscord | <luteva> Hi! Is there something like seq.flat in nim? that turns a sequence of sequences into a (one level) squence? |
22:29:09 | FromDiscord | <Elegantbeef> Not in the stdlib atleast that I know of, it's a fun metaprogramming problem though |
22:31:26 | FromDiscord | <Phil> I mean, `foldl` |
22:32:05 | FromDiscord | <Phil> Now back to not trying to go insane dealing with flipping pointers |
22:32:20 | FromDiscord | <Elegantbeef> I assumed they wanted nested sequences like a dullard |
22:33:25 | FromDiscord | <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:28 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> Speaking hyperbolically is not lying! |
22:35:21 | FromDiscord | <djazz> Even I fall for it sometimes |
22:40:11 | FromDiscord | <Phil> TFW I can't figure out how to set the log level in chronicles |
22:40:30 | FromDiscord | <Phil> Ahhh there we go, -d:chronicles_log_level |
22:42:23 | FromDiscord | <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:35 | FromDiscord | <Phil> I'm going with ` let result = createShared(Chan[Msg])` going forward |
22:43:47 | FromDiscord | <Phil> createShared seems to work more easily than other approaches |
22:43:49 | FromDiscord | <luteva> oh yeah i see "flatten" 😄 thx a lot! |
22:45:03 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> It's actually quite impressive how good type introspection can be just using procedures |
22:46:58 | FromDiscord | <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:04 | FromDiscord | <mariusandra> will get that done |
22:51:40 | * | azimut_ joined #nim |
22:51:43 | * | azimut quit (Ping timeout: 240 seconds) |
22:53:45 | FromDiscord | <nnsee> In reply to @mariusandra "hi, author of FrameOS": are you estonian? screenshot on the website says "Vannituba" |
22:55:43 | FromDiscord | <mariusandra> In reply to @nnsee "are you estonian? screenshot": yeah, left in an easter egg for people to find 🙈 |
22:56:07 | FromDiscord | <nnsee> no tere siis |
22:56:33 | FromDiscord | <mariusandra> tere tere :D.. |
22:57:00 | FromDiscord | <mariusandra> kahjuks tänapäeval ei saa sa olla veendunud, et ma ei ole GPT4 tõlge 😛 |
22:58:26 | FromDiscord | <nnsee> your Estonian is too coherent for to be gpt 😅 |
22:58:50 | FromDiscord | <nnsee> (edit) removed "for" |
22:58:55 | FromDiscord | <mariusandra> it is actually really good from my experience... but yeah 🙈 |
22:59:27 | FromDiscord | <mariusandra> been living in Belgium for over a decade now though |
22:59:41 | FromDiscord | <mariusandra> (edit) "it" => "GPT4" | "GPT4is actually really good ... from" added "in it" |
23:00:41 | FromDiscord | <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:01 | FromDiscord | <Elegantbeef> Scatter it's the police |
23:01:20 | FromDiscord | <nnsee> literally 1984 |
23:02:15 | FromDiscord | <Phil> Nobody recognizes me until I bring up the channel descriptions or rules, every time |
23:03:12 | FromDiscord | <Elegantbeef> The funny thing is you think we recognise you, you're an apple for goodness sakes |
23:03:13 | FromDiscord | <Elegantbeef> Anyway back to Nim |
23:03:30 | FromDiscord | <djazz> Apple is a fruit |
23:03:37 | FromDiscord | <Phil> the douchebag fruit |
23:03:59 | FromDiscord | <mariusandra> who uses Nim? |
23:04:02 | FromDiscord | <Elegantbeef> Oh to upset you phil I had to remove the converters from traitor |
23:04:10 | FromDiscord | <nnsee> In reply to @mariusandra "who uses Nim?": just you and me |
23:04:12 | FromDiscord | <Elegantbeef> you now have to do `myValue.toTrait MyTrait` to conver |
23:04:21 | FromDiscord | <nnsee> In reply to @isofruit "*the douchebag fruit": don't be so hard on yourself! that's our job |
23:05:06 | FromDiscord | <Elegantbeef> It's now unusable! |
23:05:13 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1192242287468621884/image.png?ex=65a85d28&is=6595e828&hm=27cf5c2ee1ff5e1376451f42cfa7051e1a7b9e99aaaf59d120c300013297b1ee& |
23:13:50 | FromDiscord | <luteva> sent a long message, see <!doctype html> |
23:14:30 | FromDiscord | <Elegantbeef> You should not even need to change much |
23:14:49 | FromDiscord | <Elegantbeef> `if` is fine inside `static` |
23:14:53 | FromDiscord | <Elegantbeef> `read` can work inside `static` |
23:15:06 | FromDiscord | <Elegantbeef> you really should be able to just do `static: compile(...)` |
23:15:24 | FromDiscord | <luteva> so |
23:16:40 | FromDiscord | <luteva> oh, i thought that if is a runtime branch while when is a compiletime branch 🙂 (same for read/static read) |
23:16:53 | FromDiscord | <luteva> (edit) "if" => ""if"" | "when" => ""when"" |
23:17:08 | FromDiscord | <Elegantbeef> `when` is for dependent compilation |
23:17:18 | FromDiscord | <Elegantbeef> inside `static` everything is compile time |
23:17:21 | FromDiscord | <Elegantbeef> That's the point of static |
23:17:39 | FromDiscord | <luteva> ok, thanks a lot! |
23:17:43 | FromDiscord | <Elegantbeef> `staticRead` is also done at compile time, but inside a `static` `read` might be usable depending on target OS |
23:19:28 | FromDiscord | <Elegantbeef> `readFile` i mean works not all `read` procs will |
23:42:14 | NimEventer | New thread by nsimha: Seq2 vs Unchecked Array performance difference , see https://forum.nim-lang.org/t/10844 |
23:48:10 | FromDiscord | <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:06 | FromDiscord | <Phil> From... chronicles? |
23:50:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:51:18 | FromDiscord | <Phil> That stems from the timestamp it tries to have somehow |
23:51:50 | FromDiscord | <Phil> The 56 bytes are static though |
23:53:45 | * | advesperacit quit () |
23:59:17 | FromDiscord | <Phil> Though it only occurs during debug logging... 🤷 |