- You got to clone this repo and navigate to where you cloned it
git clone https://github.com/mega-haste/haste-lang
cd haste-lang
- You should be already installed premake in order to run this command
premake5 gmake --cc=clang
NOTE: Since i switched to premake testing the scanner isn't avialable yet cuz I'm too lazy to do that
- Now go to
build/
folder and run make
cd build/
make
- Now create a
main.haste
file insidebuild/
touch main.haste
- Edite
main.haste
file you created earlier and add these folowing lines
func main() {
let a: int = 50; # Expected warning
}
- Scanner
- Parser
- Expressions
- Primaries
- Math (+, -, *, **, /, %)
- Comparition (==, !=, <, >, >=, =<)
- Logical (not, and, or)
- Bitewise (&, |, ~, <<, >>)
- inline if (if .. then .. else ..)
- as (type casting
expr as Type
) - call expression
- member access
- Subscript (
expr[v]
) - Scope resolusion
- Tuple
- assignment
- referencing and dereferencing (
&expr
and*expr
)
- Types
- Built-in types (int, uint, float, string, void, bool)
- Slices (
T[int]
,T[]
) - Tuple (
(T, R, Y, X, ...)
) - Generics aka. templates in c++ (
T<Args>
)
- Statements
- returns
- if
- let
- functions (needs to add generecs to it)
- Semantic Analysis
- Added basic types (arrays, functions, native types eg. bool, int, uint, char, string)
- Working immutability
- Function calls
- Subscripting
- Member accessing
- Scope resolusion
- Warnings (unused variables, unused mut)
- tuples and multi dimentional arrays
- Custom Defined types
- Generics
- Secret 🤫
- Expressions
func main() {
# no working hello world yet :(
# but we got variables :D
let x = 5;
let mut y = 9;
y += 1;
}
# My desired hello world
func main() {
@println("Hello World");
}
- Nicer Error messages
- Adding a good type-checking & Semantic analysis
- Traspiling haste to c (I'm planing on using llvm to compile haste directly to machine code)
I dropped the idea of tags, sorry Amir