Lipstick: a Rust-like syntax frontend for C

This occurred to me while trying to find a way of "turning off the borrow checker". For purely pedagogical reasons, I've wondered many times how I could compile and run a piece of "normal"-looking Rust code that foregoes ownership rules, so I could vividly demonstrate why they exist.

A lateral approach to this is lipstick: it takes a subset of Rust syntax and transpiles it to C. This is just a very toy-level, unsophisticated syntax frontend, but I think it's neat enough to show around.

:point_right: lipstick playground :point_left:

code on github

8 Likes

Neat! I don't have a present use for this myself but I like the idea.

I realize generated code can always be expected to look awful, but running it through indent or clang-format would go a long way.

Type inference?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.