00:02:31 | FromDiscord | <sOkam! π«> kk ty |
00:06:50 | * | lucasta quit (Read error: Connection reset by peer) |
00:07:05 | * | lucasta joined #nim |
00:09:47 | * | beholders_eye quit (Ping timeout: 268 seconds) |
00:25:50 | FromDiscord | <Robyn [She/Her]> Quick question to the people here, I must enable views for types to be able to store `openArray`s of types, right? Would any modification to an object in the openArray also propagate elsewhere? |
00:26:19 | FromDiscord | <Elegantbeef> Yes |
00:26:32 | FromDiscord | <Elegantbeef> If you enable views you will have codegen issues |
00:26:35 | FromDiscord | <Elegantbeef> I garuentee it |
00:26:45 | FromDiscord | <Robyn [She/Her]> Ah |
00:26:57 | FromDiscord | <Robyn [She/Her]> So no highly optimised NBT parser π |
00:27:18 | FromDiscord | <Elegantbeef> I mean you can do `ptr UncheckedArray[T]` and get the exact same thing just with no safety |
00:27:29 | FromDiscord | <Robyn [She/Her]> Wanted to avoid allocations when possible |
00:27:36 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I mean you can": Type safety is important though :P |
00:27:49 | FromDiscord | <Elegantbeef> This isn't type safety |
00:27:54 | FromDiscord | <Elegantbeef> This is memory safety |
00:28:06 | FromDiscord | <Robyn [She/Her]> Ah |
00:28:29 | FromDiscord | <Robyn [She/Her]> ~~Type~~ memory safety is important though :P |
00:29:06 | FromDiscord | <polylokh_39446> yep, some of these are pretty bad: <https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+views+label%3A%22View+Types%22> |
00:29:48 | FromDiscord | <polylokh_39446> actually the specific one I was looking for was fixed recently, nice! |
00:30:02 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=ZOKskSbm |
00:30:14 | FromDiscord | <Robyn [She/Her]> In reply to @polylokh_39446 "yep, some of these": Oh well |
00:30:24 | FromDiscord | <Robyn [She/Her]> (edit) "https://play.nim-lang.org/#pasty=yRhWvMzd" => "https://play.nim-lang.org/#pasty=flvyfcBn" |
00:30:26 | FromDiscord | <Elegantbeef> where would you even put an `openArray[T]` here? |
00:30:32 | FromDiscord | <polylokh_39446> <https://github.com/nim-lang/Nim/issues/15778> is the one |
00:30:54 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "where would you even": `cmpdVal: openArray[NbtNode[T]]` |
00:31:10 | FromDiscord | <Robyn [She/Her]> I forgot a snippet of code before |
00:31:24 | FromDiscord | <Elegantbeef> So use `ref seq[T]`? |
00:32:05 | FromDiscord | <Robyn [She/Her]> How would I use that when getting a slice of `NbtNode`s? |
00:32:20 | FromDiscord | <Elegantbeef> You'd have a lifetime issue regardless if the node outlives the `openArray` |
00:33:15 | FromDiscord | <Elegantbeef> `values: Slice[int]` |
00:34:16 | FromDiscord | <Robyn [She/Her]> Hm, thanks Beef! Gonna look into this tomorrow or whenever I finish my college assignments |
00:34:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "You'd have a lifetime": Yeah that makes sense |
00:35:53 | FromDiscord | <Elegantbeef> If you really wanted to prevent allocations you'd use a fixed array of indicies and have the user pass in a `var openArray[Node[T]]` |
00:39:33 | FromDiscord | <Elegantbeef> Now you write a `proc yourName(state: NbState[T]) = ...` |
00:39:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ywhcYGeD |
00:40:00 | FromDiscord | <polylokh_39446> avoiding copies might also not be that much of a win. It's something I found myself easily focusing too much on, as some kind of cognitive infection from exposure to Rust. But copies can be very fast and if you do a bunch of work with the outcome of copying you might have better data locality than if you carefully worked through pointers. |
00:42:02 | FromDiscord | <Elegantbeef> Copying a seq is less than ideal, but yea don't let the perfect be the enemy of good enough |
00:42:21 | FromDiscord | <polylokh_39446> although a parser? That's the same thing that led me into Nim's bugs with viewtypes. |
00:43:31 | FromDiscord | <Elegantbeef> I just go for data oriented design and scream about reasoning |
00:43:36 | FromDiscord | <polylokh_39446> >tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data.β΅β΅what I went with after giving up on viewtypes, was just copying everything, but something that might've worked is using an ad-hoc slice type and ensuring the lifetimes myself, like with mslice ... |
00:44:31 | FromDiscord | <polylokh_39446> <https://github.com/c-blake/cligen/blob/master/cligen/mslice.nim#L29> |
00:48:17 | FromDiscord | <Elegantbeef> Yea that works it's just a pain |
00:48:57 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=tdtYMPfE |
00:49:32 | FromDiscord | <Elegantbeef> The state is just an array |
00:49:38 | FromDiscord | <Elegantbeef> Or a sequence |
00:49:52 | FromDiscord | <Elegantbeef> `IdSet` tells you which element in the array is active |
00:50:01 | FromDiscord | <Elegantbeef> Like I said it's a very data oriented design |
00:50:43 | FromDiscord | <Elegantbeef> Instead of using pointers you just store all the indexes each object depends upon |
00:51:15 | FromDiscord | <Elegantbeef> It also could be a `data: Slice[int]` if you only have contiguous slices |
00:51:54 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Instead of using pointers": Yeah that was what I thought my original concept was doing even if it'd use some modification aha |
00:52:05 | FromDiscord | <Elegantbeef> The benefit here is that the user allocates a collection and you never grow out of it, if you need more you raise an error about lacking space |
00:52:36 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "`IdSet` tells you which": And that's relevant only during the construction process, I'd imagine? |
00:53:05 | FromDiscord | <Elegantbeef> Well no |
00:53:13 | FromDiscord | <Elegantbeef> If you remove indices and the like from the array you need taht |
00:53:21 | FromDiscord | <Elegantbeef> I do not know what your processing is like |
00:53:37 | FromDiscord | <Robyn [She/Her]> Fair enough |
00:53:58 | FromDiscord | <Robyn [She/Her]> I think I'm gonna have to process this after sleeping, but thanks for the help :) |
01:39:16 | * | krux02 quit (Remote host closed the connection) |
01:48:27 | * | lucasta quit (Quit: Leaving) |
02:52:56 | * | hexeme_ joined #nim |
02:55:20 | * | laintree joined #nim |
03:00:47 | * | lain quit (*.net *.split) |
03:00:49 | * | anddam quit (*.net *.split) |
03:00:49 | * | hexeme quit (*.net *.split) |
03:13:41 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
03:16:25 | * | SchweinDeBurg joined #nim |
03:38:46 | * | Onionhammer7 joined #nim |
03:40:08 | * | anddam joined #nim |
03:40:09 | * | dtomato quit (Read error: Connection reset by peer) |
03:40:21 | * | dtomato joined #nim |
03:41:34 | * | Goodbye_Vincent1 joined #nim |
03:42:01 | * | madprops_ joined #nim |
03:44:30 | * | Onionhammer quit (Read error: Connection reset by peer) |
03:44:30 | * | Onionhammer7 is now known as Onionhammer |
03:46:05 | * | noeontheend_ joined #nim |
03:46:08 | * | LyndsySimon_ joined #nim |
03:46:14 | * | dv^_^1 joined #nim |
03:46:40 | * | oprypin_ joined #nim |
03:46:43 | * | ursa-major_ joined #nim |
03:46:59 | * | johuck_ joined #nim |
03:49:45 | * | oisota5 joined #nim |
03:53:04 | * | dv^_^ quit (*.net *.split) |
03:53:04 | * | jkl quit (*.net *.split) |
03:53:05 | * | casaca quit (*.net *.split) |
03:53:05 | * | gshumway_ quit (*.net *.split) |
03:53:06 | * | oisota quit (*.net *.split) |
03:53:06 | * | void09 quit (*.net *.split) |
03:53:07 | * | dv^_^1 is now known as dv^_^ |
03:53:07 | * | oisota5 is now known as oisota |
03:53:38 | * | ursa-major quit (*.net *.split) |
03:53:39 | * | oprypin quit (*.net *.split) |
03:53:39 | * | Goodbye_Vincent quit (*.net *.split) |
03:53:39 | * | madprops quit (*.net *.split) |
03:53:39 | * | noeontheend quit (*.net *.split) |
03:53:40 | * | johuck quit (*.net *.split) |
03:53:41 | * | nils` quit (*.net *.split) |
03:53:42 | * | Ekho quit (*.net *.split) |
03:53:42 | * | bcksl quit (*.net *.split) |
03:53:43 | * | LyndsySimon quit (*.net *.split) |
03:53:45 | * | noeontheend_ is now known as noeontheend |
03:53:45 | * | LyndsySimon_ is now known as LyndsySimon |
03:53:45 | * | Goodbye_Vincent1 is now known as Goodbye_Vincent |
03:53:47 | * | johuck_ is now known as johuck |
03:53:48 | * | ursa-major_ is now known as ursa-major |
03:53:55 | * | madprops_ is now known as madprops |
03:53:56 | * | madprops quit (Changing host) |
03:53:56 | * | madprops joined #nim |
03:56:01 | * | jkl joined #nim |
03:56:01 | * | casaca joined #nim |
03:56:01 | * | gshumway_ joined #nim |
03:56:01 | * | void09 joined #nim |
04:01:29 | * | nils` joined #nim |
04:02:11 | * | bcksl joined #nim |
04:03:23 | * | Ekho joined #nim |
04:08:04 | * | jkl quit (Max SendQ exceeded) |
04:08:04 | * | gshumway_ quit (Max SendQ exceeded) |
04:09:07 | * | jkl joined #nim |
04:10:15 | * | gshumway joined #nim |
04:26:40 | * | dio quit (Read error: Connection reset by peer) |
06:32:52 | * | laintree is now known as lain |
07:32:19 | * | ntat joined #nim |
07:59:59 | * | coldfeet joined #nim |
08:14:32 | * | def- quit (Quit: -) |
08:15:52 | * | def- joined #nim |
08:50:49 | * | gst joined #nim |
08:55:23 | NimEventer | New thread by drkameleon: Super-weird error with builds on latest Windows runner (Github), see https://forum.nim-lang.org/t/11612 |
09:01:25 | FromDiscord | <Phil> Wait a minute, the entire "convert proc call to object that can be sent over channel" thing is already solved by std/tasks? Slick! |
10:59:47 | * | krux02 joined #nim |
11:18:08 | * | def- quit (Quit: -) |
11:19:27 | * | def- joined #nim |
11:28:57 | * | def- quit (Quit: -) |
11:46:33 | * | def- joined #nim |
12:12:31 | * | xet7 quit (Ping timeout: 268 seconds) |
12:24:09 | * | xet7 joined #nim |
12:47:22 | * | beholders_eye joined #nim |
12:49:58 | * | xet7 quit (Remote host closed the connection) |
13:49:10 | FromDiscord | <Phil> asan and valgrind making me remember again why I absolutely wouldn't want dealing with multithreading on my worst enemy |
13:49:26 | FromDiscord | <Phil> (edit) "want" => "wish" | "on" => "for" |
14:16:12 | * | def- quit (Quit: -) |
14:17:19 | * | def- joined #nim |
14:19:38 | * | termer_ joined #nim |
14:22:49 | * | termer quit (Ping timeout: 256 seconds) |
14:27:47 | * | xet7 joined #nim |
14:52:24 | FromDiscord | <Phil> Ey, I hate those stacktraces so damn much.β΅They were pointing me over and over and over again at a `createThread` call that was spawning a thread with a while-loop in it, when the actual god damn problem was that the `=destroy` hook of `task` wasn't being called properly with tryRecv |
14:52:50 | FromDiscord | <Phil> This was worse than no info, this was actively misleading |
14:53:15 | FromDiscord | <Phil> Not sure if that's just a general asan/tsan issue or if that's being made more complicated due to the added abstraction layer of nim |
14:53:47 | FromDiscord | <Phil> (edit) "Ey, I hate those stacktraces so damn much.β΅They were pointing me over and over and over again at a `createThread` call that was spawning a thread with a while-loop in it, when the actual god damn problem was that the `=destroy` hook of `task` wasn't being called properly with tryRecv ... " added "when cleaning up remaining tasks before shutting down the main-thread" |
15:37:57 | * | def- quit (Quit: -) |
15:38:39 | * | def- joined #nim |
15:59:44 | * | def- quit (Quit: -) |
16:00:15 | * | def- joined #nim |
16:03:17 | * | def- quit (Client Quit) |
16:05:01 | * | def- joined #nim |
16:33:56 | * | xet7 quit (Quit: Leaving) |
17:05:23 | * | beholders_eye quit (Ping timeout: 264 seconds) |
17:32:49 | * | disso-peach joined #nim |
17:41:56 | * | beholders_eye joined #nim |
17:43:23 | * | disso-peach quit (Quit: Leaving) |
17:55:30 | FromDiscord | <Phil> I kinda want something along the lines of "Try to shut down this other thread. If it hasn't shut down after n seconds, kill it" |
17:56:03 | FromDiscord | <Phil> Ideally without having to use sleep as that'd mean that the user always has to wait n seconds instead of just moving on as soon as possible |
17:57:00 | FromDiscord | <odexine> what's this supposed to remediate? |
17:57:08 | FromDiscord | <odexine> i mean the kill a thread after a delay |
17:57:43 | FromDiscord | <Phil> Essentially when somebody wants to shut down the program but they forgot to shut-down a thread server then that thread server will hang the shutdown of the entire application. |
17:58:18 | FromDiscord | <Phil> Though I guess I could fix that by offering some kind of global shut-down mechanism for all threadservers at once |
17:58:45 | FromDiscord | <Phil> Ah, no, can't do that, I'd need to know the threadservers available so I can wake them up first so they can escape their while-loop |
18:00:08 | FromDiscord | <Phil> ... which I can do, I can just record which threadServers are being put into the threadpool in a seq and iterate over that with a global shutdownproc |
18:02:23 | * | beholders_eye quit (Ping timeout: 264 seconds) |
18:38:03 | * | coldfeet quit (Remote host closed the connection) |
18:49:12 | FromDiscord | <albassort> can i assign a range to an enum |
18:49:25 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=rpQzdHxz |
18:49:31 | FromDiscord | <odexine> i dont think so no |
18:49:57 | FromDiscord | <albassort> thats stupid because i can do it in reverse |
18:50:14 | FromDiscord | <odexine> ? |
18:50:24 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=CUrLnjZA |
18:50:30 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#pasty=stovQbYB" => "https://play.nim-lang.org/#pasty=XOZtwCRH" |
18:50:40 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#pasty=deoavaWp" => "https://play.nim-lang.org/#pasty=vHbXMhLc" |
18:51:38 | FromDiscord | <albassort> eh actually |
18:51:45 | FromDiscord | <albassort> that makes sense because how word ord() work |
18:51:46 | FromDiscord | <odexine> what |
18:51:54 | FromDiscord | <albassort> would return either a range or a number |
18:54:46 | * | def- quit (Quit: -) |
18:55:14 | * | def- joined #nim |
18:58:09 | * | def- quit (Client Quit) |
19:00:24 | * | def- joined #nim |
19:03:47 | * | def- quit (Client Quit) |
19:04:29 | * | def- joined #nim |
19:25:27 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=AilWHgFd |
19:26:07 | FromDiscord | <sOkam! π«> I even went as far as redefining `items` for `HashSet[Path]` in that file and it still crashes |
19:26:16 | FromDiscord | <michaelb.eth> `import std/sets` ? |
19:26:36 | FromDiscord | <sOkam! π«> In reply to @michaelb.eth "`import std/sets` ?": I literally redefined the iterator because its already imported |
19:26:36 | FromDiscord | <michaelb.eth> ah, nvm, I see it's the Path thing |
19:26:56 | FromDiscord | <sOkam! π«> its not, if I redefine the iterator it still crashes |
19:27:54 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=iGfLRRlN |
19:29:08 | FromDiscord | <michaelb.eth> what if in the return type you have `string` instead of `Path` and yield `$A[id]` |
19:30:22 | FromDiscord | <michaelb.eth> alternatively, what if in your module you implement `iterator items[distinct T](a: set[distinct T]): distinct T` ? |
19:31:03 | FromDiscord | <michaelb.eth> sorry, I mean `HashSet[distinct T]` |
19:33:06 | FromDiscord | <sOkam! π«> the error is somewhere else entirely, it has nothing to do with the iterators |
19:33:29 | FromDiscord | <sOkam! π«> its something inside, that crashes as if it was that iterator, but really isnt |
19:33:46 | FromDiscord | <sOkam! π«> templates being templates π¦ |
19:37:03 | * | ntat quit (Quit: Leaving) |
19:42:54 | FromDiscord | <sOkam! π«> how do you access `HashSet[N]` without the `[]` proc? is there a way? |
19:43:11 | FromDiscord | <sOkam! π«> I'm trying to reimplement `[]` but don't know how to get the value at a specific id |
19:45:32 | FromDiscord | <Zoom> Have just rewritten dumb and convoluted logic of parsing a combo of cli arguments into a nice and tidy variant object. Each occasion you can lean into the type system is so satisfying! |
19:50:36 | FromDiscord | <Zoom> Speaking of Paths, current normalization routine in the stdlib ignores the case of the Windows drive. It prevents path comparison as strings. I could make a fix. Varriount (Clay Sweetser) / @varriount pinging as I saw you reviewing some code going to pathnorm. |
19:53:27 | FromDiscord | <m4ul3r> sent a code paste, see https://play.nim-lang.org/#pasty=gBvMufgq |
19:54:39 | FromDiscord | <m4ul3r> nvm i can do `sect[0][0]; sect[0][1]` |
19:55:34 | FromDiscord | <albassort> i feel like i ask this over and over and over again |
19:55:48 | FromDiscord | <albassort> but how can i convert an integer into chars with padd |
19:56:05 | FromDiscord | <albassort> so an int16(80) gets converted to 2 characters one of which ix 0x0 |
19:57:30 | FromDiscord | <Robyn [She/Her]> In reply to @m4ul3r "I'm trying to write": You can also use types in macro parameters btw |
19:57:56 | FromDiscord | <m4ul3r> yeah, i'm going to be passing in different objects into it |
19:58:59 | FromDiscord | <Robyn [She/Her]> A concept could also work perhaps? But yeah it's your choice, I'm just suggesting type safety |
19:59:12 | FromDiscord | <albassort> In reply to @albassort "so an int16(80) gets": found the solution in some old code |
19:59:26 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "but how can i": I don't get it? |
19:59:51 | FromDiscord | <albassort> sent a long message, see https://pasty.ee/byUhReNA |
20:00:07 | FromDiscord | <albassort> (edit) "long message," => "code paste," | "https://pasty.ee/mKvxDoJb" => "https://play.nim-lang.org/#pasty=uEuhGRwd" |
20:25:39 | * | def- quit (Quit: -) |
20:30:41 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=NrnAnXeH |
20:36:46 | FromDiscord | <Elegantbeef> Can also just do `[uint8(a and 0xff), unit8(a shr 8 and 0xff)]` π |
20:40:07 | * | beholders_eye joined #nim |
20:45:36 | * | def- joined #nim |
20:52:01 | FromDiscord | <m4ul3r> sent a code paste, see https://play.nim-lang.org/#pasty=rYSUgpIj |
20:52:32 | FromDiscord | <m4ul3r> (edit) "https://play.nim-lang.org/#pasty=DkqwJDXn" => "https://play.nim-lang.org/#pasty=WOvthenk" |
20:54:12 | FromDiscord | <Elegantbeef> That code works just fine |
20:55:38 | FromDiscord | <m4ul3r> I guess my issue might be coming from importing the object types from another file |
20:56:05 | FromDiscord | <Elegantbeef> No your issue is that you have a generic field most likely |
20:57:01 | FromDiscord | <m4ul3r> I'm not using any generics in the object |
20:57:09 | FromDiscord | <Elegantbeef> Are you sure? |
20:57:12 | FromDiscord | <Elegantbeef> What's the object definition? |
20:59:59 | FromDiscord | <m4ul3r> hmm, if i simplify it works - it must be the use of `type()` as a member of an object |
21:00:25 | FromDiscord | <Elegantbeef> Yes that's a generic |
21:00:43 | FromDiscord | <Elegantbeef> You cannot store a type in a runtime value |
21:01:07 | FromDiscord | <m4ul3r> I see, hmm - anyway around that? |
21:01:17 | FromDiscord | <Elegantbeef> Stop using a type field |
21:03:28 | * | def- quit (Quit: -) |
21:04:16 | * | def- joined #nim |
21:05:40 | FromDiscord | <Elegantbeef> If you explain what you're trying to do one might provide more details |
21:05:55 | FromDiscord | <m4ul3r> Have an object with function pointers |
21:06:54 | FromDiscord | <Elegantbeef> Ok so why do you need `type`? |
21:08:09 | FromDiscord | <m4ul3r> Just so i can call the functon like `o.doSomething(1,2)` and not have it take o as arg1 |
21:08:26 | FromDiscord | <Elegantbeef> But it's a function pointer |
21:11:46 | * | def- quit (Quit: -) |
21:34:55 | FromDiscord | <Robyn [She/Her]> In reply to @m4ul3r "Just so i can": Do you mean an event system of some sorts? |
21:35:42 | FromDiscord | <Robyn [She/Her]> I have two different implementations of them |
21:36:33 | FromDiscord | <Robyn [She/Her]> Oof does remind me that I need to figure out a way to hook my event system up in a way that works with the JS backend |
21:36:35 | FromDiscord | <m4ul3r> no im doing something different |
21:36:48 | FromDiscord | <Robyn [She/Her]> In reply to @m4ul3r "no im doing something": What are you doing exactly? Would probably help |
21:36:52 | FromDiscord | <Phil> @michaelb.eth are you mayhaps aware of some kind of "Work through the async queue until it is empty" mechanism for chronos?β΅I want to gracefully shut down a server and wrap up all the things it may have left over to do before I fully do so |
21:36:56 | FromDiscord | <m4ul3r> i got it figured out |
21:37:06 | FromDiscord | <Robyn [She/Her]> If you're doing dynamic dispatch, why not `method`s? |
21:37:17 | FromDiscord | <Robyn [She/Her]> In reply to @m4ul3r "i got it figured": Ah nice then |
21:37:20 | FromDiscord | <Phil> no generic methods |
21:37:37 | FromDiscord | <Phil> I use closures in object fields a ton as well for my reactive library |
21:37:43 | FromDiscord | <Phil> (edit) "reactive" => "reactivex implementation" |
21:38:19 | FromDiscord | <Phil> You also get to circumvent nim's type systems somewhat by just storing closures in objects instead of dealing with methods. As a mechanism they just work better |
21:39:26 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "no generic methods": I thought generic methods still worked? |
21:39:36 | FromDiscord | <Elegantbeef> They do but they warn you |
21:39:43 | FromDiscord | <Phil> In reply to @chronos.vitaqua "I thought generic methods": Sure if you like to build anything on deprecated code |
21:39:45 | FromDiscord | <Robyn [She/Her]> Meh, warnings are for cowards |
21:39:46 | FromDiscord | <Phil> I don't |
21:39:54 | FromDiscord | <michaelb.eth> In reply to @isofruit "<@383034029135364096> are you mayhaps": I donβt know offhand, there might be an internal proc for that, or you may need a counter on the main thread |
21:39:55 | FromDiscord | <Robyn [She/Her]> Why are they deprecated anyway |
21:40:17 | FromDiscord | <Robyn [She/Her]> Is it because iirc Araq wanted methods to work using a VTable instead or something? |
21:40:20 | FromDiscord | <Elegantbeef> Cause `method [T](obj: Bleh[T], meh: T)` can exist |
21:40:48 | FromDiscord | <Phil> In reply to @michaelb.eth "I donβt know offhand,": counter... for what? |
21:41:14 | FromDiscord | <michaelb.eth> number of outstanding tasks |
21:41:34 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Cause `method [T](obj: Bleh[T],": A method with no name? |
21:41:46 | FromDiscord | <Elegantbeef> No |
21:41:54 | FromDiscord | <Elegantbeef> A method that uses a generic parameter that is not the same across instances |
21:41:58 | FromDiscord | <Robyn [She/Her]> I don't get the issue then |
21:42:04 | FromDiscord | <michaelb.eth> though hmm i guess that wonβt work, sorry, just thinking uncritically while waiting for a friend to arrive |
21:42:18 | FromDiscord | <Phil> In reply to @michaelb.eth "number of outstanding tasks": isn't it possible that outstanding tasks may spawn more outstanding tasks (I assume an await somewhere in a piece of code spawns a new task) ?β΅So it's more like I need to while-loop over whatever counter |
21:42:22 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "No": Still don't know why it's an issue |
21:42:44 | FromDiscord | <Robyn [She/Her]> Instances like, over shared lib boundaries? |
21:42:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=fXVRmSXb |
21:44:02 | * | def- joined #nim |
21:44:30 | FromDiscord | <Robyn [She/Her]> Yep still clueless |
21:44:56 | FromDiscord | <Robyn [She/Her]> I don't use `method`s like, ever so that may be why I'm struggling a bit to see the issue |
21:46:01 | * | def- quit (Read error: Connection timed out) |
21:46:02 | FromDiscord | <Elegantbeef> I mean that's a shitty example |
21:47:22 | FromDiscord | <Elegantbeef> There's an example somewhere that I cannot recall where the generic method causes memory issues iirc |
21:47:51 | FromDiscord | <Elegantbeef> Regardless methods are lame π |
21:49:19 | * | def- joined #nim |
21:53:45 | NimEventer | New thread by Isofruit: How to "drain" remaining work from Chronos Thread Dispatcher, see https://forum.nim-lang.org/t/11615 |
21:59:13 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Regardless methods are lame": Fair enough lol |
22:00:00 | Amun-Ra | I second that ) |
22:00:02 | Amun-Ra | :> |
22:32:36 | * | def- quit (Quit: -) |
22:33:24 | * | def- joined #nim |
22:39:41 | * | def- quit (Quit: -) |
23:06:55 | * | lain quit (Ping timeout: 272 seconds) |
23:07:38 | * | lain joined #nim |
23:09:21 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
23:15:02 | * | SchweinDeBurg joined #nim |
23:18:52 | FromDiscord | <m4ul3r> With macros, would there be a way to list all of the members of the object, similar to repr? |
23:19:06 | FromDiscord | <m4ul3r> just members, not values |
23:22:08 | * | beholders_eye quit (Read error: Connection reset by peer) |
23:26:01 | FromDiscord | <Elegantbeef> Yes |
23:26:06 | FromDiscord | <Elegantbeef> You do not need macros though |
23:26:12 | FromDiscord | <Elegantbeef> the `fieldPairs` iterator exists |
23:28:12 | * | beholders_eye joined #nim |
23:32:05 | FromDiscord | <System64 ~ Flandre Scarlet> Are hashmaps and dictionnaries fast? |
23:32:15 | FromDiscord | <Elegantbeef> Relative to what? |
23:32:57 | FromDiscord | <System64 ~ Flandre Scarlet> an array or a seq |
23:34:27 | FromDiscord | <Elegantbeef> Well a `Table[int, T]` is slower than an `array[..., T]` |
23:34:33 | FromDiscord | <Elegantbeef> Hashing is slower than direct indexing |
23:35:16 | FromDiscord | <System64 ~ Flandre Scarlet> Like, much slower |
23:35:18 | FromDiscord | <System64 ~ Flandre Scarlet> ? |
23:35:23 | FromDiscord | <Elegantbeef> Yes |
23:35:34 | FromDiscord | <Elegantbeef> Sequences and arrays are contiguous data blocks |
23:35:42 | FromDiscord | <Elegantbeef> Tables require hashing and compairsons |
23:36:52 | * | gst quit (Ping timeout: 250 seconds) |
23:36:53 | FromDiscord | <m4ul3r> In reply to @Elegantbeef "the `fieldPairs` iterator exists": thanks you, can this be used in a macro? |
23:36:55 | * | def- joined #nim |
23:37:15 | FromDiscord | <Elegantbeef> No |
23:37:18 | FromDiscord | <Elegantbeef> Well yesn't |
23:37:20 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
23:39:03 | FromDiscord | <Elegantbeef> You can use `fieldPairs` on a instance you instantiate inside a macro, but you cannot use it on a NimNode you pass in |
23:44:28 | FromDiscord | <m4ul3r> That makes sense since the Nimnode will just have a bunch of dotExpr |
23:44:43 | FromDiscord | <Elegantbeef> What are you trying to do? |
23:45:20 | * | xet7 joined #nim |
23:45:38 | FromDiscord | <m4ul3r> Create an object of objects, some objects will be function pointers. I am hoping to write a macros that can iterate over an object that I know has function pointers and resolve them |
23:45:52 | FromDiscord | <Elegantbeef> "resolve them"? |
23:46:02 | FromDiscord | <Elegantbeef> I'd really suggest using closures to type erase like Phil suggested |
23:49:27 | FromDiscord | <m4ul3r> resolve them by getting where it's at in memory, I have it working for the core of what I wanted to do and was going to call the macro manually for each one, but was thinking if I could write a macro to wrap this macro it would be clever |
23:49:56 | FromDiscord | <Elegantbeef> Uh huh |
23:51:06 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=cWgpUmBC |
23:51:14 | FromDiscord | <sOkam! π«> duplicate case label?? 𧩠|
23:51:38 | FromDiscord | <Elegantbeef> What are your types? |
23:51:48 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=CurMoCFG |
23:52:15 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=TnDUbPxt |
23:53:11 | FromDiscord | <Elegantbeef> Line 120 is? |
23:53:27 | FromDiscord | <sOkam! π«> first one, the unix one |
23:53:51 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=UMCNzuKe |
23:54:22 | FromDiscord | <sOkam! π«> if i add it back it works again 𧩠|
23:54:31 | FromDiscord | <Elegantbeef> Do you do `of ext.obj` somewhere? |
23:54:41 | FromDiscord | <sOkam! π«> yeah |
23:55:00 | FromDiscord | <Elegantbeef> Well there you go |
23:55:00 | FromDiscord | <sOkam! π«> well, not ext.obj.. but rather `ext.unix.obj` |
23:55:09 | FromDiscord | <Elegantbeef> somewhere you have two `".o"` |
23:55:29 | FromDiscord | <sOkam! π«> and its failing there at the object declaration? |
23:55:44 | FromDiscord | <Elegantbeef> No |
23:55:51 | FromDiscord | <Elegantbeef> Constants are folded |
23:55:59 | FromDiscord | <Elegantbeef> So the error is at the fold source |
23:56:03 | FromDiscord | <Elegantbeef> Which is `".o"` |
23:56:16 | FromDiscord | <sOkam! π«> excuse my noobness, but what is folding? |
23:56:38 | FromDiscord | <Elegantbeef> Taking `ext.unix.obj` and turning it into \`".o"\~ |
23:56:48 | FromDiscord | <Elegantbeef> `".o"` |
23:56:53 | * | def- quit (Quit: -) |
23:56:55 | FromDiscord | <Elegantbeef> Statically |
23:57:09 | * | def- joined #nim |
23:57:58 | FromDiscord | <Elegantbeef> Constants are annoying in that respect |
23:59:04 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=HSeJFPiq |
23:59:24 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "Statically": ah i see. makes sense |