|
You are here |
vannevel.net | ||
| | | | |
blog.asleson.org
|
|
| | | | | The ability to write a C shared library in rust has been around for some time and there is quite a bit of information about the subject available. Some examples: Exposing C and Rust APIs: some thoughts from librsvg Creating C/C++ APIs in Rust (site removed?) Rust Out Your C by Carol (Nichols || Goulding) (youtube video) Exporting a GObject C API from Rust code and using it from C, Python, JavaScript and others Rust Once, Run Everywhere All this information is great, but what I was looking for was a simpl... | |
| | | | |
nora.codes
|
|
| | | | | ||
| | | | |
mbuffett.com
|
|
| | | | | Recently I've been working on a project to surface census data via a GraphQL API, mostly as a way to learn GraphQL. I did end up learning GraphQL, but I also ended up learning a lot about proc macros. I was using Juniper, which creates a GraphQL schema using structs like this: #[derive(GraphQLObject, Copy, Clone, Debug)] struct Demographics { female: Option, male: Option, } The problem, is that the census data I was looking to surface had way too many variables, I would have had to write out 207 structs, with a total of 352 fields. Here's a nice tree-view of the census data, courtesy of the frangipanni tool. Obviously, I didn't want to write out all these structs and fields by hand, even with some fancy vim macros that would have been too much tedious work f... | |
| | | | |
developerlife.com
|
|
| | | Procedural macros are a way for you to extend the Rust compiler and provide plugins that you can use to extend the language. They allow you to reduce the need to write manual boilerplate code, and even allow you to create your own DSL (domain specific language). This article goes into the details of creating the 3 kinds of procedural macros in Rust. | ||