DEV Community

Andrew Lucker
Andrew Lucker

Posted on • Updated on

Why I am learning Rust now

From its inception, I have always been vaguely aware of this new language called Rust. It has been developed up to this point, mainly by and for the Systems Programming community. Some say that it will replace C.

For me, I am no hardliner, and will accept that the old gods will continue to exist, prosper, and torment their followers. Though, thankfully, I have never been tied to these larger communities. I grew up with Forth, Prolog, SML , Haskell, and some C when in need of an escape from the walled gardens.
Before learning Rust, I had viewed it with apprehension: due to a lack of sane functional programming. Even today, after several months of attunement, I fear that multithreading is much higher on the list of priorities compared to anything that smells like old books.

This is precisely why I am hopeful for the future of FP in Rust. Traditionally there has been a rift between academic and practiced programming. The Ivory tower has always held the “good answers while everyone else just uses the “bad workarounds”. Rust can change this.

The type system in Rust, with all of its obsession with object lifetimes, has created something so paranoid, that it almost resembles the Calculus of Constructions. This is the next best thing that a Programming Theory practitioner could ask for next to a Lambda. Currently lambdas/closures in Rust are very scary things: you can use an FnMut or a closure and “move to copy all of the scoped variables. This contextual information forms the environment of the CoC logic. All that is necessary now would be a formalization of Rust's type system and then we would have a language that can be formally manipulated.

There are a few other things that Rust incorporates that have a history in published journals of Functional Programming. Rust Exception Handling is exceptional in the respect that it does not require a specific stack structure or long jumps into distant code paths. All of the basic categorical operations have been implemented. I have started to suspect that Rust will become a darling language, until I keep programming in it and get the bad taste in my mouth.

From all that I can gather from the state of the language. One, the language community is growing. Two, the language maintainers are open to experimentation. Three, there is a growing area of common structure linking Rust to the PLT community. When more people get to influence the direction of a language, as a linguist, I believe that it creates a better end product, or at least it smooths down the rough edges; and that is what Rust needs right now the most: a good polishing.

My Rust escapades are available open source on Github.

– Student

Top comments (0)