<< 19-06-2024 >>

00:14:29*SchweinDeBurg joined #nim
01:50:37*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
02:19:31lx12ucyi'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:35lx12ucyif that makes sense
02:22:53FromDiscord<kots> Isn't that normal
02:22:59lx12ucyyeah i guess
02:23:07lx12ucyi just didn't know it wasn't recursive until now
02:23:57FromDiscord<leorize> directories are files too
02:24:09FromDiscord<leorize> so they only update when their contents are changed
02:24:40FromDiscord<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:04FromDiscord<sOkam! 🫐> uhhh... i'm confused↡https://github.com/nim-lang/Nim/blob/c00e8e71e0c8465b5a5257c76c674b803273b222/lib/core/macros.nim#L1731
04:04:40FromDiscord<Elegantbeef> vmops
04:04:43FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/9d08d26e3307cf5d21271fd30d983f8d1c66ec50/compiler/vmops.nim#L160
04:08:17lx12ucydoes anyone know how to publish a nim binary to the AUR? i'm stuck at the installing the binary part
04:09:05lx12ucyif i could get an example of what package() is supposed to look like that would be great
04:12:04FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/9d08d26e3307cf": is this not only for `when nimvm`?
04:12:46FromDiscord<Elegantbeef> Macros run in vm
04:12:55FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=rdZDXCWw
04:13:12FromDiscord<sOkam! 🫐> but for nimvm `projectDir` already exists and works
04:13:24FromDiscord<sOkam! 🫐> I just don't understand why getProjectPath is empty
04:25:25FromDiscord<Elegantbeef> It's implemented for the macros vm
04:25:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=FcQUyRGV
04:27:09FromDiscord<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:55FromDiscord<ruehc> is it possible to use nim libs in c ?
08:24:45FromDiscord<Elegantbeef> Yes
08:25:06FromDiscord<Elegantbeef> https://github.com/beef331/libnimib/ an example of that is here
08:25:17FromDiscord<ruehc> ok i will check
08:33:00FromDiscord<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:41PMunchNice, 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:51FromDiscord<Elegantbeef> Much easier than making your own allocator
08:45:30PMunchDefinitely!
08:45:51PMunchJust 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:46FromDiscord<Elegantbeef> Probably
08:47:52FromDiscord<Elegantbeef> not
08:48:19PMunchI mean it shouldn't be too dissimilar from multiple threads touching the same memory
08:48:22FromDiscord<Elegantbeef> Unless you use a semaphore to indirect allocations
08:48:45FromDiscord<Elegantbeef> Right, but two allocators working with seperate logic is going to run into issues
08:49:08PMunchWill they though?
08:49:16PMunchAssuming atomicArc
08:49:17FromDiscord<Elegantbeef> If process A attempts to allocate a block as process B does, yes
08:49:39FromDiscord<Elegantbeef> The allocator needs to lock to prevent raceful allocations
08:51:48PMunchOh 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:48PMunchfor A. The only time they touch each others memory is to play with objects sent from the other.
08:52:05PMunchSo they will never try to allocate from the same piece of memory
08:52:38PMunchThe biggest problem I see is making sure that all memory from program A is mapped in program B and vice versa
08:52:59FromDiscord<Elegantbeef> Plus if the two allocators do not know the other's block information freeing likely will error
08:52:59FromDiscord<Elegantbeef> Ah
08:52:59FromDiscord<Elegantbeef> I assumed you just got mmap to share memory with Nim's allocator
08:53:02PMunchI 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:57PMunchWell 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:28PMunchFreeing might be an issue, As allocator won't know if B has freed memory in one of its chunks..
08:58:08PMunchSo 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:08PMunchand 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:15PMunchI think that should work
08:58:23PMunchAs 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:25arkanoidwhy nim keeps pushing choosenim in official website and releases? it's buggy and headless (author flee)
09:21:58arkanoidnim is spending resources on vscode extension and language server, but if user uses choosenim with there will face bad weird problems
09:22:30arkanoid*with these will face bad and weird problems
09:23:00PMuncharkanoid, we're working on it
09:23:42arkanoidwhere? is there an official fork? official github is 2 years old
09:24:23PMunchThere 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:30arkanoidwhile working on it, it should be removed from official communications
09:24:36PMunchDiscussion from two days ago: https://irclogs.nim-lang.org/17-06-2024.html#12:36:22
09:25:01PMunchI mean it still works for a lot of people
09:25:07arkanoidI mean, half of my tooling complains ended up rooted into choosenim, but it has been a wild ride to find it
09:25:10PMunchI personally use it and don't have any issues with it
09:25:44PMunchThen again I use nimlsp and not nimlangserver
09:25:49arkanoidPMunch: because you prolly are not using vscode extension
09:25:58PMunchAh no, I don't use vscode
09:26:22PMunchThat being said once the official fork is up someone still has to actually fix those issues
09:26:34PMunchPreferably someone who are facing them and can actually verify that the fix works
09:26:52arkanoidI mean the issue hits all choosenim + vscode users, which is what user gets from official homepage and stats confirms
09:27:23arkanoidsure, but the repo is headless
09:31:08arkanoidyou can't pretend the community to PR on an headless official repo, while keeping the real one private
09:33:18FromDiscord<odexine> thats not what he said, what
09:37:40arkanoidwell, 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:35FromDiscord<kots> It's alive!
10:27:18PMunchI ran out of minutes for running the CI in a private repo, please look the other way while I fix it :)
10:35:35FromDiscord<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:19FromDiscord<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:34FromDiscord<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:57FromDiscord<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:39FromDiscord<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:44PMunchYou okay there @albassort?
11:27:21FromDiscord<albassort> i forgot /usr/include exists
11:28:06FromDiscord<fabric.input_output> In reply to @albassort "i forgot /usr/include exists": `--passL:"-I./headers/path"`?
11:28:15FromDiscord<fabric.input_output> (edit) "`--passL:"-I./headers/path"`?" => "`--passC:"-I./headers/path"`?"
11:29:36FromDiscord<albassort> that doesn't work for a library
11:30:23FromDiscord<fabric.input_output> In reply to @albassort "that doesn't work for": `{.passL: "-I./headers/path".}`?
11:30:37FromDiscord<fabric.input_output> I think this should
11:30:54FromDiscord<fabric.input_output> this is probably what naylib does
11:31:03FromDiscord<Robyn [She/Her]> `{.header: "filepath.h".}` doesn't work?
11:31:11FromDiscord<albassort> well it cant be relative
11:31:19FromDiscord<albassort> is the issue
11:31:20FromDiscord<Robyn [She/Her]> You could use the compile time VM to get an absolute path
11:31:37FromDiscord<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:57FromDiscord<Robyn [She/Her]> Official Nim bindings for OpenGL does that, no?
11:32:02FromDiscord<Robyn [She/Her]> With `glGet` or something
11:32:16*PMunch joined #nim
11:34:25FromDiscord<albassort> in the static function I guess I could find then nimble path
11:34:44FromDiscord<albassort> or i could just put the deps in the right location
11:34:53FromDiscord<albassort> (edit) "the" => "a"
11:35:22FromDiscord<fabric.input_output> naylib clones the raylib git repo, builds it and uses it
11:36:32FromDiscord<albassort> someone made raylib bindings
11:36:34FromDiscord<albassort> interesting
11:36:41*ntat joined #nim
11:36:50FromDiscord<albassort> has anyone made anything practical with raylib ever
11:36:55FromDiscord<Robyn [She/Her]> Nope xD
11:37:09NimEventerNew thread by TKD: Passing an optional proc is not working, see https://forum.nim-lang.org/t/11796
11:37:13FromDiscord<Robyn [She/Her]> There are games with it, but I haven't done much beyond basic testing
11:37:14FromDiscord<albassort> yeah suppose that would be impossible perhaps
11:37:24FromDiscord<albassort> In reply to @chronos.vitaqua "There are games with": eeee?
11:37:26FromDiscord<albassort> let me see
11:37:36FromDiscord<griffith1deadly> In reply to @albassort "has anyone made anything": for game cheating in nim - like imgui
11:38:01FromDiscord<Robyn [She/Her]> In reply to @albassort "eeee?": I have no public code xD
11:38:15FromDiscord<Robyn [She/Her]> And all the code I did have is deleted
11:38:55FromDiscord<albassort> In reply to @griffith1deadly "for game cheating in": how do you do this
11:38:59FromDiscord<albassort> oh
11:39:07FromDiscord<albassort> like how does that even work
11:39:43FromDiscord<griffith1deadly> nim has very bad imgui wrapper as i last checked
11:39:51FromDiscord<griffith1deadly> so i'm stuck with naylib
11:40:05FromDiscord<albassort> you use this for... 2d rending of menus?
11:40:22FromDiscord<griffith1deadly> menu + esp
11:40:36FromDiscord<albassort> esp?
11:40:58FromDiscord<griffith1deadly> enemy drawing by easy words
11:41:40FromDiscord<albassort> I ok i'm starting to imagine how this might work.
11:42:18FromDiscord<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:20FromDiscord<Robyn [She/Her]> Anyone know how I'd get the length of all consumed input with `std/strscans`?
12:14:00FromDiscord<Robyn [She/Her]> For example: `Struct $w`
12:28:11FromDiscord<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:08FromDiscord<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:41FromDiscord<Robyn [She/Her]> `result.toOpenArray(0, s.len - 1)[0..<s.len] = s[0..<s.len]` also doesn't work
12:55:57FromDiscord<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:11FromDiscord<Robyn [She/Her]> TIL Rust doesn't have enum indexable arrays, this is yet another win for Nim :P
13:47:45FromDiscord<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:17FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=cmdTjbqD
13:55:43FromDiscord<ieltan> the assigning a slice to a slice syntax
13:56:30FromDiscord<ieltan> which would not allocate unlike the `stringify`
13:58:30FromDiscord<ieltan> maybe make a new operator like `=:` or something
13:58:44FromDiscord<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:13FromDiscord<Robyn [She/Her]> !eval (var a = ['a', 'b', 'c']; var b = @['d', 'e', 'f']; b[1..2] = a[1..2]; echo b)
14:00:18NimBotCompile failed: @['d', 'b', 'c']
14:00:30FromDiscord<Robyn [She/Her]> Really need a bot on the discord side that can evaluation multiline expressions
14:00:42FromDiscord<Robyn [She/Her]> In reply to @NimBot "Compile failed: @['d', 'b',": Huh, failed but it printed the result just fine :P
14:01:24FromDiscord<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:25FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=MCamzTny
15:07:20FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=Mzacipyl" => "https://play.nim-lang.org/#pasty=gLlPKZRg"
15:08:56FromDiscord<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:23rockcaverais there any way to get all the values ​​of a non-ordinal enum?
15:35:22rockcaveraI found it in std/setutils
15:35:52FromDiscord<fabric.input_output> In reply to @rockcavera "is there any way": `items` iterator in `std/enumutils`
15:39:14rockcaverafabric.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:26FromDiscord<planetis> https://github.com/ZoomTen/hb-strife-2024↡(@albassort)
16:19:47FromDiscord<planetis> Not impossible when you got mad skillz
16:19:55FromDiscord<planetis> like zoom
16:28:48*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
16:31:53FromDiscord<Zoom> ZoomTen is someone else. [My gh](https://github.com/ZoomRmc/), although I release nothing there, just occasional commits.
16:36:50FromDiscord<zumi.dxy> In reply to @planetis "Not impossible when you": lmao naahhhh↡this is just a bit of fun
16:39:50FromDiscord<planetis_m> oh that's you, haha
16:43:17FromDiscord<__jont__> sent a code paste, see https://play.nim-lang.org/#pasty=NgtKhSJk
16:44:28FromDiscord<leorize> compile time as typedesc are not runtime values
16:46:04FromDiscord<ieltan> In reply to @__jont__ "Trying to figure out": What does the `init` provides that `Test1(x: 0, y: 0)` does not ?
16:47:38FromDiscord<__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:37FromDiscord<__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:52FromDiscord<sOkam! 🫐> @jont aware of [`treeform/vmath`](https://github.com/treeform/vmath)?
16:51:50FromDiscord<ieltan> but to answer your question yeah it should pick the right `init` at compile-time @jont
16:51:53FromDiscord<sOkam! 🫐> In reply to @__jont__ "Trying to figure out": the right instantiation will be chosen at compile time yes
16:52:17FromDiscord<ieltan> iirc status does that in their style guide
16:53:40FromDiscord<__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:01FromDiscord<__jont__> In reply to @ieltan "but to answer your": That's good to know. Thank you everybody.
16:54:18FromDiscord<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:20FromDiscord<sOkam! 🫐> whats the alternative to object variants?
17:04:39FromDiscord<sOkam! 🫐> is there a way to have a single type that has extra fields, other than with a variant?
17:29:29FromDiscord<leorize> what is even a single type with extra fields?
17:39:10FromDiscord<Robyn [She/Her]> In reply to @heysokam "is there a way": A... Normal field?
17:39:53FromDiscord<fabric.input_output> In reply to @heysokam "is there a way": what?
17:40:28Amun-Rajust define a proc for specific type and you're all set
17:40:55FromDiscord<sOkam! 🫐> In reply to @leorize "what is even a": a variant?
17:41:10FromDiscord<sOkam! 🫐> https://nim-lang.org/docs/manual.html#types-object-variants
17:41:42FromDiscord<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:24FromDiscord<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:41FromDiscord<sOkam! 🫐> and there are two versions (variants) of that type
17:42:43*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
17:42:49Amun-Raisn't that what private is for?
17:43:17Amun-Rayou can always make it public and annotate with "do not touch" ;)
17:43:20FromDiscord<sOkam! 🫐> but its a private variant, as I said
17:43:51FromDiscord<fabric.input_output> don't export the fields of that variant?
17:45:12FromDiscord<sOkam! 🫐> did I unlearn english? started saying that `importutils.privateAccess` is broken for variants 😦
17:46:10FromDiscord<sOkam! 🫐> that's the whole problem, pretty much
17:50:00FromDiscord<sOkam! 🫐> well, my theory seems to be wrong. I can't get access to the private fields of an inherited type either 😭
17:50:28FromDiscord<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:29FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=zimUtqCV
17:51:36FromDiscord<Robyn [She/Her]> Hacky as hell but it should work
17:52:01FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=JSSDOlVr
17:52:21FromDiscord<sOkam! 🫐> sorry, creating a new variable with that type
17:52:49FromDiscord<sOkam! 🫐> so `Path(kind: Kind.Dir, dir_d: "thing")` should work... but doesn't because `dir_d` is private
17:52:59FromDiscord<Robyn [She/Her]> For instantiating it? Can do the same thing, no?
17:53:02FromDiscord<sOkam! 🫐> even if you import with privateAccess 😦
17:53:19FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "For instantiating it? Can": wdym?
17:54:16FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=sLTrSmLa
17:54:32FromDiscord<Robyn [She/Her]> That is ungodly though, and there is a MUCH better way to do this than using private access
17:54:45FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=ckdliPEs
17:55:09FromDiscord<sOkam! 🫐> hell, even `a.dir` with an inherited type breaks too
17:55:12FromDiscord<Robyn [She/Her]> In reply to @heysokam "even `a.dir_d = "thing"`": Have you tried the way I'm saying to do?
17:55:32FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Have you tried the": haven't tried in a loop like that, nope
17:55:33FromDiscord<Robyn [She/Her]> Via the field pairs iterator?
17:55:40FromDiscord<sOkam! 🫐> I don't have a variant anymore, though
17:55:46FromDiscord<Robyn [She/Her]> Ah
17:56:02FromDiscord<sOkam! 🫐> I got pissed and changed them into inherited types 😦
17:56:05FromDiscord<Robyn [She/Her]> Either way, I heavily recommend you export it, or make a public helper proc to init the thing
17:56:24FromDiscord<Robyn [She/Her]> You're digging your own grave by keeping it private
17:56:34FromDiscord<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:44FromDiscord<Robyn [She/Her]> In reply to @heysokam "well that's the problem.": Huh?
17:56:49FromDiscord<sOkam! 🫐> which is like... 🧩
17:56:54FromDiscord<sOkam! 🫐> yeah, my exact reaction
17:57:08FromDiscord<Robyn [She/Her]> Do you have a minimal reproduction or no?
17:57:17FromDiscord<sOkam! 🫐> oh, sry. its a private helper but separate
17:57:26FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Do you have a": sadly nope
17:57:33FromDiscord<Robyn [She/Her]> In reply to @heysokam "oh, sry. its a": Separate as in a different file?
17:57:38FromDiscord<sOkam! 🫐> I posted some code above, let me scroll and relink
17:57:40FromDiscord<sOkam! 🫐> of the variant
17:57:44FromDiscord<Robyn [She/Her]> Alright
17:57:50FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Separate as in a": yeah different file with `privateAccess`
17:58:21FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=ovtVByuY
17:58:40FromDiscord<Robyn [She/Her]> In reply to @heysokam "yeah different file with": Stop using privateAccess, define the helper in the same file
17:58:55FromDiscord<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:02FromDiscord<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:07FromDiscord<sOkam! 🫐> its a mess
17:59:25FromDiscord<sOkam! 🫐> plus they won't work, because the type fields are private
17:59:28FromDiscord<Robyn [She/Her]> Then make the helper public and define it in the file you declare the type?
17:59:39FromDiscord<sOkam! 🫐> and they are not accessible for some unknown reason
18:00:03FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Then make the helper": that's equivalent to exposing the type itself
18:00:17FromDiscord<sOkam! 🫐> I don't want the external api to be concerned with the internal repr
18:00:18FromDiscord<Robyn [She/Her]> Your problems seem like they stem from you using privateAccess and {.all.}
18:00:29FromDiscord<sOkam! 🫐> yeah, that's what I said earlier
18:00:42FromDiscord<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:47FromDiscord<sOkam! 🫐> but I'm surprised to find that its broken for normal types too πŸ€·β€β™‚οΈ
18:00:54FromDiscord<sOkam! 🫐> I thought it was just a variant types issue
18:00:54FromDiscord<Robyn [She/Her]> You're backing yourself into a hole :p
18:01:09FromDiscord<Robyn [She/Her]> In reply to @heysokam "but I'm surprised to": Nim is fragile so I'm not surprised
18:01:22FromDiscord<sOkam! 🫐> I guess
18:02:36FromDiscord<sOkam! 🫐> I'm seeing it coming. I make all helper procs public and they also don't show up πŸ™ˆ
18:02:40FromDiscord<sOkam! 🫐> I bet you
18:02:54FromDiscord<sOkam! 🫐> yup πŸ™ˆ
18:07:10FromDiscord<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:23FromDiscord<ieltan> It's ugly and unsafe of course
18:07:45FromDiscord<sOkam! 🫐> thats more cursed than I'm willing to accept 😦
18:07:58FromDiscord<sOkam! 🫐> I'd rather not have a custom Path type, tbh
18:08:46FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=GlYsjQAr
18:08:58FromDiscord<ieltan> You can hide the uglyness by using a template
18:09:23FromDiscord<ieltan> Which would act the same as privateAccess but hopefully without bugs
18:10:04FromDiscord<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:50FromDiscord<sOkam! 🫐> I'd rather go out and chill in the park, than debug a template
18:11:12FromDiscord<sOkam! 🫐> but I see your thinking, ty for the tip anyway
18:20:01FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=dmBgQIks
18:22:02FromDiscord<sOkam! 🫐> In reply to @ieltan "First, don't use {.inheritable.}": the access function is a generic :Thnk
18:22:06FromDiscord<sOkam! 🫐> (edit) ":Thnk" => "πŸ€”"
18:22:52FromDiscord<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:56FromDiscord<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:10FromDiscord<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:18FromDiscord<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:36FromDiscord<sOkam! 🫐> and `std/paths Path` does not allow that
18:27:49FromDiscord<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:54FromDiscord<ieltan> Lemme think
18:28:57FromDiscord<sOkam! 🫐> the simplest solution is single file define it all and forget about imports 😦
18:29:26FromDiscord<sOkam! 🫐> but thats a big mess with how many functions there are
18:30:35FromDiscord<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:57FromDiscord<sOkam! 🫐> because I just moved the functions to that file.. and now its erroring on those functions instead
18:31:14FromDiscord<sOkam! 🫐> (edit) "that file.." => "the `types.nim` file."
18:49:32*jjido joined #nim
19:03:05FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=QHxyISjU
19:03:49FromDiscord<ieltan> (edit) "https://play.nim-lang.org/#pasty=NdHRVCzu" => "https://play.nim-lang.org/#pasty=sbHvCksy"
19:04:41FromDiscord<ieltan> I know you said you don't want a custom path but eh
19:10:34FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=JKmuyLIq
19:10:42FromDiscord<sOkam! 🫐> so multifile was not the problem
19:10:58FromDiscord<sOkam! 🫐> everything was moved to a single file, so the problem is not the imports @Robyn [She/Her]
19:12:28FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=opWEznFl
19:13:07FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=IBUXMeCr
19:13:11FromDiscord<Robyn [She/Her]> I have no clue
19:19:58NimEventerNew thread by blackmius: Iterators dont inline, see https://forum.nim-lang.org/t/11799
19:23:49FromDiscord<Elegantbeef> @sOkam! 🫐 can you give the code block causing issues, and the error?
19:25:19FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "<@186489007247589376> can you give": its right there
19:29:28FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=GFUbveVm
19:30:38FromDiscord<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:49FromDiscord<ElegantBeef> Heh bridge is fun
19:31:16FromDiscord<sOkam! 🫐> yes
19:33:49FromDiscord<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:30FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=IEbFuRPL
19:35:31FromDiscord<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:44FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=uZmCpcKr
19:36:57FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=BupEjBFG" => "https://play.nim-lang.org/#pasty=UKTtwUyD"
19:37:02FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=fvEPTuGT" => "https://play.nim-lang.org/#pasty=wFVbJcwW"
19:37:26FromDiscord<sOkam! 🫐> _(dunno if bridge applies modifications, but they say `_d` not the name as is)_
19:37:58FromDiscord<Elegantbeef> I don't see how that'd confuse it
19:40:31FromDiscord<sOkam! 🫐> also, I should probably specify that I'm testing all of this inside `std/unittest`
19:40:41FromDiscord<sOkam! 🫐> which apparently is made of templates... so.... yeah, fun
19:41:06FromDiscord<ieltan> In reply to @heysokam "its hard to explain": My bad then, πŸ˜…
19:42:43FromDiscord<sOkam! 🫐> @ieltan https://scons.org/doc/production/HTML/scons-user.html#id1461 reference
19:43:09FromDiscord<sOkam! 🫐> I implemented a much less confusing/simpler version of that feature
19:45:08FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=fbwTPKQh
20:15:27*ntat quit (Quit: Leaving)
20:31:14FromDiscord<sOkam! 🫐> sent a long message, see https://pasty.ee/wXtFWDTi
20:41:15FromDiscord<sOkam! 🫐> apparently `std/unittest` hides away error messages inside the million templates↡that includes object constructors inside `const tuple` πŸ€¦β€β™‚οΈ
20:42:02FromDiscord<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:44FromDiscord<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:46FromDiscord<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:07FromDiscord<sOkam! 🫐> do you guys know any good test framework for Nim that doesn't use macros or templates?
20:57:47FromDiscord<griffith1deadly> In reply to @heysokam "do you guys know": first time treeform github does not help
20:58:16FromDiscord<sOkam! 🫐> he uses testament, afak πŸ™‚
20:58:19FromDiscord<sOkam! 🫐> (edit) "afak" => "afaik"
21:00:39FromDiscord<griffith1deadly> jsony does not use anything like test framework πŸ€”
21:03:12FromDiscord<leorize> `system.doAssert` and `system.doAssertRaises`↡(@sOkam! 🫐)
21:03:18FromDiscord<leorize> covers 90% of what you ever need
21:15:41FromDiscord<sOkam! 🫐> @leorize0713 good point
21:33:18FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=PiFzlsBF
21:33:29FromDiscord<Robyn [She/Her]> I'm doing macro hackery
21:34:49FromDiscord<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:36FromDiscord<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:23FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=aOpXvqUH
22:28:12FromDiscord<Robyn [She/Her]> Ah, fixed!
22:36:00FromDiscord<sOkam! 🫐> is there a way to get a list of symbols defined in a file? πŸ€”
22:39:05FromDiscord<Robyn [She/Her]> Hm
22:40:55FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=fWlDogmI
22:41:11FromDiscord<Robyn [She/Her]> (edit) "https://play.nim-lang.org/#pasty=csvxmHvu" => "https://play.nim-lang.org/#pasty=APVNBCPJ"
22:41:37FromDiscord<Robyn [She/Her]> Then just do `--include:myfile.nim` as a CLI param?
22:41:47FromDiscord<Robyn [She/Her]> Not sure if that'd work at all but it'd be funny if it did
22:43:25FromDiscord<leorize> I think you just managed to transform it using a very simple algorithm? \:p↡(@Robyn [She/Her])
22:45:08FromDiscord<leorize> the direction is correct \:p↡(@Robyn [She/Her])
22:47:29FromDiscord<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:26FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#pasty=uxJvqxyk
22:49:16FromDiscord<leorize> not that you should ever do this in real code
22:51:37FromDiscord<Robyn [She/Her]> xD
22:51:47FromDiscord<Robyn [She/Her]> Nice to know I was close though
23:02:12FromDiscord<Robyn [She/Her]> I don't think I can have a stateless parser if I want whitespace sensitivity
23:39:16FromDiscord<Thomas Hardy> sent a long message, see https://pasty.ee/INVQKTLi
23:41:40FromDiscord<demotomohiro> <@&371760044473319454>