00:14:29 | * | SchweinDeBurg joined #nim |
01:50:37 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
02:19:31 | lx12ucy | i've just discovered a weird quirk about my computer, the timestamps for directories only update when a file or directory only one layer deeper is changed, meaning that changing a file inside a directory inside another directory will not update the last modified time for the root directory |
02:19:35 | lx12ucy | if that makes sense |
02:22:53 | FromDiscord | <kots> Isn't that normal |
02:22:59 | lx12ucy | yeah i guess |
02:23:07 | lx12ucy | i just didn't know it wasn't recursive until now |
02:23:57 | FromDiscord | <leorize> directories are files too |
02:24:09 | FromDiscord | <leorize> so they only update when their contents are changed |
02:24:40 | FromDiscord | <leorize> contents here being entries to other files |
03:46:42 | * | SchweinDeBurg joined #nim |
03:55:51 | * | xet7 quit (Read error: Connection reset by peer) |
03:59:04 | FromDiscord | <sOkam! π«> uhhh... i'm confusedβ΅https://github.com/nim-lang/Nim/blob/c00e8e71e0c8465b5a5257c76c674b803273b222/lib/core/macros.nim#L1731 |
04:04:40 | FromDiscord | <Elegantbeef> vmops |
04:04:43 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/9d08d26e3307cf5d21271fd30d983f8d1c66ec50/compiler/vmops.nim#L160 |
04:08:17 | lx12ucy | does anyone know how to publish a nim binary to the AUR? i'm stuck at the installing the binary part |
04:09:05 | lx12ucy | if i could get an example of what package() is supposed to look like that would be great |
04:12:04 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/9d08d26e3307cf": is this not only for `when nimvm`? |
04:12:46 | FromDiscord | <Elegantbeef> Macros run in vm |
04:12:55 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=rdZDXCWw |
04:13:12 | FromDiscord | <sOkam! π«> but for nimvm `projectDir` already exists and works |
04:13:24 | FromDiscord | <sOkam! π«> I just don't understand why getProjectPath is empty |
04:25:25 | FromDiscord | <Elegantbeef> It's implemented for the macros vm |
04:25:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=FcQUyRGV |
04:27:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=hVCptdbZ |
04:41:37 | * | lx12ucy quit (Ping timeout: 256 seconds) |
04:43:34 | * | lx12ucy joined #nim |
05:08:38 | * | coldfeet joined #nim |
05:21:50 | * | coldfeet quit (Remote host closed the connection) |
05:24:21 | * | ntat joined #nim |
05:34:49 | * | rockcavera quit (Remote host closed the connection) |
06:17:41 | * | coldfeet joined #nim |
06:17:47 | * | coldfeet quit (Remote host closed the connection) |
06:20:42 | * | marcus quit (Remote host closed the connection) |
06:21:36 | * | PMunch joined #nim |
06:21:55 | * | marcus joined #nim |
06:39:21 | * | jjido joined #nim |
06:39:31 | * | lx12ucy quit (Quit: WeeChat 4.3.2) |
07:02:24 | * | ntat quit (Quit: Leaving) |
07:33:44 | * | coldfeet joined #nim |
07:35:55 | * | coldfeet quit (Remote host closed the connection) |
08:19:55 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
08:22:55 | FromDiscord | <ruehc> is it possible to use nim libs in c ? |
08:24:45 | FromDiscord | <Elegantbeef> Yes |
08:25:06 | FromDiscord | <Elegantbeef> https://github.com/beef331/libnimib/ an example of that is here |
08:25:17 | FromDiscord | <ruehc> ok i will check |
08:33:00 | FromDiscord | <Elegantbeef> Really you just need to do `exportc, dynlib` |
08:39:12 | * | coldfeet joined #nim |
08:40:37 | * | coldfeet quit (Remote host closed the connection) |
08:43:41 | PMunch | Nice, I've been able to use `--wrap` to wrap mmap and allocate all memory as shared. Now I can look at writing a queue thing which allows one program to send references to another program |
08:44:51 | FromDiscord | <Elegantbeef> Much easier than making your own allocator |
08:45:30 | PMunch | Definitely! |
08:45:51 | PMunch | Just remains to be seen if Nim will play nice with two separate programs touching the same memory :P |
08:47:44 | * | jjido joined #nim |
08:47:46 | FromDiscord | <Elegantbeef> Probably |
08:47:52 | FromDiscord | <Elegantbeef> not |
08:48:19 | PMunch | I mean it shouldn't be too dissimilar from multiple threads touching the same memory |
08:48:22 | FromDiscord | <Elegantbeef> Unless you use a semaphore to indirect allocations |
08:48:45 | FromDiscord | <Elegantbeef> Right, but two allocators working with seperate logic is going to run into issues |
08:49:08 | PMunch | Will they though? |
08:49:16 | PMunch | Assuming atomicArc |
08:49:17 | FromDiscord | <Elegantbeef> If process A attempts to allocate a block as process B does, yes |
08:49:39 | FromDiscord | <Elegantbeef> The allocator needs to lock to prevent raceful allocations |
08:51:48 | PMunch | Oh right, yeah the way I thought of doing it is that I wrap mmap in both processes to allocate shared memory. Then I have a queue which program A allocates somewhere in its memory and communicates the location to program B. Program B then maps the correct shared memory into its own memory (but without telling its allocator) and reads from the queue. So whenever B wants to allocate memory it only knows of the memory regions its allocator has allocated, and some |
08:51:48 | PMunch | for A. The only time they touch each others memory is to play with objects sent from the other. |
08:52:05 | PMunch | So they will never try to allocate from the same piece of memory |
08:52:38 | PMunch | The biggest problem I see is making sure that all memory from program A is mapped in program B and vice versa |
08:52:59 | FromDiscord | <Elegantbeef> Plus if the two allocators do not know the other's block information freeing likely will error |
08:52:59 | FromDiscord | <Elegantbeef> Ah |
08:52:59 | FromDiscord | <Elegantbeef> I assumed you just got mmap to share memory with Nim's allocator |
08:53:02 | PMunch | I think the queue pop operation needs to peek through all references and make sure the memory is already mapped |
08:53:28 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
08:53:57 | PMunch | Well Nim's allocator uses mmap to grab chunks of memory. I only wrap mmap to grab these chunks from shared memory instead. |
08:54:14 | * | beholders_eye joined #nim |
08:54:28 | PMunch | Freeing might be an issue, As allocator won't know if B has freed memory in one of its chunks.. |
08:58:08 | PMunch | So maybe the queue logic has to be expanded a bit. Basically program A puts a reference in the queue, doing this means it promises not to touch that memory again (but it is still stored in memory it knows about so it won't free it). Program B then sees that there is something in the queue and starts playing around with it, only when it is done with the object it will mark the element as popped. Once marked as popped B should never try to use that memory again, |
08:58:08 | PMunch | and have cleared all references to it. Then A sees that the queue element is popped it removes it from the queue which should trigger the GC and clear all the memory. |
08:58:15 | PMunch | I think that should work |
08:58:23 | PMunch | As long as A and B plays nice with each other |
09:02:27 | * | krux02 joined #nim |
09:09:41 | * | beholders_eye quit (Ping timeout: 240 seconds) |
09:11:48 | * | xtr00 joined #nim |
09:17:39 | * | arkanoid joined #nim |
09:20:25 | arkanoid | why nim keeps pushing choosenim in official website and releases? it's buggy and headless (author flee) |
09:21:58 | arkanoid | nim is spending resources on vscode extension and language server, but if user uses choosenim with there will face bad weird problems |
09:22:30 | arkanoid | *with these will face bad and weird problems |
09:23:00 | PMunch | arkanoid, we're working on it |
09:23:42 | arkanoid | where? is there an official fork? official github is 2 years old |
09:24:23 | PMunch | There is a private fork under the nim-lang GitHub. As soon as the CI is able to build releases again we'll do the switch and announce it publicly |
09:24:30 | arkanoid | while working on it, it should be removed from official communications |
09:24:36 | PMunch | Discussion from two days ago: https://irclogs.nim-lang.org/17-06-2024.html#12:36:22 |
09:25:01 | PMunch | I mean it still works for a lot of people |
09:25:07 | arkanoid | I mean, half of my tooling complains ended up rooted into choosenim, but it has been a wild ride to find it |
09:25:10 | PMunch | I personally use it and don't have any issues with it |
09:25:44 | PMunch | Then again I use nimlsp and not nimlangserver |
09:25:49 | arkanoid | PMunch: because you prolly are not using vscode extension |
09:25:58 | PMunch | Ah no, I don't use vscode |
09:26:22 | PMunch | That being said once the official fork is up someone still has to actually fix those issues |
09:26:34 | PMunch | Preferably someone who are facing them and can actually verify that the fix works |
09:26:52 | arkanoid | I mean the issue hits all choosenim + vscode users, which is what user gets from official homepage and stats confirms |
09:27:23 | arkanoid | sure, but the repo is headless |
09:31:08 | arkanoid | you can't pretend the community to PR on an headless official repo, while keeping the real one private |
09:33:18 | FromDiscord | <odexine> thats not what he said, what |
09:37:40 | arkanoid | well, you're right, I've read it wrong. Sorry! Surely PR will be possible once the new repo will be up and running |
09:50:07 | * | coldfeet joined #nim |
10:16:32 | * | coldfeet quit (Remote host closed the connection) |
10:17:35 | FromDiscord | <kots> It's alive! |
10:27:18 | PMunch | I ran out of minutes for running the CI in a private repo, please look the other way while I fix it :) |
10:35:35 | FromDiscord | <Robyn [She/Her]> How would folks here design a parser combinator while also making it easily debuggable in Nim? Is it possible to do something like setting a lambda's name to `(procOne and procTwo)` at compile-time? |
10:36:19 | FromDiscord | <Robyn [She/Her]> This would mean for this, the procs have to be known at compile-time but I'm alright with that |
10:36:44 | * | krux02 quit (Remote host closed the connection) |
10:39:15 | * | krux02 joined #nim |
10:42:15 | * | jjido joined #nim |
11:03:34 | FromDiscord | <Robyn [She/Her]> Hmmmm I should make a macro to optimise recursive tail calls in Nim |
11:04:38 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
11:04:57 | FromDiscord | <Robyn [She/Her]> "Do you find the stack call depth limit annoying when doing recursive tail calls? Well I have the solution for you! Introducing Tail Splitter, a simple and fragile macro that barely works to optimise your tail calls into loops!" |
11:08:31 | * | xtr00 quit (Quit: Client closed) |
11:24:39 | FromDiscord | <albassort> hello i need to put headers as a depend in a .nim file, how can i make that work with a relativ--- i cant i gotta put it in the headers place. |
11:25:42 | * | jjido joined #nim |
11:25:44 | PMunch | You okay there @albassort? |
11:27:21 | FromDiscord | <albassort> i forgot /usr/include exists |
11:28:06 | FromDiscord | <fabric.input_output> In reply to @albassort "i forgot /usr/include exists": `--passL:"-I./headers/path"`? |
11:28:15 | FromDiscord | <fabric.input_output> (edit) "`--passL:"-I./headers/path"`?" => "`--passC:"-I./headers/path"`?" |
11:29:36 | FromDiscord | <albassort> that doesn't work for a library |
11:30:23 | FromDiscord | <fabric.input_output> In reply to @albassort "that doesn't work for": `{.passL: "-I./headers/path".}`? |
11:30:37 | FromDiscord | <fabric.input_output> I think this should |
11:30:54 | FromDiscord | <fabric.input_output> this is probably what naylib does |
11:31:03 | FromDiscord | <Robyn [She/Her]> `{.header: "filepath.h".}` doesn't work? |
11:31:11 | FromDiscord | <albassort> well it cant be relative |
11:31:19 | FromDiscord | <albassort> is the issue |
11:31:20 | FromDiscord | <Robyn [She/Her]> You could use the compile time VM to get an absolute path |
11:31:37 | FromDiscord | <fabric.input_output> yeah write a function that does that or something |
11:31:45 | * | PMunch quit (Read error: Connection reset by peer) |
11:31:57 | FromDiscord | <Robyn [She/Her]> Official Nim bindings for OpenGL does that, no? |
11:32:02 | FromDiscord | <Robyn [She/Her]> With `glGet` or something |
11:32:16 | * | PMunch joined #nim |
11:34:25 | FromDiscord | <albassort> in the static function I guess I could find then nimble path |
11:34:44 | FromDiscord | <albassort> or i could just put the deps in the right location |
11:34:53 | FromDiscord | <albassort> (edit) "the" => "a" |
11:35:22 | FromDiscord | <fabric.input_output> naylib clones the raylib git repo, builds it and uses it |
11:36:32 | FromDiscord | <albassort> someone made raylib bindings |
11:36:34 | FromDiscord | <albassort> interesting |
11:36:41 | * | ntat joined #nim |
11:36:50 | FromDiscord | <albassort> has anyone made anything practical with raylib ever |
11:36:55 | FromDiscord | <Robyn [She/Her]> Nope xD |
11:37:09 | NimEventer | New thread by TKD: Passing an optional proc is not working, see https://forum.nim-lang.org/t/11796 |
11:37:13 | FromDiscord | <Robyn [She/Her]> There are games with it, but I haven't done much beyond basic testing |
11:37:14 | FromDiscord | <albassort> yeah suppose that would be impossible perhaps |
11:37:24 | FromDiscord | <albassort> In reply to @chronos.vitaqua "There are games with": eeee? |
11:37:26 | FromDiscord | <albassort> let me see |
11:37:36 | FromDiscord | <griffith1deadly> In reply to @albassort "has anyone made anything": for game cheating in nim - like imgui |
11:38:01 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "eeee?": I have no public code xD |
11:38:15 | FromDiscord | <Robyn [She/Her]> And all the code I did have is deleted |
11:38:55 | FromDiscord | <albassort> In reply to @griffith1deadly "for game cheating in": how do you do this |
11:38:59 | FromDiscord | <albassort> oh |
11:39:07 | FromDiscord | <albassort> like how does that even work |
11:39:43 | FromDiscord | <griffith1deadly> nim has very bad imgui wrapper as i last checked |
11:39:51 | FromDiscord | <griffith1deadly> so i'm stuck with naylib |
11:40:05 | FromDiscord | <albassort> you use this for... 2d rending of menus? |
11:40:22 | FromDiscord | <griffith1deadly> menu + esp |
11:40:36 | FromDiscord | <albassort> esp? |
11:40:58 | FromDiscord | <griffith1deadly> enemy drawing by easy words |
11:41:40 | FromDiscord | <albassort> I ok i'm starting to imagine how this might work. |
11:42:18 | FromDiscord | <albassort> now, while I don't endorse cheating in games, why not help improve the imgui library if you would prefer it? Its a very high value library.. |
11:55:27 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
12:08:13 | * | PMunch quit (Quit: Leaving) |
12:09:57 | * | PMunch joined #nim |
12:13:20 | FromDiscord | <Robyn [She/Her]> Anyone know how I'd get the length of all consumed input with `std/strscans`? |
12:14:00 | FromDiscord | <Robyn [She/Her]> For example: `Struct $w` |
12:28:11 | FromDiscord | <Robyn [She/Her]> Also, in a macro how would I accept a `Parser` and `static Parser` in `varargs` and perform the appropriate behaviour on each? :pβ΅`static Parser` should get the code of the body and paste it into the macro's result, while a call to `Parser` should be pasted in |
12:40:42 | * | PMunch_ joined #nim |
12:43:01 | * | PMunch quit (Ping timeout: 246 seconds) |
12:51:08 | FromDiscord | <Robyn [She/Her]> I can't do `result[0..<s.len] = s[0..<s.len]` where `s` is `openArray[char]` and `result` is a `string` |
12:51:41 | FromDiscord | <Robyn [She/Her]> `result.toOpenArray(0, s.len - 1)[0..<s.len] = s[0..<s.len]` also doesn't work |
12:55:57 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=cuVFfwcl |
13:26:02 | * | krux02_ joined #nim |
13:28:29 | * | krux02 quit (Ping timeout: 256 seconds) |
13:32:12 | * | PMunch_ is now known as PMunch |
13:36:11 | FromDiscord | <Robyn [She/Her]> TIL Rust doesn't have enum indexable arrays, this is yet another win for Nim :P |
13:47:45 | FromDiscord | <ieltan> In reply to @chronos.vitaqua "I can't do `result[0..<s.len]": Even if the syntax worked, `result[0..<s.len]` is an allocating slice which won't mutate `result` |
13:55:17 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=cmdTjbqD |
13:55:43 | FromDiscord | <ieltan> the assigning a slice to a slice syntax |
13:56:30 | FromDiscord | <ieltan> which would not allocate unlike the `stringify` |
13:58:30 | FromDiscord | <ieltan> maybe make a new operator like `=:` or something |
13:58:44 | FromDiscord | <Robyn [She/Her]> In reply to @ieltan "i get what you're": It is, you can allocate slices to slices |
13:59:37 | * | jjido joined #nim |
14:00:13 | FromDiscord | <Robyn [She/Her]> !eval (var a = ['a', 'b', 'c']; var b = @['d', 'e', 'f']; b[1..2] = a[1..2]; echo b) |
14:00:18 | NimBot | Compile failed: @['d', 'b', 'c'] |
14:00:30 | FromDiscord | <Robyn [She/Her]> Really need a bot on the discord side that can evaluation multiline expressions |
14:00:42 | FromDiscord | <Robyn [She/Her]> In reply to @NimBot "Compile failed: @['d', 'b',": Huh, failed but it printed the result just fine :P |
14:01:24 | FromDiscord | <ieltan> In reply to @chronos.vitaqua "!eval (var a =": huuuuh... today i learned i guess |
14:07:37 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
14:08:18 | * | PMunch quit (Quit: Leaving) |
14:12:43 | * | rockcavera joined #nim |
15:06:25 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=MCamzTny |
15:07:20 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#pasty=Mzacipyl" => "https://play.nim-lang.org/#pasty=gLlPKZRg" |
15:08:56 | FromDiscord | <sOkam! π«> If I make the object fields public it works, but that's why I'm using `importutils` to access the private ones π€·ββοΈ |
15:10:32 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
15:11:33 | * | xutaxkamay joined #nim |
15:34:23 | rockcavera | is there any way to get all the values ββof a non-ordinal enum? |
15:35:22 | rockcavera | I found it in std/setutils |
15:35:52 | FromDiscord | <fabric.input_output> In reply to @rockcavera "is there any way": `items` iterator in `std/enumutils` |
15:39:14 | rockcavera | fabric.input_output in fact in std/enumutils there is the same macro that is in std/setutils that I need |
15:58:50 | * | jjido joined #nim |
16:19:26 | FromDiscord | <planetis> https://github.com/ZoomTen/hb-strife-2024β΅(@albassort) |
16:19:47 | FromDiscord | <planetis> Not impossible when you got mad skillz |
16:19:55 | FromDiscord | <planetis> like zoom |
16:28:48 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
16:31:53 | FromDiscord | <Zoom> ZoomTen is someone else. [My gh](https://github.com/ZoomRmc/), although I release nothing there, just occasional commits. |
16:36:50 | FromDiscord | <zumi.dxy> In reply to @planetis "Not impossible when you": lmao naahhhhβ΅this is just a bit of fun |
16:39:50 | FromDiscord | <planetis_m> oh that's you, haha |
16:43:17 | FromDiscord | <__jont__> sent a code paste, see https://play.nim-lang.org/#pasty=NgtKhSJk |
16:44:28 | FromDiscord | <leorize> compile time as typedesc are not runtime values |
16:46:04 | FromDiscord | <ieltan> In reply to @__jont__ "Trying to figure out": What does the `init` provides that `Test1(x: 0, y: 0)` does not ? |
16:47:38 | FromDiscord | <__jont__> In reply to @ieltan "What does the `init`": This is a simple example to demonstrate my question, I want to implement multiple "constructors" on a single type that perform some manipulation of parameters based on the types provided. I also know of 2.0's default type values |
16:48:37 | FromDiscord | <__jont__> For example, I'm making a Matrix22 type that I want to be able to take four floats, two Vector2s, or a single float as a rotation. |
16:50:52 | FromDiscord | <sOkam! π«> @jont aware of [`treeform/vmath`](https://github.com/treeform/vmath)? |
16:51:50 | FromDiscord | <ieltan> but to answer your question yeah it should pick the right `init` at compile-time @jont |
16:51:53 | FromDiscord | <sOkam! π«> In reply to @__jont__ "Trying to figure out": the right instantiation will be chosen at compile time yes |
16:52:17 | FromDiscord | <ieltan> iirc status does that in their style guide |
16:53:40 | FromDiscord | <__jont__> In reply to @heysokam "<@725135437756235786> aware of [`treeform/vmath`](h": Actually was not, that takes out a ton of setup. Thank you! |
16:54:01 | FromDiscord | <__jont__> In reply to @ieltan "but to answer your": That's good to know. Thank you everybody. |
16:54:18 | FromDiscord | <sOkam! π«> check out treeform's repo whenever you need somthing in Nim, because there is a big chance he already did some of it π |
17:04:20 | FromDiscord | <sOkam! π«> whats the alternative to object variants? |
17:04:39 | FromDiscord | <sOkam! π«> is there a way to have a single type that has extra fields, other than with a variant? |
17:29:29 | FromDiscord | <leorize> what is even a single type with extra fields? |
17:39:10 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "is there a way": A... Normal field? |
17:39:53 | FromDiscord | <fabric.input_output> In reply to @heysokam "is there a way": what? |
17:40:28 | Amun-Ra | just define a proc for specific type and you're all set |
17:40:55 | FromDiscord | <sOkam! π«> In reply to @leorize "what is even a": a variant? |
17:41:10 | FromDiscord | <sOkam! π«> https://nim-lang.org/docs/manual.html#types-object-variants |
17:41:42 | FromDiscord | <sOkam! π«> I'm just trying to get over the fact that object variants with private fields are broken if you define the type in a separate file than the implementation |
17:42:24 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "A... Normal field?": the idea is the external API knows nothing about the internal data. to the external API it should all be strings |
17:42:41 | FromDiscord | <sOkam! π«> and there are two versions (variants) of that type |
17:42:43 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
17:42:49 | Amun-Ra | isn't that what private is for? |
17:43:17 | Amun-Ra | you can always make it public and annotate with "do not touch" ;) |
17:43:20 | FromDiscord | <sOkam! π«> but its a private variant, as I said |
17:43:51 | FromDiscord | <fabric.input_output> don't export the fields of that variant? |
17:45:12 | FromDiscord | <sOkam! π«> did I unlearn english? started saying that `importutils.privateAccess` is broken for variants π¦ |
17:46:10 | FromDiscord | <sOkam! π«> that's the whole problem, pretty much |
17:50:00 | FromDiscord | <sOkam! π«> well, my theory seems to be wrong. I can't get access to the private fields of an inherited type either π |
17:50:28 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "did I unlearn english?": Ah, sounds like a bug? But private access is a tad hacky anyway |
17:51:29 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=zimUtqCV |
17:51:36 | FromDiscord | <Robyn [She/Her]> Hacky as hell but it should work |
17:52:01 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=JSSDOlVr |
17:52:21 | FromDiscord | <sOkam! π«> sorry, creating a new variable with that type |
17:52:49 | FromDiscord | <sOkam! π«> so `Path(kind: Kind.Dir, dir_d: "thing")` should work... but doesn't because `dir_d` is private |
17:52:59 | FromDiscord | <Robyn [She/Her]> For instantiating it? Can do the same thing, no? |
17:53:02 | FromDiscord | <sOkam! π«> even if you import with privateAccess π¦ |
17:53:19 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "For instantiating it? Can": wdym? |
17:54:16 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=sLTrSmLa |
17:54:32 | FromDiscord | <Robyn [She/Her]> That is ungodly though, and there is a MUCH better way to do this than using private access |
17:54:45 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=ckdliPEs |
17:55:09 | FromDiscord | <sOkam! π«> hell, even `a.dir` with an inherited type breaks too |
17:55:12 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "even `a.dir_d = "thing"`": Have you tried the way I'm saying to do? |
17:55:32 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Have you tried the": haven't tried in a loop like that, nope |
17:55:33 | FromDiscord | <Robyn [She/Her]> Via the field pairs iterator? |
17:55:40 | FromDiscord | <sOkam! π«> I don't have a variant anymore, though |
17:55:46 | FromDiscord | <Robyn [She/Her]> Ah |
17:56:02 | FromDiscord | <sOkam! π«> I got pissed and changed them into inherited types π¦ |
17:56:05 | FromDiscord | <Robyn [She/Her]> Either way, I heavily recommend you export it, or make a public helper proc to init the thing |
17:56:24 | FromDiscord | <Robyn [She/Her]> You're digging your own grave by keeping it private |
17:56:34 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Either way, I heavily": well that's the problem. the public helper is not being found either |
17:56:44 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "well that's the problem.": Huh? |
17:56:49 | FromDiscord | <sOkam! π«> which is like... 𧩠|
17:56:54 | FromDiscord | <sOkam! π«> yeah, my exact reaction |
17:57:08 | FromDiscord | <Robyn [She/Her]> Do you have a minimal reproduction or no? |
17:57:17 | FromDiscord | <sOkam! π«> oh, sry. its a private helper but separate |
17:57:26 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Do you have a": sadly nope |
17:57:33 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "oh, sry. its a": Separate as in a different file? |
17:57:38 | FromDiscord | <sOkam! π«> I posted some code above, let me scroll and relink |
17:57:40 | FromDiscord | <sOkam! π«> of the variant |
17:57:44 | FromDiscord | <Robyn [She/Her]> Alright |
17:57:50 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Separate as in a": yeah different file with `privateAccess` |
17:58:21 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=ovtVByuY |
17:58:40 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "yeah different file with": Stop using privateAccess, define the helper in the same file |
17:58:55 | FromDiscord | <threefour> My struggles with multithreaded TCP via `OptReusePort` persist. The newest baffler: how do I get almost the exact same performance with `-d:debug` and `-d:release`? |
17:59:02 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Stop using privateAccess, define": you are asking me to duplicate the helper in 10 files, pretty much |
17:59:07 | FromDiscord | <sOkam! π«> its a mess |
17:59:25 | FromDiscord | <sOkam! π«> plus they won't work, because the type fields are private |
17:59:28 | FromDiscord | <Robyn [She/Her]> Then make the helper public and define it in the file you declare the type? |
17:59:39 | FromDiscord | <sOkam! π«> and they are not accessible for some unknown reason |
18:00:03 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Then make the helper": that's equivalent to exposing the type itself |
18:00:17 | FromDiscord | <sOkam! π«> I don't want the external api to be concerned with the internal repr |
18:00:18 | FromDiscord | <Robyn [She/Her]> Your problems seem like they stem from you using privateAccess and {.all.} |
18:00:29 | FromDiscord | <sOkam! π«> yeah, that's what I said earlier |
18:00:42 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "that's equivalent to exposing": Then do that, that's not a problem if you just put a notice? |
18:00:47 | FromDiscord | <sOkam! π«> but I'm surprised to find that its broken for normal types too π€·ββοΈ |
18:00:54 | FromDiscord | <sOkam! π«> I thought it was just a variant types issue |
18:00:54 | FromDiscord | <Robyn [She/Her]> You're backing yourself into a hole :p |
18:01:09 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "but I'm surprised to": Nim is fragile so I'm not surprised |
18:01:22 | FromDiscord | <sOkam! π«> I guess |
18:02:36 | FromDiscord | <sOkam! π«> I'm seeing it coming. I make all helper procs public and they also don't show up π |
18:02:40 | FromDiscord | <sOkam! π«> I bet you |
18:02:54 | FromDiscord | <sOkam! π«> yup π |
18:07:10 | FromDiscord | <ieltan> @sOkam! π« one trick sokam is to reimplement your type with public fields in the other module and then cast back and forth to it |
18:07:23 | FromDiscord | <ieltan> It's ugly and unsafe of course |
18:07:45 | FromDiscord | <sOkam! π«> thats more cursed than I'm willing to accept π¦ |
18:07:58 | FromDiscord | <sOkam! π«> I'd rather not have a custom Path type, tbh |
18:08:46 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=GlYsjQAr |
18:08:58 | FromDiscord | <ieltan> You can hide the uglyness by using a template |
18:09:23 | FromDiscord | <ieltan> Which would act the same as privateAccess but hopefully without bugs |
18:10:04 | FromDiscord | <sOkam! π«> In reply to @ieltan "You can hide the": I hit my head against templates enough to not use them unless there is literally no single other option and the solution is like a quick aliasing to something. they are pretty much soft-banned from my projects, because their error messages are atrocious π¦ |
18:10:50 | FromDiscord | <sOkam! π«> I'd rather go out and chill in the park, than debug a template |
18:11:12 | FromDiscord | <sOkam! π«> but I see your thinking, ty for the tip anyway |
18:20:01 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=dmBgQIks |
18:22:02 | FromDiscord | <sOkam! π«> In reply to @ieltan "First, don't use {.inheritable.}": the access function is a generic :Thnk |
18:22:06 | FromDiscord | <sOkam! π«> (edit) ":Thnk" => "π€" |
18:22:52 | FromDiscord | <sOkam! π«> as for the types, `Path`s can be files or folders (aka directories). the type is supposed to represent both |
18:23:24 | * | xet7 joined #nim |
18:23:56 | FromDiscord | <sOkam! π«> both files and dirs have a folder, and they might have a subfolder defined (or not)β΅only files have a filename, and only files have a fileextension |
18:25:10 | FromDiscord | <sOkam! π«> if you say `Path("/path/to/dir/subdir/filename.ext")` you sure get a file.... but you cannot remap its containing folder unless you know where it came from and whats its original root folder and subfolderβ΅because the type is destructive, you get a single thing and that's it |
18:26:18 | FromDiscord | <sOkam! π«> so if I have two folders with the same file structure, and I'm supposed to remap one file from one folder to the other, but keep the same structure (like a git repo, or a buildsystem of a project that only -extends- another, not modifies the entire thing) then you need that information separate |
18:26:36 | FromDiscord | <sOkam! π«> and `std/paths Path` does not allow that |
18:27:49 | FromDiscord | <sOkam! π«> aka enter the custom `Path` type... that represents both Files and Folders.... but... I don't think the implementation of all of that, or its fields, are relevant to the external API, that only cares to remap a file in the worst case, and the simplest case its just a string to do `readFile` or similar |
18:27:54 | FromDiscord | <ieltan> Lemme think |
18:28:57 | FromDiscord | <sOkam! π«> the simplest solution is single file define it all and forget about imports π¦ |
18:29:26 | FromDiscord | <sOkam! π«> but thats a big mess with how many functions there are |
18:30:35 | FromDiscord | <sOkam! π«> ok, just to make sureβ΅is there a chance that a cyclic import is not showing itself in error messages and triggering errors incorrectly? |
18:30:57 | FromDiscord | <sOkam! π«> because I just moved the functions to that file.. and now its erroring on those functions instead |
18:31:14 | FromDiscord | <sOkam! π«> (edit) "that file.." => "the `types.nim` file." |
18:49:32 | * | jjido joined #nim |
19:03:05 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=QHxyISjU |
19:03:49 | FromDiscord | <ieltan> (edit) "https://play.nim-lang.org/#pasty=NdHRVCzu" => "https://play.nim-lang.org/#pasty=sbHvCksy" |
19:04:41 | FromDiscord | <ieltan> I know you said you don't want a custom path but eh |
19:10:34 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=JKmuyLIq |
19:10:42 | FromDiscord | <sOkam! π«> so multifile was not the problem |
19:10:58 | FromDiscord | <sOkam! π«> everything was moved to a single file, so the problem is not the imports @Robyn [She/Her] |
19:12:28 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=opWEznFl |
19:13:07 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=IBUXMeCr |
19:13:11 | FromDiscord | <Robyn [She/Her]> I have no clue |
19:19:58 | NimEventer | New thread by blackmius: Iterators dont inline, see https://forum.nim-lang.org/t/11799 |
19:23:49 | FromDiscord | <Elegantbeef> @sOkam! π« can you give the code block causing issues, and the error? |
19:25:19 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "<@186489007247589376> can you give": its right there |
19:29:28 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=GFUbveVm |
19:30:38 | FromDiscord | <Elegantbeef> > types.nim(105, 22) Error\: The fields ''dir\_d', 'sub\_d'' and ''dir\_f', 'sub\_f', 'name', 'ext'' cannot be initialized together, because they are from conflicting branches in the case object.β΅Is from that code? |
19:30:49 | FromDiscord | <ElegantBeef> Heh bridge is fun |
19:31:16 | FromDiscord | <sOkam! π«> yes |
19:33:49 | FromDiscord | <sOkam! π«> In reply to @ieltan "Sorry I'm on my": its hard to explain without understanding the concept of remotes from confy or repositories from sconsβ΅but yeah, you are definitely not getting the idea. i believe you are getting lost in the typenames |
19:34:30 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=IEbFuRPL |
19:35:31 | FromDiscord | <sOkam! π«> (edit) "In reply to @ieltan "Sorry I'm on my": its hard to explain without understanding the concept of remotes from confy or repositories from sconsβ΅but yeah, you are definitely not getting the idea. i believe you are getting lost in the typenames" => "sent a long message, see https://pasty.ee/vxZcBovM" |
19:36:44 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=uZmCpcKr |
19:36:57 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#pasty=BupEjBFG" => "https://play.nim-lang.org/#pasty=UKTtwUyD" |
19:37:02 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#pasty=fvEPTuGT" => "https://play.nim-lang.org/#pasty=wFVbJcwW" |
19:37:26 | FromDiscord | <sOkam! π«> _(dunno if bridge applies modifications, but they say `_d` not the name as is)_ |
19:37:58 | FromDiscord | <Elegantbeef> I don't see how that'd confuse it |
19:40:31 | FromDiscord | <sOkam! π«> also, I should probably specify that I'm testing all of this inside `std/unittest` |
19:40:41 | FromDiscord | <sOkam! π«> which apparently is made of templates... so.... yeah, fun |
19:41:06 | FromDiscord | <ieltan> In reply to @heysokam "its hard to explain": My bad then, π
|
19:42:43 | FromDiscord | <sOkam! π«> @ieltan https://scons.org/doc/production/HTML/scons-user.html#id1461 reference |
19:43:09 | FromDiscord | <sOkam! π«> I implemented a much less confusing/simpler version of that feature |
19:45:08 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=fbwTPKQh |
20:15:27 | * | ntat quit (Quit: Leaving) |
20:31:14 | FromDiscord | <sOkam! π«> sent a long message, see https://pasty.ee/wXtFWDTi |
20:41:15 | FromDiscord | <sOkam! π«> apparently `std/unittest` hides away error messages inside the million templatesβ΅that includes object constructors inside `const tuple` π€¦ββοΈ |
20:42:02 | FromDiscord | <sOkam! π«> there was a mistake in the spelling of the `const` test dummy constructor, and the errors were not even showing up at all π |
20:51:44 | FromDiscord | <sOkam! π«> yeah, that was the issue, pretty much. it was hidden away in a template, so couldn't track it and it looked like an import error |
20:52:46 | FromDiscord | <sOkam! π«> @Robyn [She/Her] π apparently `privateAccess` has issues, but it does work on object variants in most casesβ΅it just doesnt let you access the `kind` field that differentiates one object variant from the other |
20:54:07 | FromDiscord | <sOkam! π«> do you guys know any good test framework for Nim that doesn't use macros or templates? |
20:57:47 | FromDiscord | <griffith1deadly> In reply to @heysokam "do you guys know": first time treeform github does not help |
20:58:16 | FromDiscord | <sOkam! π«> he uses testament, afak π |
20:58:19 | FromDiscord | <sOkam! π«> (edit) "afak" => "afaik" |
21:00:39 | FromDiscord | <griffith1deadly> jsony does not use anything like test framework π€ |
21:03:12 | FromDiscord | <leorize> `system.doAssert` and `system.doAssertRaises`β΅(@sOkam! π«) |
21:03:18 | FromDiscord | <leorize> covers 90% of what you ever need |
21:15:41 | FromDiscord | <sOkam! π«> @leorize0713 good point |
21:33:18 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=PiFzlsBF |
21:33:29 | FromDiscord | <Robyn [She/Her]> I'm doing macro hackery |
21:34:49 | FromDiscord | <Robyn [She/Her]> Is just looping over the symbols and checking which one is a proc the best way to do it? |
21:47:45 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzβ¦) |
22:04:36 | FromDiscord | <leorize> can you write the actual nim you want to transform and how do you want to determine which is which? |
22:23:15 | * | arkanoid quit (Ping timeout: 260 seconds) |
22:26:23 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=aOpXvqUH |
22:28:12 | FromDiscord | <Robyn [She/Her]> Ah, fixed! |
22:36:00 | FromDiscord | <sOkam! π«> is there a way to get a list of symbols defined in a file? π€ |
22:39:05 | FromDiscord | <Robyn [She/Her]> Hm |
22:40:55 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=fWlDogmI |
22:41:11 | FromDiscord | <Robyn [She/Her]> (edit) "https://play.nim-lang.org/#pasty=csvxmHvu" => "https://play.nim-lang.org/#pasty=APVNBCPJ" |
22:41:37 | FromDiscord | <Robyn [She/Her]> Then just do `--include:myfile.nim` as a CLI param? |
22:41:47 | FromDiscord | <Robyn [She/Her]> Not sure if that'd work at all but it'd be funny if it did |
22:43:25 | FromDiscord | <leorize> I think you just managed to transform it using a very simple algorithm? \:pβ΅(@Robyn [She/Her]) |
22:45:08 | FromDiscord | <leorize> the direction is correct \:pβ΅(@Robyn [She/Her]) |
22:47:29 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "I think you just": Yep! My issue was adding a node to the end of my proc def, when I meant to add it to the root statement list instead |
22:48:26 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#pasty=uxJvqxyk |
22:49:16 | FromDiscord | <leorize> not that you should ever do this in real code |
22:51:37 | FromDiscord | <Robyn [She/Her]> xD |
22:51:47 | FromDiscord | <Robyn [She/Her]> Nice to know I was close though |
23:02:12 | FromDiscord | <Robyn [She/Her]> I don't think I can have a stateless parser if I want whitespace sensitivity |
23:39:16 | FromDiscord | <Thomas Hardy> sent a long message, see https://pasty.ee/INVQKTLi |
23:41:40 | FromDiscord | <demotomohiro> <@&371760044473319454> |