38 ms·
Wow. Anyone remembers Rust pre-0.1? When it had typestate, ML syntax, garbage collection, etc.? So nice to see how the language slowly evolved and was molded
by gnuvince 12y ago
Wow. Anyone remembers Rust pre-0.1? When it had typestate, ML syntax, garbage collection, etc.? So nice to see how the language slowly evolved and was molded to fit as best as possible the problem they were trying to solve.
- bjz_ 12y agoYeah, looking through the early commits is really eye-opening.
- kibwen 12y agoIt's been a fascinating metamorphosis, undeniably. I'm going to attempt to turn it into an interesting talk for the tentative Rust conference that may be happening this year. :)
- riffraff 12y agois it really "so nice"? I wish they had been able to go forward with typestate :(
- aturon 12y agoThis is a very old post, but you can encode many uses of typestate pretty easily: http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/ http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/ It'd be great for someone to write a more up-to-date version of this post!
- Solarsail 12y agoHaven't used Rust, but I wonder what you could use in place of the phantom types? Are Traits capable of filling this role? Am I completely misreading what Traits are? Can Rust still do phantom types, and I just can't see them anywhere in the language reference?
- Jweb_Guru 12y agoRust can still do phantom types. struct Foo<T>; // `T` is a phantom type parameter.
- xKingfisher 12y agoYou should still be able to use phantom types with empty traits or enums. Here's an article[0] (admittedly from ~6 months ago), about using phantom types in Servo. [0] https://blog.mozilla.org/research/2014/06/23/static-checking-of-units-in-servo/ https://blog.mozilla.org/research/2014/06/23/static-checking...
- vhbit 12y agoYes, you can read a bit about collections and how phantom types are used in them http://cglab.ca/~abeinges/blah/rust-btree-case/ http://cglab.ca/~abeinges/blah/rust-btree-case/
- vedosity 12y agoPhantom types aren't part of the language because they don't need to be. They're just empty types used as type parameters for structs, where the type parameter isn't actually used as a variable in the struct. It is more of a design pattern than a language feature.
- legulere 12y agoWasn't garbage collection actually always just planned but never realized (other than reference counting)?
- steveklabnik 12y agoSort of, yeah. Gc<T> was just refcount + simple cycle detection.
- eslaught 12y agoYes, I worked on GC as a summer project. Turned out to be way harder than anyone had thought because LLVM isn't really set up to handle high performance GC. I have a talk on it here: https://elliottslaughter.com/2012/09/rust-precise-gc/ https://elliottslaughter.com/2012/09/rust-precise-gc/
- listic 12y ago> the language slowly evolved and was molded to fit as best as possible the problem they were trying to solve. Which is...? Wikipedia says [1] > "to be a good language for the creation of large client and server programs that run over the Internet" and that looks too vague to me. [1] http://en.wikipedia.org/wiki/Rust_%28programming_language%29#cite_note-infoq2012-19 http://en.wikipedia.org/wiki/Rust_%28programming_language%29...
- steveklabnik 12y agoMemory safety without garbage collection.
- bjz_ 12y agoAgreed. I think that description should be updated.
- chuwy 12y agoJust started to learn Rust. Could you show me examples of this ancient ML syntax? Just curious how it would look like.
- agumonkey 12y agoDeeply second that.