Rust Icon

Rust

Rust is a systems programming language created by Mozilla.
92 Stories
All Topics

Rust blog.servo.org

Servo’s new home

The Servo Project is excited to announce that it has found a new home with the Linux Foundation. Servo was incubated inside Mozilla, and served as the proof that important web components such as CSS and rendering could be implemented in Rust, with all its safety, concurrency and speed. Now it’s time for Servo to leave the nest!

The project’s governance has also changed. It now has a board and a TSC (technical steering committee). They’ve also set up their community/chat on Zulip, which is new to me and looks… interesting.

Rust github.com

An independent Rust text editor that runs in your terminal

Ox is a code editor. It was written in Rust using ANSI escape sequences. It assists developers with programming by providing several tools to speed up and make programming easier and a refreshing alternative to heavily bloated and resource hungry editors such as VS Code and JetBrains. Ox is lightweight so it can be used on older computers.

Bear in mind, this is a personal project and is nowhere near ready to replace your existing tools just yet.

Ox is stealing good ideas from existing editors and provides a rundown of what that means in the README. It works on Linux, macOS, and Windows via WSL.

An independent Rust text editor that runs in your terminal

Rust github.com

binserve – a fast static web server in a single binary

This web server for static assets is “blazing fast” and executable with a single binary, but what excites me about it is the simplistic, singular config file: binserve.json

{
  "directory_listing": false,
  "enable_logging": true,
  "error_pages": {
    "404": "404.html"
  },
  "follow_symlinks": false,
  "routes": {
    "/": "index.html",
    "/example": "example.html"
  },
  "server": {
    "host": "127.0.0.1",
    "port": 1337
  },
  "static_directory": "static",
  "template_variables": {
    "load_static": "/static/",
    "name": "Binserve"
  }
}

Elixir simplabs.com

Writing Rust NIFs for Elixir with Rustler

A Native Implemented Function is implemented in C (or Rust when using Rustler) and can be called from Elixir or Erlang just like any other function. It’s the simplest and fastest way to run native code from Erlang but it does come with a caveat: a crash in a NIF can bring down the whole BEAM. This makes Rust a safer option than C for implementing NIFs as its type system and ownership model guarantee memory and thread-safety.

Rust blog.rust-lang.org

Laying the foundation for Rust's future

The Rust core team has addressed the concerns raised by the significant changes at Mozilla.

On Tuesday, August 11th 2020, Mozilla announced their decision to restructure the company and to lay off around 250 people, including folks who are active members of the Rust project and the Rust community. Understandably, these layoffs have generated a lot of uncertainty and confusion about the impact on the Rust project itself. Our goal in this post is to address those concerns. We’ve also got a big announcement to make, so read on!

Git github.com

A pure Rust implementation of Git with a CLI

gix is a command-line interface (CLI) to access git repositories. It’s written to optimize the
user-experience, and perform as good or better than the canonical implementation.

Furthermore it provides an easy and safe to use API in the form of various small crates for implementing your own tools in a breeze.

The author describes this as “idiomatic, modern, lean, fast, safe, & pure” but that was too many superlatives to put in the headline. It does look nice, though. I dig the libraries + CLI that leverages them approach. Demo video on Asciinema.

Gaming github.com

A "refreshingly simple" data-driven game engine built in Rust

Bevy has the following design goals:

  • Capable: Offer a complete 2D and 3D feature set
  • Simple: Easy for newbies to pick up, but infinitely flexible for power users
  • Data Focused: Data-oriented architecture using the Entity Component System paradigm
  • Modular: Use only what you need. Replace what you don’t like
  • Fast: App logic should run quickly, and when possible, in parallel
  • Productive: Changes should compile quickly … waiting isn’t fun

Before you get too excited, a word of warning 🚨

Bevy is still in the very early stages of development. APIs can and will change (now is the time to make suggestions!). Important features are missing. Documentation is sparse. Please don’t build any serious projects in Bevy unless you are prepared to be broken by api changes constantly.

Sheshbabu Chinnakonda sheshbabu.com

Rust for JavaScript developers (functions and control flow)

This is part 3 of a three part series from Sheshbabu Chinnakonda introducing the Rust language to JavaScript developers — this one is focused on functions and control flow.

When Shesh kicked off this series he said, “I find it easier to understand something new if it was explained in terms of something I already know. I thought there might be others like me.”

BTW, here are links to the others from this series:

Joab Jackson The New Stack

Microsoft gradually switching to Rust to build its infrastructure software

No matter how much investment software companies may put into tooling and training their developers, “C++, at its core, is not a safe language,” said Ryan Levick, Microsoft cloud developer advocate, during the AllThingsOpen virtual conference last month, explaining, in a virtual talk, why Microsoft is gradually switching to Rust to build its infrastructure software, away from C/C++. And it is encouraging other software industry giants to consider the same.

This sounds SO familiar, as heard from Josh Aas recently on The Changelog (listen here).

We certainly should not be writing any new code in C and C++. The opportunity for vulnerabilities – I mean, it absolutely will have vulnerabilities, and we need to get that type of code away from our networks to start with, and then probably away from most other things, too… So I would hope that in 10-20 years we think it’s crazy to be deploying major (or maybe even minor) pieces of software that are written in languages that are not memory-safe.

So we’re trying to remove code written in C and C++ from our infrastructure at Let’s Encrypt. I think that’s just a basic part of diligence applied to secure infrastructure. If your stack is some giant pile of C++ or C at the network edge, followed by OpenSSL written in C, followed by a Linux kernel written in C, glibc - your whole pathway has got all this code that you just know is full of security holes. It absolutely is. You just can’t claim that those are even close to secure systems. They’re absolutely not. We’re gonna look back on this and say “That was crazy. We have better options today.”

Rust github.com

A tiny, full-text search engine for static sites built with Rust and WASM

A Rust/WASM port of the Python code from the article “Writing a full-text search engine using Bloom filters”. This can be seen as an alternative to lunr.js and elasticlunr.

The idea is to generate a small, self-contained WASM module from a list of articles on your website and ship it to browsers. tinysearch can be integrated into the build process of generators like Jekyll, Hugo, zola, or Cobalt.

Kick the tires on the author’s blog.

NGINX github.com

top for nginx (re-written in Rust)

This tool is a rewrite of ngxtop to make it more easily installed and hopefully quicker. For those unfamiliar with the ngxtop, it is a tool that helps you parse NGINX access logs and print various statistics from them regardless of format. It is currently not feature complete with the original version but it should have enough functionality to be usable.

If you already have Rust installed you can cargo install topngx and you’re off to the races.

topngx < /path/to/access.log

# Output:
count  avg_bytes_sent  2XX  3XX  4XX  5XX
2      346.5           2    0    0    0
request_path              count  avg_bytes_sent  2XX  3XX  4XX  5XX
GET / HTTP/1.1            1      612             1    0    0    0
GET /some_file1 HTTP/1.1  1      81              1    0    0    0

Rust github.com

A guide to writing a DNS Server from scratch in Rust

With the combined goal of gaining a deep understanding of DNS, of doing something interesting with Rust, and of scratching some of my own itches, I originally set out to implement my own DNS server. This document is not a truthful chronicle of that journey, but rather an idealized version of it, without all the detours I ended up taking. We’ll gradually implement a full DNS server, starting from first principles.

5 Chapters short.

Rust blog.rust-lang.org

Five years of Rust

This year marks five years of Rust. On the Rust blog they reflect back on all the major changes since 1.0.

Rust has changed a lot these past five years, so we wanted to reflect back on all of our contributors’ work since the stabilization of the language.

When Rust turned 1.0 you could count the number of companies that were using it in production on one hand. Today, it is being used by hundreds of tech companies with some of the largest tech companies such as Apple, Amazon, Dropbox, Facebook, Google, and Microsoft choosing to use Rust for its performance, reliability, and productivity in their projects.

Christian Scott christianfscott.com

Making Rust as fast as Go (fake news)

Is this more proof of Cunningham’s law, which says, “The best way to get the right answer on the Internet is not to ask a question; it’s to post the wrong answer.”

Update: as some keen HN commenters have pointed out, it looks like the rust program is not actually equivalent to the go program. The go program parses the string once, while the rust program parses it repeatedly inside every loop. It’s quite late in Sydney as I write this so I’m not up for a fix right now, but this post is probably Fake News.

Read Christian’s post then have fun in the comments and discussions on HN and Reddit analyzing his hypothesis, which includes a repo of code to backup his ideas.

0:00 / 0:00