What’s everyone working on this week? (Week 38, 2015)


I’m in Portugal, at RubyConf Portugal. I’m giving a talk comparing and contrasting Rust and Ruby.


Yesterday I played with making Python bindings for a Rust library: https://github.com/SimonSapin/html5ever-python

Other than binding more of this specific API, things not quite figured out include:

  • How to deal with Rust panics v.s. Python exceptions. This probably involves std::thread::catch_panic, but when to do on Err? It seems hard to get anything out of Box<Any>.
  • Strings and bytes. Make dealing with them at the boundary more convenient, and minimize the amount of copying.
  • Packaging. In theory I can ship binary “wheel” file that contain compiled native code so that end users don’t need a Rust compiler, but setuptools / distutils internals are a mess.


With my spare time this week I’m hoping to

  • fix a couple of racer issues
  • work on my prototype of racer using rustc (This is mainly to help provide input regarding the shape of future compiler ide support for the tools subteam)



One of my 2 PRs to cargo got merged, the other got some really awesome feedback on refactoring that I haven’t yet gotten back to but might this week :slight_smile: I’m also making some decent progress on my for-fun implementation of a sass compiler that I’ve been slowly picking away at-- I’m learning a lot about Cow and parsing and refactoring. Don’t get too excited about it though, it only passes 7% of the sass-spec right now :wink: I keep meaning to record some refactoring where I lean on the compiler… maybe I’ll try and do that this week :smiley: :headphones:


Probably not much more than that.


I’m making use of my rexiv2 library for photo metadata management (crates.io, github), which is built on top of the gexiv2-sys FFI bindings around gexiv2/exiv2 (crates.io, github).

In the process, I discovered a huge and terrible bug that I’d missed for months. After spending quite a lot of time isolating it and trying to put together a minimal repro case, the fantastic folks on IRC identified the error in about two minutes! Huge thanks to SpaceManiac and @bluss, with whose help I was able to land a fix!

It also motivated me to make a bunch of other improvements and fixes to these libraries. Latest versions hot off the presses on crates.io!


[quote=“felixc, post:9, topic:2857”]
In the process, I discovered a huge and terrible bug that I’d missed for months. After spending quite a lot of time isolating it and trying to put together a minimal repro case, the fantastic folks on IRC identified the error in about two minutes! Huge thanks to SpaceManiac and @bluss, with whose help I was able to land a fix!
[/quote]I invite you to try the translate infrastructure from Gtk-rs so you’ll never have to type “CString” ever again or think about wrapping GObject any more than you want to. Your project will also benefit from an increasing amount of automatic generation.

We can chat about it at gitter if you like :wink:


I’m working on an implementation of software transactional memory.
I got some first unit tests working today.


I just finished my first compiler plugin. :tada: It generates boilerplate code for an objC inspired dynamic type library I hacked together several weeks back. The plugin allows me to be lazy and write code such as this.

The dynamic library and plugin were a “small” distraction from my original side-project of trying to write a game engine from scratch. So for the rest of the week I shall continue tinkering on that.


I’m using Rust for MIT’s 6.837 Computer Graphics course. It’s my first time using Rust, so I’m still getting up to speed on the language. So far, I’ve built a simple GPU powered 3d renderer as the first assignment.

I hope to make a progressively enhancing stochastic ray tracer at some point, so I might post updates, and potentially try to contribute to Piston if something decent comes of it. I’m currently using the Glium library, but I might use my infinite free time to look writing Rust flavored GPU code (as described here) to make writing the GPU algorithms less painful.

I’m also using Sublime Text 3, so I might look into some ideas I had on for advanced syntax highlighting. I think that traversing Rusts AST could allow for some nice semantic highlighting to aid in debugging.


I published another small crate for the cargo cult: either. The Either enum has its use case when you want a one-off sum type that implements a common trait, for example having either a file or stdin, both implementing Read.

Also going to bump itertools to 0.4 this week. Just dragging my feet on writing a blog post for it…


I’m planning to release Rustful 0.5 as soon as issues #17 and #65 are fixed. Rust 1.3 is on its way with some sweet fixes, so it seems like those stupid wrapper structs around handler functions can finally be removed :tada:. It’s also time to write another post about what has changed since mid July, I think.


I’m continuing to work on project to build a debugger called rusty_trap. I’ve just completed a new blog post on this week’s work: Debuger state machine in Rust


With PySequence merged and PyMapping PR submitted, I’m going to look at getting the Buffer protocol into dgrunwald’s rust-cpython package. I think it’s a key step in getting Rust and Numpy playing together.


I made some kind of Atomic COW pointer using crossbeam.

Probably buggy. Probably a better way to achieve it. I don’t even know if it’s really useful. It was fun to do though, and it caught a bug in crossbeam so I guess it’s not completely fruitless.


I have been trying to work on a FLAC decoder in Rust.


I’m creating a VSOP87 library for Rust. VSOP87 is an algorithm that can calculate accurately planet positions in the solar system. I’d like to create something with this algorithm in the future, along with the ELP2000 algorithm.

Popular programs such as Celestia and Orbiter use this algorithm and I’m sure somebody apart from me will find it useful to create simulations / ephemeris of the planets in the sky etc.

Be sure to check it out in crates.io!


I did hack Blender’s C/C++ code to make the Cycles Render Engine export a binary file (containing triangle information) during rendering. I wrote a Rust program to read that data and used it for another renderer (in this case Radiance). Cameras are treated differently anyway, so having a view file which describes the camera to Radiance is enough to start rendering images, after making some of the triangles light emitters by defining a “light” material and using it on those triangles …

Quick hack, but fun to do :innocent:


I released version 1.1.0 of tokei. It’s a simple code counter, with only 38~ languages supported. But it’s blazingly faster than cloc. To get through a directory containing 117916 files, and ignoring all node_modules folders. tokei takes 0m1.815s while cloc takes 3m14.354s.