Kitty Lang is a work_in_progress programming language, basically "what if Rust was a friendly scripting language".
Kitty Lang is intended to be used as the foundation for Village Kit, a future-thinking code-as-CAD system for open source makers.
- Accessible to beginners, like Logo
- Powerful for experts, like Haskell
- Structs and traits, like Rust
- Embeddable, so can be used in web or native apps
- Language-aware, so compiler can be used as linter, formatter, language server, etc
- Even if some syntax is wrong, the compiler is able to parse the remaining correct syntax and still give useful feedback
- Debug-friendly, so you know exactly how and why something went wrong
- Evaluation-aware, so you even know where values come from
- Every value has a reference to the code span which created it
- This is important for code-as-CAD editors where you can interact with an object in 3d space and it performs a macro on the code
- Secure, so you are safe with untrusted input
- Inspired by future-thinking languages: Julia, Flix, Gleam
At the moment
- Lexer (String -> Tokens)
- Parser (Tokens -> Concrete Syntax Tree)
- Analysis (Concrete Syntax Tree -> High-level Intermediate Representation)
- Evaluator (High-level Intermediate Representation -> Value)
- ???
(Incomplete)
- Rust-like type system
- Primitives
(): Unit typeNumberString
- Compound types:
(T, U...): TupleList
- Enum types:
BooleanOptionResult
- Primitives
- Functions can be called with either positional args or keyword args
- Type generics are the same
- Functions can describe multi-arity multi-type overloads
- Only top-level declarations and expressions
- In
let, a newline is an implicitin.
- In
- Use only
whereclause to describe type trait bounds, not in generic params - Use
.instead of::for type paths - Use
[]for generics, use()for tuples, useList()for lists, uselist.getandlist.setfor get and set.- Although Flix seems to be able to use
[]for generics AND lists.
- Although Flix seems to be able to use
- Use labelled arguments like Gleam: https://tour.gleam.run/everything/#functions-labelled-arguments
- Match like Gleam: https://tour.gleam.run/everything/#data-types-record-pattern-matching
TrueandFalseare part of aBooleanenum- but they are aliased so you can use as
TrueandFalse.
- but they are aliased so you can use as