| ... | @@ -0,0 +1,38 @@ |
| 1 | # Design |
| 2 | |
| 3 | The largest pain point of using other languages is that they are slow to |
| 4 | compile, especially at scale. A core belief is that the less time a developer |
| 5 | waits, the more productive they can be. The obvious solution for this is to |
| 6 | reduce what happens during re-compilation, which is what Ix's incremental |
| 7 | compilation model has been fundamentally designed for. Unlike with JavaScript, |
| 8 | Ix starts on a fresh canvas that a perfect system can be built on. |
| 9 | |
| 10 | This document assumes one already read the language manual document, and will |
| 11 | build on top of it to justify all of the design choices taken to provide an easy |
| 12 | to use language with a performant compiler. |
| 13 | |
| 14 | ## Motivations |
| 15 | |
| 16 | - How easy it is to write web applications with HTML, CSS, and JavaScript |
| 17 | - Result location semantics, decl literals, and `comptime` from Zig being |
| 18 | productive tools that have led to more concise code. |
| 19 | - Rust `enum`s and `match` being very powerful and expressive. |
| 20 | - The desire for a compiler and LSP that never slows down, unlike `tsc` |
| 21 | - The lack of exploration in how debugging applications can be made better |
| 22 | |
| 23 | ## Garbage Collection and JavaScript as a compilation target |
| 24 | |
| 25 | Ix intentionally includes automatic memory management via garbage collected |
| 26 | reference types. This was chosen as manual memory management is already explored |
| 27 | and executed better in the Zig language than what Ix could achieve. |
| 28 | |
| 29 | ## Macros |
| 30 | |
| 31 | Macros are unambiguously hard to read, write. By definition, they make all code |
| 32 | harder to understand and maintain. Ix will never implement macros. |
| 33 | |
| 34 | ## Configuration |
| 35 | |
| 36 | It is important that configuration is kept to a minimum. Teams shouldn't argue |
| 37 | on linting and formatting rules, libraries shouldn't conflict due to flags, and |
| 38 | code shouldn't look unfamiliar. |