00:00:04 | * | spacelucy joined #nim |
00:06:20 | * | om3ga quit (Read error: Connection reset by peer) |
00:08:51 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:09:09 | * | om3ga joined #nim |
00:09:14 | FromDiscord | <scipio_nl> Can probably be rewritten in 3 lines or less, but it works and I'm learning |
00:14:36 | FromDiscord | <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:57 | FromDiscord | <huantian> though you might need to handle the 0 and 1 base cases |
00:15:02 | FromDiscord | <huantian> (edit) removed "base" |
00:20:00 | * | spacelucy quit (Quit: WeeChat 4.1.2) |
00:20:13 | FromDiscord | <scipio_nl> `b += temp` is a more obvious improvement đ€Ł , but I'll do the `for` construct, sure |
00:23:46 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:24:11 | * | Qaziquza quit (Ping timeout: 252 seconds) |
00:28:25 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:29:12 | FromDiscord | <scipio_nl> I like how you flexible Nim seems to be |
00:29:21 | FromDiscord | <scipio_nl> (edit) removed "you" |
00:33:15 | FromDiscord | <Elegantbeef> It's a very common sentiment |
00:33:16 | FromDiscord | <Elegantbeef> But so is the "I dislike that there are multiple different ways to do X thing" |
00:33:18 | FromDiscord | <Elegantbeef> Cmon grave `result[1..2] = [1, 1]` đ |
00:34:47 | FromDiscord | <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:21 | FromDiscord | <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:26 | FromDiscord | <scipio_nl> (edit) "nhow" => "now" |
00:36:27 | FromDiscord | <scipio_nl> hmm the `result` variable doesnt need declaration? |
00:36:59 | FromDiscord | <scipio_nl> it doesn't need `return` either?? |
00:37:58 | FromDiscord | <Elegantbeef> Implicit in all non void procs |
00:39:04 | FromDiscord | <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:09 | FromDiscord | <huantian> But it doesnât really matter |
00:43:32 | * | Qaziquza joined #nim |
00:45:05 | FromDiscord | <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:03 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:47:08 | FromDiscord | <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:14 | FromDiscord | <michaelb.eth> I'm not into the tokens, never really was, just enthusiastic about decentralization tech, so I don't know CryptoWatch |
00:48:22 | FromDiscord | <michaelb.eth> that being said |
00:50:25 | FromDiscord | <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:38 | FromDiscord | <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:27 | FromDiscord | <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:44 | FromDiscord | <scipio_nl> ... on the contrary, in Rust I had to put away my computer for trying to concatenate strings and failing initially đ |
00:56:36 | FromDiscord | <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:57 | FromDiscord | <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:20 | FromDiscord | <scipio_nl> (all Rust, Solana is ETH's main competitor, 1000x as fast and cheap) |
00:57:46 | FromDiscord | <michaelb.eth> is that the Justin Sun chain? |
00:57:57 | FromDiscord | <scipio_nl> No that is Tron (Justin Sun is a scammer) |
00:58:08 | FromDiscord | <scipio_nl> Solana, Anatoly Yakovenko |
00:58:42 | FromDiscord | <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:11 | FromDiscord | <scipio_nl> He lives in San Francisco, Solana Beach |
00:59:15 | FromDiscord | <michaelb.eth> anyway, if we want to chat crypto, probably best to shift to #offtopic |
00:59:16 | FromDiscord | <scipio_nl> Hence the name |
00:59:19 | FromDiscord | <michaelb.eth> gotcha |
01:00:16 | FromDiscord | <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:35 | FromDiscord | <scipio_nl> And indeed concurrency is extremely important, is that indeed cumbersome in Nim? |
01:01:07 | FromDiscord | <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:01 | FromDiscord | <scipio_nl> Also offtopic, I used to have a cat (Zoe) like your avatar, but my ex took it (2010) |
01:02:09 | FromDiscord | <scipio_nl> blue eyes! |
01:02:10 | FromDiscord | <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:45 | FromDiscord | <michaelb.eth> if you want unstructured multi-threaded concurrency, it's... a bit cumbersome to date |
01:03:06 | FromDiscord | <scipio_nl> In reply to @michaelb.eth "if you want unstructured": I think I do... hmm đ€ |
01:03:36 | FromDiscord | <scipio_nl> well I really like and appreciate the community in here, extremely helpful, so that gives me courage to learn it |
01:04:14 | FromDiscord | <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:27 | FromDiscord | <michaelb.eth> unstructured... in Nim, I mean |
01:04:54 | FromDiscord | <scipio_nl> There's a book about that in Rust I think "fearless concurrency" |
01:06:23 | FromDiscord | <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:57 | FromDiscord | <leorize> ref + MT = no ORC possible, which is quite sad |
01:18:49 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
01:21:10 | FromDiscord | <graveflo> @vindaar the default allocator isnt dirty |
01:21:21 | FromDiscord | <graveflo> Wrong ping mb |
01:22:28 | FromDiscord | <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:12 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:00:23 | * | Jjp137 joined #nim |
02:02:24 | FromDiscord | <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:40 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:16:58 | FromDiscord | <albassort> nim flows like water until you wanna be all staticy |
02:17:31 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:17:34 | FromDiscord | <albassort> you gone too far |
02:18:14 | FromDiscord | <albassort> but with concepts you can get duck typing in nim which is fun |
02:18:50 | FromDiscord | <albassort> (edit) "but with concepts you can get duck typing ... in" added "(but at compile time)" |
02:19:49 | FromDiscord | <Elegantbeef> Why is distinct too far? |
02:20:08 | FromDiscord | <Robyn [She/Her]> Distinct isn't too far at all, it's useful imo |
02:20:18 | FromDiscord | <Robyn [She/Her]> Concepts are very neat |
02:21:42 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:22:25 | FromDiscord | <Elegantbeef> `if` not `when` |
02:22:26 | FromDiscord | <Elegantbeef> `when` is compile time delimited |
02:22:33 | FromDiscord | <scipio_nl> ahh |
02:24:57 | * | rockcavera quit (Remote host closed the connection) |
02:27:18 | FromDiscord | <albassort> In reply to @chronos.vitaqua "Distinct isn't too far": far when my brain starts to the flow state of understanding |
02:27:26 | FromDiscord | <albassort> (edit) "In reply to @chronos.vitaqua "Distinct isn't too far": far when my brain starts to ... the" added "loose" |
02:27:39 | FromDiscord | <Robyn [She/Her]> In reply to @albassort "far when my brain": Fair :P |
02:36:23 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:56:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
02:57:25 | FromDiscord | <scipio_nl> I need to add spaces you mean Beef? |
02:57:49 | FromDiscord | <scipio_nl> or indent at the next line? |
02:57:53 | FromDiscord | <Elegantbeef> No `:` to take in an expression or statement as the next argument |
02:58:14 | FromDiscord | <scipio_nl> ahh |
02:58:21 | FromDiscord | <scipio_nl> had to look 3 times đ |
02:58:52 | FromDiscord | <Robyn [She/Her]> I wonder if it's worth writing an alternative stdlib for Nim :P |
03:00:02 | FromDiscord | <odexine> In reply to @chronos.vitaqua "I wonder if it's": For what reason? |
03:00:37 | FromDiscord | <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:49 | FromDiscord | <Robyn [She/Her]> I'd imagine things like that would be nice in an stdlib, if they're commonly used |
03:01:30 | FromDiscord | <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:01 | FromDiscord | <odexine> In reply to @chronos.vitaqua "I know earlier, someone": âUnpack arguments into the lambdaâ? |
03:05:51 | FromDiscord | <Robyn [She/Her]> In reply to @nervecenter "How do you unpack": Hold on, this |
03:06:10 | FromDiscord | <Robyn [She/Her]> Very small QoL changes |
03:09:14 | FromDiscord | <odexine> That involves pattern matching |
03:09:33 | FromDiscord | <odexine> Tuple unpacking is basically a special case of pattern matching isnât it |
03:10:23 | FromDiscord | <odexine> So youâd need to modify => to make it unpack tuples |
03:17:57 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
03:18:01 | FromDiscord | <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:00 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=html> |
03:19:16 | FromDiscord | <Elegantbeef> Yes scipio `(a, b) = ...` is an assignment sugar |
03:19:18 | FromDiscord | <Elegantbeef> `(b, a + b)` makes a temp |
03:19:30 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/tests/tintrospection.nim#L14 yea @odexine there is no reason to fork the stdlib |
03:20:56 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Why would that need": Why would you have to edit map |
03:21:23 | FromDiscord | <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:35 | FromDiscord | <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:37 | FromDiscord | <odexine> How would you make map accept arbitrary procedures |
03:21:43 | FromDiscord | <odexine> Rather |
03:21:45 | FromDiscord | <Elegantbeef> While Nim could make that implicit, there is not much reason for that to work |
03:21:46 | FromDiscord | <odexine> Arbitrary story |
03:21:49 | FromDiscord | <odexine> Ugh |
03:21:51 | FromDiscord | <odexine> Arity |
03:22:21 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "How would you make": `C: proc` :p |
03:22:27 | FromDiscord | <Robyn [She/Her]> Generics are fun âš |
03:22:45 | FromDiscord | <Elegantbeef> Seems like a lot of specialised work instead of making a generalised solution |
03:24:04 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Just make a operator": `unpackTuple`, ya made that macro already didn't you |
03:24:05 | FromDiscord | <odexine> Other than the trivial âwhat if I donât want to unpackâ what other problems arise from this |
03:24:33 | FromDiscord | <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:41 | FromDiscord | <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:48 | FromDiscord | <Robyn [She/Her]> I do not Think, I simply Speakâąïž |
03:25:19 | FromDiscord | <odexine> In reply to @Elegantbeef "I mean my version": Well one could simply reject every other case than matching arity |
03:25:24 | FromDiscord | <Elegantbeef> But you can make a `macro unpackTuple(prc: untyped, args: varargs[typed])` which unpacks it into a `nnkCall(prc, args)` |
03:25:29 | FromDiscord | <Robyn [She/Her]> What does arity mean? |
03:25:34 | FromDiscord | <Elegantbeef> Length |
03:25:34 | FromDiscord | <odexine> Argument count |
03:25:38 | FromDiscord | <Robyn [She/Her]> Aah |
03:25:39 | FromDiscord | <Robyn [She/Her]> Thanks |
03:25:51 | FromDiscord | <Robyn [She/Her]> Yeah, I'd imagine making the lengths match would make sense |
03:25:59 | FromDiscord | <Elegantbeef> I'd say not really |
03:26:16 | FromDiscord | <Elegantbeef> cause `doThing.unpack((10, 20), 30, "hello", (100, 200))` could be valid |
03:26:34 | FromDiscord | <odexine> Why should it |
03:26:59 | FromDiscord | <Elegantbeef> Cause `doThing` can be overloaded and if you want to match airty you're doing Nim's job inside a macro |
03:27:12 | FromDiscord | <Elegantbeef> It's best to expand into a procedure call and let the compile handle disambiguation |
03:27:21 | FromDiscord | <Robyn [She/Her]> Ah |
03:27:31 | FromDiscord | <Robyn [She/Her]> So loading the work onto the compiler, yeah okay I get you |
03:28:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
03:29:17 | FromDiscord | <Robyn [She/Her]> That's not valid |
03:29:17 | FromDiscord | <Elegantbeef> In that case the first parameter could be typed I guess |
03:29:24 | FromDiscord | <Elegantbeef> Why isn't that valid? |
03:29:27 | FromDiscord | <Robyn [She/Her]> `(10,)` is a tuple, not `int` |
03:29:32 | FromDiscord | <odexine> Yes and? |
03:29:34 | FromDiscord | <Elegantbeef> So it unpacks |
03:29:48 | FromDiscord | <Robyn [She/Her]> Recursively? |
03:29:49 | FromDiscord | <Elegantbeef> The point is that `unpack` would unpack all tuples |
03:29:57 | FromDiscord | <odexine> What do you mean recursively? |
03:29:59 | FromDiscord | <Elegantbeef> There is no recursion there |
03:30:01 | FromDiscord | <Robyn [She/Her]> Wait |
03:30:05 | FromDiscord | <odexine> Itâs a top level tuple |
03:30:06 | FromDiscord | <Robyn [She/Her]> I am so confused god damn |
03:30:24 | FromDiscord | <odexine> But that was what I wanted to ask, should it unpack recursively |
03:30:31 | FromDiscord | <Robyn [She/Her]> Why would `d: int` match `(10,)`? |
03:30:39 | FromDiscord | <odexine> Because it unpacks the tuple |
03:30:40 | * | vsantana quit (Ping timeout: 276 seconds) |
03:30:52 | FromDiscord | <Elegantbeef> unpack would unpack all first level tuples |
03:30:54 | FromDiscord | <Robyn [She/Her]> Oh wait, Nim semantics? |
03:30:59 | FromDiscord | <Elegantbeef> No |
03:31:00 | FromDiscord | <odexine> Same question as why should a and b match (10,20) |
03:31:05 | FromDiscord | <Elegantbeef> `unpack` is a hypothetical macro |
03:31:23 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "Same question as why": That is a good question :p |
03:31:34 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> A general solution is always better than a specific solution |
03:31:50 | FromDiscord | <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:06 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "The question is what": Ah okay, makes sense now I think |
03:32:11 | FromDiscord | <Elegantbeef> This is a tremendously simple macro btw đ |
03:32:19 | FromDiscord | <Robyn [She/Her]> I also think I should sleep, but I am ignoring thay |
03:32:21 | FromDiscord | <Robyn [She/Her]> That |
03:32:46 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "This is a tremendously": It seems simple but I don't trust 3 am me |
03:33:14 | FromDiscord | <Robyn [She/Her]> Just gonna keep reading my book about sigils, I don't have the capacity to think |
03:36:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
03:36:31 | FromDiscord | <Elegantbeef> QED |
03:36:37 | FromDiscord | <Elegantbeef> Just quickly modified my already existent macro |
03:38:00 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
03:40:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:48:02 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> Presently Nimscripter reloads the entire project so... it needs to change eventually |
04:50:24 | FromDiscord | <kreatoo> that sucks, i guess i could write a small parser of sorts to get those variables |
04:51:11 | FromDiscord | <Elegantbeef> Also are you testing in release or debug? |
04:51:36 | FromDiscord | <kreatoo> debug |
04:52:03 | FromDiscord | <Elegantbeef> Debug is very very slow |
04:52:04 | FromDiscord | <kreatoo> ill try release to see if thats viable but i doubt it |
04:53:28 | FromDiscord | <kreatoo> yeah, its still way too slowâ”it is much better than debug atleast |
04:57:03 | FromDiscord | <Elegantbeef> What are you doing exactly? |
05:00:04 | FromDiscord | <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:43 | FromDiscord | <kreatoo> unless i write a nimscript parser myself which i might do at this point |
05:03:15 | FromDiscord | <Elegantbeef> You could refer to atlas to see how it does it |
05:06:36 | FromDiscord | <wago> GMT-2 is on a boat? \:) |
05:07:09 | FromDiscord | <Elegantbeef> What an unprompted question |
05:08:00 | FromDiscord | <wago> Sorry somebody said it was 3am and i'm wondering where that is \:) just curious |
05:08:58 | FromDiscord | <Elegantbeef> Think they're in the UK, but do not recall |
05:09:02 | * | rockcavera joined #nim |
05:10:09 | FromDiscord | <wago> I'm currently in GMT-4 i think -2 is in the ocean lol |
05:10:49 | FromDiscord | <Elegantbeef> Timezones are a myth, made by clockmakers |
05:10:55 | FromDiscord | <wago> Lol |
05:11:18 | FromDiscord | <Elegantbeef> If every house only needed one clock a well made clock would make you no longer by a clock |
05:12:07 | FromDiscord | <Elegantbeef> buy a clock\ |
05:12:21 | FromDiscord | <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:29 | FromDiscord | <wago> That's a point |
05:12:47 | FromDiscord | <wago> Good point |
05:13:00 | FromDiscord | <Elegantbeef> Our lord and saviour chatgpt will lead us to the light of clocks |
05:13:09 | FromDiscord | <michaelb.eth> https://chat.openai.com/share/bffe5a1e-e55d-4715-ab17-c7c0a6779378 |
05:13:22 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "Our lord and saviour": sure, but it's still fun to ask đ |
05:13:22 | FromDiscord | <Elegantbeef> Ew a openai link |
05:13:33 | FromDiscord | <michaelb.eth> doesn't require an account... |
05:13:44 | FromDiscord | <odexine> I donât think thatâs the point of their remark |
05:13:46 | FromDiscord | <Elegantbeef> Still clicking an open ai link |
05:14:05 | FromDiscord | <Elegantbeef> Sorta like licking your hands after opening a door |
05:14:20 | FromDiscord | <odexine> Just swallow the doorknob |
05:14:30 | FromDiscord | <wago> Omg you broke chatgtp |
05:14:39 | FromDiscord | <odexine> What |
05:15:27 | FromDiscord | <wago> That craziness about timezone calculations |
05:15:49 | FromDiscord | <Elegantbeef> So uhh Nim eh? |
05:16:31 | FromDiscord | <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:42 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "So uhh Nim eh?": true, more of an #offtopic thing |
05:17:07 | FromDiscord | <Elegantbeef> It just feels icky to click an openai link |
05:17:20 | FromDiscord | <wago> Sry i thought it would be a simple quicky q&a |
05:17:32 | FromDiscord | <Elegantbeef> Less so than a tiktok or facebook link, but nevertheless |
05:19:20 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> For ones I dislike I just use libredirect and say "Ok instance I trust you marginally more than the original corporation" |
05:21:38 | FromDiscord | <wago> I like it when companies watch me clicking their links, it's kind of like a form of identity voyeurism |
05:22:07 | FromDiscord | <Elegantbeef> To you "Accept all cookies" as an aphrodisiac? |
05:22:09 | FromDiscord | <Elegantbeef> is an\ |
05:22:16 | FromDiscord | <wago> Omg yes |
05:22:23 | FromDiscord | <wago> I always do that |
05:22:25 | FromDiscord | <michaelb.eth> In reply to @wago "I like it when": this isn't a feelings channel, take that hot mess to #offtopic |
05:23:04 | FromDiscord | <Elegantbeef> Oh somewhat more topical michael I wrote code in a lisp language finally |
05:23:18 | FromDiscord | <michaelb.eth> which one, my heart skipped a beat |
05:23:23 | FromDiscord | <Elegantbeef> Not anything substantial, but it still did a thing |
05:23:47 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> I still have not got what I wanted done cause all the docs are lacking for all the lisps |
05:24:40 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> Are they really? |
05:25:37 | FromDiscord | <Elegantbeef> I'm just trying to do some FFI and the examples lack how to handle dynamic library variables for instance |
05:25:54 | FromDiscord | <Elegantbeef> `set!` in my testing fails to set a dynamic library variable |
05:27:55 | FromDiscord | <michaelb.eth> ? https://docs.racket-lang.org/foreign/Loading_Foreign_Libraries.html |
05:28:39 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> But then they leaveout how to do anything with variables |
05:28:53 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> I mean I have procedures and variables imported and just want to set the bool! đ |
05:30:38 | FromDiscord | <wago> Interesting Racket has a GUI |
05:31:01 | FromDiscord | <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:09 | FromDiscord | <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:19 | FromDiscord | <michaelb.eth> ... to complete assignments |
05:32:43 | FromDiscord | <wago> I see it's GTK based under dependencies |
05:32:46 | FromDiscord | <michaelb.eth> today its known as DrRacket |
05:35:10 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "I mean I have": sorry, not sure, I'd have to experiment |
05:35:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:35:48 | FromDiscord | <Elegantbeef> Given this throws no runtime errors in rkt you'd expect it to be right... but no! đ |
05:36:21 | FromDiscord | <Elegantbeef> It does have some nice ffi semantics though |
05:36:33 | FromDiscord | <Elegantbeef> Having that macro that allows replacing `_` for `-` |
05:36:48 | FromDiscord | <Elegantbeef> Atleast that macro |
05:37:30 | FromDiscord | <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:47 | FromDiscord | <michaelb.eth> (that was an in-joke) |
05:38:17 | FromDiscord | <Elegantbeef> On the plus side this did give me appreciation to the simplicity that is Lisp |
05:39:06 | FromDiscord | <Elegantbeef> Parsing and lexing is so clearly simple đ |
05:41:40 | FromDiscord | <michaelb.eth> there is an official Racket community Discord, it's not the most active dev crowd, but maybe worth asking there |
05:42:55 | FromDiscord | <michaelb.eth> Racket's legacy is / probably will be HTDPv2, which is really, really good |
05:43:26 | FromDiscord | <Elegantbeef> I did ask a few questions there but I guess they were badly worded cause they just faded into oblivion đ |
05:43:55 | FromDiscord | <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:11 | FromDiscord | <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:51 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> I mean you don't have to, it's the least important thing in the world |
05:46:08 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> Rust's stringfy macro strips all formatting |
05:49:17 | FromDiscord | <wago> Thanks for the HTDP link thats intetesting. |
05:50:05 | FromDiscord | <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:09 | FromDiscord | <michaelb.eth> God help us all |
05:52:42 | FromDiscord | <wago> That's great thanks |
06:05:27 | FromDiscord | <michaelb.eth> well that was for beef, given his metaprogramming proclivities, but I hope you enjoy/ed it too |
06:07:47 | FromDiscord | <wago> Yes |
06:12:58 | FromDiscord | <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:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:23:02 | FromDiscord | <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:24 | FromDiscord | <Phil> And arises from the trySend call |
08:24:27 | FromDiscord | <Elegantbeef> `x` cannot be isolated as statically there is 0 information on how many references it has |
08:25:12 | FromDiscord | <Phil> Then basically this is just a straight "not possible" or are there workarounds? |
08:25:21 | FromDiscord | <Elegantbeef> `unsafeIsolate` |
08:25:33 | FromDiscord | <Elegantbeef> But that overrules any point of `isolate` |
08:25:48 | FromDiscord | <Phil> I mean, trySend is not a proc from me but threading |
08:25:54 | FromDiscord | <Phil> And it is the one doing the isolation |
08:26:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:27:10 | FromDiscord | <Elegantbeef> Isolation has quite prominent limitations presently |
08:29:08 | FromDiscord | <Elegantbeef> Basically all graphs have to be made inside of the `isolate` call |
08:29:24 | FromDiscord | <Elegantbeef> Or it has to be from a proc that has no side effect |
08:29:40 | FromDiscord | <Elegantbeef> so like `mySend myProc(...)` would be fine assuming it has no side effect |
08:29:47 | FromDiscord | <Phil> Which criteria does it use to assert "nosideeffect"? |
08:30:03 | FromDiscord | <Phil> Ah wait, that's what you mean |
08:31:05 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> I mean passing it to a proc will never work |
08:31:12 | FromDiscord | <Elegantbeef> A parameter cannot be isolated as you have no clue if it's referenced |
08:31:31 | FromDiscord | <Elegantbeef> I mean it is what it is đ |
08:31:36 | FromDiscord | <Elegantbeef> Proc indirection breaks isolate |
08:31:47 | FromDiscord | <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:56 | FromDiscord | <Phil> (edit) "break" => "proc" |
08:32:10 | FromDiscord | <Elegantbeef> Move semantics do not keep track of reference ownerships |
08:32:43 | FromDiscord | <Elegantbeef> Moving a ref is not even possible `sink` is removed |
08:33:26 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/10161#67280 is an example of how it's supposed to be used |
08:33:34 | FromDiscord | <Elegantbeef> Which means for `Chan` you have to make `mySend` a template đ |
08:33:41 | FromDiscord | <Elegantbeef> Cause isolate is not an antifeature |
08:34:20 | FromDiscord | <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:28 | FromDiscord | <Elegantbeef> You do not |
08:34:34 | FromDiscord | <Elegantbeef> You call a proc that has no side effect |
08:34:35 | FromDiscord | <Phil> Or fetch it inside of that proc |
08:34:53 | FromDiscord | <Phil> That's not any mount of intuitive control flow |
08:35:09 | FromDiscord | <Elegantbeef> Hey I do not like it I'm just telling you how it's supposed to be used đ |
08:35:28 | FromDiscord | <Phil> (edit) "mount" => "amount" |
08:35:48 | FromDiscord | <Elegantbeef> You can use `unsafeIsolate` to override the compiler checks |
08:36:10 | FromDiscord | <Elegantbeef> Instead of `ref T` turn it into `Isolated[ref T]` |
08:36:20 | FromDiscord | <Phil> Yeah, I gueessss I'll have to tell the user to just be careful |
08:39:15 | FromDiscord | <Phil> @.elcritch if you read my response in #appdev later - this is thus the conclusion I've reached for ThreadButler: Circumventing isolation |
08:42:29 | FromDiscord | <Phil> I wonder if I should add an "id" field to my object variant wrappers for better logging |
08:42:55 | FromDiscord | <Phil> Those shouldn't cause problems with isolation since they'll be copied either way |
08:55:52 | * | azimut joined #nim |
08:57:52 | FromDiscord | <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:04 | FromDiscord | <Phil> Out of curiosity regarding terminology.â”Beef is what I'm providing with ThreadButler considered a "runtime"? |
09:02:27 | FromDiscord | <Phil> Mostly asking because reading through the thead you've got zevv providing his actor implementation and talking about his runtime |
09:03:22 | FromDiscord | <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:13 | FromDiscord | <Elegantbeef> no clueâ”(@Phil) |
09:37:33 | FromDiscord | <nnsee> yes, it's a type of runtime |
09:52:36 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> It falls apart when you want to have cstring interop |
09:54:09 | FromDiscord | <grumblygibson> because of possible lack of null term? |
09:54:17 | FromDiscord | <Elegantbeef> Yea |
09:54:23 | FromDiscord | <Elegantbeef> Otherwise it's quite simple |
09:54:42 | FromDiscord | <Elegantbeef> Use the first bit of the length to indicate whether it's interned or not |
09:54:56 | FromDiscord | <Elegantbeef> If it's interned the destructor does not call |
09:55:17 | FromDiscord | <grumblygibson> ah cool |
09:55:22 | FromDiscord | <grumblygibson> thanks! |
09:55:31 | FromDiscord | <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:43 | NimEventer | New 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:20 | FromDiscord | <System64 ~ Flandre Scarlet> How will C interop be handled with NIR? |
14:04:51 | * | wheatengineer joined #nim |
14:36:00 | FromDiscord | <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:35 | FromDiscord | <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:48 | FromDiscord | <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:09 | FromDiscord | <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:49 | FromDiscord | <System64 ~ Flandre Scarlet> @grumblygibson @asviest and will NIR make Nim even faster and more performant? |
16:04:50 | FromDiscord | <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:48 | FromDiscord | <ezquerra> I'd like to make a function that works for all types that support the openarray "interface" |
16:10:41 | FromDiscord | <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:16 | FromDiscord | <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:35 | NimEventer | New thread by Sentmoraap2: Constness of variable inside a for in loop, see https://forum.nim-lang.org/t/10814 |
17:55:40 | FromDiscord | <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:16 | FromDiscord | <odexine> "access that message from the first thread" with |
17:58:18 | FromDiscord | <odexine> (edit) "with" => "with?" |
18:00:17 | FromDiscord | <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:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
18:05:21 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
18:05:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
18:07:34 | FromDiscord | <odexine> aint familiar with how isolation works so |
18:07:49 | FromDiscord | <Phil> Isolation is irrelevant in this respect since I circumvent it with unsafeIsolate |
18:08:47 | FromDiscord | <odexine> well isnt that literally why it doesnt do anything about it |
18:09:39 | FromDiscord | <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:08 | FromDiscord | <Phil> Which I consciously circumvented here and tried to do something illegal to double check that it actually blows up |
18:10:39 | FromDiscord | <Phil> And now it isn't and I'm confused |
18:10:57 | FromDiscord | <odexine> just because you do something illegal doesnt mean it will always blow up |
18:11:02 | FromDiscord | <odexine> more like it might blow up |
18:11:32 | FromDiscord | <odexine> this is usually how undefined behaviour acts; it |
18:11:49 | FromDiscord | <odexine> (edit) "it" => "it's more like itll break sometimes or not" |
18:12:03 | FromDiscord | <odexine> at least that is my understanding |
18:12:14 | FromDiscord | <odexine> i will say again i dont know much about isolation |
18:12:15 | FromDiscord | <Phil> Hmmmmm so being GC'd doesn't necessarily mean that the memory is immediately overwritten/nilled? |
18:12:34 | FromDiscord | <Phil> Or is the point also that it's UB and it may not even be GC'd |
18:12:35 | FromDiscord | <odexine> i think it does under ARC/ORC |
18:19:50 | FromDiscord | <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:10 | FromDiscord | <Phil> I don't think it is since the uint64 of the ref is the same |
18:20:37 | FromDiscord | <Phil> > [CLIENT DEBUG] On Client: 140475163328704 - Thread: 86359â”â”> [SERVER DEBUG] On Server: 140475163328704 - 86360 |
18:21:09 | FromDiscord | <Phil> Though... maybe it gets copied on the client, one sec |
18:23:17 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
18:23:31 | FromDiscord | <Phil> Nope, same ref every time |
19:06:33 | FromDiscord | <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:33 | FromDiscord | <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:22 | NimEventer | New 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:58 | FromDiscord | <Elegantbeef> @amarevite is your `testVar` nil? |
21:14:44 | FromDiscord | <amarevite> `testVar.isNil` returns `false`â”but `echo testVar.repr` gives the sigsegv error |
21:14:54 | FromDiscord | <amarevite> (edit) "gives" => "causes" |
21:15:28 | FromDiscord | <nnsee> what about `echo $testVar` |
21:15:56 | FromDiscord | <Elegantbeef> Oh is this just attempting to access memory outside of your program |
21:17:48 | FromDiscord | <Robyn [She/Her]> Considering writing some Nim bindings to a Rust library, not sure what library to wrap tho |
21:18:07 | FromDiscord | <scipio_nl> MakePad |
21:18:17 | FromDiscord | <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:19 | FromDiscord | <scipio_nl> @Chronos [She/Her] |
21:18:59 | FromDiscord | <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:45 | FromDiscord | <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:19 | FromDiscord | <Elegantbeef> Lol scipio is just like "I do not want to import a complex library, but I want you to!" |
21:20:36 | FromDiscord | <scipio_nl> I have no idea how to write bindings Beef, am interested to learn tho! |
21:20:55 | FromDiscord | <Elegantbeef> For Rust -\> Nim NBindgen might work but I have 0 clue |
21:20:55 | FromDiscord | <Robyn [She/Her]> In reply to @scipio_nl "MakePad": Sounds interesting ngl |
21:21:08 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "For Rust -\> Nim": Nbindgen isn't maintained nor complete afaik |
21:21:14 | FromDiscord | <scipio_nl> Let me get you a video presentation from RustConf |
21:21:44 | FromDiscord | <Elegantbeef> I mean it had a commit 2 months ago |
21:21:57 | FromDiscord | <Robyn [She/Her]> Nvm it may actually be maintained- |
21:21:59 | FromDiscord | <scipio_nl> no no, there is the "Rik" branche which gets daily commits |
21:22:11 | FromDiscord | <Elegantbeef> We're talking about nbindgen |
21:22:29 | FromDiscord | <scipio_nl> ow you were talking about Nbindgen |
21:22:43 | FromDiscord | <scipio_nl> https://www.youtube.com/watch?v=rC4FCS-oMpg |
21:23:22 | FromDiscord | <scipio_nl> well there are newer videos but this one is most comprehensive |
21:23:41 | FromDiscord | <nnsee> eedeerR r trrr r y |
21:26:00 | FromDiscord | <bostonboston> Tell us more |
21:31:24 | FromDiscord | <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:44 | FromDiscord | <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:19 | FromDiscord | <amarevite> how would i go about accessing the address im trying to it in a way that doesnt segfault? |
21:56:14 | FromDiscord | <Elegantbeef> How did the code you're referrring to do it @amarevite ? |
21:58:18 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:59:00 | FromDiscord | <Elegantbeef> The way I see it you want to do `readProcessMemory` of that pointer to a int32 |
21:59:02 | FromDiscord | <Elegantbeef> An operator touching anything directly is unary |
21:59:04 | FromDiscord | <Elegantbeef> `$a + b` is `($a) + b` |
21:59:06 | FromDiscord | <Elegantbeef> but `a+b` is a binary operator |
21:59:10 | FromDiscord | <scipio_nl> `Error: in expression '(last 3) 1': identifier expected, but found '(last 3)'` |
21:59:16 | FromDiscord | <Elegantbeef> so that turns into `(last 3)` and `+1` |
21:59:31 | FromDiscord | <Elegantbeef> This unary rule is for `-1` |
22:00:09 | FromDiscord | <Elegantbeef> Actually that's wrong |
22:00:16 | FromDiscord | <Elegantbeef> `-1` is parsed as a `intlit` |
22:00:21 | FromDiscord | <huantian> Beef I thought you were perfect smh |
22:00:38 | FromDiscord | <Elegantbeef> Perfectly flawed |
22:00:50 | FromDiscord | <Elegantbeef> Like a diamond in the rough of a golf course |
22:02:12 | FromDiscord | <nnsee> rtyuyytr syrrttr r Rytrrrlk |
22:02:24 | FromDiscord | <Elegantbeef> Someone's cat loves their keyboard |
22:19:49 | FromDiscord | <Robyn [She/Her]> @nnsee you alright? :P |
22:36:49 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> That comes from utility which is unrelated to the windows api |
22:39:19 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1190786221002215614/image.png?ex=65a31116&is=65909c16&hm=1bc6b45ec86b20c713c3e518aba0ba83a279e50c3f57f7e60e410fe56df487cb& |
22:40:24 | FromDiscord | <Elegantbeef> I do not get the point of that code though |
22:41:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:46:00 | FromDiscord | <Elegantbeef> The ref count never decrements |
22:46:53 | FromDiscord | <Elegantbeef> I mean it frees but the `trySend` takes in the `x` and the count never decrements to be freed |
22:47:33 | FromDiscord | <Elegantbeef> `unsafeIsolate` is not unsafe cause it bypasses `ref` |
22:47:41 | FromDiscord | <Elegantbeef> It's unsafe as it does not make sure the graph is isolated |
22:48:29 | FromDiscord | <Elegantbeef> I guess I was wrong about the premise that `ref` cannot sink |
22:49:14 | FromDiscord | <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:28 | FromDiscord | <Phil> Actually... maybe it does? |
22:49:41 | FromDiscord | <Phil> Does a variable go out of scope from one iteration to the next? it isn't, is it? |
22:50:23 | FromDiscord | <Elegantbeef> It should |
22:50:35 | FromDiscord | <Elegantbeef> `--expandArc:runServerLoop` |
22:52:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:53:10 | FromDiscord | <Elegantbeef> `=destroy` only decrements the ref count |
22:53:11 | FromDiscord | <Phil> That is assuming that calling destroy on msg leads to that memory getting free'd |
22:53:29 | FromDiscord | <Phil> Wait... does that object carry over its ref counter from the first thread? |
22:53:43 | FromDiscord | <Elegantbeef> The ref count is next to the data on the heap |
22:54:09 | FromDiscord | <Elegantbeef> `ref int` points to an integer on the heap and the ref count is right be fore it |
22:54:20 | FromDiscord | <Elegantbeef> so the data is actually `(refCount, int)` on the heap |
22:54:26 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> Well in theory a double free should be possible |
22:55:16 | FromDiscord | <Elegantbeef> But this program does not exhibit it so valgrind/helgrind/.... |
22:58:31 | FromDiscord | <Elegantbeef> This might just be a case that the data is not being 0'd |
23:01:07 | FromDiscord | <amarevite> sent a long message, see <!doctype html> |
23:01:38 | FromDiscord | <graveflo> I've done this before. This is windows? |
23:01:51 | FromDiscord | <amarevite> im working in windows 10 yeah |
23:02:46 | FromDiscord | <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:00 | FromDiscord | <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:49 | FromDiscord | <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:45 | FromDiscord | <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:16 | FromDiscord | <Elegantbeef> Ok phil so it seems the destruction of `msg` inside send never happens on `runServerLoop` only inside `send`.... which is interesting |
23:09:16 | FromDiscord | <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:13 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
23:10:34 | FromDiscord | <Phil> (edit) |
23:10:58 | FromDiscord | <Elegantbeef> Actually this makes sense |
23:11:38 | FromDiscord | <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:46 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> Or thereabouts |
23:12:05 | FromDiscord | <Elegantbeef> Too lazy to actually debug the ref count |
23:12:56 | FromDiscord | <Phil> Understandable |
23:13:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:13:54 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> since `=copy` on refs increase ref count |
23:18:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:18:49 | FromDiscord | <Elegantbeef> Whoops I'm dumb |
23:18:51 | FromDiscord | <Elegantbeef> That uses `tryRecv` |
23:21:03 | FromDiscord | <scipio_nl> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:21:08 | FromDiscord | <Phil> That one still works once you account for success |
23:21:17 | FromDiscord | <Phil> (Directed at beef) |
23:21:27 | FromDiscord | <Elegantbeef> Yea I know |
23:22:01 | FromDiscord | <Phil> In reply to @scipio_nl "hmm, on my MacOS": Try putting the -d: before the crypto.nim |
23:22:29 | FromDiscord | <Phil> Mostly saying that because I've never seen anyone define flags after stating the nim-file to compile |
23:22:32 | FromDiscord | <scipio_nl> huh? indeed |
23:22:33 | FromDiscord | <scipio_nl> thx |
23:22:35 | FromDiscord | <Elegantbeef> Presently you're passing `-d:ssl` to the running program |
23:22:48 | FromDiscord | <Elegantbeef> `-r` allows arguments after the nim file to be passed to the nim file |
23:22:58 | FromDiscord | <scipio_nl> In reply to @isofruit "Mostly saying that because": Always trying out stuff đ
|
23:23:17 | FromDiscord | <scipio_nl> `200 OK` |
23:23:51 | FromDiscord | <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:27 | FromDiscord | <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 |