Tuesday 22 March 2011

Upcomming Programming Language Rust

Mozilla  is designing a new multi-paradigm programming language called Rust. According to the Rust Project FAQ, the Rust team's goal is "To design and implement a safe, concurrent, practical, static systems language."
Rust began as a side project by Graydon Hoare in 2006, and Mozilla got involved in 2009 once the project was mature enough to run some basic tests. The language is now published on Github, but is in no sense production-ready.
Here's a code sample from the Rust Language FAQ:
Rust code sample
Here's a list of features from the Language FAQ:
Safety oriented:
  • Memory safe. No null pointers, wild pointers, etc. Automatic storage management.
  • Mutability control. Immutable by default. No shared mutable state across tasks.
  • Dynamic execution safety: task failure / unwinding, trapping, logging. RAII / dtors.
  • Typestate system: ability to define complex invariants that hold over data structures.

Concurrency and efficiency oriented:
  • Explicit memory control. Layout and allocation control. Interior / value types.
  • Very lightweight tasks (coroutines). Cheap to spawn thousands-to-millions.
  • Stack iterators (effectively lambda-blocks w/o heap allocation).
  • Static, native compilation. Emits ELF / PE / Mach-o files.
  • Direct and simple interface to C code (switch stacks and call, ~8 insns).

Practicality oriented:
  • Multi-paradigm. pure-functional, concurrent-actor, imperative-procedural, OO.
  • First class functions with bindings.
  • Structurally-typed objects (no nominal types or type hierarchy).
  • Multi-platform. Developed on Windows, Linux, OSX.
  • UTF8 strings, assortment of machine-level types.
  • Works with existing native toolchains. GDB / Valgrind / Shark / etc.
  • Practical rule-breaking: can break safety rules, if explicit about where and how

No comments:

Post a Comment