-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update reasons-for-rewriting-in-rust.md
- Loading branch information
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
## Reasons for rewriting Insect in Rust: | ||
## Reasons why I rewrote Insect in Rust: | ||
|
||
- Rust is much more popular amongst developers => more possible contributors | ||
- A redesign from scratch would allow me to focus on areas of improvement: | ||
- Introducing the concept of physical *dimensions* into the language | ||
- Experimenting with a static dimension/unit checker | ||
- Allowing user-defined units => move all of the unit definitions to the language | ||
- Better parser errors | ||
- Automated tracking of significant digits | ||
- Support for rational numbers? Complex numbers? Intervals? | ||
- Support for binary and hexadecimal numbers, bitwise operators, etc | ||
- Insect is written in PureScript, which is a niche programming language with a (fantastic but) small community. Rust is much more popular amongst developers, so | ||
it is much easier to find contributors in a Rust project than in a PureScript project. This has been an actual problem with Insect, since I got multiple comments | ||
over the years that people wanted to contribute, but couldn't. | ||
- A redesign from scratch allowed me to focus on the following areas of improvement: | ||
- Introducing the concept of physical *dimensions* into the language (see https://numbat.dev/doc/dimension-definitions.html) | ||
- Adding a static type system (see https://numbat.dev/doc/type-system.html) | ||
- Allowing users to define their own units (https://numbat.dev/doc/unit-definitions.html) | ||
- Being able to define constants and the whole unit system in the language itself (https://numbat.dev/doc/prelude.html) | ||
- Much better error messages | ||
- Support for notepad-style computations (Mathematica/Jupyter style) | ||
- The PureScript implementation is *slow*. A Rust-based parser & interpreter could be much faster. Not just | ||
- The PureScript implementation is *slow*. Numbats Rust-based parser & interpreter is orders of magnitude faster. Not just | ||
on the command-line (startup speed!) but also on the Web (via WASM) | ||
- It would be a nice playground for a WASM project | ||
- I always wanted to experiment with WASM and Numbat was a perfect excuse for this. |