6 ms·
> However, I am not convinced one can make something solving all the things Rust solves which is substantially simpler as language. I wonder a lot about this t
by josephg 4y ago
> However, I am not convinced one can make something solving all the things Rust solves which is substantially simpler as language.
I wonder a lot about this too. As far as I know, rust is alone. It’s the first language to exist which does compile time memory management in a safe way. Every other language either is memory-unsafe (C, Zig) or garbage collected. (Go, JS, etc).
Rust might the first language of its kind, but it probably won’t be the last. I’d be very surprised if we’re still using rust 100 years from now. Subsequent languages can learn from rust’s accidental complexity and clean up the approach.
Personally I suspect it’s possible to have a borrow checked language that’s much simpler than rust. I don’t know what that would look like, but it would be surprising to me if we found the best programming language in this space on our (collective) first attempt at it.
But I don’t have enough insight to figure out what rust’s successor would look like either. But luckily for both of us, there are a lot of smart people thinking about the problem now. Let’s give it a decade and see.
- pcwalton 4y agoThere have been memory-safe non-GC languages before, like Ada SPARK, but they generally disallow heap allocation altogether. If you heap allocate you get a GC. There were also some academic languages, most notably ML Kit, that offered a safe no-GC region-based memory management system that has a lot in common with Rust. Also, there are academic languages like Cyclone that have a very Rust-like memory management system, but they all use GCs in the end. Still, if you know Rust, Cyclone's ideas will be very familiar.
- throwaway17_17 4y agoSmall point of contention, but it’s actually Rust that has a Cyclone-like memory management system. Cyclone’s initial release was ‘02 and it finalized in ‘06.
- pcwalton 4y agoOh, I'm sorry, I didn't mean to imply that Rust invented any of those things. Cyclone was a big influence on Rust actually. We chatted with Dan Grossman early on, and his presentation "Existential Types and Imperative Languages" is the earliest description of the problem the borrow checker is trying to solve (check it out, it's a great presentation!) We stand on the shoulders of giants :)
- jolux 4y agoLikeness is bidirectional and doesn’t imply derivedness, though.
- throwaway17_17 4y agoI feel like I stuck my foot in my mouth with my comment, but separate from that… This is an interesting perspective, I can’t think of a reason you would be incorrect, but I know I have some default intuition that likeness is most often used to imply derivedness. Also, that’s a great way to phrase what you meant.
- chriskrycho 4y agoYou just (accidentally, no doubt!) well-actually’d someone who helped build Rust and has been invoked in it since long before 1.0. ;-p He’s aware of the direction of influence and was just saying they’re similar, not saying one influenced the other.
- pcwalton 4y agoNo worries, it's my fault for not being clear. The absolute last thing I want to do is to take credit for things we didn't do. Rust wouldn't exist without that academic work by Tofte, Talpin, Grossman, etc.
- throwaway17_17 4y agoI said it in my sibling comment above, but to be clear, I was well aware you almost certainly knew Cyclone’s general age. I don’t want you to think I was implying or hinting anything near taking or denying credit.
- throwaway17_17 4y agoI’m aware of pcwalton’s involvement in Rust. So it wasn’t accidental in any way. It was however slightly tongue-in-cheek, but I probably could have used a /s to indicate it wasn’t an attempt to score ‘I’m smart points’. I was also very aware that, despite anything else, they were almost certain to be aware of which came first. I may take serious issue with pcwalton’s assessment of the performance characteristics of OS threads vs other concurrency implementations, but fun HN arguments aside; I have never seen or heard of any lack of acknowledgement of preceding language/implementation work leading to Rust’s development. So I certainly wasnt attempting to imply any stealing or denial of credit/attribution.
- fanf2 4y agoI gather that in later versions of the ML Kit, the contents of regions were also garbage collected. The problem they had with the compile-time lifetime / region analysis was that in difficult cases an object would be given a longer lifetime than necessary, leading to space leaks
- verdagon 4y agoThere's some exciting work already going on in this space, in fact! * Andrew Kelley is looking into combining escape analysis with allocators to assist in Zig's memory safety. [0] It could be quite a step forward! * D is adding a borrow checker! [1] * Cone is adding a borrow checker on top of user-definable allocators. [2] * We're currently prototyping a region-based borrow checker [3] for Vale, which should get us most of the benefit of Rust's borrow checker with only a fraction of the complexity. It's opt-in, not upwardly infectious, and can stay near the "computational leaves" of one's program. [0] https://news.ycombinator.com/item?id=31853964 https://news.ycombinator.com/item?id=31853964 [1] https://dlang.org/changelog/2.092.0.html#ob https://dlang.org/changelog/2.092.0.html#ob [2] https://cone.jondgoodwin.com/memory.html https://cone.jondgoodwin.com/memory.html [3] https://verdagon.dev/blog/zero-cost-refs-regions https://verdagon.dev/blog/zero-cost-refs-regions
- pcwalton 4y agoIt sounds like the "region borrow checker" is fundamentally based on reference counting, which makes it a garbage collected system. Also, statically eliminating reference count traffic from the stack isn't new; it goes back to Deutsch and Bobrow 1976. Actually, I suggest reading the paper; it seems like a quite similar system [1]. [1]: https://www.memorymanagement.org/bib.html#db76 https://www.memorymanagement.org/bib.html#db76
- verdagon 4y agoThe region borrow checker was originally designed for a reference-counted system, but not any more. We later discovered generational references, a method for memory-safe single ownership with no borrow checker, reference counting, nor garbage collection. To our delight, the region borrow checker works even better with generational references than with reference counting =)
- deleted 4y ago[deleted]
- zozbot234 4y ago
- amenghra 4y agoThere are several languages which use linear types, Rust being the most popular. For example, https://github.com/austral/austral https://github.com/austral/austral claims to be simpler than Rust and was discussed on hackernews a few days ago.
- network2592 4y agoThere is also Vlang [0] which the Zig core maintainer seems to both look up to [1] as well as look down upon [2]. [0] https://github.com/vlang/v https://github.com/vlang/v [1] https://news.ycombinator.com/item?id=19086589 https://news.ycombinator.com/item?id=19086589 [2] https://news.ycombinator.com/item?id=31795445 https://news.ycombinator.com/item?id=31795445 EDIT to reflect critical attitude as indicated by [2].
- throwaway17_17 4y agoI don’t have a real opinion in this particular topic area, but I am certain many people will find the Andrew Kelly reference to be not entirely accurate.
- network2592 4y agoNeither do I. The word seems was used as a tentative qualifier rather than an assertion. Feel free to provide context that would indicate otherwise if you deem it salient.
- demindiro 4y agohttps://news.ycombinator.com/item?id=31795445 https://news.ycombinator.com/item?id=31795445
- network2592 4y agoThanks for pointing this out. At the very least, there are conflicting attitudes. Comment will be edited to reflect that. Initial reply made a valid point.
- Tozen 4y agoYou did nothing wrong in pointing out the difference in attitude. The change in views is arguably indicative to the extent that Vlang was perceived as a real threat, competition, or could become more successful. Vlang has continually maintained its development pace and popularity (https://github.com/vlang/v/releases https://github.com/vlang/v/releases), so that pretending to dismiss it as if it was nothing or attempting to smear the author just does not work. It's not going away. Vlang is also not a one-man show, but has numerous other committed developers, new contributors, and loyal long time supporters.
- nomel 4y agoIf people are still typing words with fingers to make computers do things, in 100 years, technology has failed!
- flohofwoe 4y agoMaybe, maybe not. Technologies that are 'good enough' just stick around forever instead of being replaced by something entirely else. Wheels are still round, we still print words on paper, we still use glass lenses when eyesight starts to fail, rifles don't look fundamentally different from when they first appeared, etc etc...
- nomel 4y ago> rifles don't look fundamentally different from when they first appeared, etc etc... I would claim that a modern rifle flies at hundreds of miles an hour, and is operated remotely.
- pjmlp 4y agoRust is the first achieving commercial success (so to speak), several others have precedded in the use of affine types. While we cannot, and should not, take away its glory in achieving this, we should also not address it as if all belongs to Rust alone.
- brundolf 4y agoAnother possibility is Rust continues to get more advanced in ways that remove constraints over time, making it less complex to use in practice. We already see a lot of (small, incremental) improvements of this type, where a bunch of compiler work goes into proving that new cases are actually safe and therefore allowed Basically what I'm wondering is if Rust has room to become that language that's learned from the ways Rust has been clunky in the past, without introducing dramatically breaking changes