💾 Archived View for yujiri.xyz › software › my-ideal-lang.gmi captured on 2024-07-09 at 00:08:42. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2023-09-08)
➡️ Next capture (2024-08-18)
-=-=-=-=-=-=-
yujiri.xyz
Software
What I want in a programming language
written 2023-04-04
Broad strokes
Interpretation is a sin
- No garbage collection. I want it to have some sort of compile-time memory management system like Rust, but I'm open to innovation on the specifics, and also could settle for manual memory management if there are tools to make it easier, like Zig.
Type system
Essentials:
- Tagged unions or sum types
- Static arrays (as in Rust)
- A static polymorphism system like Rust's traits or Zig's opt-in duck typing
Ideally also, in order of importance:
- A dynamic polymorphism system like Rust's trait objects
- Binary operators on custom types (like +, - on 2D coordinates)
- Negative indexing (as in Python)
Errors
I want errors to work like a combination of Rust and Zig:
- I want the `orelse` and `catch` keywords (Zig)
- I want it to be easy to use different error types together (Zig)
- I want errors to be able to carry information (Rust)
- I want to reuse the concept of sum types instead of making optionals and error unions language-level features (Rust)
Tooling
- Documentation generator that allows command-line viewing like Go.
- Built-in formatter, or if not, a good third-party one that's popular enough to be considered the standard style of the language. I also want its style to be reasonable, unlike rustfmt. I want me to be in charge of deciding when to break a line.
Metaprogramming
I want something to overcome the limits of static typing. My favorite solution so far is Zig's, which lets you get information about types with `@typeInfo` and manipulate them with ordinary code executed at compile-time.