5
jestdotty
47d

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
  • 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
    @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
  • 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