- grammar
- comments
- sigils
- keywords
- identifiers
- types Requires more thinking
- operators
- assignment
- equality & identity
- conditional
- loops
- functions
- methods
- mutability
- modules
- concurrency
- dialects
Silicon is a new programming language that emphasizes simplicity, extensibility and usability. It is extremely easy to learn and extremely difficult to use incorrectly. The main target is WASM. This is the specification with documentation on all the future features.
- WASM compilation target
- Full-Stack web dev
- blazingly fast compilation
- interpreted for fast dev cycles
- Algebraic Data Types
- Pattern Matching
- 100% Type Inference (safety without type gymnastics)
- Co-routines (no colored functions)
- ARC (no GC)
- 100% Web API compatability
- 100% Node API compatability
In my opinion, non-goals are just as important as goals. They prevent scope-screep and keep the language and toolchain great at specific use-case instead of mediocre at everything.
*Not a direct goal but other tools will be used **A future, much less important goal to think about
- Native Compilation*
- LLVM / other native backends*
- Variadic functions * Silicon Dynamic
- Function over-loading * Silicon Dynamic
- Game dev
- Systems dev (Yes, even though Silicon has no GC and is fairly "low-level". It is NOT anything like Zig nor Rust)
- Operator overloading * use infix functions instead
- Functionally Pure * functional, may have an effects system but it isn't Haskell nor purescript
- Borrower Checker / compile-type memory safety**
- no unary operators
- no operator precedence
- no methods
- no inheritance
- no function / method overloading (TDNR so kinda
@let x = 1; x.toString; @let y = $false; y.toString
) - no modifiers (just annotations)
- no garbage collector: reference counting / borrower checker (optional)
- ONE function syntax
@fn
(named, anonymous, lambda) - ONE looping expression
@loop
(for, while and do/while) - ONE condition expression
@when
(if and switch/case)
- Native Testing (Unit, Fuzz)
- Protocols: Typesafe usage and upgrades to APIs
- Row Polymorphism
- Algebraic Effects
- Annotations (for flexiblity)
- TDNR (fake overloading)
- SIMPLE and consistent syntax
- Parallel Parsing
- Coroutines: no locks, mutexes / semaphores or runtime to schedule concurrent tasks
- Pattern matching
- Full type inference!
- Full lifetime inference!
- Large standard library (many native libraryes from C, C++ and Rust)
- Common integrations (SQL, websockets, graphql, ORMs, Kafka, Graphics etc)
- Great errors as values and error handling
- Cross-platform!
- Sandboxed (WASM)
- 100% Web API coverage
- 100% Node API coverage
- WASI(X) APIs
Silicon's grammar is extremely regular and straight forward. That does make it simple but simple is simply (pun intended) a by product of using a few simple grammar rules everywhere for everything.
Silicon has only two Semantic grammar rules: Statements and Expressions.
My goal is to keep Silicon's grammar to around 100 lines of PEG grammar. It may grow but it should never be more than 150-200 LOC. 100-125 is more realistic. For comparison, Zig which is very minimalistic uses 300 lines of PEG grammar.
Silicon's goal is to only have the most expressive and versatile language features.
Influenced by: Ruby, Lua, Zig, Rust, LISP, ML, Effiel...
- ML Algebraic Data Types
- ML Function Definition Pattern Matching
- ML Hindley-Milner Type System: 100% Type Inference
- ML Effectful Type System: total, exception, timeout/nohault, pure(previous two), IO, random, parallel
- Co-routines
- (self)Embeddable as a Dynamically Typed Scripting Language
- WASM output: fast, safe, cross-platform, interop, ecosystem
- GC optional: ARC, Generational References, manual or Lifetimes, MAYBE a tracing GC for the backend.
- JS 100% Web API and Node API compatability
- Protocols: API usage and upgrade help
- SilVer: Silicon (smart) Versioning. No more failing at SemVer.
- Capabilities: Permissions in code
- Idiomatic Merging: Via Git or NIT. Language aware code merging!
- Quasi-Quoting (Lisp style macros that work on the AST! Are hygenic and use comptime)
- Very simple and regular grammar
- Easy and fast to parse
- Forced DI of I/O Functions
- UFCS (fake methods) & TDNR (fake overloading)
- Pipe syntax ( when UFCS isn't needed)
- LISP style macros / quotes?
- Language Interop via WASM and Zig. Uses many proven Native Libraries.
- Zig CC Cross-Compilation
- Rust borrower checker / lifetimes BUT without writing the lifetimes