<< 30-12-2023 >>

00:00:04*spacelucy joined #nim
00:06:20*om3ga quit (Read error: Connection reset by peer)
00:08:51FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:09:09*om3ga joined #nim
00:09:14FromDiscord<scipio_nl> Can probably be rewritten in 3 lines or less, but it works and I'm learning
00:14:36FromDiscord<huantian> if you'd like to improve it, my first hint would be, instead of a while loop, use a for loop that executes something `size` times: `for _ in 1..size`
00:14:57FromDiscord<huantian> though you might need to handle the 0 and 1 base cases
00:15:02FromDiscord<huantian> (edit) removed "base"
00:20:00*spacelucy quit (Quit: WeeChat 4.1.2)
00:20:13FromDiscord<scipio_nl> `b += temp` is a more obvious improvement đŸ€Ł , but I'll do the `for` construct, sure
00:23:46FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:24:11*Qaziquza quit (Ping timeout: 252 seconds)
00:28:25FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:29:12FromDiscord<scipio_nl> I like how you flexible Nim seems to be
00:29:21FromDiscord<scipio_nl> (edit) removed "you"
00:33:15FromDiscord<Elegantbeef> It's a very common sentiment
00:33:16FromDiscord<Elegantbeef> But so is the "I dislike that there are multiple different ways to do X thing"
00:33:18FromDiscord<Elegantbeef> Cmon grave `result[1..2] = [1, 1]` 😛
00:34:47FromDiscord<scipio_nl> In reply to @Elegantbeef "But so is the": I'm only scratching the surface here but it feels like home immediately, unlike how I struggle with Rust syntax
00:35:21FromDiscord<scipio_nl> I do see a problem indeed with how flexible Nim can get in _teaching_ Nim to beginners, being a beginner nhow
00:35:26FromDiscord<scipio_nl> (edit) "nhow" => "now"
00:36:27FromDiscord<scipio_nl> hmm the `result` variable doesnt need declaration?
00:36:59FromDiscord<scipio_nl> it doesn't need `return` either??
00:37:58FromDiscord<Elegantbeef> Implicit in all non void procs
00:39:04FromDiscord<huantian> In reply to @scipio_nl "You beat me to": I like 1..size more than 0..<size if you don’t care about the value itself
00:39:09FromDiscord<huantian> But it doesn’t really matter
00:43:32*Qaziquza joined #nim
00:45:05FromDiscord<michaelb.eth> In reply to @scipio_nl "hmm the `result` variable": there are some pros and cons to it, outlined here; good to be aware of potential issues even if you disagree with Status' style guide's recommendation against using it: https://status-im.github.io/nim-style-guide/language.result.html
00:46:03FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:47:08FromDiscord<scipio_nl> In reply to @michaelb.eth "there are some pros": Looking at your username you know CryptoWatch, the desktop app too? Would similar "speed" be possible with Nim/Owlkettle you think?
00:48:14FromDiscord<michaelb.eth> I'm not into the tokens, never really was, just enthusiastic about decentralization tech, so I don't know CryptoWatch
00:48:22FromDiscord<michaelb.eth> that being said
00:50:25FromDiscord<michaelb.eth> I think you could do it with Nim/Owlkettle, but you'll probably want to have a look at Phil's ThreadButler because I suspect you'll want to establish the websocket connection using either std/asyncdispatch or chronos ( https://github.com/status-im/nim-chronos ) and the event loops ("dispatcher") of either one won't get along with the GTK event loop on the main thread
00:53:38FromDiscord<scipio_nl> No idea! I am turbo boosting my way through the Nim basics first, I immediately like it a lot but I have no idea which modules/components need patching
00:54:27FromDiscord<scipio_nl> But Owlkettle feels very stable and responsive, and I like how I can rewrite code in multiple ways with every language construct I learn
00:55:44FromDiscord<scipio_nl> ... on the contrary, in Rust I had to put away my computer for trying to concatenate strings and failing initially 😁
00:56:36FromDiscord<michaelb.eth> sure, np↔https://github.com/PhilippMDoerner/ThreadButler↔quick summary, oversimplifying a bit but not wrong: multithreaded programming with Nim can be a bit rough when you want async/concurrency like a thread hanging off the main GUI thread to continously do background work. Multithreading has gotten a lot better when it comes to parallelizing workloads (cf. nim-taskpools and malebolgia), but that's often not what a GUI is looki
00:56:57FromDiscord<scipio_nl> In reply to @michaelb.eth "I'm not into the": ahh, I stumbled in the Solana Discord 3 weeks after it was publicly launched and got to know the founders since then. Was pure coincidence
00:57:20FromDiscord<scipio_nl> (all Rust, Solana is ETH's main competitor, 1000x as fast and cheap)
00:57:46FromDiscord<michaelb.eth> is that the Justin Sun chain?
00:57:57FromDiscord<scipio_nl> No that is Tron (Justin Sun is a scammer)
00:58:08FromDiscord<scipio_nl> Solana, Anatoly Yakovenko
00:58:42FromDiscord<michaelb.eth> ah, okay, the "Sol" in the name made me think it another crypto product/thing that has last name "cleverly" embedded in it
00:59:11FromDiscord<scipio_nl> He lives in San Francisco, Solana Beach
00:59:15FromDiscord<michaelb.eth> anyway, if we want to chat crypto, probably best to shift to #offtopic
00:59:16FromDiscord<scipio_nl> Hence the name
00:59:19FromDiscord<michaelb.eth> gotcha
01:00:16FromDiscord<scipio_nl> In reply to @michaelb.eth "anyway, if we want": well, was asking because cryptowatch (the charting engine in Rust, was ultrafast and stable) is what I would like to rebuild, possibly in Nim)
01:00:35FromDiscord<scipio_nl> And indeed concurrency is extremely important, is that indeed cumbersome in Nim?
01:01:07FromDiscord<michaelb.eth> sure, it's not problem, I just meant if we started chatting about crypto per se↔as long as it's clear how Nim is involved in the discussion #main is okay
01:02:01FromDiscord<scipio_nl> Also offtopic, I used to have a cat (Zoe) like your avatar, but my ex took it (2010)
01:02:09FromDiscord<scipio_nl> blue eyes!
01:02:10FromDiscord<michaelb.eth> In reply to @scipio_nl "And indeed concurrency is": well, if you're okay with single-threaded, then you'll probably be pretty happy with std/asyncdispatch, though chronos has the edge imo
01:02:45FromDiscord<michaelb.eth> if you want unstructured multi-threaded concurrency, it's... a bit cumbersome to date
01:03:06FromDiscord<scipio_nl> In reply to @michaelb.eth "if you want unstructured": I think I do... hmm đŸ€”
01:03:36FromDiscord<scipio_nl> well I really like and appreciate the community in here, extremely helpful, so that gives me courage to learn it
01:04:14FromDiscord<michaelb.eth> the main thing is that for unstructured multithreaded concurrency you need from the start to think about message passing, and NOT mutating across thread boundaries
01:04:27FromDiscord<michaelb.eth> unstructured... in Nim, I mean
01:04:54FromDiscord<scipio_nl> There's a book about that in Rust I think "fearless concurrency"
01:06:23FromDiscord<michaelb.eth> what gets a lot of people frustrated is that they think something like this:↔"okay, I want to go multithreaded, and I've got this large-ish datastrcucture that I've made a `ref object` so that Nim isn't copying it all over the place all the time, so I know, I'll put a lock around it and then I'll be able to mutate across threads safely... oh wait, what's this gcsafe thing..."
01:10:57FromDiscord<leorize> ref + MT = no ORC possible, which is quite sad
01:18:49FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
01:21:10FromDiscord<graveflo> @vindaar the default allocator isnt dirty
01:21:21FromDiscord<graveflo> Wrong ping mb
01:22:28FromDiscord<graveflo> Wait who tf did I even ping? How is that even possible
01:52:33*Qaziquza_ joined #nim
01:55:45*Qaziquza quit (Ping timeout: 245 seconds)
01:59:10*Jjp137 quit (Quit: Leaving)
02:00:12FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:00:23*Jjp137 joined #nim
02:02:24FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:04:50*Qaziquza_ quit (Ping timeout: 260 seconds)
02:12:40FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:16:58FromDiscord<albassort> nim flows like water until you wanna be all staticy
02:17:31FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:17:34FromDiscord<albassort> you gone too far
02:18:14FromDiscord<albassort> but with concepts you can get duck typing in nim which is fun
02:18:50FromDiscord<albassort> (edit) "but with concepts you can get duck typing ... in" added "(but at compile time)"
02:19:49FromDiscord<Elegantbeef> Why is distinct too far?
02:20:08FromDiscord<Robyn [She/Her]> Distinct isn't too far at all, it's useful imo
02:20:18FromDiscord<Robyn [She/Her]> Concepts are very neat
02:21:42FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:22:25FromDiscord<Elegantbeef> `if` not `when`
02:22:26FromDiscord<Elegantbeef> `when` is compile time delimited
02:22:33FromDiscord<scipio_nl> ahh
02:24:57*rockcavera quit (Remote host closed the connection)
02:27:18FromDiscord<albassort> In reply to @chronos.vitaqua "Distinct isn't too far": far when my brain starts to the flow state of understanding
02:27:26FromDiscord<albassort> (edit) "In reply to @chronos.vitaqua "Distinct isn't too far": far when my brain starts to ... the" added "loose"
02:27:39FromDiscord<Robyn [She/Her]> In reply to @albassort "far when my brain": Fair :P
02:36:23FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:56:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
02:57:25FromDiscord<scipio_nl> I need to add spaces you mean Beef?
02:57:49FromDiscord<scipio_nl> or indent at the next line?
02:57:53FromDiscord<Elegantbeef> No `:` to take in an expression or statement as the next argument
02:58:14FromDiscord<scipio_nl> ahh
02:58:21FromDiscord<scipio_nl> had to look 3 times 😁
02:58:52FromDiscord<Robyn [She/Her]> I wonder if it's worth writing an alternative stdlib for Nim :P
03:00:02FromDiscord<odexine> In reply to @chronos.vitaqua "I wonder if it's": For what reason?
03:00:37FromDiscord<Robyn [She/Her]> I know earlier, someone here was talking about passing a lambda to `map` and having it unpack args into the lambda
03:00:49FromDiscord<Robyn [She/Her]> I'd imagine things like that would be nice in an stdlib, if they're commonly used
03:01:30FromDiscord<Robyn [She/Her]> Separate from the language because it'd be easier to update it separately from the language ofc, downside is less rigorous testing, and less support :p
03:03:01FromDiscord<odexine> In reply to @chronos.vitaqua "I know earlier, someone": “Unpack arguments into the lambda”?
03:05:51FromDiscord<Robyn [She/Her]> In reply to @nervecenter "How do you unpack": Hold on, this
03:06:10FromDiscord<Robyn [She/Her]> Very small QoL changes
03:09:14FromDiscord<odexine> That involves pattern matching
03:09:33FromDiscord<odexine> Tuple unpacking is basically a special case of pattern matching isn’t it
03:10:23FromDiscord<odexine> So you’d need to modify => to make it unpack tuples
03:17:57FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:18:01FromDiscord<Robyn [She/Her]> In reply to @odexine "So you’d need to": Why would that need to unpack tuples? `=>` is just proc declaration sugar, it's `map` I'd have to edit
03:19:00FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:19:16FromDiscord<Elegantbeef> Yes scipio `(a, b) = ...` is an assignment sugar
03:19:18FromDiscord<Elegantbeef> `(b, a + b)` makes a temp
03:19:30FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/tests/tintrospection.nim#L14 yea @odexine there is no reason to fork the stdlib
03:20:56FromDiscord<odexine> In reply to @chronos.vitaqua "Why would that need": Why would you have to edit map
03:21:23FromDiscord<Elegantbeef> Just make a operator or macro that takes a tuple and a proc and converts it to `a(tup[0], tup[1], ...)`
03:21:35FromDiscord<Robyn [She/Her]> In reply to @odexine "Why would you have": Because you're passing the lambda to map? Map is passing a tuple to the lambda?
03:21:37FromDiscord<odexine> How would you make map accept arbitrary procedures
03:21:43FromDiscord<odexine> Rather
03:21:45FromDiscord<Elegantbeef> While Nim could make that implicit, there is not much reason for that to work
03:21:46FromDiscord<odexine> Arbitrary story
03:21:49FromDiscord<odexine> Ugh
03:21:51FromDiscord<odexine> Arity
03:22:21FromDiscord<Robyn [She/Her]> In reply to @odexine "How would you make": `C: proc` :p
03:22:27FromDiscord<Robyn [She/Her]> Generics are fun ✹
03:22:45FromDiscord<Elegantbeef> Seems like a lot of specialised work instead of making a generalised solution
03:24:04FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Just make a operator": `unpackTuple`, ya made that macro already didn't you
03:24:05FromDiscord<odexine> Other than the trivial “what if I don’t want to unpack” what other problems arise from this
03:24:33FromDiscord<Robyn [She/Her]> In reply to @odexine "Other than the trivial": Nothing, it'd just make it look nicer, which is basically my entire reasoning lol
03:24:41FromDiscord<Elegantbeef> I mean my version is dumb as shit and does not unpack all tuples it expects the tuple arity to match the procedure arity
03:24:48FromDiscord<Robyn [She/Her]> I do not Think, I simply Speakâ„ąïž
03:25:19FromDiscord<odexine> In reply to @Elegantbeef "I mean my version": Well one could simply reject every other case than matching arity
03:25:24FromDiscord<Elegantbeef> But you can make a `macro unpackTuple(prc: untyped, args: varargs[typed])` which unpacks it into a `nnkCall(prc, args)`
03:25:29FromDiscord<Robyn [She/Her]> What does arity mean?
03:25:34FromDiscord<Elegantbeef> Length
03:25:34FromDiscord<odexine> Argument count
03:25:38FromDiscord<Robyn [She/Her]> Aah
03:25:39FromDiscord<Robyn [She/Her]> Thanks
03:25:51FromDiscord<Robyn [She/Her]> Yeah, I'd imagine making the lengths match would make sense
03:25:59FromDiscord<Elegantbeef> I'd say not really
03:26:16FromDiscord<Elegantbeef> cause `doThing.unpack((10, 20), 30, "hello", (100, 200))` could be valid
03:26:34FromDiscord<odexine> Why should it
03:26:59FromDiscord<Elegantbeef> Cause `doThing` can be overloaded and if you want to match airty you're doing Nim's job inside a macro
03:27:12FromDiscord<Elegantbeef> It's best to expand into a procedure call and let the compile handle disambiguation
03:27:21FromDiscord<Robyn [She/Her]> Ah
03:27:31FromDiscord<Robyn [She/Her]> So loading the work onto the compiler, yeah okay I get you
03:28:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:29:17FromDiscord<Robyn [She/Her]> That's not valid
03:29:17FromDiscord<Elegantbeef> In that case the first parameter could be typed I guess
03:29:24FromDiscord<Elegantbeef> Why isn't that valid?
03:29:27FromDiscord<Robyn [She/Her]> `(10,)` is a tuple, not `int`
03:29:32FromDiscord<odexine> Yes and?
03:29:34FromDiscord<Elegantbeef> So it unpacks
03:29:48FromDiscord<Robyn [She/Her]> Recursively?
03:29:49FromDiscord<Elegantbeef> The point is that `unpack` would unpack all tuples
03:29:57FromDiscord<odexine> What do you mean recursively?
03:29:59FromDiscord<Elegantbeef> There is no recursion there
03:30:01FromDiscord<Robyn [She/Her]> Wait
03:30:05FromDiscord<odexine> It’s a top level tuple
03:30:06FromDiscord<Robyn [She/Her]> I am so confused god damn
03:30:24FromDiscord<odexine> But that was what I wanted to ask, should it unpack recursively
03:30:31FromDiscord<Robyn [She/Her]> Why would `d: int` match `(10,)`?
03:30:39FromDiscord<odexine> Because it unpacks the tuple
03:30:40*vsantana quit (Ping timeout: 276 seconds)
03:30:52FromDiscord<Elegantbeef> unpack would unpack all first level tuples
03:30:54FromDiscord<Robyn [She/Her]> Oh wait, Nim semantics?
03:30:59FromDiscord<Elegantbeef> No
03:31:00FromDiscord<odexine> Same question as why should a and b match (10,20)
03:31:05FromDiscord<Elegantbeef> `unpack` is a hypothetical macro
03:31:23FromDiscord<Robyn [She/Her]> In reply to @odexine "Same question as why": That is a good question :p
03:31:34FromDiscord<Elegantbeef> The question is what should the semantics of this unpack macro be in your view as it's better than making map work in a single case
03:31:43FromDiscord<Elegantbeef> A general solution is always better than a specific solution
03:31:50FromDiscord<Robyn [She/Her]> I'm running on less sleep than usual so, I'm able to comprehend even less than the miniscule amount I can comprehend
03:32:06FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "The question is what": Ah okay, makes sense now I think
03:32:11FromDiscord<Elegantbeef> This is a tremendously simple macro btw 😄
03:32:19FromDiscord<Robyn [She/Her]> I also think I should sleep, but I am ignoring thay
03:32:21FromDiscord<Robyn [She/Her]> That
03:32:46FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "This is a tremendously": It seems simple but I don't trust 3 am me
03:33:14FromDiscord<Robyn [She/Her]> Just gonna keep reading my book about sigils, I don't have the capacity to think
03:36:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:36:31FromDiscord<Elegantbeef> QED
03:36:37FromDiscord<Elegantbeef> Just quickly modified my already existent macro
03:38:00FromDiscord<Elegantbeef> This does dumbly create temps, so really it should create hidden temps for each tuple so unpacking does not do multiple copies
03:38:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:40:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
04:48:02FromDiscord<kreatoo> hello, i am trying to get a variable from a nimscript using nimscripter, but loading the entire script is too slow since i need to get variables from multiple nimscript files↔is there a way to only load the variables so it can be faster?
04:49:00FromDiscord<Elegantbeef> Presently Nimscripter reloads the entire project so... it needs to change eventually
04:50:24FromDiscord<kreatoo> that sucks, i guess i could write a small parser of sorts to get those variables
04:51:11FromDiscord<Elegantbeef> Also are you testing in release or debug?
04:51:36FromDiscord<kreatoo> debug
04:52:03FromDiscord<Elegantbeef> Debug is very very slow
04:52:04FromDiscord<kreatoo> ill try release to see if thats viable but i doubt it
04:53:28FromDiscord<kreatoo> yeah, its still way too slow↔it is much better than debug atleast
04:57:03FromDiscord<Elegantbeef> What are you doing exactly?
05:00:04FromDiscord<kreatoo> im trying to use nimscript for package scripts on my package manager, but getting the dependency list from the each package's nimscript takes a lot of time since it tries to load the entire script↔↔i didnt have this issue when i was parsing my own format since i could only parse variables but i can't do that here so
05:01:43FromDiscord<kreatoo> unless i write a nimscript parser myself which i might do at this point
05:03:15FromDiscord<Elegantbeef> You could refer to atlas to see how it does it
05:06:36FromDiscord<wago> GMT-2 is on a boat? \:)
05:07:09FromDiscord<Elegantbeef> What an unprompted question
05:08:00FromDiscord<wago> Sorry somebody said it was 3am and i'm wondering where that is \:) just curious
05:08:58FromDiscord<Elegantbeef> Think they're in the UK, but do not recall
05:09:02*rockcavera joined #nim
05:10:09FromDiscord<wago> I'm currently in GMT-4 i think -2 is in the ocean lol
05:10:49FromDiscord<Elegantbeef> Timezones are a myth, made by clockmakers
05:10:55FromDiscord<wago> Lol
05:11:18FromDiscord<Elegantbeef> If every house only needed one clock a well made clock would make you no longer by a clock
05:12:07FromDiscord<Elegantbeef> buy a clock\
05:12:21FromDiscord<michaelb.eth> latest version of ChatGPT 4 is struggling with this... it's still processing after a minute! will post final result shortly
05:12:29FromDiscord<wago> That's a point
05:12:47FromDiscord<wago> Good point
05:13:00FromDiscord<Elegantbeef> Our lord and saviour chatgpt will lead us to the light of clocks
05:13:09FromDiscord<michaelb.eth> https://chat.openai.com/share/bffe5a1e-e55d-4715-ab17-c7c0a6779378
05:13:22FromDiscord<michaelb.eth> In reply to @Elegantbeef "Our lord and saviour": sure, but it's still fun to ask 😄
05:13:22FromDiscord<Elegantbeef> Ew a openai link
05:13:33FromDiscord<michaelb.eth> doesn't require an account...
05:13:44FromDiscord<odexine> I don’t think that’s the point of their remark
05:13:46FromDiscord<Elegantbeef> Still clicking an open ai link
05:14:05FromDiscord<Elegantbeef> Sorta like licking your hands after opening a door
05:14:20FromDiscord<odexine> Just swallow the doorknob
05:14:30FromDiscord<wago> Omg you broke chatgtp
05:14:39FromDiscord<odexine> What
05:15:27FromDiscord<wago> That craziness about timezone calculations
05:15:49FromDiscord<Elegantbeef> So uhh Nim eh?
05:16:31FromDiscord<michaelb.eth> In reply to @odexine "I don’t think that’s": okay, I just meant that you can open in a private browser tab or a TOR session or whatever and you'll get the same page, it's not like it's going to pollute your eyeballs or your soul
05:16:42FromDiscord<michaelb.eth> In reply to @Elegantbeef "So uhh Nim eh?": true, more of an #offtopic thing
05:17:07FromDiscord<Elegantbeef> It just feels icky to click an openai link
05:17:20FromDiscord<wago> Sry i thought it would be a simple quicky q&a
05:17:32FromDiscord<Elegantbeef> Less so than a tiktok or facebook link, but nevertheless
05:19:20FromDiscord<michaelb.eth> fair, but I've found myself becoming link-agnostic: if it's not a domain I know/trust, I default to opening it in a private tab; if it's a domain that seems suspect to me, then to Tor Browser it goes
05:20:09FromDiscord<Elegantbeef> For ones I dislike I just use libredirect and say "Ok instance I trust you marginally more than the original corporation"
05:21:38FromDiscord<wago> I like it when companies watch me clicking their links, it's kind of like a form of identity voyeurism
05:22:07FromDiscord<Elegantbeef> To you "Accept all cookies" as an aphrodisiac?
05:22:09FromDiscord<Elegantbeef> is an\
05:22:16FromDiscord<wago> Omg yes
05:22:23FromDiscord<wago> I always do that
05:22:25FromDiscord<michaelb.eth> In reply to @wago "I like it when": this isn't a feelings channel, take that hot mess to #offtopic
05:23:04FromDiscord<Elegantbeef> Oh somewhat more topical michael I wrote code in a lisp language finally
05:23:18FromDiscord<michaelb.eth> which one, my heart skipped a beat
05:23:23FromDiscord<Elegantbeef> Not anything substantial, but it still did a thing
05:23:47FromDiscord<Elegantbeef> I was trying to find a language that had good expression/statement stringification so just chose the most notable one I heard of which is racket
05:24:00FromDiscord<Elegantbeef> I still have not got what I wanted done cause all the docs are lacking for all the lisps
05:24:40FromDiscord<michaelb.eth> đŸ€š Racket's docs are like cream-of-the-crop of almost any language in existence, so now I'm very curious
05:24:52FromDiscord<Elegantbeef> Are they really?
05:25:37FromDiscord<Elegantbeef> I'm just trying to do some FFI and the examples lack how to handle dynamic library variables for instance
05:25:54FromDiscord<Elegantbeef> `set!` in my testing fails to set a dynamic library variable
05:27:55FromDiscord<michaelb.eth> ? https://docs.racket-lang.org/foreign/Loading_Foreign_Libraries.html
05:28:39FromDiscord<Elegantbeef> The docs shows using https://docs.racket-lang.org/foreign/Defining_Bindings.html#%28form._%28%28lib._ffi%2Funsafe%2Fdefine..rkt%29._define-ffi-definer%29%29
05:28:46FromDiscord<Elegantbeef> But then they leaveout how to do anything with variables
05:28:53FromDiscord<michaelb.eth> to be fair, the search box for https://docs.racket-lang.org did not turn that up readily re: searches for "dynamic", et al.
05:29:22FromDiscord<Elegantbeef> I mean I have procedures and variables imported and just want to set the bool! 😄
05:30:38FromDiscord<wago> Interesting Racket has a GUI
05:31:01FromDiscord<michaelb.eth> aside: Scribble ( https://docs.racket-lang.org/scribble/index.html ) is actually a really cool DSL, but it felt/feels half-finished, i.e. too tied to Racket-isms; someone with enough motivation could probably generalize it
05:32:09FromDiscord<michaelb.eth> In reply to @wago "Interesting Racket has a": it's had a GUI since 1995/96, when it was known as DrScheme. I know, because I was in the guinea pig class that had to use that mf
05:32:19FromDiscord<michaelb.eth> ... to complete assignments
05:32:43FromDiscord<wago> I see it's GTK based under dependencies
05:32:46FromDiscord<michaelb.eth> today its known as DrRacket
05:35:10FromDiscord<michaelb.eth> In reply to @Elegantbeef "I mean I have": sorry, not sure, I'd have to experiment
05:35:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
05:35:48FromDiscord<Elegantbeef> Given this throws no runtime errors in rkt you'd expect it to be right... but no! 😄
05:36:21FromDiscord<Elegantbeef> It does have some nice ffi semantics though
05:36:33FromDiscord<Elegantbeef> Having that macro that allows replacing `_` for `-`
05:36:48FromDiscord<Elegantbeef> Atleast that macro
05:37:30FromDiscord<michaelb.eth> yeah, well, give academics (Felleisen's grad students, mainly) a break will you? I heard these days they're paid by the hour in grams of rice
05:37:47FromDiscord<michaelb.eth> (that was an in-joke)
05:38:17FromDiscord<Elegantbeef> On the plus side this did give me appreciation to the simplicity that is Lisp
05:39:06FromDiscord<Elegantbeef> Parsing and lexing is so clearly simple 😄
05:41:40FromDiscord<michaelb.eth> there is an official Racket community Discord, it's not the most active dev crowd, but maybe worth asking there
05:42:55FromDiscord<michaelb.eth> Racket's legacy is / probably will be HTDPv2, which is really, really good
05:43:26FromDiscord<Elegantbeef> I did ask a few questions there but I guess they were badly worded cause they just faded into oblivion 😄
05:43:55FromDiscord<michaelb.eth> https://htdp.org↔if you click that link and then click on the book-cover-artwork, it gets you to the latest online edition
05:44:11FromDiscord<Elegantbeef> All I wanted was a language that could emit it's own AST as a string to play with nimib across ABI
05:44:51FromDiscord<michaelb.eth> In reply to @Elegantbeef "I did ask a": alright, I'll try to sort it out (I probably can?), just mainly focused on my Nim `achan` thing atm
05:45:22FromDiscord<Elegantbeef> I mean you don't have to, it's the least important thing in the world
05:46:08FromDiscord<Elegantbeef> Annoyingly C macros do not allow you to put `#include` in them so you have to do string concatenation to do what I want, or use a multiline string literal
05:46:32FromDiscord<Elegantbeef> Rust's stringfy macro strips all formatting
05:49:17FromDiscord<wago> Thanks for the HTDP link thats intetesting.
05:50:05FromDiscord<michaelb.eth> if you are really ( I mean really, like you're really really serious) are interested in bending Scheme/Lisp to your indomnitable Canadian will, you could dive into Felleisen's PLT Redex: https://redex.racket-lang.org
05:50:09FromDiscord<michaelb.eth> God help us all
05:52:42FromDiscord<wago> That's great thanks
06:05:27FromDiscord<michaelb.eth> well that was for beef, given his metaprogramming proclivities, but I hope you enjoy/ed it too
06:07:47FromDiscord<wago> Yes
06:12:58FromDiscord<Elegantbeef> Eh I was not wanting to bend it at all 😄
06:29:34*vsantana joined #nim
06:34:06*vsantana quit (Ping timeout: 260 seconds)
07:21:15*derpydoo joined #nim
08:22:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:23:02FromDiscord<Phil> The error is `/home/philipp/.nimble/pkgs2/threading-0.2.0-3cd4360369b8abf1c53ddfd49ea8aef70208658c/threading/channels.nim(277, 21) Error: expression cannot be isolated: x`
08:23:24FromDiscord<Phil> And arises from the trySend call
08:24:27FromDiscord<Elegantbeef> `x` cannot be isolated as statically there is 0 information on how many references it has
08:25:12FromDiscord<Phil> Then basically this is just a straight "not possible" or are there workarounds?
08:25:21FromDiscord<Elegantbeef> `unsafeIsolate`
08:25:33FromDiscord<Elegantbeef> But that overrules any point of `isolate`
08:25:48FromDiscord<Phil> I mean, trySend is not a proc from me but threading
08:25:54FromDiscord<Phil> And it is the one doing the isolation
08:26:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:27:10FromDiscord<Elegantbeef> Isolation has quite prominent limitations presently
08:29:08FromDiscord<Elegantbeef> Basically all graphs have to be made inside of the `isolate` call
08:29:24FromDiscord<Elegantbeef> Or it has to be from a proc that has no side effect
08:29:40FromDiscord<Elegantbeef> so like `mySend myProc(...)` would be fine assuming it has no side effect
08:29:47FromDiscord<Phil> Which criteria does it use to assert "nosideeffect"?
08:30:03FromDiscord<Phil> Ah wait, that's what you mean
08:31:05FromDiscord<Phil> That won't work, the idea is that a user instantiates a message they want to send to another thread, they call "send" which wraps their stuff (x in this case) in an object variant and sends it through the channel using mySend
08:31:10FromDiscord<Elegantbeef> I mean passing it to a proc will never work
08:31:12FromDiscord<Elegantbeef> A parameter cannot be isolated as you have no clue if it's referenced
08:31:31FromDiscord<Elegantbeef> I mean it is what it is 😄
08:31:36FromDiscord<Elegantbeef> Proc indirection breaks isolate
08:31:47FromDiscord<Phil> I honestly thought move semantics could do this, raising compiler errors if you try to access the memory when it was sunk into another break
08:31:56FromDiscord<Phil> (edit) "break" => "proc"
08:32:10FromDiscord<Elegantbeef> Move semantics do not keep track of reference ownerships
08:32:43FromDiscord<Elegantbeef> Moving a ref is not even possible `sink` is removed
08:33:26FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/10161#67280 is an example of how it's supposed to be used
08:33:34FromDiscord<Elegantbeef> Which means for `Chan` you have to make `mySend` a template 😄
08:33:41FromDiscord<Elegantbeef> Cause isolate is not an antifeature
08:34:20FromDiscord<Phil> I mean I agree, but it feels naive to assume you can just have all your data in the proc that sends the message at compiletime
08:34:28FromDiscord<Elegantbeef> You do not
08:34:34FromDiscord<Elegantbeef> You call a proc that has no side effect
08:34:35FromDiscord<Phil> Or fetch it inside of that proc
08:34:53FromDiscord<Phil> That's not any mount of intuitive control flow
08:35:09FromDiscord<Elegantbeef> Hey I do not like it I'm just telling you how it's supposed to be used 😄
08:35:28FromDiscord<Phil> (edit) "mount" => "amount"
08:35:48FromDiscord<Elegantbeef> You can use `unsafeIsolate` to override the compiler checks
08:36:10FromDiscord<Elegantbeef> Instead of `ref T` turn it into `Isolated[ref T]`
08:36:20FromDiscord<Phil> Yeah, I gueessss I'll have to tell the user to just be careful
08:39:15FromDiscord<Phil> @.elcritch if you read my response in #appdev later - this is thus the conclusion I've reached for ThreadButler: Circumventing isolation
08:42:29FromDiscord<Phil> I wonder if I should add an "id" field to my object variant wrappers for better logging
08:42:55FromDiscord<Phil> Those shouldn't cause problems with isolation since they'll be copied either way
08:55:52*azimut joined #nim
08:57:52FromDiscord<Phil> In reply to @Elegantbeef "https://forum.nim-lang.org/t/10161#67280 is an exam": That's actually an interesting read.↔So I've reached PMunch 's position, but 7 months late basically 😄
09:02:04FromDiscord<Phil> Out of curiosity regarding terminology.↔Beef is what I'm providing with ThreadButler considered a "runtime"?
09:02:27FromDiscord<Phil> Mostly asking because reading through the thead you've got zevv providing his actor implementation and talking about his runtime
09:03:22FromDiscord<Phil> For reference, a Thread in ThreadButler has access to a thread-local threadpool and is running a pre-defined event-loop provided by ThreadButler that also handles async
09:08:00*azimut quit (Remote host closed the connection)
09:08:27*azimut joined #nim
09:17:52*vsantana joined #nim
09:22:58*vsantana quit (Ping timeout: 276 seconds)
09:23:13FromDiscord<Elegantbeef> no clue↔(@Phil)
09:37:33FromDiscord<nnsee> yes, it's a type of runtime
09:52:36FromDiscord<grumblygibson> I saw some folks and Araq on the forum talking about making a string (v2 flavor) from existing byte data and setting a flag so that the data are not deallocated upon string destruction. I tried it myself but could not figure it out. Is anyone familiar with this?
09:53:10FromDiscord<Elegantbeef> It falls apart when you want to have cstring interop
09:54:09FromDiscord<grumblygibson> because of possible lack of null term?
09:54:17FromDiscord<Elegantbeef> Yea
09:54:23FromDiscord<Elegantbeef> Otherwise it's quite simple
09:54:42FromDiscord<Elegantbeef> Use the first bit of the length to indicate whether it's interned or not
09:54:56FromDiscord<Elegantbeef> If it's interned the destructor does not call
09:55:17FromDiscord<grumblygibson> ah cool
09:55:22FromDiscord<grumblygibson> thanks!
09:55:31FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/pull/23035 ringabout worked on it but the cstring issue makes it unusable for Nim's `string` but another string could be built upon it
10:23:39*krux02 joined #nim
11:34:05*rockcavera quit (Read error: Connection reset by peer)
11:34:51*rockcavera joined #nim
11:44:11*azimut quit (Remote host closed the connection)
11:44:35*azimut joined #nim
12:01:22*eery quit (Ping timeout: 255 seconds)
12:03:12*eery joined #nim
12:38:43NimEventerNew thread by aiac: Specify lib dir by `--passL` can not work, see https://forum.nim-lang.org/t/10812
13:16:10*krux02 quit (Remote host closed the connection)
13:25:19*azimut quit (Ping timeout: 240 seconds)
13:49:46*lucasta joined #nim
13:52:20FromDiscord<System64 ~ Flandre Scarlet> How will C interop be handled with NIR?
14:04:51*wheatengineer joined #nim
14:36:00FromDiscord<grumblygibson> @System64 ~ Flandre Scarlet From what I gather, C interop will be the same way it is now, but there will be more/better information to make the translation to backends even easier. I think NIR is not an interop level feature, but an internal change allowing better features.
14:56:13*azimut joined #nim
15:26:23*_________ quit (Ping timeout: 264 seconds)
15:28:11*_________ joined #nim
15:29:43*azimut quit (Ping timeout: 240 seconds)
15:32:35FromDiscord<asviest> ProcDecl instruction can have NIR pragmas and some of these pragmas need for FFI: ExternName, HeaderImport, DllImport, DllExport, etc. Frontend C interop will not change.
15:32:48FromDiscord<asviest> In reply to @sys64 "How will C interop": ProcDecl instruction can have NIR pragmas and some of these pragmas need for FFI: ExternName, HeaderImport, DllImport, DllExport, etc. Frontend C interop will not change.
15:34:05*lucasta quit (Quit: Leaving)
15:42:15*wheatengineer quit (Quit: Leaving)
16:02:25*_________ quit (Ping timeout: 245 seconds)
16:03:09FromDiscord<ezquerra> This is probably obvious but, is it possible to express that the output type of a procedure must be the same type as one an input argument that is an openarray?
16:04:49FromDiscord<System64 ~ Flandre Scarlet> @grumblygibson @asviest and will NIR make Nim even faster and more performant?
16:04:50FromDiscord<odexine> you use generics instead of openarray, no?
16:05:26*wheatengineer joined #nim
16:06:01*wheatengineer quit (Remote host closed the connection)
16:07:48FromDiscord<ezquerra> I'd like to make a function that works for all types that support the openarray "interface"
16:10:41FromDiscord<ezquerra> It'd be surprising to me that openarray could not be used in functions that transform an openarray (by returning a container of the same type as the input)...
16:10:59*_________ joined #nim
16:14:55*wheatengineer joined #nim
16:28:16FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=html>
16:38:33*azimut joined #nim
16:57:53*wheatengineer quit (Quit: Leaving)
17:06:35NimEventerNew thread by Sentmoraap2: Constness of variable inside a for in loop, see https://forum.nim-lang.org/t/10814
17:55:40FromDiscord<Phil> ... I honestly do not understand how one of my newer examples can possibly work.↔I send a message through a threading/channels.Chan from one thread to another, then 3s later I access that message from the first thread.↔I expect a segfault and explosions because I expect the object to go out of scope in the new thread and be destroyed.↔I get actual access to the object as expected.
17:58:16FromDiscord<odexine> "access that message from the first thread" with
17:58:18FromDiscord<odexine> (edit) "with" => "with?"
18:00:17FromDiscord<Phil> A ref. The message is a ref type and I triple checked that it's ref to the same memory.↔https://github.com/PhilippMDoerner/ThreadButler/blob/main/examples/ex_stdinput_illegalaccess.nim↔The important bits are `handleRequestOnServer` and `runClientLoop`.↔The former runs on a separate thread than the latter, which runs on the main thread
18:02:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
18:05:21FromDiscord<Phil> sent a long message, see <!doctype html>
18:05:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
18:07:34FromDiscord<odexine> aint familiar with how isolation works so
18:07:49FromDiscord<Phil> Isolation is irrelevant in this respect since I circumvent it with unsafeIsolate
18:08:47FromDiscord<odexine> well isnt that literally why it doesnt do anything about it
18:09:39FromDiscord<Phil> All Isolation should do is guarantee that I don't have a ref to the message in my programming.↔Which architecturally is not possible with me wrapping message passing functionality as a library.
18:10:08FromDiscord<Phil> Which I consciously circumvented here and tried to do something illegal to double check that it actually blows up
18:10:39FromDiscord<Phil> And now it isn't and I'm confused
18:10:57FromDiscord<odexine> just because you do something illegal doesnt mean it will always blow up
18:11:02FromDiscord<odexine> more like it might blow up
18:11:32FromDiscord<odexine> this is usually how undefined behaviour acts; it
18:11:49FromDiscord<odexine> (edit) "it" => "it's more like itll break sometimes or not"
18:12:03FromDiscord<odexine> at least that is my understanding
18:12:14FromDiscord<odexine> i will say again i dont know much about isolation
18:12:15FromDiscord<Phil> Hmmmmm so being GC'd doesn't necessarily mean that the memory is immediately overwritten/nilled?
18:12:34FromDiscord<Phil> Or is the point also that it's UB and it may not even be GC'd
18:12:35FromDiscord<odexine> i think it does under ARC/ORC
18:19:50FromDiscord<odexine> In reply to @isofruit "Or is the point": i think since using unsafe isolate means that the compiler doesnt check for whether its under a ref, and that it's a sink param, then it's just copied ...?
18:20:10FromDiscord<Phil> I don't think it is since the uint64 of the ref is the same
18:20:37FromDiscord<Phil> > [CLIENT DEBUG] On Client: 140475163328704 - Thread: 86359↔↔> [SERVER DEBUG] On Server: 140475163328704 - 86360
18:21:09FromDiscord<Phil> Though... maybe it gets copied on the client, one sec
18:23:17FromDiscord<Phil> sent a long message, see <!doctype html>
18:23:31FromDiscord<Phil> Nope, same ref every time
19:06:33FromDiscord<asviest> In reply to @sys64 "<@517047177961537548> <@437324912991010817> and wil": Who knows. 🙂
19:16:00*azimut quit (Remote host closed the connection)
19:16:27*azimut joined #nim
19:25:26*Batzy_ joined #nim
19:28:46*Batzy quit (Ping timeout: 260 seconds)
19:29:33FromDiscord<amarevite> sent a long message, see <!doctype html>
19:50:07*azimut quit (Remote host closed the connection)
19:50:32*azimut joined #nim
20:00:04*yeti joined #nim
20:02:34*jmdaemon quit (Ping timeout: 276 seconds)
21:08:08*yae joined #nim
21:09:22NimEventerNew thread by Niminem: Just Complaining About JSFFI And Ambiguous Stack Traces Don't Mind Me, see https://forum.nim-lang.org/t/10816
21:09:58FromDiscord<Elegantbeef> @amarevite is your `testVar` nil?
21:14:44FromDiscord<amarevite> `testVar.isNil` returns `false`↔but `echo testVar.repr` gives the sigsegv error
21:14:54FromDiscord<amarevite> (edit) "gives" => "causes"
21:15:28FromDiscord<nnsee> what about `echo $testVar`
21:15:56FromDiscord<Elegantbeef> Oh is this just attempting to access memory outside of your program
21:17:48FromDiscord<Robyn [She/Her]> Considering writing some Nim bindings to a Rust library, not sure what library to wrap tho
21:18:07FromDiscord<scipio_nl> MakePad
21:18:17FromDiscord<Elegantbeef> The pointer points to an address outside of your programs memory, which means attempting to access it as you have should segfault
21:18:19FromDiscord<scipio_nl> @Chronos [She/Her]
21:18:59FromDiscord<Elegantbeef> Also if you're reading 1 byte you can just do `readBuffer: byte` and you really should do `Size_T(1)` not `cast[...]`
21:19:45FromDiscord<scipio_nl> In reply to @chronos.vitaqua "Considering writing some Nim": It's a super fast new UI framework, with as little of dependencies as possible. Founder Rik Arends is a friend of mine (fellow Dutchie)
21:20:19FromDiscord<Elegantbeef> Lol scipio is just like "I do not want to import a complex library, but I want you to!"
21:20:36FromDiscord<scipio_nl> I have no idea how to write bindings Beef, am interested to learn tho!
21:20:55FromDiscord<Elegantbeef> For Rust -\> Nim NBindgen might work but I have 0 clue
21:20:55FromDiscord<Robyn [She/Her]> In reply to @scipio_nl "MakePad": Sounds interesting ngl
21:21:08FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "For Rust -\> Nim": Nbindgen isn't maintained nor complete afaik
21:21:14FromDiscord<scipio_nl> Let me get you a video presentation from RustConf
21:21:44FromDiscord<Elegantbeef> I mean it had a commit 2 months ago
21:21:57FromDiscord<Robyn [She/Her]> Nvm it may actually be maintained-
21:21:59FromDiscord<scipio_nl> no no, there is the "Rik" branche which gets daily commits
21:22:11FromDiscord<Elegantbeef> We're talking about nbindgen
21:22:29FromDiscord<scipio_nl> ow you were talking about Nbindgen
21:22:43FromDiscord<scipio_nl> https://www.youtube.com/watch?v=rC4FCS-oMpg
21:23:22FromDiscord<scipio_nl> well there are newer videos but this one is most comprehensive
21:23:41FromDiscord<nnsee> eedeerR r trrr r y
21:26:00FromDiscord<bostonboston> Tell us more
21:31:24FromDiscord<amarevite> In reply to @nnsee "what about `echo $testVar`": this does ↔`echo $testVar` gives a type mismatch error↔`echo $testVar.repr` gives sigsegv error
21:31:44FromDiscord<amarevite> In reply to @Elegantbeef "Also if you're reading": changing `cast[
]` to `SIZE_T(readBuffer.len)` works (thank you)↔but changing `readBuffer` to a byte gives a type mismatch error
21:33:19FromDiscord<amarevite> how would i go about accessing the address im trying to it in a way that doesnt segfault?
21:56:14FromDiscord<Elegantbeef> How did the code you're referrring to do it @amarevite ?
21:58:18FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:59:00FromDiscord<Elegantbeef> The way I see it you want to do `readProcessMemory` of that pointer to a int32
21:59:02FromDiscord<Elegantbeef> An operator touching anything directly is unary
21:59:04FromDiscord<Elegantbeef> `$a + b` is `($a) + b`
21:59:06FromDiscord<Elegantbeef> but `a+b` is a binary operator
21:59:10FromDiscord<scipio_nl> `Error: in expression '(last 3) 1': identifier expected, but found '(last 3)'`
21:59:16FromDiscord<Elegantbeef> so that turns into `(last 3)` and `+1`
21:59:31FromDiscord<Elegantbeef> This unary rule is for `-1`
22:00:09FromDiscord<Elegantbeef> Actually that's wrong
22:00:16FromDiscord<Elegantbeef> `-1` is parsed as a `intlit`
22:00:21FromDiscord<huantian> Beef I thought you were perfect smh
22:00:38FromDiscord<Elegantbeef> Perfectly flawed
22:00:50FromDiscord<Elegantbeef> Like a diamond in the rough of a golf course
22:02:12FromDiscord<nnsee> rtyuyytr syrrttr r Rytrrrlk
22:02:24FromDiscord<Elegantbeef> Someone's cat loves their keyboard
22:19:49FromDiscord<Robyn [She/Her]> @nnsee you alright? :P
22:36:49FromDiscord<amarevite> In reply to @Elegantbeef "How did the code": i dont have a file that im trying to copy exactly↔i think lines 14 and 15 at 11:50 in [this video](<https://youtu.be/fvlkgdngGlQ?t=710>) are what im trying to do↔winim doesnt have a `FindDMAAddy` proc though
22:37:47FromDiscord<Elegantbeef> That comes from utility which is unrelated to the windows api
22:39:19FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1190786221002215614/image.png?ex=65a31116&is=65909c16&hm=1bc6b45ec86b20c713c3e518aba0ba83a279e50c3f57f7e60e410fe56df487cb&
22:40:24FromDiscord<Elegantbeef> I do not get the point of that code though
22:41:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:46:00FromDiscord<Elegantbeef> The ref count never decrements
22:46:53FromDiscord<Elegantbeef> I mean it frees but the `trySend` takes in the `x` and the count never decrements to be freed
22:47:33FromDiscord<Elegantbeef> `unsafeIsolate` is not unsafe cause it bypasses `ref`
22:47:41FromDiscord<Elegantbeef> It's unsafe as it does not make sure the graph is isolated
22:48:29FromDiscord<Elegantbeef> I guess I was wrong about the premise that `ref` cannot sink
22:49:14FromDiscord<Phil> Yeah, which is what I'm intentionally violating here.↔I have a piece of memory shared by 2 threads.↔It should be under control of the `runServerLoop`.↔There `Thing` data is received, falls out of sco... this doesn't fall out fo scope
22:49:28FromDiscord<Phil> Actually... maybe it does?
22:49:41FromDiscord<Phil> Does a variable go out of scope from one iteration to the next? it isn't, is it?
22:50:23FromDiscord<Elegantbeef> It should
22:50:35FromDiscord<Elegantbeef> `--expandArc:runServerLoop`
22:52:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:53:10FromDiscord<Elegantbeef> `=destroy` only decrements the ref count
22:53:11FromDiscord<Phil> That is assuming that calling destroy on msg leads to that memory getting free'd
22:53:29FromDiscord<Phil> Wait... does that object carry over its ref counter from the first thread?
22:53:43FromDiscord<Elegantbeef> The ref count is next to the data on the heap
22:54:09FromDiscord<Elegantbeef> `ref int` points to an integer on the heap and the ref count is right be fore it
22:54:20FromDiscord<Elegantbeef> so the data is actually `(refCount, int)` on the heap
22:54:26FromDiscord<Phil> So basically it does and this thread-shared object is not and can not be collected while the other thread still holds refs
22:54:45FromDiscord<Elegantbeef> Well in theory a double free should be possible
22:55:16FromDiscord<Elegantbeef> But this program does not exhibit it so valgrind/helgrind/....
22:58:31FromDiscord<Elegantbeef> This might just be a case that the data is not being 0'd
23:01:07FromDiscord<amarevite> sent a long message, see <!doctype html>
23:01:38FromDiscord<graveflo> I've done this before. This is windows?
23:01:51FromDiscord<amarevite> im working in windows 10 yeah
23:02:46FromDiscord<graveflo> k well the code that I have is shitty bc I only used it to get a quick and dirty script running, but I can give you an example
23:04:00FromDiscord<amarevite> In reply to @amarevite "im trying to write": if it can find this pointer, that would be greatly appreciated↔the message im replying to has my current code↔but i have to change `thisChangesEachLaunch` for it to work and i currently get that value by using cheat engine
23:04:49FromDiscord<graveflo> it won't find the pointer but itll allow you to chose a process and peek and poke the memory at a given address
23:05:45FromDiscord<amarevite> it'll probably be helpful for me to look over even if it doesnt have exactly what im trying to do, thank you
23:07:16FromDiscord<Elegantbeef> Ok phil so it seems the destruction of `msg` inside send never happens on `runServerLoop` only inside `send`.... which is interesting
23:09:16FromDiscord<graveflo> In reply to @amarevite "it'll probably be helpful": https://gist.github.com/Graveflo/1decf9d78efda6af7a213bfc3ebfd70b↔you'll have to translate from python, but this code was working for me in a custom script that I used for a couple months
23:10:13FromDiscord<Phil> sent a long message, see <!doctype html>
23:10:34FromDiscord<Phil> (edit)
23:10:58FromDiscord<Elegantbeef> Actually this makes sense
23:11:38FromDiscord<Phil> I mean, it is good behaviour for my purposes, but it is still discouraged and I'm wondering where the edgecases are that'll make it all blow up on me
23:11:46FromDiscord<Elegantbeef> since you reference `msg` after `mySend` it keeps the ref count 1, but when you do `unsafeIsolate` it increases it to 2 and when you retrieve it on the otherside it goes up to 3
23:12:00FromDiscord<Elegantbeef> Or thereabouts
23:12:05FromDiscord<Elegantbeef> Too lazy to actually debug the ref count
23:12:56FromDiscord<Phil> Understandable
23:13:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
23:13:54FromDiscord<Elegantbeef> Yea this works but if you remove the `msgAddr` it does indeed increase the ref count to a point that only `send` can clear it
23:14:14FromDiscord<Elegantbeef> since `=copy` on refs increase ref count
23:18:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
23:18:49FromDiscord<Elegantbeef> Whoops I'm dumb
23:18:51FromDiscord<Elegantbeef> That uses `tryRecv`
23:21:03FromDiscord<scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html>
23:21:08FromDiscord<Phil> That one still works once you account for success
23:21:17FromDiscord<Phil> (Directed at beef)
23:21:27FromDiscord<Elegantbeef> Yea I know
23:22:01FromDiscord<Phil> In reply to @scipio_nl "hmm, on my MacOS": Try putting the -d: before the crypto.nim
23:22:29FromDiscord<Phil> Mostly saying that because I've never seen anyone define flags after stating the nim-file to compile
23:22:32FromDiscord<scipio_nl> huh? indeed
23:22:33FromDiscord<scipio_nl> thx
23:22:35FromDiscord<Elegantbeef> Presently you're passing `-d:ssl` to the running program
23:22:48FromDiscord<Elegantbeef> `-r` allows arguments after the nim file to be passed to the nim file
23:22:58FromDiscord<scipio_nl> In reply to @isofruit "Mostly saying that because": Always trying out stuff 😅
23:23:17FromDiscord<scipio_nl> `200 OK`
23:23:51FromDiscord<Phil> I will say that my issue is the weirdest form of problem I had so far.↔In the sense that I typically don't look for actually provoking segfaults but now I kinda wanna for my own understanding
23:24:27FromDiscord<Phil> So the fact it's kinda hard doing so I guess is good in a sense, because it implies the entire system is more robust than I assumed, but also bad because if a problem occurs it'll be that much harder to debug