From bf69122559590d993d91ff663dcbb3705ba8be7c Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Fri, 26 Jul 2024 04:02:14 +0000 Subject: [PATCH] Update Coding environment --- Coding-environment.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Coding-environment.md b/Coding-environment.md index 529361b..86e149c 100644 --- a/Coding-environment.md +++ b/Coding-environment.md @@ -89,4 +89,5 @@ The gist of the most significant argument for the upper version is that one read - ⇓⇓ Big con: we would have to implement this! (but it is probably less work than for C++ since the syntax is much simpler/cleaner; i.e., we could probably actually base it on a proper parser, like civet does, rather than by local string transforms, which is the only way I could think of to do unmangled C++) - If we decide to bite the bullet and implement our own unmangling, is Rust enough better than the far more mature C++ with vast legions of existing packages to make it worth doing this for Rust rather than C++? - There's at least one linear algebra library—[nalgebra](https://www.nalgebra.org/)—that's explicitly designed to support WASM builds. - - Large, active, and growing user community. \ No newline at end of file + - Large, active, and growing user community. + - One way to build a syntax crufter/decrufter would be to have a parser that starts basically just like the Rust parser, and then modify it to accept the syntax we prefer. The official state of Rust grammar is sad, in that there was an accepted RFC#1331 to create an official grammar, which led to the grammar working group, which was disbanded in 2024 Apr. So it is not at all clear what the state is. On the other hand, there are at least three (lively) parsers out there other than the official rust compiler, namely rust-analyzer, which is the basis for the "official" Rust LSP used by VSCode etc; syn, a library within Rust used for writing macros; and the Intellij Rust plugin, which includes a BNF grammar for Rust (so possibly the best for our purposes?). I would likely start from one of these sources in trying to generate the parser for Crust (or whatever we'd call the decrufted Rust, maybe CLR -- the name of a popular rust remover ;-). \ No newline at end of file