Today is a small post because I have decided to take a break from building the language... In order to learn a bit about LLVM This way I can start learning it when the size of the project is mangeable and learn as I go rather than having to do all the complicated thing at once
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Yes I finished the type checker. But the language don’t have all the feature I want to Sooooo for now it’s good enough.
main = add 5 .$ + 1 2
add: a, b = + a b
$: function, right function, right argument one, right argument two =
right function right argument one right argument two .function
//main :: Int
//add :: Int -> Int -> Int
//$ :: (b -> a) -> (c -> d -> b) -> c -> b -> a
This is a lot more than what I usually do for my dev test and it looks kinda bad because i don’t have all the control flow I wish implement.
My next step is going to look at how to produce bite code in the llvm ir
Since last time ai realised that my previous implementation of the type checker wouldn’t work for generics. So I re-wrote the entire thing. I am not handling infix type checking yet. But I did managed to do the following
main = apply 2 add 5
add: a, b = + a b
apply: a, f, b = f a b
the “add” function still get inferred to
Int -> Int -> Int
But “apply” wouldn’t have been possible because it is a generic function but now it get inferred to
a -> (a -> c -> b) -> c -> b
At first but then in the main function it gets inferred further thanks to “add”. To finaly be
Since the last time I have been working on type inference. I finished basic inference today.
add one: n = + 1 n
add two: n = 2 .+ n
-> (Int -> Int -> Int)
but now I have to attack on the part I’m dreading. With what I have written so far I require to have a know function at some point in the execution to determine the type.
and it might cover most of the cases but their are 2 very important function that don’t work right now.
id: n = n
-> (a -> a)
apply: f, a, b = f a b
-> ((a -> b- > c) -> a -> b -> c)
these tow are really important for a functional language and right now i don’t know how I’m gonna do it. But that’s why I started this project.
In last update I talked about how you could only call one function per function body. Now it’s no longer the case with the introduction of the “.” oporator you can turn ANY function into an infix function with left priority. the result of the expretion to the left will be passed as the first argument of the function
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
An other important milestone is here you can now define your own function. It is still somewhat limited since it will only do one function call per line (by design, but I have something coming for that later) and we don’t have conditional branching yet.
my add: a, b = add a b
main = my add 5 5
-> 10
Next isn’t going to be conditional branching but the solution to the one function call per function thing. Function aliasing is a very good tool but I want to do things with space script and not just call the add function 3 different way.