Hacker News new | ask | show | jobs
by nottorp 439 days ago
Isn't Go better for writing servers, and as fast and memory safe as the second coming of $DEITY?
1 comments

Go has larger ecosystem of libraries for building web servers. You have FrankenPHP for running PHP, Lego for automatic TLS, etc. For Rust there is `tokio-rustls-acme` crate (used by Ferron) for automatic TLS. While for PHP there is a `php` crate that depends on unsupported PHP version. Ferron uses FastCGI for communicating with PHP-FPM daemon instead. However, Go uses a garbage collector, unlike Rust, which has a borrow checker to ensure memory safety.
Rust has garbage collection.
How? I rather think that it uses a borrow checker with ownership and borrowing rules.
no it doesn't
It absolute does. What do you think Arc/Rc are?
(Atomic) Reference Counted structs. They count their own references, there is no external mechanism tracking all of the reference counts at runtime. Modern rust does not include a garbage collector. You might be confusing a garbage collector with the general concept of memory management, which is a feature of (AFAIK) every high level language. Many C projects also have reference counted structs, but a reference count and a call to malloc/free doesn't quite qualify as garbage collection to most developers.
You might be confusing "garbage collector" and "garbage collection" and Rust definitely has the latter. Reference counting is also a subset of garbage collection. That is a matter of fact, not opinion. See below.

https://en.wikipedia.org/wiki/Garbage_collection_(computer_s...

By the name i'd say Arc is reference counting, which isn't exactly garbage collection...
Reference counting is quite literally a subset of garbage collection.