4
jestdotty
193d

starting to get annoyed at async

works so easy in JavaScript!

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

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

    oh I'm sure that won't cause deadlocks at all!
  • 2
    You really jumped in the deep end with that one :D

    Starting with the hardest feature of one of the hardest languages
  • 1
    @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
  • 0
    @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
  • 1
    @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
  • 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
  • 0
    @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
  • 0
    @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