cmacro
cargo-expand
cmacro | cargo-expand | |
---|---|---|
4 | 16 | |
876 | 2,435 | |
- | - | |
4.9 | 9.0 | |
3 months ago | 13 days ago | |
Common Lisp | Rust | |
- | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cmacro
- Advanced Metaprogramming in C: A select statement
- Cmacro: Lisp Macros for C
-
Syntatic Sugar that compiles to C
even more interesting are the handful of projects layering lisp style macros on top of C. i've seen several go by over the years; a quick google search brought up c-mera and cmacro.
-
Show HN: C programming language extension: Cedro pre-processor
To implement something like linear types[1] in C, such that each instance of type_t must be used once and only once. But I imagine this would require too much integration with the type system and code analysis.
I wish binary inclusion was provided by more languages or build systems. For small files it's a very suitable alternative to the difficulties of packaging resources when distributing an application or library.
[0]: https://github.com/eudoxia0/cmacro
[1]: https://en.wikipedia.org/wiki/Substructural_type_system#Line...
cargo-expand
-
What is Rust doing behind the scenes?
It's been superseded by https://github.com/dtolnay/cargo-expand
-
Why dereferencing coercion is not used here?
Try installing cargo expand, it's useful to see how macros eventually get expanded. For example, if you run cargo expand on the following code
-
Procedural Macros are really hard to understand
You can use cargo expand to see what your code expands to: https://github.com/dtolnay/cargo-expand
-
[blog] Rust should own its debugger experience
Not too familiar with macros but does cargo-expand do what you want or did you mean something else?
-
Help me understand the borrowing and moving variable concept!
Yes. You can use Tools > Expand Macro on the playground or install and run cargo-expand to see what the macro expands to. It just adds a & before the argument.
- Advanced Metaprogramming in C: A select statement
-
How does declaring variables in macros work
cargo expand
-
How to see macro's source code in crate?
Along with what others are saying, there is also cargo expand which can show you what code a macro generates
-
How does Rust Python ffi work?
Something that may help you understand code with magic proc macros is this utility. It's basically a wrapper around a Rust compiler flag that allows you to expand macros for a file.
-
How does libtest know which functions are marked with #[test]?
You can use https://github.com/dtolnay/cargo-expand to examine how it works.
What are some alternatives?
ltools - LTools are a set of free, open-source productivity command-line tools (drawing inspiration from Unix commands and philosophy).
saito-rust - A high-performance (reference) implementation of Saito in Rust
elpp - --- IN ATTIC BECAUSE: no feature
proc-macro-workshop - Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]
lisp-preprocessor - Common lisp embedded template engine
lol-html - Low output latency streaming HTML parser/rewriter with CSS selector-based API
C-headers
rust - Empowering everyone to build reliable and efficient software.
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
quote - Rust quasi-quoting
MyDef - Programming in the next paradigm -- your way
cargo-llvm-cov - Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).