- grammar
- comments
- sigils
- keywords
- identifiers
- types
- 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, currently just the PEG grammar, for the language.
- 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
@wif
(if and switch/case)
- Traits (because they're awesome)
- Annotations (for flexiblity)
- UFCS (fake methods)
- TDNR (fake overloading)
- ADT (Algebraic Data Type;the best type of type)
- SIMPLE and consistent syntax
- 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)
- Native dependency injection
- Native testing (within the same file)
- Great errors as values and error handling
- Generics
- Sinq (Silicon equivalent of C# LINQ)
- Cross-platform!
- Cross-compilation (thanks Zig cc!)
- C interop!
- 100% Web API coverage
- 100% Node API coverage
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.
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.
Silicon's goal is to only have the most expressive and versatile language features.
Influenced from: Ruby, Lua, Zig, Rust, LISP, ML
- 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
- Lua Co-routines
- Lua (self)Embeddable as a Dynamically Typed Scripting Language
- Ruby Blocks: non-local returns, thread safe etc..
- WASM output: fast, safe, cross-platform, interop, ecosystem
- No GC: ARC, Generational References, manual or Lifetimes, MAYBE a tracing GC for the backend.
- JS 100% Web API and Node API compatability
- Very simple and regular grammar
- Easy and fast to parse
- Forced DI of I/O Functions
- UFCS (fake methods) & TDNR (fake overloading)
- 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