Would there be any interest in converting Less to Rust (or other language?) #3723
Replies: 4 comments 7 replies
-
If browser usage is not abandoned... why not? But then, it would probably be hard to maintain 2 code bases (i.e. JS + Rust). |
Beta Was this translation helpful? Give feedback.
-
There are currently fewer project maintainers, and if switch to another language with fewer users, there will be fewer maintainers and more problems will be difficult to fix,more new features are also difficult to keep up with. |
Beta Was this translation helpful? Give feedback.
-
Although I'm more of a C/C++ programmer than a Rust one, I still do know some Rust and think I can help contribute. I wonder if we could write the whole compiler ourselves without any external libraries, even though that seems extremely inefficient. It would be a long road to completely replacing the JS Less, but since other JS project have already started to use Rust (such as Next.js), the transition should be feasible. I will start trying to contribute to the Rust repo you have linked in your original post. |
Beta Was this translation helpful? Give feedback.
-
I perfer maintain a pure JavaScript(TypeScript) project |
Beta Was this translation helpful? Give feedback.
-
There has been a lot of great examples of tools in the JavaScript ecosystem being converted to (or built in) Rust / WASM for tremendous speed improvements, such as SWC. I personally feel that Rust is probably going to become more and more of the "web" workflow, and probably more of the Node.js workflow as well, although it has a steep learning curve.
A Rust-based Less compiler would, in theory, be extremely fast with low overhead. And it would actually make Less more viable in browser-based compiling scenarios. (Again, in theory.) I started tinkering with a Rust / WASM setup here, using Pest as the basis of the Less grammar, although I ran into some issues with Pest. (I'm not sure that Pest is the right solution, since no one has commented on that issue, which is a shame because it would make the grammar very self-documenting. There are a few parsers / parsing tools in the Rust ecosystem, and I think someone would need to dive into pros and cons.)
The hitch to all of this is: I don't really have time to work on this personally, BUT I could certainly help steer planning, features, testing, alignment with Less.js, etc. It's a big undertaking, and would probably need more than one interested developer.
I think the first step is assessing interest. Also, if someone would have objections to a future version of Less being written in Rust, this would also be a good place to mention that and why.
Beta Was this translation helpful? Give feedback.
All reactions