Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
roca
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
49 ms
·
661.
▲
by
roca
6y ago
rust-analyzer is remarkably good. I am curious as to how Zig comptime is going to interact with IDE features.
662.
▲
by
roca
6y ago
The fact that Rust has traits and generics doesn't make it more complex than C++, because they substitute for C++ features that are even more complex (classes, virtual methods, templates, concepts). I believe C++ is far more complex be
663.
▲
by
roca
6y ago
I've been developing mostly in Rust for the last five years. C++ for decades before that. It is always comforting to dismiss something that you haven't made much effort to understand as unnecessarily overcomplex. I think we'r
664.
▲
by
roca
6y ago
GC always forces you into a tradeoff between pause time, throughput, and memory overhead.
665.
▲
by
roca
6y ago
Perhaps more accurate to say "safe reclamation of dynamic allocations without GC was not known to be possible in a practical programming language, before Rust". The problem with languages like ATS and Cyclone is that you need heav
666.
▲
by
roca
6y ago
It is hard to stop people perceiving Rust as over-complex if they are motivated to perceive it as over-complex.
667.
▲
by
roca
6y ago
He doesn't give any concrete examples of that though.
668.
▲
by
roca
6y ago
The main piece is stackless coroutines which definitely aren't a library.
669.
▲
by
roca
6y ago
It is in no danger of become as complex than C++. Nowhere near.
670.
▲
by
roca
6y ago
This article is a bit confusing. The concrete issues described all relate to closures, but the author says the real problem is async and they liked Rust before that (when it had the closures they have concrete issues with?).
671.
▲
by
roca
6y ago
C# and C++ adopted basically the same model.
672.
▲
by
roca
6y ago
As someone who cares about safety in my software I'm going to take Rust's proven benefits over Zig's unproven hopes.
673.
▲
by
roca
6y ago
> you don't care if your program fails due to UB or another bug, Actually you do, because memory safety bugs are more likely to be exploitable than some arbitrary correctness bug, because they can be weaponized to take full control
674.
▲
by
roca
6y ago
> And even keeping each document in its own (OS) thread ain't really that unprecedented; browsers already do this, last I checked (each open tab being a "document" in this context) - in some cases (like Chrome) even doing
675.
▲
by
roca
6y ago
> Safety and correctness are as emphasised in Zig as in Rust This is so far from true I cannot take you seriously. Zig doesn't have any kind of lifetime analysis, so it's as vulnerable to use-after-free/dangling pointers a
676.
▲
by
roca
6y ago
> that document's existence would likely be a running function No, that would mean an application managing multiple documents would need one thread per document, which is not normal practice for GUIs. In fact it would then need one
677.
▲
by
roca
6y ago
In this case it kind of seems like what you'd want to happen is happening: we've been warned about the dangers of climate change under "business as usual" scenarios, so we're not carrying on "business as usual&
678.
▲
by
roca
6y ago
> When I close the document, I can then simply free that chunk of memory - and everything allocated against it. You probably don't want to do this directly. Instead you want to walk the object graph and run cleanup code for everythi
679.
▲
by
roca
6y ago
I don't think your critiques are accurate, but anyway, the "similarity" here is that you have the same high-level critique of both languages. This does not make Rust "pretty darn similar to C++". For me, memory and
680.
▲
by
roca
6y ago
That makes a little bit of sense if by "component" you mean not a software component but a unit of work users care about (e.g. a document).
681.
▲
by
roca
6y ago
Thanks, that's a good counterexample.
682.
▲
by
roca
6y ago
> Choosing to forego generics and do everything with a comptime abstraction makes Zig a lot easier to understand, compared to Rust generics and traits. The downside is that documentation and predictability suffers. If I understand correc
683.
▲
by
roca
6y ago
I really don't understand why someone would think Rust is "pretty darn similar to C++". I think about my code and data in Rust very differently to C++. C++ doesn't have tagged unions, Rust does. C++ does have inheritance
684.
▲
by
roca
6y ago
In a large complex application you are going to want to use the same allocator everywhere, or close to everywhere, and almost all functions may allocate memory directly or indirectly, in which case this Zig convention will require most ever
685.
▲
by
roca
6y ago
Partitioning memory-unsafe code into lots of little OS or WASM sandboxes each running with least-privilege would be interesting, but I think it would get really costly at runtime and at development time, because they all have to have disjoi
686.
▲
by
roca
6y ago
Actually Cosmopolitan doesn't support threads so Java, Go and Rust won't work at all on top of it. https://github.com/jart/cosmopolitan/blob/master/libc/runtim...
687.
▲
by
roca
6y ago
That's not the claim though. The claim is that Cosmopolitan offers the same portability benefits as Java, Go and Rust, not that Cosmopolitan + (Java, Go, Rust) offers the same portability benefits as (Java, Go, Rust). Also the latter c
688.
▲
by
roca
6y ago
Some of these statements are very misleading too. > Cosmopolitan makes C a build-once run-anywhere language, similar to Java, except it doesn't require interpreters or virtual machines be installed beforehand. Cosmo provides the sam
689.
▲
by
roca
6y ago
There is nothing lifetime-related here, right? I.e. nothing to help prevent use-after-free errors.
690.
▲
by
roca
6y ago
I'm surprised they're not following Microsoft WSL2 and taking the virtualization approach. Ultimately the virtualization approach has better performance (fewer context switches) and much better compatibility. AFAICT one of the big
More ›