24 days of Rust - zeromq

ZeroMQ is a language-independent messaging solution. It's not a full-fledged system such as for example RabbitMQ, basically it's just a transport layer. From the programmer's perspective working with it doesn't differ much from ordinary sockets, but there's a lot of power hidden underneath. The zeromq crate is a native Rust implementation and while still lacking a lot of features, it is already usable today.

Continue reading »
Written on Dec. 20, 2014

24 days of Rust - rusti

A few days ago the Rust subreddit got excited about the rebirth of rusti - an interactive shell for Rust. Such interpreters (sometimes called REPLs - read-eval-print loop) are the bread and butter of dynamic languages like Lisp, Python or Ruby. But that is not a requirement - as Haskell demonstrates with its GHCi, you can have a REPL for a statically typed, compiled language too. rusti is an attempt to build such an interpreter for Rust.

Continue reading »
Written on Dec. 19, 2014

24 days of Rust - from_fn

In Rust there is no concept of a constructor as a language feature, like for example in C++. However there is a strong convention (and mentioned in the guidelines) to use a static method called new as the constructor. This works well, but you can have only one function called new in the impl - there is no method overloading. So are we out of luck if we want to have different constructors? No! But arguably different purposes should imply different method names, so another convention is to prefix extra constructors with with_ (such as Vec::with_capacity) or from_, if the constructor does some kind of a conversion.

Continue reading »
Written on Dec. 17, 2014