{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiaun3rkz2qwydrikwbklxvfx6tyq6st5c5uyd2blrtqtfc5qzthne",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mig44kpua372"
},
"path": "/t/pre-rfc-allow-custom-syntax-parsing-for-attribute-macro-inputs/23092#post_10",
"publishedAt": "2026-03-31T21:38:50.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Dear Rust Developers and users.\n\nWhile experiencing a macro limitation inside Rust, targeting and customized and alternated language subset for domain-specific usage, I've thankfully encountered this particular page, containing a feature discussion which really would help in my case. Also, I'm feeling relieved to reach out here in time, long before the discussion function is going to be removed (due to topic closing, a year after the last post is submitted).\n\nA short prehistory: after gaining inspiration from Flutter and Jetpack Compose, I decided to create a similar GUI approach inside Rust (I have to admit Rust became the primary and only choice for a compiled low-level language half a year ago. Thanks for providing an alternative better than C++... But that's information rather to discuss inside another topic, hehe). I also won't tell more about the exact framework I'm designing; you just should know the so-called \"Compose Syntax\" slightly differs from Rust's, underlining the specific domain it's addressed to.\n\nAdditionally, I understood Egui's and ICED's notation and construction methods look too unlikely to seem attractive (I'm expressing it mildly, because those remain good frameworks for graphical applications anyways). I'm also not aiming to build an alternative to Slint (with it being more a hybrid out of Flutter and QT, carrying its own runtime and markup language).\n\nMy request finally results in a fundamental change inside the Rust Compiler, particularly the macro preprocessor, mainly containing the methods showed up here inside this discussion. Allowing custom grammar definitions would take away the problem of coding lexer, parser, updater, LSP server and different IDE extensions for highlighting errors/suggestions at design time. (Also imagine taking permanent care of these different systems, which could be more challenging than helping out). I would like to remind: my aimed language implementation JUST SLIGHTLY differs from Rust, therefore a much wiser strategy would be to adapt the evergreen built-in parser system inside Rust's own tool chain, maintained and extended by the wonderful language's development team / foundation.\n\nDear Developers and Users. Let's create such a grammar extension, in order to achieve similar goals to those other programming languages solved as well:\n\n * SwiftUI required a specific compiler modification for native parsing of the alternated syntax, recommendes for GUI design. Apple implemented it.\n * Jetpack Compose was requested by Google as a primary feature inside the Language primarily chosen for Android development: Kotlin. The Compiler was modified to fit.\n * Rust has the best macro implementation of any language so far, made for unlimited compile-time task management. I really adore such a feature, being missing or just misimplemented (like in C++) quite often. Also, it's proven not only to be limited for a single use-case like \"Compose\", but also capable of customized usage, exampled by many yet existing cargo crates.\n\n\n\nI don't believe the feature of \"custom language grammar implementation inside macros\" would badly influence the Compiler development, especially if the Rust's built-in parser/lexer/grammar is being used anyway (this time, in an extended way).\n\nRemember: this is the chance to DO IT RIGHT.\n\nI would thank all readers for insighting till the end of this message; I appreciate their (/your) patience. Also, I really hope this plea is going to be taken seriously, as it underlines the need of the discussed feature. I would love to assist realizing it, as far as I can or have power to.\n\nSincerely.",
"title": "Pre-RFC: Allow Custom Syntax Parsing for Attribute Macro Inputs"
}