00:00:01 | FromDiscord | <Elegantbeef> `let x = y` can copy |
00:00:22 | FromDiscord | <Robyn [She/Her]> Nice, it works :) |
00:00:39 | FromDiscord | <Robyn [She/Her]> No I meant for copying the tree |
00:02:41 | FromDiscord | <Elegantbeef> Cause it's the same asst |
00:02:43 | FromDiscord | <Elegantbeef> ast\ |
00:02:47 | FromDiscord | <Elegantbeef> Cause Nim uses pointers |
00:03:31 | FromDiscord | <Robyn [She/Her]> And the body is being modified after the fact? |
00:03:31 | * | beholders_eye quit (Read error: Connection reset by peer) |
00:03:46 | FromDiscord | <Elegantbeef> No it's semantically resolved in the first branch |
00:04:18 | FromDiscord | <Elegantbeef> In the second branch it's already checked so it's not resemmed and the compiler accepts the `Error` into `ok` |
00:09:03 | * | beholders_eye joined #nim |
00:10:14 | * | beholders_eye quit (Read error: Connection reset by peer) |
00:12:41 | FromDiscord | <Robyn [She/Her]> Aah |
00:16:25 | * | beholders_eye joined #nim |
00:17:49 | * | def- joined #nim |
00:22:27 | FromDiscord | <Robyn [She/Her]> I think a better name for `unpackIt` is needed |
00:34:04 | FromDiscord | <Robyn [She/Her]> I wonder if I should make an `init` macro to provide the basic initialisation functionality |
00:36:29 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=XsUsTUGf |
00:36:47 | FromDiscord | <Robyn [She/Her]> I don't like the idea of overloading `()` but it might be the best way |
00:37:01 | FromDiscord | <Robyn [She/Her]> Alternatively I could just name it `init` |
00:37:21 | FromDiscord | <Robyn [She/Her]> Not sure which one is more idiomatic for Nim |
00:37:40 | FromDiscord | <Elegantbeef> `init` works better |
00:39:32 | * | SchweinDeBurg joined #nim |
00:41:43 | * | beholders_eye quit (Read error: Connection reset by peer) |
00:42:29 | * | beholders_eye joined #nim |
00:44:56 | * | beholders_eye quit (Read error: Connection reset by peer) |
00:47:46 | FromDiscord | <Robyn [She/Her]> Good point |
00:48:02 | FromDiscord | <Robyn [She/Her]> I do need to use `new` for ref sum types though, hm |
00:48:07 | FromDiscord | <Robyn [She/Her]> Eh, not my problem for now |
00:50:53 | * | beholders_eye joined #nim |
01:14:43 | FromDiscord | <zumi.dxy> sent a code paste, see https://play.nim-lang.org/#pasty=IuzDOpVS |
01:25:25 | FromDiscord | <Robyn [She/Her]> What's the recommended way to slice a string without copying? I want to be able to store it in a type, but iirc codegen issues with views are an issue rn |
01:27:44 | FromDiscord | <Elegantbeef> `toOpenArray` |
01:27:48 | FromDiscord | <Elegantbeef> The answer is there are no view types |
01:27:58 | FromDiscord | <Elegantbeef> so you take a `ptr` and ensure the life times our cry |
01:28:00 | FromDiscord | <Elegantbeef> or cry\ |
01:28:43 | FromDiscord | <Robyn [She/Her]> Hm... |
01:28:50 | FromDiscord | <zumi.dxy> `lent` doesn't work yet? |
01:29:00 | FromDiscord | <Robyn [She/Her]> What does lent do? |
01:29:14 | FromDiscord | <Elegantbeef> Lent works but you cannot hold onto it |
01:29:16 | FromDiscord | <Elegantbeef> just like var |
01:29:27 | FromDiscord | <Elegantbeef> It's a copy on storage operation since there is no lifetime tracking |
01:30:04 | FromDiscord | <Robyn [She/Her]> Hm |
01:32:19 | FromDiscord | <Robyn [She/Her]> Is it expensive to slice a string? I could return an offset instead which would mean I could pass around `openArray[char]` freely without losing the original string and having to copy often |
01:32:31 | FromDiscord | <Elegantbeef> It copies the slice |
01:32:56 | FromDiscord | <Robyn [She/Her]> Ah |
01:33:26 | FromDiscord | <Robyn [She/Her]> Well, `toOpenArray(offset, myStr.len - 1)` should be fine to avoid copying right? |
01:33:43 | FromDiscord | <Elegantbeef> Except you cannot hold onto `openArray[char]` in a field |
01:34:05 | FromDiscord | <Robyn [She/Her]> I'll just pass around a `var string` in parameters, which would allow me to avoid the need to store it |
01:34:24 | FromDiscord | <Robyn [She/Her]> As long as I have access to the original string (I always will), an offset is more than enough |
01:37:58 | * | lucasta quit (Quit: Leaving) |
01:43:47 | * | beholders_eye quit (Read error: Connection reset by peer) |
01:45:47 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
01:52:59 | * | fallback quit (Read error: Connection reset by peer) |
01:58:49 | * | fallback joined #nim |
02:09:33 | * | krux02 quit (Remote host closed the connection) |
02:19:09 | * | def- quit (Quit: -) |
02:19:43 | * | def- joined #nim |
02:22:41 | * | def- quit (Client Quit) |
02:53:24 | FromDiscord | <Robyn [She/Her]> `Error: invalid type: 'openArray[char]' for let` pain |
03:04:23 | * | def- joined #nim |
03:30:35 | * | fallback quit (Read error: Connection reset by peer) |
03:40:00 | * | SchweinDeBurg joined #nim |
03:40:20 | FromDiscord | <albassort> @leorize0713 encase you're curious where the direction im going with this project its:↵Im binding sequoria because im blown away by it, seriously impressed with the quality of code. I'm going to be binding it by writing a bunch of super high level high configuration rust functions that only take in c-compatible paramaters arrays, string, and ints. Not exposing the low-level api, but making simple tools the average person needs. |
03:40:28 | FromDiscord | <albassort> how does that sound |
03:40:51 | FromDiscord | <albassort> @Robyn [She/Her] way in on this i value ur opinion because you're my age |
03:41:30 | FromDiscord | <albassort> (edit) "way" => "weigh" |
03:46:53 | FromDiscord | <leorize> sequoia is pretty good, rpm is even using it now |
03:47:03 | FromDiscord | <leorize> (rpm is the fedora/red hat package manager) |
03:51:52 | FromDiscord | <leorize> though I'll remind you that you should only be trying to do gpg because you want to interop with ecosystems already using gpg (like verifying packages or something) |
03:52:34 | FromDiscord | <leorize> the gpg model is very outdated for today's internet and other format rose up to replace it for the encryption/signing use cases |
03:57:25 | FromDiscord | <albassort> no |
03:57:57 | FromDiscord | <albassort> its not outdated for our time, if what you're describing to me is correct, an engineer in 1975 would laugh at you for the design of gpgme |
03:58:26 | FromDiscord | <albassort> that is simply bad design |
03:58:42 | FromDiscord | <albassort> theres nothing new or old about it\ |
03:58:42 | FromDiscord | <albassort> (edit) "it\" => "it" |
03:58:56 | FromDiscord | <Elegantbeef> > weigh in on this i value ur opinion because you're my age↵What a weird statement 😄 |
03:59:39 | FromDiscord | <albassort> why don't you weigh in then beef |
04:00:14 | FromDiscord | <Elegantbeef> Make the high level wrapper wherever is easiest |
04:00:23 | FromDiscord | <Elegantbeef> If it's easier to use cbindgen and do it in Nim, then do it that way |
04:01:02 | FromDiscord | <albassort> beef, i thought rust had this by default |
04:01:08 | FromDiscord | <albassort> i dont actually know anything about rust |
04:01:15 | FromDiscord | <Elegantbeef> Had what by default? |
04:01:20 | FromDiscord | <albassort> the ability to importc |
04:01:25 | FromDiscord | <Elegantbeef> It does |
04:01:35 | FromDiscord | <Elegantbeef> cbindgen generates C headers for CFFI |
04:01:38 | FromDiscord | <Elegantbeef> From rust |
04:02:35 | FromDiscord | <albassort> i thought by compiling it as a library it already had something i could import |
04:02:52 | FromDiscord | <albassort> https://dev.to/dumblepytech1/the-way-integrate-rust-into-nim-40p3 |
04:03:27 | FromDiscord | <Elegantbeef> I mean sure if you want to define the ABI and have no safety you can use any library without a C header |
04:03:47 | FromDiscord | <Elegantbeef> The C header formalises the ABI and since it's generated from Rust code gives you type safety |
04:03:49 | FromDiscord | <albassort> understood. I would like a c header |
04:03:55 | FromDiscord | <albassort> instead of shooting in blank |
04:04:09 | FromDiscord | <Elegantbeef> cbindgen lets you generate headers from rust code |
04:04:21 | FromDiscord | <Elegantbeef> Wishes we had this for Nim in a way that wasn't hacky like seeya |
04:04:34 | FromDiscord | <albassort> yes i understood the point after pointed out the different haha |
04:05:55 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=xvFyQhno |
04:05:58 | FromDiscord | <Elegantbeef> Hell until some commit in devel Nim's ABI caused RVO even in cdecls 😄 |
04:06:11 | FromDiscord | <Elegantbeef> No references cannot be constants |
04:06:30 | FromDiscord | <Elegantbeef> Turn that into a `table` then at runtime do `myTable[] = theConst` |
04:06:42 | FromDiscord | <Elegantbeef> Only use `ref` if you want reference semantics |
04:07:14 | FromDiscord | <xkonti> I see. The resulting table is quite large so I'll try the `myTable[] = theConst` trick. Thanks! |
04:07:37 | FromDiscord | <Elegantbeef> Are you mutating the table? |
04:08:00 | FromDiscord | <Elegantbeef> Ostensibly you're not |
04:10:50 | FromDiscord | <xkonti> Oooh so nice to see `ostensibly` being actually used 😍↵↵The table isn't mutated but it contains several megs of data and a few hundred items inside (which are not refs). |
04:11:09 | FromDiscord | <Elegantbeef> I over use a few select amount of words |
04:11:27 | FromDiscord | <Elegantbeef> Well then yea you can move it into the reference |
04:15:05 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=AgVZaZlU |
04:15:23 | FromDiscord | <Elegantbeef> Lol that's so wrong it's not funny |
04:15:27 | FromDiscord | <Elegantbeef> `[]` is the dereference operator |
04:15:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LOWCOFle |
04:17:46 | FromDiscord | <xkonti> Uh oh. That's why `[]` looked familiar. Duh. Doesn't it mean that the `myConst` is being copied into `glyphsBlocky` and because of that I have 2 copies of it in RAM? |
04:18:17 | FromDiscord | <Elegantbeef> You could likely use some codegen hacks to get that in static memory |
04:20:16 | FromDiscord | <Elegantbeef> Actually... Nim's sequence literals are CoW so that might be fine |
04:24:34 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=bEXTdOWp |
04:24:53 | FromDiscord | <Elegantbeef> Const's are compiled into the binary's data section |
04:26:35 | FromDiscord | <xkonti> Oh right. What the hell am I thinking. Clearly I'm not used to this kind of low-level programming. I know it's pretty far from the real low level, but for me it's low enough 😅↵↵I guess I'll deal with it being the way it is for now 🙂 |
04:26:42 | FromDiscord | <xkonti> I don't like "hacks" 😛 |
04:27:02 | FromDiscord | <Elegantbeef> Hmph actually seq literals do not do that CoW optimisation, only strings |
04:28:09 | FromDiscord | <Elegantbeef> Well the least hacky you can do is `ptr Table[string, string]` |
04:28:19 | FromDiscord | <Elegantbeef> That's not ideal of course using unsafe mechanisms |
04:29:27 | FromDiscord | <xkonti> Hmm... I might actually try that... This wouldn't get propagated far as it's instantly hidden behind some safe procs... |
04:31:04 | FromDiscord | <Elegantbeef> I do wonder, why do you even need this reference? |
04:32:41 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=bsEELwJr |
04:33:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OOLrmiZX |
04:33:41 | FromDiscord | <Elegantbeef> Whoops |
04:34:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=XWegPpcY |
04:34:56 | FromDiscord | <Elegantbeef> Then you do like `state.getCharacter(character, font)` and have no need for this large trap filled table to be exposed |
04:36:17 | * | xet7 quit (Remote host closed the connection) |
04:38:40 | FromDiscord | <xkonti> Ok. I'll pause this conversation here. I'll see how the current approach works and if I will ever need to pass the thing around. |
04:39:12 | FromDiscord | <Elegantbeef> Here we can see someone regretting asking a question whilst I was around |
04:56:55 | * | fallback joined #nim |
05:08:46 | FromDiscord | <pmunch> In reply to @zumi.dxy "<@392962235737047041> tried your labelledtry": Hmm, good question. Haven't tried it on 2.0.4. I'll give it a go and see if I can figure out what's going on |
05:46:49 | * | fallback quit (Read error: Connection reset by peer) |
06:11:37 | NimEventer | New Nimble package! shobiz - Simple structured console messages for Nim applications., see https://github.com/logavanc/shobiz |
06:27:39 | * | PMunch joined #nim |
06:41:40 | FromDiscord | <pmunch> In reply to @zumi.dxy "<@392962235737047041> tried your labelledtry": Turns out my original test couldn't run inside a procedure 😛 You're playing with very untested stuff here. But I fixed it now, should work better now |
07:10:16 | FromDiscord | <ebahi> didn't know this was possible https://media.discordapp.net/attachments/371759389889003532/1245997763561521202/sQq0v2O.png?ex=665ac958&is=665977d8&hm=db500355fc8079082853aa8a2c1fc7d9b83c855b07f6482b264052d133b0bf2b& |
07:15:04 | * | ntat joined #nim |
07:18:34 | FromDiscord | <zumi.dxy> In reply to @pmunch "Turns out my original": ahh lmao↵yeah that's understandable |
07:20:45 | FromDiscord | <zumi.dxy> it compiles now at least, thanks! |
07:21:07 | FromDiscord | <zumi.dxy> now to figure out how to use it with {.raises: [].} |
07:24:37 | FromDiscord | <pmunch> In reply to @ebahi "didn't know this was": Didn't know what was possible? |
07:25:28 | FromDiscord | <nnsee> spaces |
07:25:50 | FromDiscord | <nnsee> before this, they wrote code strictly with no spaces |
07:26:07 | PMunch | And now they're making up for it by putting spaces everywhere? |
07:30:11 | FromDiscord | <nnsee> indeed |
07:33:17 | FromDiscord | <ebahi> In reply to @PMunch "And now they're making": it looks good to my eyes |
07:34:00 | FromDiscord | <Elegantbeef> are your eyes open? |
07:34:04 | FromDiscord | <pmunch> You might have to see an optometrist |
07:34:11 | FromDiscord | <pmunch> Just kidding, to each their own |
07:35:06 | FromDiscord | <ebahi> i always kinda liked how assembly looked but to each their own |
07:51:04 | * | fallback joined #nim |
07:55:47 | FromDiscord | <.bobbbob> could random "IndexDefect: index out of bounds, the container is empty" be caused by that bug which is fixed in devel and is recommended to use -d:useMalloc to fix? |
07:56:18 | FromDiscord | <.bobbbob> what are the advantages and disadvantages for -d:useMalloc anyways? |
07:57:03 | FromDiscord | <.bobbbob> also what's the link to the bug report for that anyways |
08:05:12 | PMunch | That is very unlikely |
08:05:22 | PMunch | IndexDefect is often a bug in your code |
08:10:56 | FromDiscord | <.bobbbob> In reply to @.bobbbob "what are the advantages": yeah that's what I figured, you know the answer to this though? |
08:17:58 | FromDiscord | <ieltan> sent a long message, see https://pasty.ee/LncOBCjU |
08:18:04 | PMunch | To what causes the IndexDefect in your code? |
08:18:35 | PMunch | Oh sorry, replies don't show up clearly on IRC |
08:19:05 | PMunch | I think @ieltan summed it up nicely |
08:19:20 | FromDiscord | <.bobbbob> In reply to @ieltan "advantage: you don't use": I see, thanks |
08:19:26 | PMunch | Pros and cons, mostly speed vs. compatibility |
08:19:35 | FromDiscord | <.bobbbob> In reply to @PMunch "To what causes the": Trying to hunt it down haha, it's a weird transient error |
08:19:51 | PMunch | Don't you get a stack trace? |
08:22:00 | FromDiscord | <.bobbbob> I run a website and people have been complaining about a problem for a while but I've never been able to replicate it, no idea what causes it |
08:24:13 | PMunch | Sounds like you need some logging :P |
08:25:18 | PMunch | IndexDefects are typically caused by things like `somecollection[0]` without checking whether `somecollection` actually has any data, or by `somecollection[indexfromuser]` without verifying that `indexfromuser` is valid. |
08:56:55 | FromDiscord | <ieltan> Funny how this comes up |
08:58:11 | FromDiscord | <ieltan> I was thinking about how to deal with this issue because I'm not a fan of the repeated `if t.hasKey(k)` ceremony |
08:59:17 | FromDiscord | <ieltan> There's that function that returns a default when a key is missing but still |
09:10:08 | PMunch | That shouldn't raise an IndexError though, but a KeyError |
09:10:27 | PMunch | IndexDefect rather |
09:10:37 | PMunch | It's for arrays and such |
09:28:55 | FromDiscord | <ieltan> oops, my bad |
09:29:57 | * | beholders_eye joined #nim |
10:36:56 | * | gshumway quit (Quit: .) |
10:41:04 | * | gshumway joined #nim |
10:53:13 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "<@524288464422830095> weigh in on": Hm?- i don't have many thoughts in general ehe |
11:04:11 | * | beholders_eye quit (Ping timeout: 264 seconds) |
11:58:45 | * | beholders_eye joined #nim |
12:12:10 | * | beholders_eye quit (Ping timeout: 255 seconds) |
12:24:15 | * | krux02 joined #nim |
12:42:05 | * | nils` quit (Quit: nils`) |
13:05:34 | FromDiscord | <Robyn [She/Her]> Hm, I'm trying `getTypeInst` on a symbol, and it's returning the alias of the type rather than what it's supposed to point to |
13:07:50 | FromDiscord | <Robyn [She/Her]> `getImpl` isn't helping here, either |
13:10:22 | PMunch | `getTypeImpl`? |
13:11:35 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "`getTypeImpl`?": Return an empty node |
13:13:05 | FromDiscord | <Robyn [She/Her]> (edit) "Return" => "Returns" |
13:13:09 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=XeTzyCpd |
13:13:20 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "`getImpl` isn't helping here,": as i know `getImpl` give `nil` on primitives |
13:13:52 | FromDiscord | <Robyn [She/Her]> `Stipes` is a `Table[string, Table[string, tuple[value, field: NimNode]]` |
13:14:07 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=GssroeVN |
13:14:57 | FromDiscord | <Robyn [She/Her]> In reply to @griffith1deadly "as i know `getImpl`": It's not a primitive, the type is `ParseResult = Result[tuple[idx: AstIndex, offset: int], string]` (`Result` is my own type) |
13:15:26 | FromDiscord | <Robyn [She/Her]> I'm passing an instance of `ParseResult` around, but I need the symbol of `Result` |
13:22:07 | * | PMunch quit (Remote host closed the connection) |
13:33:52 | * | PMunch joined #nim |
13:35:38 | * | beholders_eye joined #nim |
13:42:05 | * | PMunch quit (Quit: Leaving) |
14:00:15 | * | lucasta joined #nim |
14:03:31 | FromDiscord | <Robyn [She/Her]> `/data/data/com.termux/files/home/Napkins-Combinator/main.nim(178, 11) Error: cannot use symbol of kind 'var' as a 'field'` https://play.nim-lang.org/#pasty=WXDYyTYM :/ |
14:03:39 | FromDiscord | <Robyn [She/Her]> This error makes zero sense to me |
14:16:49 | FromDiscord | <thesherwood> What's the SOTA for generating nim bindings for C libraries? |
14:17:15 | FromDiscord | <solitudesf> In reply to @chronos.vitaqua "`/data/data/com.termux/files/home/Napkins-Combinato": tuple field in parseOk template has the same name as template parameter |
14:17:57 | FromDiscord | <solitudesf> so it gets substituted unsuccessfully |
14:46:01 | FromDiscord | <Robyn [She/Her]> Ooooh, thanks Solitude! |
14:50:43 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#pasty=cuJyUsdz |
14:52:01 | FromDiscord | <pmunch> In reply to @thesherwood "What's the SOTA for": Futhark I'd say, granted I'm a bit biased |
14:54:23 | * | beholders_eye quit (Ping timeout: 256 seconds) |
14:55:15 | FromDiscord | <thesherwood> In reply to @pmunch "Futhark I'd say, granted": I just saw it and it looks great. Though I'm a complete novice when it comes to linking C libs. So I might ask a few questions shortly. I'm wanting to wrap `tree-sitter` |
14:56:55 | FromDiscord | <nocturn9x> In reply to @treeform "Probably means you are": ye ig |
14:57:54 | * | krux02 quit (Remote host closed the connection) |
15:44:23 | * | lain quit (Ping timeout: 264 seconds) |
15:53:55 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
16:15:57 | FromDiscord | <thesherwood> In reply to @pmunch "Futhark I'd say, granted": Heads up that I ran into errors trying `nimble install futhark` on my machine. I assumed this is because my environment is funky because I've been using nimskull as well. But then I tried it on replit (https://replit.com/@theSherwood/ProfuseDarkmagentaAutotote) (`nimble install futhark`) and ran into similar errors with `ldl`. |
16:18:24 | FromDiscord | <pmunch> What are the errors? And did you check the README? |
16:19:44 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/glassesneo/OOlib↵This thing looks so cool! |
16:26:41 | FromDiscord | <thesherwood> sent a code paste, see https://play.nim-lang.org/#pasty=MDefwpDQ |
16:31:14 | * | lain joined #nim |
16:35:52 | * | lucasta quit (Quit: Leaving) |
16:38:08 | * | krux02 joined #nim |
16:41:12 | FromDiscord | <thesherwood> With clang installed on replit, the futhark installation works fine. Sorry about that |
16:53:19 | * | beholders_eye joined #nim |
17:09:57 | FromDiscord | <pmunch> Some distros split clang and libclang, maybe you need to install the latter? |
17:11:07 | FromDiscord | <pmunch> In reply to @sys64 "https://github.com/glassesneo/OOlib This thing look": Not gonna lie, that actually looks pretty good if you want to do OO programming |
17:12:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "Not gonna lie, that": https://github.com/YaDev/NimCLS↵There is that too↵I dunno what's the best |
17:18:23 | FromDiscord | <thesherwood> sent a code paste, see https://play.nim-lang.org/#pasty=EHaXnGII |
17:58:55 | FromDiscord | <pmunch> In reply to @thesherwood "On replit, I've got": Which version of Futhark? Clang should be able to find stdlib.h in more recent versions 🤔 |
17:59:13 | FromDiscord | <pmunch> Did you set `sysPath` in Futhark by accident? |
18:01:45 | FromDiscord | <thesherwood> sent a code paste, see https://play.nim-lang.org/#pasty=yssPBvHm |
18:08:06 | FromDiscord | <pmunch> Hmm, that shouldn't fail with that error.. |
18:08:22 | FromDiscord | <pmunch> Although not sure if that `./` will work |
18:09:36 | * | SchweinDeBurg joined #nim |
18:09:54 | FromDiscord | <pmunch> What does `clang -print-resource-dir` return on your system? |
18:10:27 | FromDiscord | <thesherwood> `/nix/store/j17j4qqf28js718v8pfymvhk6p3l6n38-clang-wrapper-11.1.0/resource-root` |
18:11:01 | FromDiscord | <thesherwood> If you have a replit account, you should be able to access the environment here: https://replit.com/@theSherwood/EarlyBlueSpreadsheets |
18:47:29 | FromDiscord | <pmunch> I don't, and besides I'm on my phone |
18:48:08 | FromDiscord | <pmunch> Clang 11 is really old though.. |
18:48:39 | FromDiscord | <pmunch> Well, a couple of years |
18:48:52 | FromDiscord | <pmunch> But I think we're at 16-17 atm? |
18:50:03 | FromDiscord | <thesherwood> Okay. I'll see if I can make that work. Thanks for your help |
19:03:39 | * | ntat quit (Quit: Leaving) |
19:35:06 | FromDiscord | <albassort> In reply to @chronos.vitaqua "Hm?- i don't have": Head empty |
20:03:01 | * | jmdaemon joined #nim |
20:07:54 | * | jmdaemon quit (Ping timeout: 252 seconds) |
20:20:07 | * | jmdaemon joined #nim |
21:07:42 | FromDiscord | <shad.ow> could i use nimscript for dynamic configuration of a nim program ? |
21:07:51 | FromDiscord | <shad.ow> i want to use it as the plugin language for my text editor |
21:27:34 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "Head empty": Ye |
21:27:57 | FromDiscord | <Robyn [She/Her]> In reply to @shad.ow "could i use nimscript": What do you mean by dynamic configuration? But you should look at nimscripter |
21:28:06 | FromDiscord | <albassort> In reply to @shad.ow "could i use nimscript": I don't know if there is any good example of that in nim right now |
21:28:48 | FromDiscord | <albassort> In reply to @chronos.vitaqua "What do you mean": He means like running lua in a jit with an API from within a program to extend it |
21:28:53 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "I don't know if": `config.nims` files |
21:29:07 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "He means like running": Oh yeah that can definitely be done, Nimscripter can enable that |
21:29:09 | FromDiscord | <albassort> Like emacs lisp |
21:29:11 | FromDiscord | <Robyn [She/Her]> It's just pretty slow |
21:29:13 | FromDiscord | <shad.ow> In reply to @chronos.vitaqua "Oh yeah that can": i see |
21:29:15 | FromDiscord | <shad.ow> In reply to @albassort "Like emacs lisp": yep |
21:29:24 | FromDiscord | <Robyn [She/Her]> By enable I mean allow you to do that |
21:29:42 | FromDiscord | <albassort> Yeah Nim script while having a cool name isn't actually that cool |
21:29:55 | FromDiscord | <Robyn [She/Her]> Nimscript is pretty slow |
21:30:13 | FromDiscord | <albassort> Ur script is pretty slow |
21:30:29 | FromDiscord | <Elegantbeef> We're talking about config for a text editor, speed really is not the most concerning thing |
21:30:37 | FromDiscord | <Elegantbeef> There are entire X window managers written in python |
21:30:56 | FromDiscord | <albassort> That's a horrible thing to tell me exist |
21:31:03 | FromDiscord | <albassort> I guess I kind of figured it had to exist but I didn't want to know about it |
21:31:14 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "We're talking about config": When you're writing plugins though, I'd imagine it's a concern if it's something that runs every time to you edit |
21:31:19 | FromDiscord | <albassort> (edit) "exist" => "exists" |
21:31:30 | FromDiscord | <Elegantbeef> They said config, not plugins |
21:31:52 | FromDiscord | <Robyn [She/Her]> Fair |
21:31:58 | FromDiscord | <Elegantbeef> Robyn you might like this https://play.nim-lang.org/#pasty=yMmzuVJU |
21:32:01 | FromDiscord | <albassort> Yeah but from other context clues I think you can tell they didn't actually mean config |
21:32:06 | FromDiscord | <Elegantbeef> I had this idea to steal Zig's' comptime |
21:32:22 | FromDiscord | <Elegantbeef> Right we should use wasm for plugin systems |
21:32:32 | FromDiscord | <Elegantbeef> That way it's language, OS, and arch agnostic |
21:32:45 | FromDiscord | <albassort> I agree with this beef |
21:32:45 | FromDiscord | <Elegantbeef> Or use a risc-v emulator like @fwsgonzo wrote about recently |
21:33:14 | FromDiscord | <albassort> Nah man we should be fucking deploying it using docker and have an entire sub operating system for each and every plugin |
21:33:37 | FromDiscord | <Elegantbeef> So you dislike learning about qtile but you have the gall to mention docker |
21:33:53 | FromDiscord | <albassort> That was sarcasm haha |
21:34:28 | FromDiscord | <albassort> I'm getting to like podman for internal build environments for programs that have very poorly makefiles |
21:34:59 | FromDiscord | <albassort> (edit) "I'm getting to like podman for internal build environments for programs that have very poorly ... makefiles" added "made" |
21:35:06 | FromDiscord | <Elegantbeef> The amount of times I've had docker builds actually work is like 1 time |
21:35:18 | FromDiscord | <Elegantbeef> So if anyone relies on docker files, please make sure they work |
21:35:26 | FromDiscord | <albassort> No man don't use |
21:35:28 | FromDiscord | <albassort> Docker |
21:35:30 | FromDiscord | <albassort> Use podman |
21:35:34 | FromDiscord | <albassort> It removes like half of the problems |
21:35:38 | FromDiscord | <Elegantbeef> Same shit |
21:36:13 | FromDiscord | <albassort> That being said with the amount of problems I have with docker, and I have no ability to fix them because they are so esoteric |
21:36:24 | FromDiscord | <albassort> I'm tired of my Linux ecosystem being eaten up by insane sub ecosystems |
21:38:41 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Robyn you might like": Oh? What's so special about Zig comptime? |
21:38:55 | FromDiscord | <Elegantbeef> It let's you create types like that |
21:39:00 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Right we should use": I third this motion |
21:39:28 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It let's you create": I still don't get the importance aha |
21:39:51 | FromDiscord | <Elegantbeef> You can dynamically make types at compile time then emit them out without relying on a macro |
21:40:16 | FromDiscord | <fwsgonzo> you need a decent compiler to emit good RISC-V |
21:40:47 | FromDiscord | <fwsgonzo> (edit) "RISC-V" => "RISC-V, same with WASM" |
21:42:35 | FromDiscord | <fwsgonzo> aftwards you can live with a decent interpreter of RISC-V, but you practically need JIT for WASM |
21:46:42 | FromDiscord | <Elegantbeef> Yea, but the alternative is either a single scripting language or system libraries |
21:47:00 | FromDiscord | <Elegantbeef> Both have negatives |
21:47:13 | FromDiscord | <Robyn [She/Her]> In reply to @fwsgonzo "aftwards you can live": You don't need a JIT, wasm3 exists after all |
21:47:30 | FromDiscord | <Elegantbeef> Think the point was you need a jit for speed |
21:47:41 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It let's you create": Fair |
21:47:56 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Think the point was": Aah, isn't Wasm3 still fast for an interpreter? |
21:48:40 | FromDiscord | <Elegantbeef> If you feel that, benchmark it |
21:49:14 | FromDiscord | <fwsgonzo> I can only recuse myself from that 🙂 |
21:50:07 | FromDiscord | <fwsgonzo> we really do lack a way to compile directly to a target from inside a program, ignoring TCC |
21:50:15 | FromDiscord | <Elegantbeef> The major benefit wasm has over risc-v is it's actively being targeted and supported by compilers |
21:50:41 | FromDiscord | <Elegantbeef> risc-v is targeted and supported, but it's userbase is like 3 people and a bird |
21:50:58 | FromDiscord | <fwsgonzo> yes, you're kinda forced to target it, especially if you want your language to have a good playground web-app |
21:51:55 | FromDiscord | <Elegantbeef> Ponders whether clang can remove everything but the wasm backend |
21:52:27 | FromDiscord | <Elegantbeef> Not that it's fast, but if one could strip all the non wasm needed code from clang/llvm it'd debloat it a tinge to ship it |
21:53:01 | FromDiscord | <fwsgonzo> some projects ship Zig 🙂 |
21:54:23 | FromDiscord | <fwsgonzo> but it's grossly practical, it's more techno-dazzling if it's an actual embedded compiler |
21:55:12 | FromDiscord | <Elegantbeef> Hey nlvm is only a 40mb appimage 😛 |
21:55:13 | FromDiscord | <Elegantbeef> No wasi support, but who needs wasi when you're using it for plugins |
22:02:17 | * | oprypin_ quit (Quit: Bye) |
22:02:28 | * | oprypin joined #nim |
22:03:18 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "If you feel that,": https://github.com/wasm3/wasm3/blob/main/docs/Performance.md I don't need to :) |
22:03:37 | FromDiscord | <albassort> In reply to @fwsgonzo "you need a decent": why would you want RISC-V as an internal processing engine? |
22:03:45 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "*Ponders whether clang can": I mean, clang can be compiled to WASM so possibly |
22:03:51 | FromDiscord | <albassort> is RISC-V so insanely well designed you should run its entire cpu in your program |
22:04:00 | FromDiscord | <albassort> i somehow doubt that physically possible |
22:04:55 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "is RISC-V so insanely": Semantics are lower-level and likely can translate a few instructions into whatever would be done on your native platform, probably |
22:05:14 | FromDiscord | <albassort> then why not use wasm |
22:05:20 | FromDiscord | <albassort> im not understanding the advantage |
22:05:26 | FromDiscord | <albassort> or the point at all |
22:10:53 | FromDiscord | <Robyn [She/Her]> 🤷♀️ |
22:50:57 | * | jmdaemon quit (Ping timeout: 256 seconds) |
22:52:05 | FromDiscord | <Robyn [She/Her]> Oh hey Beef, when I do `getTypeInst` on a variable that used the type alias `ParseResult` (which was `Result[(AstIndex, int), string]`), I couldn't figure out how to get the underlying definition, any clues? This is related to my `unpackIt` macro, I'll post some code now |
22:54:46 | FromDiscord | <Elegantbeef> You have to walk the tree |
22:55:41 | FromDiscord | <Robyn [She/Her]> What do you mean? |
22:55:52 | FromDiscord | <Robyn [She/Her]> `getType` on the tree returned an empty node |
22:56:07 | FromDiscord | <Elegantbeef> Well give code I guess |
22:59:38 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=ACoNhlKE |
23:00:01 | * | marcus quit (Remote host closed the connection) |
23:00:42 | * | marcus joined #nim |
23:00:46 | FromDiscord | <Robyn [She/Her]> That's a minimal reproducible example |
23:04:08 | FromDiscord | <Elegantbeef> Yea you need to do like `typ.getImpl()` and navigate the tree |
23:07:47 | FromDiscord | <albassort> how can i use importc to point to the header and then point to the library file somewhere else |
23:09:00 | FromDiscord | <albassort> do i need to passc LD_LIBRARY_PATH=/some/custom/dir |
23:09:19 | FromDiscord | <albassort> (passl)? |
23:11:08 | FromDiscord | <Elegantbeef> If you're linking using `passL` you do not need to worry about where the library is as long as you do `-LpathToLib` |
23:12:55 | FromDiscord | <albassort> like this |
23:13:34 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=VpMyTyzb |
23:13:41 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#pasty=oqkdRUeU" => "https://play.nim-lang.org/#pasty=PLDoDsow" |
23:13:53 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#pasty=byxtSPqu" => "https://play.nim-lang.org/#pasty=rbHZISsR" |
23:13:59 | FromDiscord | <Elegantbeef> Sure |
23:14:03 | FromDiscord | <albassort> thank u :) |
23:14:08 | FromDiscord | <Elegantbeef> But `-L` takes in a path to where the lib is |
23:15:22 | FromDiscord | <albassort> so im getting the impression the header has to have the same name as the library except without the lib |
23:15:27 | FromDiscord | <albassort> and also has to be in the dir |
23:18:31 | FromDiscord | <Elegantbeef> Nope |
23:19:05 | FromDiscord | <Elegantbeef> You can name a header whatever you want as long as the it's in the system path or you provide `-I` |
23:19:24 | FromDiscord | <Elegantbeef> Same with `-L` as long as you do `-lmyLibName` you're fine |
23:19:38 | FromDiscord | <Elegantbeef> There is absolute include and linking you can do, but those are generally not used |
23:20:00 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Yea you need to": Aaah okay |
23:21:26 | FromDiscord | <Robyn [She/Her]> `typeKind` is `ntyGenericInst`, huh |
23:21:39 | FromDiscord | <albassort> In reply to @Elegantbeef "Same with `-L` as": please point me to an example, I don't think I've used headers in this context before |
23:21:39 | FromDiscord | <Elegantbeef> Yep welcome to the issue with Nim's typegraph |
23:21:42 | FromDiscord | <Robyn [She/Her]> I would've thought it'd be `ntyAlias` |
23:21:52 | FromDiscord | <Elegantbeef> Aliases are not aliases if they're generic |
23:21:59 | FromDiscord | <Robyn [She/Her]> Uuugh |
23:22:09 | FromDiscord | <Elegantbeef> A generic alias is an `tyGenericInst` that points to a `tyGenericInst` |
23:22:19 | FromDiscord | <Elegantbeef> Don't worry this causes some types to not be representable! |
23:22:28 | FromDiscord | <Elegantbeef> Wait that's a bug not a feature |
23:22:49 | FromDiscord | <Elegantbeef> `--passL: "-LsomeLibPath -lmyLibWithoutLibPrefix` |
23:23:59 | FromDiscord | <Elegantbeef> `gcc -Iinclude -lnimib ` adds `include` to the include path and links against `libnimib.so` on linux |
23:24:15 | FromDiscord | <Elegantbeef> This does not use `-L` so we know the lib is in the system lib path |
23:24:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Don't worry this causes": Really? Eesh |
23:24:41 | FromDiscord | <Elegantbeef> Yes Nim's typegraph causes so many issues |
23:24:46 | FromDiscord | <Robyn [She/Her]> Why hasn't this been fixed, then? Is it just tricky? Or is it too deeply ingrained in the mess of compiler code? |
23:24:56 | FromDiscord | <Elegantbeef> Do I look like Araq? |
23:25:04 | FromDiscord | <Robyn [She/Her]> Maybe |
23:25:46 | FromDiscord | <albassort> In reply to @Elegantbeef "`--passL: "-LsomeLibPath -lmyLibWithoutLibPrefix`": ahah! yes now that breaks when i typo. Thank you |
23:26:08 | FromDiscord | <Elegantbeef> Is this sarcasm |
23:28:54 | FromDiscord | <Robyn [She/Her]> Please tell me generic distinct don't have this issue at least? |
23:29:02 | FromDiscord | <Robyn [She/Her]> (edit) "distinct" => "distincts" |
23:29:19 | FromDiscord | <Elegantbeef> They're either `tyDistinct` that wrap `tyGenericInst` or vice versa |
23:34:55 | FromDiscord | <albassort> In reply to @Elegantbeef "Is this sarcasm": one way i debug for issues where a file must be read is to deliberately typo |
23:35:17 | FromDiscord | <albassort> if i typo and it continues that means it doesn't care if the file exists or not |
23:36:17 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "They're either `tyDistinct` that": That's not too bad then |
23:43:32 | FromDiscord | <Robyn [She/Her]> Making a robust macro is an absolute pain honestly |
23:44:05 | FromDiscord | <Elegantbeef> Just load it up with helpful `error` and ensure to copy line information |
23:51:29 | FromDiscord | <Robyn [She/Her]> That's what I'm trying to do at least |
23:55:10 | FromDiscord | <Robyn [She/Her]> Thanks for the help Beef, got it working :> |