00:04:04 | * | lucasta joined #nim |
01:33:16 | * | lucasta quit (Quit: Leaving) |
02:05:23 | * | Jjp137 joined #nim |
02:33:07 | * | sagax joined #nim |
02:38:20 | * | jmdaemon joined #nim |
04:02:28 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
04:03:04 | * | pbsds joined #nim |
04:09:35 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
04:10:55 | * | pbsds joined #nim |
04:18:12 | FromDiscord | <eszetera> hi guys |
04:18:29 | FromDiscord | <eszetera> i want to make a exe that when run shows me my next classtest |
04:18:42 | FromDiscord | <eszetera> and adds it to a sticky note |
04:19:00 | FromDiscord | <eszetera> im wondering how i can make it get the info |
04:19:11 | FromDiscord | <eszetera> (edit) "classtest" => "classtests" |
04:19:13 | FromDiscord | <JJ> cool. learn about web protocols |
04:19:18 | FromDiscord | <eszetera> ikr |
04:19:24 | FromDiscord | <eszetera> yeah i figured |
04:19:45 | FromDiscord | <JJ> try playing around with browser devtools and making requests with curl. there are libraries that wrap such, ex. treeform/puppy |
04:19:49 | FromDiscord | <Elegantbeef> JJ taking my passive aggressive position |
04:20:08 | FromDiscord | <eszetera> huh |
04:20:18 | FromDiscord | <eszetera> yo guys its not malware |
04:20:21 | FromDiscord | <eszetera> literally |
04:20:28 | FromDiscord | <Elegantbeef> > cool. learn about web protocols↵Reads as passive aggressive to me 😄 |
04:20:28 | FromDiscord | <eszetera> i just want to do some coding after weeks |
04:20:42 | FromDiscord | <Elegantbeef> "It's not malware, trust" - Person that should not be trusted |
04:20:52 | FromDiscord | <eszetera> bruh |
04:21:03 | FromDiscord | <eszetera> if i want to make malware i already wouldve done |
04:21:09 | FromDiscord | <Elegantbeef> No one even said you were talking about malware |
04:21:13 | FromDiscord | <Elegantbeef> You brought it up |
04:21:15 | FromDiscord | <eszetera> im guessing |
04:21:29 | FromDiscord | <JJ> this is very funny |
04:21:34 | FromDiscord | <eszetera> it seems like yall always think im making malware |
04:21:35 | FromDiscord | <eszetera> anyways |
04:21:45 | FromDiscord | <JJ> you brought it up |
04:21:46 | FromDiscord | <eszetera> i have to send a get request right |
04:22:33 | FromDiscord | <eszetera> alright |
04:22:38 | FromDiscord | <eszetera> ill just watch youtube |
04:23:08 | FromDiscord | <eszetera> actually |
04:23:12 | FromDiscord | <eszetera> just lost motivation |
04:23:14 | FromDiscord | <eszetera> lmfao |
04:23:30 | FromDiscord | <eszetera> ok i will next be active again when asking another stupid question |
04:23:31 | FromDiscord | <eszetera> byebye |
04:24:05 | FromDiscord | <Elegantbeef> Haf fun |
04:26:11 | FromDiscord | <.bobbbob> ban this idiot |
04:26:19 | FromDiscord | <Elegantbeef> Hey I have feelings |
04:26:35 | FromDiscord | <.bobbbob> "🎃 wannabe maldev" my ass |
04:29:16 | FromDiscord | <eszetera> In reply to @.bobbbob ""🎃 wannabe maldev"": wannabe |
04:29:19 | FromDiscord | <eszetera> you know |
04:29:20 | FromDiscord | <eszetera> bcs |
04:29:21 | FromDiscord | <eszetera> im ass |
04:29:42 | FromDiscord | <eszetera> boobiebob |
04:33:06 | FromDiscord | <eszetera> In reply to @eszetera "i want to make": im such a good programmer https://media.discordapp.net/attachments/371759389889003532/1183265111788486688/image.png?ex=6587b482&is=65753f82&hm=aa266c123b198ab2f86bfb0ffcbd49391ff9f79dc7ce98a17321b3dea8f86903& |
04:33:17 | FromDiscord | <eszetera> no1 problem solver |
04:33:33 | FromDiscord | <eszetera> i typed it in myself |
04:45:34 | * | sagax quit (Remote host closed the connection) |
05:16:32 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
05:18:52 | * | pbsds joined #nim |
05:22:45 | * | azimut quit (Remote host closed the connection) |
05:25:58 | * | azimut joined #nim |
05:27:52 | * | azimut quit (Remote host closed the connection) |
05:28:11 | * | azimut joined #nim |
06:12:35 | FromDiscord | <Phil> In reply to @.bobbbob "ban this idiot": > Be respectful towards other people. No harassing or personally attacking others.↵Just because I'm asleep doesn't mean this rule doesn't exist, I'd like to point it out.↵↵They repeated past attempts on malware notwithstanding, they've been behaving "fine" - When they didn't back in the day by overdoing it with image/meme posting they received a warning as appropriate. |
06:12:54 | FromDiscord | <Phil> (edit) "out.↵↵They" => "out.↵↵Their" |
06:13:11 | FromDiscord | <Phil> (edit) ""fine"" => "fine" |
07:06:53 | * | sagax joined #nim |
09:00:45 | * | def- quit (Quit: -) |
09:01:28 | * | def- joined #nim |
09:03:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:04:16 | FromDiscord | <Phil> (edit) |
09:12:05 | * | sagax quit (Excess Flood) |
09:14:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:24:06 | * | jmdaemon quit (Ping timeout: 260 seconds) |
09:30:23 | FromDiscord | <Phil> Hmm how do I get the pointer of a proc? I kinda want to accept a proc with a type for type-checks and then reduce it down to a pointer within the proc |
09:32:39 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:33:29 | FromDiscord | <Phil> I can't cast to pointer either and using `p.addr` shows me different values for y and pt |
09:42:02 | NimEventer | New thread by Kind-Distribution376: Nim raw syscalls , see https://forum.nim-lang.org/t/10752 |
09:51:49 | FromDiscord | <Elegantbeef> @Phil `cast[pointer](myProc)` |
09:52:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:53:10 | FromDiscord | <Phil> I want to perform the casting inside of x so I get type-checking when using x |
09:53:51 | FromDiscord | <Phil> I'm arranging myself currently with storing `ptr proc` in the pointer of CommunicationHub for routes |
09:55:13 | FromDiscord | <Elegantbeef> `proc(){.nimcall.}` |
09:55:30 | FromDiscord | <Elegantbeef> You do not need `ptr proc` |
09:55:37 | FromDiscord | <Elegantbeef> You just need `proc` procs are pointers |
09:55:54 | FromDiscord | <Elegantbeef> First class procedures and all |
09:55:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:56:16 | FromDiscord | <Elegantbeef> Cause you can have a `ptr proc` but it's redundant |
09:56:18 | FromDiscord | <Phil> note how I can't remove the ptr from the cast statement as I'll get compiler errors if I do |
09:56:31 | FromDiscord | <Elegantbeef> `proc(msg: T, c: ...){.nimcall.}` |
09:56:38 | FromDiscord | <Elegantbeef> You have to state it's a nimcall |
09:56:59 | FromDiscord | <Elegantbeef> Casting to a closure is a silly prospect and the compiler protects you from it |
09:57:58 | FromDiscord | <Elegantbeef> Remember that inside type annotations the default calling convention is `closure` |
09:57:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:58:13 | FromDiscord | <Phil> Check |
09:58:22 | FromDiscord | <Elegantbeef> You only need the annotation on the parameter type 😄 |
09:58:30 | FromDiscord | <Phil> Yeah, just tried it out and can confirm that one |
09:59:55 | FromDiscord | <Phil> Hmmm using the addr approach may be nicer though if the user wants to write handler procs that are closures |
10:00:16 | FromDiscord | <Phil> If I can support both nimcall and closure it feels better to support both |
10:00:30 | FromDiscord | <Elegantbeef> Closure has GC'd memory |
10:00:57 | FromDiscord | <Phil> Ah so that may be inviting use after frees? |
10:01:22 | FromDiscord | <Phil> or nil access more likely |
10:01:27 | FromDiscord | <Elegantbeef> Well moreso it means you are subscribing data across threads that you do not own |
10:02:19 | FromDiscord | <Phil> I'm mostly just thinking in terms of global resources that you may have, like e.g. a connection pool to a DB |
10:02:22 | FromDiscord | <Elegantbeef> Plus you cannot have top level closure procs so I do not even get how the handler would look |
10:02:29 | FromDiscord | <Elegantbeef> Right but globals do not require closures |
10:02:31 | FromDiscord | <Elegantbeef> They're global |
10:08:39 | FromDiscord | <Phil> Ahhhh shit, yeah running into issues at the readMessage step now, because typeInfo kinda is runtime info, casting channel pointers to their accurate representation back is difficult |
10:09:46 | FromDiscord | <Elegantbeef> Yea I was uncertain the design require for usage |
10:10:19 | FromDiscord | <Phil> one sec, writing it out more fuly |
10:10:19 | FromDiscord | <Elegantbeef> If you spool up a thread per route it's easy as hell as it's just `recv` 😄 |
10:10:20 | FromDiscord | <Phil> (edit) "fuly" => "fully" |
10:11:09 | FromDiscord | <Elegantbeef> Otherwise it's not so easy and this was a fools errand I guess as you are facing type erasure hell |
10:11:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
10:12:45 | FromDiscord | <Phil> But yeah, you can't know what the messages is based on all the pointers everywhere |
10:12:51 | FromDiscord | <Phil> So Object variant it remains? |
10:13:04 | FromDiscord | <Elegantbeef> Well you can if you create a thread per route 😛 |
10:13:41 | FromDiscord | <Phil> Not an option, that would possibly lead to 100+ threads and the amount of chatter between them is overhead-hell |
10:14:00 | FromDiscord | <Elegantbeef> So what 100+ threads waiting on `recv` is fine! 😛 |
10:14:24 | FromDiscord | <Phil> The mental model for it isn't though 😛 |
10:14:33 | FromDiscord | <Elegantbeef> What's so complex? |
10:14:41 | FromDiscord | <Elegantbeef> You make a route it gets dealt with you get a response |
10:15:20 | FromDiscord | <Phil> I keep coming back to that example because its so good:↵One thread may be running a chess-engine, and only that thread.↵That chess-engine can provide N different outputs that should be reflected and handled each in different ways. |
10:15:54 | FromDiscord | <Phil> Hmm but that the user could actually handle by creating their own object variant |
10:17:17 | FromDiscord | <Phil> Still not a fan |
10:18:21 | FromDiscord | <Phil> Because suddenly everything is a separate thread, that means you can't have a group of functionality sharing some state together because they're not on the same thread, it must be passed back and forth every time |
10:18:38 | FromDiscord | <Elegantbeef> You can pass pointers 😄 |
10:18:49 | FromDiscord | <Elegantbeef> But anyway I'm still uncertain what you're actively solving |
10:18:58 | FromDiscord | <Elegantbeef> Using web routes for threading is interesting |
10:19:50 | FromDiscord | <Phil> Overall just client-server architecture for a gui thread communicating with a backend-thread and I'd like to be able to group similarly, so group routes together on a thread like a "monolith" or split them up into lots of tiny threads as if they were microservices |
10:20:05 | FromDiscord | <Phil> (edit) "Overall just client-server architecture for a gui thread communicating with a backend-thread and I'd like to be able to group similarly, so group routes together on a ... threadhaving" added "single" | "singlethread ... like" added "having all the functionality" |
10:20:59 | FromDiscord | <Phil> (edit) "similarly," => "functionality similarly to webdev," |
10:22:16 | FromDiscord | <Phil> And I'm trying to do it in a way that provides the user with simply a way to define a "threadName" and all routes are now associated with that threadname as well as a channel to pass messages to it which automatically get routed to the associated route. |
10:23:57 | FromDiscord | <Phil> Okay so back to the ObjectVariant approach with a bit fresher of a mind than yesterday evening |
11:09:13 | FromDiscord | <rakgew> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:14:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
11:15:31 | FromDiscord | <Phil> Though you can make that `typed`, which is generally better ans it grants you more access later generally |
11:15:48 | FromDiscord | <Phil> (edit) "`typed`," => "a `typed` input parameter," |
11:16:10 | FromDiscord | <arathanis> maybe try genasts? |
11:16:16 | FromDiscord | <arathanis> (edit) "genasts?" => "`std/genasts`?" |
11:16:51 | FromDiscord | <Phil> I'm somewhat surprised how rarely for myself genast and so on are useful. I tend to do a lot of partial generating things I guess |
12:19:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:23:53 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
12:28:25 | FromDiscord | <rakgew> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:33:17 | FromDiscord | <Phil> In reply to @rakgew "<@180601887916163073> thank you": This can be made to work, but seeing as you're using "let", you seem to want to be able to define that string at runtime right? |
12:37:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:38:28 | FromDiscord | <rakgew> maybe I should rather build it with ast nodes. |
12:39:31 | FromDiscord | <Phil> If you want to call different procs based on a string you receive at runtime then you'll have to define a simple switch-case statement, there's no "easy" way to turn a string into a proc-call at runtime.↵Though you can of course define a table of procs that all have the same general type if that's possible. |
12:39:58 | FromDiscord | <Phil> (edit) "If you want to call different procs based on a string you receive at runtime then you'll have to define a simple switch-case statement, there's no "easy" way to turn a string into a proc-call at runtime.↵Though you can of course define a table of procs that all have the same general type ... ifthe" added "-" | "that's possible." => "the different procs you want to call have the same type." |
12:40:06 | FromDiscord | <rakgew> the procnames are know when compiling, but the user provides a string, and if that is in my string array of proc names I would like to call it. |
12:40:28 | FromDiscord | <Phil> In that case you'll want to generate yourself essentially a routing proc with a massive switch-case statement |
12:40:38 | FromDiscord | <rakgew> ah ok - I was wondering wheter I should go that route - will try that. |
12:41:11 | FromDiscord | <rakgew> thank you so much! \:-D |
12:42:19 | FromDiscord | <rakgew> yeah, the table I tried before (which gave me the cast(gcfase) headaches) - so I think I will try the if else or switch case way.. |
12:43:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:43:23 | FromDiscord | <rakgew> as in future I might want to expand it to procs with arguments, and then the tble would not work again, due to different proc call signature, I assume. |
12:44:05 | FromDiscord | <rakgew> ok - will try. \:-D |
12:46:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:47:24 | FromDiscord | <rakgew> exactly - their arg counts are not matching unfortunately. |
12:47:56 | FromDiscord | <Phil> Then the pointer approach is absolutely not in there.↵Even the "generate a switch case" statement approach doesn't look too good.↵Honestly you might be better off writing that routing proc by hand |
12:48:36 | FromDiscord | <Phil> Because it appears to not be possible to infer anything about the type of the proc that needs to be called based on the string |
12:48:39 | FromDiscord | <rakgew> well I though one macro per proc call signature.. |
12:49:10 | FromDiscord | <Phil> I don't think I understand |
12:49:15 | FromDiscord | <rakgew> one for no args, one for one arg, one for two args.. |
12:49:37 | FromDiscord | <Phil> I would honestly not recommend going down that route, that sounds like non-debuggable |
12:49:54 | FromDiscord | <rakgew> I get the whole ast of these procs beforehand |
12:50:19 | FromDiscord | <Phil> hmmmm |
12:50:35 | FromDiscord | <rakgew> I do an inspected import in a macro to collect all procs with repl pragma. so I can collect any other info there as well |
12:51:00 | FromDiscord | <rakgew> these repl prama progs are the ones the user can call. |
12:51:02 | FromDiscord | <Phil> My cold addled brain is drawing blanks in trying to visualize your problem and given I'm already burning through a ton of what's left to just deal with channel code generation I'm tapped out ^^ |
12:51:34 | FromDiscord | <rakgew> no worries - you helped a lot. thank you! |
12:51:47 | FromDiscord | <rakgew> once I get it working and cleaned up I will open-source it |
12:52:04 | FromDiscord | <Phil> Looking forward to it 😄 |
12:52:23 | FromDiscord | <rakgew> will send you the link when it is ready. \:-D |
12:56:18 | FromDiscord | <rakgew> it is a cli app that checks if there are new videos on yt (or rather on the invidious instances, as a few of them have open apis) playlists or channels. if there are new ones, one can view them in mpv with a simple command. the infos are stored into sqlite. apart from that it accepts any other yt-link and sends that straight to mpv. |
12:57:39 | FromDiscord | <rakgew> it is kind of the counterpart to nimcoon\: there the focus is on searching new things, my cli app is about checking on updates of known lists. |
13:38:28 | NimEventer | New thread by hackermanmaj0: Package-Rot as growth hindrance, see https://forum.nim-lang.org/t/10753 |
13:47:36 | FromDiscord | <alireza0x0> is it ok to isolate a ref and pass it through channels? so the thread that receives it will be its owner right? or bad things can happen? |
13:48:46 | FromDiscord | <alireza0x0> the rfc example for isolation was a jsonNode which was a ref so that can work right? i wonder what happens if the isolation happens after object creation... |
14:12:34 | FromDiscord | <ieltan> In reply to @alireza0x0 "is it ok to": If my Nim-fu doesn't fail me, `Isolation[T]` was made for the purpose of expressing unique ownership in Nim, it should allows you to safely send data through channels |
14:12:42 | FromDiscord | <ieltan> (edit) "`Isolation[T]`" => "`Isolated[T]`" |
14:13:46 | FromDiscord | <ieltan> The RFC is clear enough imo to grasp the utility and how you should apply it but I heard that in practice the analysis is way too strict for it to be useful so ymmv |
14:14:15 | FromDiscord | <alireza0x0> hmm okay |
14:14:21 | FromDiscord | <alireza0x0> btw , one dum question |
14:14:26 | FromDiscord | <alireza0x0> how this code actually works and prints hi? |
14:14:33 | FromDiscord | <alireza0x0> https://media.discordapp.net/attachments/371759389889003532/1183411434558849164/image.png?ex=65883cc8&is=6575c7c8&hm=2681914d3ec5a45920c4b9513c68166633d50eb7e904085f4b381aae20a7c220& |
14:14:46 | FromDiscord | <ieltan> In reply to @alireza0x0 "the rfc example for": What happens is that you should use `isolate()` and pray the compiler is happy |
14:15:02 | FromDiscord | <alireza0x0> i did acquire lock 2 times so it should not pass the seccond one ... |
14:15:08 | FromDiscord | <alireza0x0> (edit) "seccond" => "second" |
14:17:55 | FromDiscord | <ieltan> In reply to @alireza0x0 "": I dunno, my uneducated guess is that maybe `aquire`ing a lock twice in the same thread is idempotent, in real life this isn't how you would use locks and typically you have multiple threads |
14:18:30 | FromDiscord | <alireza0x0> yea but i want to test a dead lock in nim... |
14:22:22 | FromDiscord | <ieltan> In reply to @alireza0x0 "yea but i want": You'll need to spawn at least two threads or more in order to get what you want tho |
14:30:22 | FromDiscord | <alireza0x0> In reply to @ieltan "You'll need to spawn": something like this? this still not blocking the main thread...🤔 https://media.discordapp.net/attachments/371759389889003532/1183415414252896277/image.png?ex=6588407d&is=6575cb7d&hm=9342edeb9d371d9b858b682a5dc492215468a74dddced2f07049378e762a100b& |
14:31:42 | FromDiscord | <alireza0x0> so maybe acquire remembers the thread that acquired it and do nothing if its already used by the same thread...? |
14:32:51 | FromDiscord | <alireza0x0> yes, that should be it, and this code now blocks https://media.discordapp.net/attachments/371759389889003532/1183416039296483418/image.png?ex=65884112&is=6575cc12&hm=1be1670af8475b2f8a9f42f3099bb900c16d7599f9be17514c14b4859b1635bc& |
14:34:16 | FromDiscord | <ieltan> Are you doing this for educational purposes perhaps? |
14:34:37 | FromDiscord | <alireza0x0> im going to build a full networking multi threaded app with nim |
14:34:58 | FromDiscord | <alireza0x0> and its bin 3 days im searching all froums, rfcs, books, etc and dont know yet how can i pass a seq[byte] to threads safely |
14:35:07 | FromDiscord | <alireza0x0> but i will do it one day, and ill be happy 🙂 |
14:35:34 | FromDiscord | <alireza0x0> (edit) "bin 3" => "been3" |
14:35:55 | FromDiscord | <ieltan> I wish you good luck on your endeavor 🙂 |
14:46:46 | FromDiscord | <Phil> Huh, I myself am just passing messages between 2 threads back and forth with a client-server model, I wonder if that could be expanded down the line to work across network since you'd still just be passing messages |
14:47:04 | * | mahlon quit (Ping timeout: 268 seconds) |
14:47:32 | FromDiscord | <alireza0x0> can you share your source code ? that can help ofcourse |
14:48:26 | FromDiscord | <alireza0x0> yea, the idea is just about passing some bytes from thread x to y but the point is doing such things with no copies |
14:48:29 | FromDiscord | <Phil> I can, it's already out there (Appster), but a lot of it is code-generation |
14:49:29 | FromDiscord | <Phil> Because I don't care too much about bytes, I care about allowing you specific types.↵So I let you register procs(might swap that to types) and set up 2 threads with 2 channels between them (one Client => Server, the other Client <= Server), each channel with its own variant. |
14:49:49 | FromDiscord | <Phil> (edit) "variant." => "variant that I generate based upon the procs you register and the types you register them with" |
14:50:02 | * | mahlon joined #nim |
14:50:08 | FromDiscord | <Phil> (edit) "types" => "message parameter type" |
14:51:08 | FromDiscord | <alireza0x0> looks good for me to start reading it |
14:51:15 | FromDiscord | <alireza0x0> btw i did not find exact repo `Appster` |
14:51:19 | FromDiscord | <alireza0x0> is it on github ? |
14:51:28 | FromDiscord | <Phil> https://github.com/PhilippMDoerner/Appster |
14:52:03 | FromDiscord | <Phil> It has example that you can look at, though the owlkettle one may need you to pass some flags etc. |
14:52:10 | FromDiscord | <Phil> (edit) "It has ... example" added "2" |
14:52:14 | FromDiscord | <Phil> (edit) "example" => "examples" |
14:52:28 | FromDiscord | <alireza0x0> alright |
14:52:29 | FromDiscord | <alireza0x0> Thanks 🙏 |
14:52:40 | FromDiscord | <Phil> And all of it is under construction, so nothing's finished 😅 |
14:52:54 | FromDiscord | <Phil> Or rather it functions for now but needs tons of cleanup before I'd even consider writing docs |
15:22:36 | FromDiscord | <river_raid> Hello! I am trying to get started with Nim, and ran this command to install LSP:↵▶ nimble install nimlangserver |
15:22:51 | FromDiscord | <river_raid> After many downloads, it fails with: |
15:22:55 | FromDiscord | <river_raid> sent a code paste, see https://play.nim-lang.org/#ix=html> |
15:23:16 | FromDiscord | <river_raid> Is the nimlangserver package lock file wrong? |
15:43:18 | NimEventer | New question by Ramon Mateas: Bypassing sql protection, see https://stackoverflow.com/questions/77635379/bypassing-sql-protection |
15:45:02 | FromDiscord | <Phil> Hm I wonder how you alias a macro, I kinda want to offer the same functionality under multiple names |
15:45:43 | * | azimut quit (Ping timeout: 240 seconds) |
16:03:49 | FromDiscord | <rakgew> @Phil \: wohoo \\o/ - I got my macro madness working \:↵during macro inspect import, where I collect the repl pragma procs, I also create a static array with these proc names and a dispatch proc with a case statement for each of these calling a proc with same name. both are injected into the repl module. then in the repl loop, I check if the user entered something that is in the array and if so call the dispatch proc \:-D↵thanks for |
16:04:12 | FromDiscord | <Phil> happy to have helped! |
16:19:07 | * | azimut joined #nim |
16:41:28 | * | xet7 quit (Quit: Leaving) |
17:56:29 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
17:56:44 | FromDiscord | <Phil> (edit) |
17:57:03 | FromDiscord | <Phil> (edit) |
17:59:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
18:00:02 | FromDiscord | <Phil> I'm really not sure if I can make this any less complicated but I feel like given the complexity of the problem this is... alright? |
18:01:23 | FromDiscord | <Phil> I'll happily take name suggestions for the various macro/proc names I mentioned with a `` btw., I'm not too happy with any of them |
18:56:28 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
19:18:31 | * | lucasta joined #nim |
19:36:02 | NimEventer | New thread by arnetheduck: Hello `nph`, an opinionated source code formatter for Nim, see https://forum.nim-lang.org/t/10754 |
19:37:48 | * | derpydoo joined #nim |
19:46:19 | FromDiscord | <Phil> @arnetheduck Just a quick shoutout and thank you again for yet another contribution that shows a path forward for a pretty key "visible" problem of the language in regards to tooling! |
20:01:25 | FromDiscord | <JJ> @arnetheduck cool project, having trouble building: where are the imports `ast, parser, idents` coming from? |
20:03:08 | FromDiscord | <Phil> Hah, same issue I ran into, currently I assume that the modules just got renamed to "phase" etc. because the "ph" prefix is pretty consistent in the modules |
20:03:29 | FromDiscord | <Phil> (edit) ""phase"" => ""phast"" |
20:04:30 | FromDiscord | <Phil> Though never mind, some imports straight up don't have equivalents, like there is no idents module equivalent |
20:08:53 | FromDiscord | <intellij_gamer> Think it's meant to have "$nim/compiler" prefix so it imports from the compiler (idents is in the compiler) |
20:17:04 | * | krux02 joined #nim |
20:17:37 | FromDiscord | <JJ> still can't get it to build, i get type mismatches left and right 🙁 |
20:17:44 | FromDiscord | <JJ> no idea where it's pulling newStringOfCap from |
20:17:56 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/eDykD |
20:33:30 | NimEventer | New thread by ASVI: Is normal that nim ast stmt changes its ast structure in the compiler ?, see https://forum.nim-lang.org/t/10755 |
20:38:52 | FromDiscord | <intellij_gamer> Running `nimble setup -l` first makes it all compile fine |
20:40:40 | FromDiscord | <JJ> not for me :-( |
20:40:55 | FromDiscord | <guttural666> how do I get the maximum possible value of an int? chatGPT says maxInt, but that seems deprecated |
20:41:05 | FromDiscord | <intellij_gamer> Oh rip↵Still complaining about newStringOfCap? |
20:41:13 | FromDiscord | <intellij_gamer> In reply to @guttural666 "how do I get": `int.high` should do it |
20:41:43 | FromDiscord | <JJ> In reply to @intellij_gamer "Oh rip Still complaining": well, i was prepending one-of `ph` or `compiler/` to i |
20:42:01 | FromDiscord | <JJ> (edit) "i" => "imports to get anything beginning to compile, and gave up on that" |
20:42:09 | FromDiscord | <intellij_gamer> Ah, I'd just reset those changes since it worked without them for me |
20:42:37 | FromDiscord | <JJ> hmm i did `nimble setup -l && nimble build` before making any changes |
20:42:53 | FromDiscord | <intellij_gamer> Hmm strange 🤔 |
20:42:57 | FromDiscord | <JJ> (edit) "hmm i did `nimble ... setup" added "-l" | removed "-l" |
20:46:11 | * | derpydoo quit (Ping timeout: 245 seconds) |
20:46:34 | NimEventer | New thread by EnteryName: How does 'nim secret' actually work?, see https://forum.nim-lang.org/t/10756 |
21:28:21 | FromDiscord | <Elegantbeef> `sink` implicitly means "move memory when you can" |
21:28:23 | FromDiscord | <Elegantbeef> `sink Isolated` means memory is moved and `Isolated` means that memory has to be a self contained graph↵(@Phil) |
21:29:50 | FromDiscord | <Phil> In that case my next task is likely going to be to provide an option to use threading channels instead of normal ones, as well as cleanup, doccomments, README.md and all that good stuff, maybe a more complex example while I'm at it |
21:46:06 | * | vsantana joined #nim |
21:48:54 | FromDiscord | <_goel_> What is the difference between regex libraries in std? `std/re` and `std/nre`?↵I had a quick look but i don't understand the difference |
21:49:14 | FromDiscord | <Elegantbeef> `nre` is "new" |
21:49:27 | FromDiscord | <Elegantbeef> Neither are pure and both rely on pcre |
21:52:16 | FromDiscord | <_goel_> So a "new" one was added instead of drastically changing the other original "re" if i get it right, but basically they do the same stuff↵I'm asking this because i had old links all referring to `std/re`, but few minutes ago looking at some fresh code made with 2.0 i've see someone importing `std/nre` and i was like: What is that?↵Thanks for clarify Beef 👍 |
21:52:21 | * | xet7 joined #nim |
21:52:53 | FromDiscord | <Elegantbeef> `import pkg/regex` |
21:52:55 | FromDiscord | <Elegantbeef> Be merry |
21:54:20 | * | vsantana quit (Quit: Client closed) |
21:58:03 | FromDiscord | <zectbumo> I want to see if Nim 2 got my change request in |
22:01:33 | FromDiscord | <zectbumo> https://forum.nim-lang.org/t/9132↵it would be nice to see a green checkmark for things that got in and a red X for things that didn't in this list |
22:03:57 | * | lucasta quit (Read error: Connection reset by peer) |
22:19:57 | * | lucasta joined #nim |
22:28:09 | FromDiscord | <JJ> i've been keeping https://gist.github.com/omentic/08cd36b7475d461d6291416381ce98ad somewhat updated. if there's anything that's been rejected/accepted/implemented that i've missed (likely), lmk and i'll update it |
22:28:13 | FromDiscord | <JJ> or anything it's missing |
22:41:19 | FromDiscord | <zectbumo> ❌ single quote strings↵❌ proc argument types default to :auto↵❌ var a, b = myProc() is a single call↵looks like I'm 0/3 |
22:42:06 | FromDiscord | <Elegantbeef> The first makes very little sense |
22:42:38 | FromDiscord | <michaelb.eth> how would you distinguish char from string? |
22:42:48 | FromDiscord | <zectbumo> I mean, python does it. so it makes some sense |
22:43:34 | FromDiscord | <zectbumo> In reply to @michaelb.eth "how would you distinguish": I was proposing that single character strings using single quotes remain char type |
22:44:35 | FromDiscord | <Elegantbeef> but then there are escape characters so then it's not just "single characters" |
22:45:02 | FromDiscord | <zectbumo> escapes are fine, as long as they result to char size |
22:45:34 | FromDiscord | <michaelb.eth> also seems like it would be difficult to sort out at compile/run time and it would be a tad ambiguous whether a const/let/var is char or string |
22:46:17 | FromDiscord | <Elegantbeef> It's even worse for macros |
22:46:39 | FromDiscord | <Elegantbeef> `nnkSingleQuote` could be a char it could be a string, you'd need to introspect the value to see what it is |
22:46:43 | FromDiscord | <zectbumo> really? is it not simple that 'hello' looks like a string and '\r' looks like a char? |
22:46:53 | FromDiscord | <Elegantbeef> It's simple |
22:47:17 | FromDiscord | <Elegantbeef> There is just no benefit to have single quote strings when you can use `""` for strings and `''` for chars and have 0 ambiguity |
22:48:15 | FromDiscord | <zectbumo> it would be nice not having to hold shift all the time for strings and not have to escape things like '<html class="myClass">' |
22:48:56 | FromDiscord | <arathanis> Also the convention for `''` is a char and `""` is a string was set over 5 decades ago. |
22:49:18 | FromDiscord | <zectbumo> but, I'm cool with the 0 ambiguity. I can move on. The macro argument can put this one to rest. |
22:50:22 | FromDiscord | <that_dude.> In reply to @zectbumo "❌ single quote strings": What's the issue with: 'var (a, b) = myProc()`? |
22:50:25 | FromDiscord | <that_dude.> (edit) "myProc()`?" => "myProc()'?" |
22:50:30 | FromDiscord | <that_dude.> (edit) "'var" => "`var" | "myProc()'?" => "myProc()`?" |
22:50:36 | FromDiscord | <Phil> It does double call without the brackets |
22:50:49 | FromDiscord | <Phil> Which is unexpected behaviour when you naively look at it |
22:51:20 | FromDiscord | <that_dude.> ah. I kinda thought it was supposed to splat like python does for some things |
22:51:37 | FromDiscord | <Elegantbeef> Tuple unpacking happens in `var (a, b)` |
22:51:52 | FromDiscord | <Elegantbeef> it is ambiguous whether one would want a single or double call in `var a, b = ...` |
22:51:58 | FromDiscord | <that_dude.> I thought that's what he was asking for |
22:52:00 | FromDiscord | <Elegantbeef> so in reality you could make a lint for it in 10 seconds 😄 |
22:52:00 | FromDiscord | <that_dude.> mb |
22:53:21 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/HOL1m |
22:53:58 | FromDiscord | <arathanis> (edit) "https://paste.rs/zvJDK" => "https://paste.rs/FN0eN" |
22:53:58 | FromDiscord | <Phil> Basically a cha is a primitive like int, a String is a whole-ass object |
22:54:00 | FromDiscord | <zectbumo> yes, it is not exactly like python. I wouldn't want that anyway |
22:54:32 | FromDiscord | <zectbumo> (edit) "anyway" => "anyway, because I want to get to the primitive char." |
22:55:55 | FromDiscord | <zectbumo> sent a long message, see https://paste.rs/yz02A |
22:56:13 | FromDiscord | <zectbumo> (no cheating) |
22:56:28 | FromDiscord | <arathanis> x |
22:56:29 | FromDiscord | <Phil> The output of this is me not letting you get that PR merged through the code-review because it is bad style |
22:56:32 | FromDiscord | <arathanis> is... |
22:56:39 | FromDiscord | <arathanis> thats a weird one i have no idea |
22:56:51 | FromDiscord | <zectbumo> @Phil will you style it for me, plz? |
22:57:09 | FromDiscord | <Elegantbeef> 2, 0, 0 |
22:57:22 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/Vo4YM |
22:57:23 | FromDiscord | <Elegantbeef> Do i win? |
22:57:24 | FromDiscord | <zectbumo> Elegantbeef, you are a bot so you don't count |
22:57:37 | FromDiscord | <Phil> No as in literally this is one of the few pieces of nim-syntax I do not agree with.↵This should not be valid syntax in the first place. You want to assign something twice you call it explicitly twice |
22:57:49 | FromDiscord | <arathanis> ohhhh i get it now. X incs to 2, inc returns nothing so incX returns 0. Why does the double assignment work? |
22:57:55 | FromDiscord | <Elegantbeef> Just write a linter kids |
22:57:55 | FromDiscord | <Phil> (edit) "twice" => "twice, that nim allows this is meh in my book" |
22:58:04 | FromDiscord | <arathanis> I would think it the compiler would yell at you |
22:58:32 | FromDiscord | <Elegantbeef> It should complain that you have a procedure that does not set the return value but alas |
22:59:54 | FromDiscord | <that_dude.> I'm not seeing the issue with that though. Inc doesn't return anything so the default is 0? |
23:00:15 | FromDiscord | <that_dude.> but I see what you mean with the extra calls |
23:00:49 | FromDiscord | <zectbumo> maybe in 3.0? |
23:01:10 | FromDiscord | <arathanis> In reply to @michaelb.eth "what is the primitive": nerdrage |
23:01:11 | FromDiscord | <michaelb.eth> sent a code paste, see https://paste.rs/SKZ1k |
23:01:20 | FromDiscord | <arathanis> thats a primitive, right? |
23:01:36 | FromDiscord | <arathanis> if I saw that in a PR I would reject it so fast |
23:01:45 | FromDiscord | <ElegantBeef> Dammit matrix bridge! https://media.discordapp.net/attachments/371759389889003532/1183544110490063058/image.png?ex=6588b859&is=65764359&hm=90ad557fa530ac73146de96c70453166b515a2ef59c2ccb47caccdfee1088691& |
23:01:57 | FromDiscord | <zectbumo> In reply to @michaelb.eth "what is the primitive": you used a double string so it wouldn't fall into my proposal |
23:02:03 | FromDiscord | <Elegantbeef> The issue is they expect it to be a single call |
23:02:05 | FromDiscord | <Elegantbeef> they want it to be expanded into `var (x, y) = (let val = incX; (x, x))` |
23:02:06 | FromDiscord | <Elegantbeef> instead of `var (x, y) = (incX(), incX())` |
23:02:08 | FromDiscord | <Elegantbeef> whoops in the tuple it should be `(val, val)` not `(x, x)` |
23:02:10 | FromDiscord | <Elegantbeef> Pardon phil |
23:02:15 | FromDiscord | <zectbumo> (edit) "In reply to @michaelb.eth "what is the primitive": you used a double ... string" added "quote" |
23:03:36 | FromDiscord | <Phil> In reply to @Elegantbeef "they want it to": Either that or outright don't compile there, both are imo sensible options.↵Calling per assignable on the left-hand-side is just unexpected imo |
23:03:51 | FromDiscord | <michaelb.eth> In reply to @zectbumo "you used a double": right, just another way I thought to point out that Nim string type is fundamentally multi-byte while char type is single-byte |
23:04:57 | FromDiscord | <zectbumo> In reply to @michaelb.eth "right, just another way": I think you meant to write↵`let s = ':nerd:'` |
23:05:11 | FromDiscord | <arathanis> In reply to @michaelb.eth "right, just another way": pretty sure the underlying type is still `char`. |
23:05:13 | FromDiscord | <Phil> Nah, he explicitly wanted to point out that nim strings are UTF |
23:05:16 | FromDiscord | <Phil> while char aren't |
23:05:28 | FromDiscord | <Phil> (edit) "while char aren't ... " added "(Afaik at least)" |
23:05:34 | FromDiscord | <zectbumo> (edit) "write↵`let" => "write↵let" | "':nerd:'`" => "'🤓'" |
23:05:39 | FromDiscord | <arathanis> We are playing with encodings now. |
23:05:46 | FromDiscord | <arathanis> No one has every ripped their hair out over encodings 😎 |
23:06:02 | FromDiscord | <Phil> And by that you mean you're safe because you went bald or sth? |
23:06:17 | FromDiscord | <arathanis> nope |
23:06:18 | FromDiscord | <arathanis> at least not yet |
23:06:19 | FromDiscord | <ElegantBeef> Hey ascii is a subset of utf8 😄 |
23:06:26 | FromDiscord | <arathanis> but judging by my father? its gonna happen sooner or later |
23:06:34 | FromDiscord | <arathanis> ¯\_(ツ)_/¯ |
23:06:53 | FromDiscord | <michaelb.eth> In reply to @arathanis "We are playing with": sort of, but to that Nim string is multi-byte and Nim char is single-byte is independent of encoding |
23:07:06 | FromDiscord | <michaelb.eth> (edit) "In reply to @arathanis "We are playing with": sort of, but to ... that" added "say" |
23:07:16 | FromDiscord | <ElegantBeef> Finally the all parameters are implicitly `auto` is a masochistic adventure of compiler errors and instantiation errors |
23:07:39 | FromDiscord | <ElegantBeef> Everything being ducktyped sounds good until you're 3 generics inside of a instantiation error wondering why you need to implement `doThing` for a pretty printer |
23:07:53 | FromDiscord | <arathanis> `auto` is evil |
23:08:05 | FromDiscord | <ElegantBeef> It's not evil if used approriately |
23:08:11 | FromDiscord | <ElegantBeef> It's not different to `proc[T](a: T)` |
23:08:28 | FromDiscord | <arathanis> ive seen too much horror |
23:08:33 | FromDiscord | <Phil> I would like to support this.↵And I would like to point out that I'm the guy that wrote code that fully generates entire API endpoints going like 7+ layers of generics deep |
23:08:35 | FromDiscord | <arathanis> that is fine I like generics |
23:08:35 | FromDiscord | <ElegantBeef> Just use concepts |
23:08:47 | FromDiscord | <ElegantBeef> In reply to @isofruit "I would like to": Support all parameters being generic? |
23:09:16 | FromDiscord | <Phil> No, that it's really not fun when you go multiple layers deep into generics and suddenly have no clue why the types don't line up |
23:09:19 | FromDiscord | <ElegantBeef> Ah |
23:09:24 | FromDiscord | <ElegantBeef> I wonder if you can use `using` with generics |
23:10:16 | FromDiscord | <ElegantBeef> You can |
23:10:22 | FromDiscord | <ElegantBeef> You're welcome for hell |
23:10:30 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/8byj2 |
23:10:44 | FromDiscord | <michaelb.eth> In reply to @zectbumo "I think you meant": that would be 4 bytes of info packed between the `''` whereas `')'` is just one byte of info |
23:11:00 | FromDiscord | <Phil> Beef, why can't you use your powers only for good instead of a mixture of both? |
23:11:18 | FromDiscord | <ElegantBeef> Hey I'm presently stealing flamegraph's SVG logic |
23:11:29 | FromDiscord | <ElegantBeef> Hooking it into Nim's built in profiling logic |
23:11:33 | FromDiscord | <ElegantBeef> To build the worlds worst profiler |
23:11:42 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1183546614594420736/image.png?ex=6588baae&is=657645ae&hm=002ecd1d4362ece4116543ecfdb682512659e4ed18dac372930146548aae05c3& |
23:11:44 | FromDiscord | <ElegantBeef> It almost works |
23:12:22 | FromDiscord | <ElegantBeef> Yes I just wanted a Nim package to generate flamegraphs and remembered Nim's got a build in profiler api |
23:13:46 | FromDiscord | <zectbumo> In reply to @elegantbeef "Just use concepts": I never did get to learn concepts. I got too lost in templates and macros |
23:14:01 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/x3zzX |
23:14:13 | FromDiscord | <ElegantBeef> Well they're wonderful and better than the rodeo of undescribed duck typing |
23:14:31 | FromDiscord | <ElegantBeef> Though @JJ whines and moans that they should be called interfaces |
23:14:55 | FromDiscord | <arathanis> everytime Beef brings up concepts and how cool they are I feel compiled to have him repeat his short blurb about _what_ they are good for |
23:15:15 | FromDiscord | <ElegantBeef> You feel compiled? |
23:15:25 | FromDiscord | <arathanis> In reply to @elegantbeef "You feel compiled?": sometimes |
23:15:25 | FromDiscord | <michaelb.eth> he’s got a nice web page about that |
23:15:31 | FromDiscord | <ElegantBeef> Do I really?! |
23:15:36 | FromDiscord | <arathanis> (edit) "compiled" => "~~compiled~~compelled" |
23:15:39 | FromDiscord | <michaelb.eth> your concepts page |
23:15:57 | FromDiscord | <arathanis> On paper they can do incredibly complex things, but iirc Beef supports using them for something more specific that isn't overly complex and difficult. |
23:16:08 | FromDiscord | <ElegantBeef> I mean I do not support using them for FP inanity |
23:16:19 | FromDiscord | <zectbumo> In reply to @isofruit "Beef, why can't you": I actually like this about Elegantbeef. Don't change his programming please |
23:16:19 | FromDiscord | <ElegantBeef> Use them to constrain generic types |
23:16:42 | FromDiscord | <ElegantBeef> When you implement a generic interface use a concept to limit that generic interface |
23:17:09 | FromDiscord | <michaelb.eth> this is the page that came to mind: https://www.jasonbeetham.com/writeups/codereuse.html |
23:17:22 | FromDiscord | <ElegantBeef> Doxxed |
23:18:00 | FromDiscord | <zectbumo> Did you guys hear about how 1980s level AI passed the touring test at this time because humans didn't think that "AI" could actually be _that_ dumb? |
23:18:04 | FromDiscord | <michaelb.eth> oh, sorry 😞 but haven’t you shared that here?? |
23:18:15 | FromDiscord | <ElegantBeef> When am I ever sincere? |
23:19:08 | FromDiscord | <michaelb.eth> In reply to @elegantbeef "When am I ever": when discouraging use of regex, I’m pretty sure |
23:19:17 | FromDiscord | <ElegantBeef> Oh right yes I'm deathly sincere then |
23:19:50 | FromDiscord | <ElegantBeef> Regex killed my entire family since someone attempted to validate an email using regex, we never got the appointment.... apparently `me@[192.168.0.1]` is an invalid email |
23:20:53 | FromDiscord | <michaelb.eth> I’m hoping the death-of-family part isn’t sincere 😬 |
23:20:54 | FromDiscord | <zectbumo> invalid ipv6 address |
23:21:46 | FromDiscord | <ElegantBeef> In reply to @michaelb.eth "I’m hoping the death-of-family": The entire thing was not sincere of course, it wasn't regex it was whatever I can pretend to be outraged about at the time! |
23:22:21 | FromDiscord | <zectbumo> I'm outraged at the ipv4 address inside the ipv6 brackets |
23:22:27 | FromDiscord | <ElegantBeef> To put you at rest my entire family is alive... well for now |
23:22:43 | FromDiscord | <zectbumo> so dark |
23:22:47 | FromDiscord | <ElegantBeef> isn't it ia prefix for ipv6? |
23:22:56 | FromDiscord | <ElegantBeef> I do not recall the spec, I was going for a joke not to be 100% accurate |
23:23:13 | FromDiscord | <zectbumo> I was triggered and missed the joke |
23:23:19 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1183549537449680986/image.png?ex=6588bd67&is=65764867&hm=31caedc109c90cdaf1db5904865c4d657ba7898e53504f3ef67a9e1e8385c7eb& |
23:23:27 | FromDiscord | <ElegantBeef> Ipv4 and ipv6 are different with a prefix |
23:23:51 | FromDiscord | <zectbumo> ah okay. I don't know that spec then |
23:24:04 | FromDiscord | <ElegantBeef> You think I'm going to write a valid ipv6 email for a joke, i've never even wrote a valid ipv6 ip for sincerity |
23:25:01 | * | lucasta quit (Remote host closed the connection) |
23:25:04 | FromDiscord | <zectbumo> I tried using ipv6 only server because I thought it was "time". and I was so sad to find out when I rented that AirBnB that they only had ipv4 routers. 😞 |
23:25:10 | FromDiscord | <JJ> In reply to @elegantbeef "Though <@572634810917322773> whines and": yes lol |
23:25:24 | FromDiscord | <ElegantBeef> Get a hobby |
23:25:33 | FromDiscord | <JJ> that is my hobby 😃 |
23:25:38 | FromDiscord | <ElegantBeef> A real hobby |
23:26:05 | FromDiscord | <JJ> like, concepts v2 take a series of function signatures that must be satisfied by a concrete type at compile-time: that's an interface |
23:26:15 | FromDiscord | <JJ> concepts v1 are something entirely different |
23:26:21 | FromDiscord | <ElegantBeef> This is wild my sampler logic fails in the oddest way and some samples return so many more children samples .... |
23:26:44 | FromDiscord | <ElegantBeef> Belch who cares JJ |
23:28:46 | FromDiscord | <ElegantBeef> Jokes aside yea it's probably fine to call them interfaces though Golang, Java, and C# are domain sitting |
23:29:05 | FromDiscord | <zectbumo> In reply to @elegantbeef "You think I'm going": for your next joke:↵`me@[IPV6:::ffff:192:168:0:1]` |
23:29:22 | FromDiscord | <ElegantBeef> Scribbles in "shitty joke" notepad |
23:31:59 | FromDiscord | <ElegantBeef> Anyone see anything wrong with my tree traversal? https://media.discordapp.net/attachments/371759389889003532/1183551714536718396/image.png?ex=6588bf6e&is=65764a6e&hm=3e0b086332dc78a512a867ebea4d25a61f6adfecd9a3fb78f0435b53edf68e87& |
23:32:11 | FromDiscord | <ElegantBeef> I'm clearling missing something and it eludes me |
23:33:52 | FromDiscord | <ElegantBeef> (edit) "clearling" => "clearly" |
23:35:20 | FromDiscord | <arathanis> in what way is it obviously wrong? |
23:35:23 | FromDiscord | <arathanis> the output I mean |
23:35:38 | FromDiscord | <ElegantBeef> In some cases it returns samples that are smaller than the children |
23:35:54 | FromDiscord | <arathanis> like fewer samples than the children? |
23:35:59 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1183552723354918953/image.png?ex=6588c05e&is=65764b5e&hm=ac01cdaee2b3988ae18355a14f05ef79d2bed73c30c348c63dca0ae121467bff& |
23:36:01 | FromDiscord | <ElegantBeef> yes |
23:36:37 | FromDiscord | <ElegantBeef> The sequence is what the children return, the left is the calculated for this node, the 0 is how many actual samples it had and the float is the percentage of samples the children had |
23:36:44 | FromDiscord | <ElegantBeef> 340% the samples |
23:36:50 | FromDiscord | <ElegantBeef> 380% |
23:37:04 | FromDiscord | <ElegantBeef> or 115% for the first |
23:38:03 | FromDiscord | <arathanis> what does `withValue` do? |
23:38:11 | FromDiscord | <ElegantBeef> returns a `ptr T` to the value in the table |
23:38:18 | FromDiscord | <arathanis> is taht a builtin? |
23:38:21 | FromDiscord | <ElegantBeef> instead of doing `sampleTable[entry]` a bunch of times |
23:38:21 | FromDiscord | <ElegantBeef> Yes |
23:38:24 | * | Jjp137 quit (Quit: Leaving) |
23:38:30 | FromDiscord | <arathanis> thats awesome |
23:38:37 | FromDiscord | <ElegantBeef> I want speed so yes 😄 |
23:40:02 | FromDiscord | <ElegantBeef> Yea it's pretty silly right now https://media.discordapp.net/attachments/371759389889003532/1183553742616940676/image.png?ex=6588c151&is=65764c51&hm=ce4f7dd610030fbb08623d8334bf40e5146ee6f1c9511eaebd9875c46b349e98& |
23:40:08 | FromDiscord | <arathanis> im assuming GraphEntry is recursive? It is mapping strings -> instances of itself? |
23:40:20 | FromDiscord | <ElegantBeef> Yea |
23:40:45 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1183553919553650748/image.png?ex=6588c17b&is=65764c7b&hm=c5ff4636b47b1a4f71fda433703550b82213d33c82615d292b1b83d1e9ba6473& |
23:41:15 | FromDiscord | <ElegantBeef> It does not make much sense why it fails in some instances so I have a feeling the graph construction is just wrong |
23:42:28 | FromDiscord | <zectbumo> is `counted.incl entry` in the right place? inside the for loop? |
23:43:24 | FromDiscord | <ElegantBeef> I imagine so it's only iterated once when it's first found |
23:44:12 | FromDiscord | <zectbumo> is it once? I don't see anything changing counted |
23:44:31 | FromDiscord | <zectbumo> oh, nvm. that is changing counted |
23:44:53 | FromDiscord | <arathanis> In reply to @elegantbeef "I imagine so it's": I noticed you check if the root is in the sample table, but you do not do that for any of the children |
23:45:00 | FromDiscord | <arathanis> is that correct logic? |
23:45:24 | FromDiscord | <ElegantBeef> `withValue` checks |
23:46:28 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/X63JF |
23:47:23 | FromDiscord | <arathanis> so it basically skips the body if the entry is not present, very cool |
23:48:20 | FromDiscord | <ElegantBeef> Well I'm going to take a break now so have fun with the mystery 😛 |
23:55:22 | FromDiscord | <arathanis> @ElegantBeef Is it because the hashing function for your custom cstring is generating hashes on the memory address so 2 strings with the same value hash differently? |
23:55:43 | FromDiscord | <arathanis> That could really wrench up your contains checks |
23:56:11 | FromDiscord | <arathanis> (edit) "strings" => "of them" | "hash differently?" => "will have different hashes?" |
23:59:11 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/Eb26k |