From 098fb8515e8ab883328562398778dd4960d752cf Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Mon, 28 Oct 2024 23:50:52 -0700 Subject: [PATCH] chore: begin design doc --- doc/design.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doc/design.md diff --git a/doc/design.md b/doc/design.md new file mode 100644 index 0000000000000000000000000000000000000000..3a54adfa37976adbe4e679838ea44ea62a0a406e --- /dev/null +++ b/doc/design.md @@ -0,0 +1,38 @@ +# Design + +The largest pain point of using other languages is that they are slow to +compile, especially at scale. A core belief is that the less time a developer +waits, the more productive they can be. The obvious solution for this is to +reduce what happens during re-compilation, which is what Ix's incremental +compilation model has been fundamentally designed for. Unlike with JavaScript, +Ix starts on a fresh canvas that a perfect system can be built on. + +This document assumes one already read the language manual document, and will +build on top of it to justify all of the design choices taken to provide an easy +to use language with a performant compiler. + +## Motivations + +- How easy it is to write web applications with HTML, CSS, and JavaScript +- Result location semantics, decl literals, and `comptime` from Zig being + productive tools that have led to more concise code. +- Rust `enum`s and `match` being very powerful and expressive. +- The desire for a compiler and LSP that never slows down, unlike `tsc` +- The lack of exploration in how debugging applications can be made better + +## Garbage Collection and JavaScript as a compilation target + +Ix intentionally includes automatic memory management via garbage collected +reference types. This was chosen as manual memory management is already explored +and executed better in the Zig language than what Ix could achieve. + +## Macros + +Macros are unambiguously hard to read, write. By definition, they make all code +harder to understand and maintain. Ix will never implement macros. + +## Configuration + +It is important that configuration is kept to a minimum. Teams shouldn't argue +on linting and formatting rules, libraries shouldn't conflict due to flags, and +code shouldn't look unfamiliar. -- 2.54.0