It's time to ditch Medium for good! 🌈⚡️

Introducing Devblog by Hashnode. Blog on your domain for FREE. Highly customizable and optimized for developers.

Learn more

Ask anything to Rust Language Team

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Featuring

  • zero-cost abstractions

  • move semantics

  • guaranteed memory safety

  • threads without data races

  • trait-based generics

  • pattern matching

  • type inference

  • minimal runtime

  • efficient C bindings

    Ask Rust Language Team about:

  • Getting started with Rust

  • Contributing to Rust

  • Migrating to Rust

  • Performance questions

  • Future plans

  • OSS

  • General Advice

Hosted by:


Hey y'all! A subset of the Rust core team is now here and we'll be answering from our personal perspectives. Keep the questions coming!

EDIT: And we're done! Thanks for the great questions, everyone! This was a lot of fun.

Ask a Question

158 discussions

Complex constraints and code abstractions can be handled in different ways, including with advanced type systems including higher-kinded types (as in Haskell and Scala) or by including advanced code-generation capabilities (as in C++ templates and Scheme macros). Both come with drawbacks, however (large learning curve and difficulty in figuring out where behavior is coming from, respectively).

Other languages (e.g. Go) eschew such features. This makes programming feel simple; simple tasks are simple to understand, and you handle complexity face-to-face (manually--the compiler doesn't help you).

Rust already has a sophisticated type system (especially if lifespans are counted), a robust macro system, and plans are underway to add to both capacities. What is the ideal end-goal? Is there a balance to be had between language simplicity and language expressivity? When should the type system carry the burden of taming complexity and when should metaprogramming (macros)?

These questions really strike right at the heart of language design philosophy! Here's my perspective.

In Rust, we try not to be too dogmatic about attributes like "simplicity", "expressivity", and so on. Instead, we're driven as much as possible by use-cases and programmer experience. So, taking higher-kinded types as an example: we've so far avoided adding them, waiting for strong demand and clear use-cases to emerge. While we now have a design that touches on HKT, we're also taking the most simple-minded approach we can that solves real-world use-cases.

This year, we've been really focused on reducing the learning curve, and increasing productivity around Rust. To do that, we've found ways to simplify or clarify existing features that benefit new and existing users alike. In some cases, this means using the information the compiler already has to avoid the need for you to jump through extra hoops. We've done this work with utmost care, ensuring that these improvements don't involve hidden complexities that you have to grapple with eventually. You can read more about the effort here.

The question of expressivity via macros vs the core language is an interesting one. To some degree, we see macros as a way of prototyping things that might become core features eventually; we're developing our async/await story this way.

While Rust libraries definitely do employ macros to do some pretty spectacular things, there are also some particularly common ways to use macros that don't feel so mysterious -- like automatically implementing traits for a particular struct. In my experience, as a client of these macros, I virtually never need to know anything about their implementation.

Reply to this…

Share your programming knowledge and learn from the best developers on Hashnode

Get started

What RFC or other language feature are you most excited about in Rust?

Show all replies

After custom derive landed in 1.15, I lost my good answer to this question ;)

I'd say the default binding modes in matches, non-lexical lifetimes, and impl trait. The first one is something I run into all the time, the latter are things others run into all the time.

Reply to this…

Are there any plans for any sort of official (or at least standard) GUI solution in rust?

Show all replies

No plans now. One of our driving philosophies is that we truly want the language and the standard library to be stable in order to make it easy for users to upgrade when we release every 6 weeks (known as the train model). The consequence of this is that we are promising to support that anything added to the standard library. If we followed Python's "batteries included" philosophy, those libraries would be quick to atrophy as we learn better ways to implement things.

So instead we developed Cargo to make it as easy as possible to depend on external resources. There are a few projects trying to make GUIs easy to use with Rust, which you can see on Awesome Rust. I believe the most advanced integration is with GTK, but I don't have much experience in this space, so I could be wrong.

Reply to this…

Explain like I'm 5: Why would I want to use Rust rather than C? Give as many reasons as you can.

Well, not having to start your project by writing a hashtable is certainly a plus. ;)

In general, I'd say that everything we said about C++17 also applies here, but even more so -- e.g., C lacks generics, which means that you either have to write code that uses void* as a stand-in for "some type" (forcing you to use pointers), or else write complex macros or python scripts that generate different copies of your types (been there), or... well, that's kind of it.

Reply to this…

Do you think every security related C code should be rewritten in Rust to prevent vulnerabilities like Heartbleed in the future? And are there already any plans of famous projects to do this?

Show all replies

Another great security project that's starting to integrate Rust is Tor. They talk about the branch here.

Reply to this…

Load more responses