Hacker News new | ask | show | jobs
by amelius 709 days ago
Why did you think Rust was the right tool for the job, and why not a language with a GC?
2 comments

Rust is the language I am the most proficient at this point, so it was a natural choice for me.

Tuxguitar is written in Java and works perfectly fine TBH, even if Rust has clear advantages for high performance software it does not matter that much in this context.

Why would one prefer a language with a GC?

Iced is a great library if you are willing to put in the effort to learn it (as it's new and documentation is still mostly limited to examples)

> Why would one prefer a language with a GC?

One thing less to worry about.

Everything is a tradeoff. Iced is blazing fast, with a low memory footprint (~30MB binary), cross platform, extensible and pretty elegant if a bit challenging to learn.
Your job is to make your users happy. If you spend 2x the amount of time to build a blazing fast UI compared to a normal speed UI, then the question is if you maybe had better spent the time on things your users wanted, like features. Features are not everything, but code that is faster than necessary (or has lower memory footprint) just doesn't bring much to the table from the user's perspective, especially for UI programs. If you were writing an OS kernel or a browser, then maybe (probably even) Rust is a better choice.
> the question is if you maybe had better spent the time on things your users wanted, like features.

That question is for the author of the software alone to decide how they want to build their own software.

For audio software like this, using a GC-free language translates into reliable, stutter-free, low-latency playback, particularly on lower-power devices. A lot of JavaScript-based audio things I've tried, even really simple ones, become miserable experiences once GC pauses start consuming a lot of CPU. I think it's no surprise that GC'd languages are unpopular for audio applications!
But then you should also run it on a realtime OS.
Yeah? Well, you know, that's just like uh, your opinion, man.
You just said that everything is a trade-off yourself ...