5

starting to get annoyed at async

works so easy in JavaScript!

Comments
  • 2
    what's efficiency? NOTIFY ALL THE THINGS!
  • 2
    -.-

    mutex lock().await comes in in the order they are called

    oh I'm sure that won't cause deadlocks at all!
  • 2
    If you write c you would've get all async stuff under all dem languages and maybe you stopped using the word :p Async is fairly tales. It's just a loop of events repeating and walking trough file descriptors every time who are set to non-block. That 1337 times await in your code, actually harmful (in theory!). Would be better to only do io calls 'async'. Here, five hours of content with exactly stuff you're doing I watched all: https://youtu.be/sNHzizPu7yQ/... https://youtu.be/IGv5WYYmyfo/... https://youtu.be/eEHqCZpYtOE/.... He's such a cutii. And yes, he has indeed the file size of his porn folder all the time in bottom of his screen. It's hours, but that first video at least will make you stop using the word async :p. Afaik his youtube income stopped since the war so I don't understand what he does for living anymore. He has same life as me? I feel connected 😁
  • 3
    You really jumped in the deep end with that one :D

    Starting with the hardest feature of one of the hardest languages
  • 2
    @retoor It's actually not though, at least in Rust. Async in Rust basically assembles a big state machine for you that is perfectly sized

    It's a lot more impressive than just an event loop
  • 1
    @12bitfloat probably also just uses epoll or that new one ui_***, can't imagine it being much different.
  • 1
    @retoor It does for execution, the real difference of async await is that it's SO MUCH nicer to write than doing it by hand

    Here's a rough example of what Rust transform async await into: https://play.rust-lang.org//...

    I do NOT want to write that C code by hand lol
  • 0
    I rewrote my swarm code to a vec dequeue version and a mpsc version

    I changed the code somewhere else in the codebase and kept running it and it kept having issues

    so then yesterday I finally wrote tests, to test the speed that the swarm runs at

    my original swarm takes 0.5 seconds per request, the queue swarm takes 1.7, and the mpsc swarm takes 1.4

    and all three of them will mysteriously hang. even though they don't have the same code.

    there's no damned deadlock debugging for tokio evidently. and me rewriting things isn't narrowing down the damned mystery bug. and by this rate evidently my proxy selection code is slower than even the original version (and these new versions don't even do proxy revival, whereas my original version does)
  • 2
    @12bitfloat the first thing I tried to do in rust was some audio engineer shit. I still don't understand it. it had anonymous functions and operator overloading

    after that I decided I'd do a CLI chat. that required threads and I actually never finished it cuz it confuses my brain at the time. still something I want to do. I know there's several versions of these out there but mine was going to spool up a server as necessary on a client instead of just being a client and server apps (also I wanted encryption)

    seems everything is "hard". these don't seem like hard things. writing a chat is JavaScript 101. I also wrote a music library before in JavaScript, and that did take some time because I knew nothing about music engineering but who cares

    rust, the language where you can't write anything, I guess
  • 1
    @retoor I find him annoying but if it's useful

    oh look a rant about Oracle. how political

    he's also annoyingly depressed, petty. arrogant in that hypocritical way
  • 1
    @12bitfloat in C you won't write generic stuff anyway. Generic stuff costs performance. What's the point of still writing C then. But nice example. Soon I have my 'async' intercepting proxy ready, can show you. I've uploaded the source to Chatgpt (yes, I upload source instead of download there 😂) and asked questions about it and it says it's high performance stuff and good for 500.000 clients when ulimit is adjusted.
  • 0
    @jestdotty There are some really overengineered rust libraries out there, I feel you

    Yeah and Rust is hard. That's just a fact. Rust is a great language but it solves a really hard problem in a way that can make writing code annoying at times

    At the end of the day it really depends what you need to do. I wouldn't pick Rust for everything. I mean I just posted a Rant about how great garbage collectors are. I love writing simple games in Kotlin or C#

    But when you actually do need a low level language Rust is just absolutely amazing
  • 0
    @jestdotty "the language you can't write anything in, I guess"

    My engine has 30k loc now. Some were very painful to write, but you definitely can write complex things in Rust :P
  • 1
    @retoor C not having generics is such a showstopper for me. How can anyone use a language without generics!? :P
  • 1
    @retoor kicker is I would write generics in java because it was faster than writing the same basic bitch code everywhere, even the first time

    in js everything is already a generic so it solved the whole mini game

    in rust? generics seem to give me more work than solve... because the type system is so low level and picky

    so I'm just writing everything out repeatedly because I can't be sure if it'll work with this current architecture or not and writing something generic will cause more work than solve... zzzz

    also caveat though. I used to be smart before and now I'm not. I think I have brain inflammation so bad my insulin receptors in my brain don't work and I have to wait for them to grow back, and they're necessary for neurons to be able to get energy. 145 iq to fucking 120. pathetic. I can't even remember where I left something when I was unpacking the damned groceries

    *woes*
  • 0
    @retoor wish the AIs could debug my code. see we're doing the same thing. my swarm is just a proxy roundrobin thingy. I mean ok it's not s roudrobin. I just have it load hundreds of proxies and it keeps track if the proxy has errors aka is down, then it uses proxies that are active for delegating any requests sent to it, and it does this async. WE ARE THE SAME NOW RAGH
  • 1
    @12bitfloat I remember enjoying programming because it's the most humbling thing ever. or rather I remember saying those words

    I used to have a giant ego about things cuz I was the smartest person everrrr

    I don't seem to interpret challenges this way anymore though which is kind of strange. now it's just up to me and my bullheaded resilience instead of me being in awe that I could've gotten something wrong. I'll get an error and I'll fix it but my brain won't commit to memory that the event ever happened. so I effectively can't build models of understanding from my experiences. really puts a kink in that ego I used to have where I had a basically photographic memory once upon a time. just had to run into something once and I could remember it for 3 months even if I didn't ever run into it again or find a use for that information in that time period. to go from a god to pound scum! fuck! *emotions*
  • 0
    @12bitfloat and I wrote a ecs engine in about 100 lines in Java and later in JavaScript (which was far more complex / capable than ecs engines these days even still)

    complexity is all about your brain's ability to reduce it to its most fundamental repeat patterns
  • 0
    @jestdotty > complexity is all about your brain's ability to reduce it to its most fundamental repeat patterns

    Writing a game engine myself right now I can tell you: Not always

    Some things are just a lot of work. A LOT of work. No way around it :D
  • 2
    @12bitfloat it does have this actually, but that's as far as it goes and actually would never use it. How much is a function name worth to you by doing this instead of two functions.

    I'm still looking for a daily driver language. For performance, it will stay C. But i'm looking for kinda python replacement. I'm considering swift or C# (did do C# as job when younger, was nice).

    Python, it's just too fragile for me. I have not the idea i'm building very decent software. I need something compiled.
  • 1
    @retoor I really like and can recommend C# and Kotlin

    C# has really cool features and Kotlin is JVM based and I grew up programming Java so it will always have a space in my heart :D
Add Comment