hackeryarn

4 posts tagged: Rust

Fast Python with Rust: a data-oriented approach

By applying data-oriented design patterns in Rust, we can build a use case specific Python library that outperforms even NumPy. This article lays out the bottlenecks and architectural shifts needed to achieve this level of performance.

· 11 minutes

Let's write a macro in Rust - Part 3

In the last part we covered all the fundamental techniques in writing macros. This enables us to write just about any macro we could think of, but knowing a few tricks can make the process much easier. In this part, we will build on our where clause from the previous article. In the process we will allow the where clause to support multiple comparison operator (instead of just =) as well as multiple ways to join those operators (instead of just and).

· 5 minutes

Let's write a macro in Rust - Part 2

In the last part we covered the very basics of macros and implemented a single argument query select. This was a good start, but only scratched the surface of what macros can do. In this part we will implement multi-field select and a basic where clause. That will make our query macro far more useful.

· 5 minutes

Let's write a macro in Rust - Part 1

Macros are required to do some very helpful things in Rust, but this isn't an article about any of those things. I became enamored with macros many years ago when I read Practical Common Lisp and saw the implementation of a SQL DSL that works with built in data structures. The whole implementation took less than a screen of code and absolutely blew away my expectations of what it took to create DSLs.

· 6 minutes