Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
verdagon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
verdagon
3y ago
Not quite, there are non-GC ways to guarantee memory safety without borrow checking, see languages like Vale, HVM (more a runtime), and Inko. With those in mind, Rust's complexity does indeed look accidental here. It has its other bene
92.
▲
by
verdagon
3y ago
Their approach lines up pretty well with how we do regions in Vale. [0] Specifically, we consider the "spine" of a linked list to be its own private "region", separate from the elements' region. This lets us freeze
93.
▲
by
verdagon
3y ago
Those first two principles help promote simpler and more stable APIs, which is a must for large projects with many teams. If you iterate on the interface between large enough layers, it ends up anywhere between "very costly migration&q
94.
▲
by
verdagon
3y ago
For you or anyone else that has numbness in the hands, a neck x-ray could be enlightening. As we hunch a lot we start to deform the cervical spine into pinching the nerves that run all the way down our arms into our hands. Problems in the n
95.
▲
by
verdagon
4y ago
I'm not sure the complexity of the borrowing rules are always essential. Sometimes it is, but often it adds an accidental layer of complexity that doesn't exist in the real world. For example, I once saw someone bring in an entire
96.
▲
by
verdagon
4y ago
I'm particularly excited for this too. We're starting to see a lot on the horizon: * Austral is using linear types for zero-cost memory safety [0] and then allows for borrowing on top of that. Val does something similar called mut
97.
▲
by
verdagon
4y ago
I think the future is in languages that offer "opt-in" borrow checking, so you can use it where it makes sense. After all, most of a program should prefer simplicity over performance, and only optimize where it matters. I think th
98.
▲
by
verdagon
4y ago
> I've been wondering lately whether a new spatial approach can yet again simplify matters. This is indeed the case! Rust's borrow checking is the first step towards "regions", a more general and more flexible model.
99.
▲
by
verdagon
4y ago
If we go so far as to say that using anything unsafe is dangerous and a "moral hazard" then we would also have to disqualify Rust, C#, and any other language that allows unsafe escape hatches (especially in dependencies).
100.
▲
by
verdagon
4y ago
Perhaps instead of distributing program executables, we can distribute program intermediate representations and then lazily invoke the OS's trusted compiler to do the final translation to binary. Someone suggested a Vale-based OS along
101.
▲
by
verdagon
4y ago
Both viewpoints make sense; whether Rust is good for prototyping depends on the domain. If it fits the borrow checker well (like in CLI apps, stateless servers, data transformation) then the borrow checker fits beautifully and seamlessly. I
102.
▲
by
verdagon
4y ago
As a fellow Rust user, please stop saying this. Not everyone who codes like us is a bad programmer. It's this kind of sentiment that gives us a bad name. Rust may influence us into patterns that are better in some (likely even most) s
103.
▲
by
verdagon
4y ago
I'm not sure this is true, since you could simulate it on other CPUs. I believe most modern OSs don't use the top byte, so you can store things in there (as long as you clear it before trying to dereference it).
104.
▲
by
verdagon
4y ago
I'm particularly excited for top byte ignore, as it can be used for some pretty creative things. In Vale, we're planning on storing a small "offset-to-generation" integer in the top bits. This will let us easily find the
105.
▲
by
verdagon
4y ago
I'm particularly interested in this line of thinking, and I'd probably lean the same way. Would love to hear more, why do you think it's a better approach to default to more high-level, with the ability to drop down into manu
106.
▲
by
verdagon
4y ago
Just because shared mutability is sometimes inconvenient for parallelism doesn't mean it's a good idea to outlaw it everywhere. That's like saying "inheritance makes some things easier, so let's use it everywhere we
107.
▲
by
verdagon
4y ago
It can often be quite a pain to use an index. From further up: > For example, in Rust, we often have to use an index or an ID where a regular reference would do in Go. We need to do extra refactoring of function signatures to pass collec
108.
▲
by
verdagon
4y ago
Forcing you into a model up-front can be good, but only if the model is a good one for the situation. It must have as many constraints as the situation calls for, and no more. Unfortunately, the borrow checker forces two extra constraints w
109.
▲
by
verdagon
4y ago
A rarely covered topic in these discussions is architectural benefits that Go provides. Rust tends to solve problems by adding more constraints, which often leads to more complexity. It's great when that complexity is inherent (like wi
110.
▲
by
verdagon
4y ago
Can you say more about these storms? Sounds pretty interesting. How does preempting solve it?
111.
▲
by
verdagon
4y ago
I think the reason Rust's syntax is so controversial and divisive is that its syntax works well for some areas and poorly for others. TFA highlights it well: > It is needed because Rust loves exposing physical layout of bytes in mem
112.
▲
What’s the Smallest Variety of Cheri?
(msrc-blog.microsoft.com)
1 points
by
verdagon
4y ago
|
0 comments
113.
▲
Sources of Complexity: Constraints
(hillelwayne.com)
2 points
by
verdagon
4y ago
|
0 comments
114.
▲
by
verdagon
4y ago
That's a fair perspective. I don't have the same faith in Rust's dominance for high-level use as these problems seem inherent to their kind of borrow checking, but its possible they can compensate for it with improvements lik
115.
▲
by
verdagon
4y ago
There are some design decisions mean Rust can't work with generational references and regions, unfortunately. They're incompatible with their form of borrow checking. In Vale, each struct has a generation in theory, but they are o
116.
▲
by
verdagon
4y ago
Zig is great for low-level use cases like embedded, especially where performance is a high priority and memory safety doesn't offer as much benefit as in other domains [0]. Nim's also geared towards systems programming, though it
117.
▲
by
verdagon
4y ago
I recommend taking a look at Cone in a little more detail, its type system support for allocators are head and shoulders above what Rust has. The language's awareness of allocator allows it to decouple it from the users code in a way n
118.
▲
by
verdagon
4y ago
While technically true, I'm not sure that the iterator invalidation argument is that strong in practice. Rust doesn't seem to eliminate those problems, it more moves them around and transforms them into different (though sometimes
119.
▲
by
verdagon
4y ago
Like I mentioned in response to your other comment about this, the anecdotes were added to the borrow checking sections because that's what the initial readers were surprised about. That in turn made those sections longer. I also did m
120.
▲
by
verdagon
4y ago
This was a particularly fascinating realization of mine a few years ago. I realized that for certain domains, the borrow checker was a dream to use (command line tools and scripts, ECS games), and in others it wasn't so much (GUI, turn
More ›