What's everyone working on this week (10/2016)?


New week, new Rust. What are you folks up to?


Ranting, plotting and some coding.

I played around with porting Rails ActiveSupport::SafeBuffer over to Rust. For those that don’t know: SafeBuffer is a Buffer which you can transparently concatenate Strings to, which are automatically escaped during the process, unless they have been explicitly marked as “safe” before. This reverses the most common problem with XSS: the need to blacklist all strings that are unsafe.

What's everyone working on this week (9/2016)?

(Posted in the wrong week thread :slight_smile: )

Finally got the first release of my Elasticsearch client on crates.io

Now working on an idea for the type mapping that involves a bit of gymnastics with generics. The idea is to define your Elasticsearch mapping using Rust’s type system. An example for the date type. Once the design is sorted I’ll work on making it easier to derive for end-users.


Fitting: Elasticsearch doesn’t always reliably count, too :).


Working a bit more on some libtls bindings (github - crate - docs).
I’ve published this crate a while back, but what I really wanted was an
easy(er) way to use TLS in mio, it seems to be working (not in windows
though, due to the need for RawSocket). Also trying to figure out some
ways to clean up the API a bit.

[quote=“KodrAus, post:3, topic:4879”]
(Posted in the wrong week thread :slight_smile: )

Actually so did I, thanks @skade for kicking me into the right week.


I published a microcrate asprim “Cast any primitive numeric type to any other using as with the AsPrim trait.”

I’m not entirely sure what needs to be done with the inconvenient state of generics for numerics. I’m starting with publishing a crate that simply gives generic access to the as operator as it works in the base language itself (no checking, no error cases). I didn’t find this anywhere else.


Continuing work on building a safe, idiomatic wrapper around OpenGL (example of current progress). It’s proving to be good experience to slowly go through OpenGL and figure out what its idioms are and how they interact with Rust’s idioms.


I published New Rustacean e011: Once Upon a Type, in which I talk about type systems in general and Rust’s in particular. Lots of fun. (Possibly a few mistakes, though I tried to get it right—I’m new to type theory!)


Beginning to work on a Jade parser/renderer for Rust. It’s such a nice templating language, I wanted to use it in Rust! But I can’t find an actual spec for it, so I’m reading docs, playing with a reference implementation, and trying to write up my understanding of how it’s supposed to handle the weird edge cases.


My Rust and Swift series continues:

(Side note: this is a fascinating area where the two languages let you do similar things but approach it in very different ways.)


Banging my head against a rusty wall.


Writing an assembler for fun and to get some experience with nom.

Very early days, concentrating on parsing at the moment. Current progress is here.


Writing a simple-as-possible entity-component system in Rust, because all the current solutions are unmaintained and/or way too complex for my use-case. I’ve got a heavy focus on type shenanigans, because entity-component systems are heavy on downcasting by their nature so I’ve got some trait gymnastics to allow better static typing, so you can define a system with an associated type like this

struct Test;
struct DoSomethingSystem;
impl<'a> System<'a> for DoSomethingSystem {
    type Input = (&'static u32, &'static Test);
    type Output = u32;

    fn update(
        &mut self,
        entities: Vec<(EntityId, (&u32, &Test))>
    ) -> Vec<(EntityId, u32)> {
            .map(|(e, (i, _))| (e, i + 1))

and it “just works” and passes the values from the EntityStore without having to implement anything for u32 or Test. Rust’s type system is so wacky.