Rust Icon

Rust

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

Command line interface github.com

fselect – find files with SQL-like queries

This doesn’t aim to entirely replace find and ls, but if you already know SQL (like many of us do), why not be able to leverage that knowledge for your more advanced file-finding needs? Here’s a couple of examples so you get the idea:

Find temporary or config files (full path and size):

fselect size, path from /home/user where name = '*.cfg' or name = '*.tmp'

Use aggregate functions:

fselect "MIN(size), MAX(size), AVG(size), SUM(size), COUNT(*) from /home/user/Downloads"

Find by date and time intervals:

fselect path from /home/user where modified gte 2017-05-01

Command line interface github.com

A tool for generating regular expressions from user-provided test cases

grex is a library as well as a command-line utility that is meant to simplify the often complicated and tedious task of creating regular expressions. It does so by automatically generating a single regular expression from user-provided test cases. The resulting expression is guaranteed to match the test cases which it was generated from.

Unfortunately, the tool’s authors still think you need learn how to write regexes, even when grex works flawlessly (and I tend to agree with them).

Rust github.com

A fast static site generator in a single binary with everything built-in

Lots to like here:

Zola comes as a single executable with Sass compilation, syntax highlighting, table of contents and many other features that traditionally require setting up a dev environment or adding some JavaScript libraries to your site.

And here:

The average site will be generated in less than a second, including Sass compilation and syntax highlighting.

I’d love to see some build time benchmarks on a site with many pages.

Google Icon Google

Google is funding rewrites of critical OSS projects in memory-safe languages

Dan Lorenc, from Google’s Infrastructure Security Team:

Software written in unsafe languages often contains hard-to-catch bugs that can result in severe security vulnerabilities, and we take these issues seriously at Google. That’s why we’re expanding our collaboration with the Internet Security Research Group to support the reimplementation of critical open-source software in memory-safe languages.

Notice he said “expanding our collaboration”, which must mean they’ve been doing this for a bit, but I wasn’t aware of the effort? An uplifting trend, regardless. Work is well underway:

The new Rust-based HTTP and TLS backends for curl and now this new TLS library for Apache httpd are an important starting point in this overall effort. These codebases sit at the gateway to the internet and their security is critical in the protection of data for millions of users worldwide.

Ashley Willams foundation.rust-lang.org

Rust Foundation, "Hello World!"

Stoked for the Rust community!

Today, on behalf of the Rust Core team, I’m excited to announce the Rust Foundation, a new independent non-profit organization to steward the Rust programming language and ecosystem, with a unique focus on supporting the set of maintainers that govern and develop the project.

Also, Mozilla has “transferred all trademark and infrastructure assets, including the crates.io package registry,” to the Rust Foundation.

Hardware github.com

Turn your Kindle into a HUD for every day life

David Hamp-Gonsalves created a really cool use for your old Kindle:

Second hand Kindles are waiting in drawers for someone to repurpose them into something great. Boasting large e-ink screens, wifi connectivity and ARM processors they are an amazing hacking platform.

In my case I created an information panel summarizing my day such as my calendar, surf and weather forecast, garbage schedule, school closures, etc. My favorite part is that any extra space is filled with a random Pokémon sprite which my kids(not me) like to come check in on.

Built with Rust plus some serverless backend data collection bits.

Turn your Kindle into a HUD for every day life

WebAssembly github.com

Impossibly fast web search (made for static sites)

Stork is two things. First, it’s an indexer: it indexes your loosely-structured content and creates a file that you can upload to your web server. Second, it’s a JavaScript + WebAssembly frontend for that index file: Stork will hook into an <input> on your web page, download the index you’ve specified, and display the best search results immediately to your user, as they type. The precomputed index and WebAssembly frontend module make the entire Stork engine very good, and very fast.

Impossibly fast web search (made for static sites)

Command line interface github.com

Crush – a command line shell that is also a modern programming language

Crush is an attempt to make a traditional command line shell that is also a modern programming language. It has the features one would expect from a modern programming language like a type system, closures and lexical scoping, but with a syntax geared toward both batch and interactive shell usage.

Check out the overview of features right here.

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.

0:00 / 0:00