Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lishy2/adjika
Typed functional language with actors
https://github.com/lishy2/adjika
actor-model compiler llvm
Last synced: 27 days ago
JSON representation
Typed functional language with actors
- Host: GitHub
- URL: https://github.com/lishy2/adjika
- Owner: LIshy2
- Created: 2024-08-28T14:40:56.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T20:26:02.000Z (about 2 months ago)
- Last Synced: 2024-10-11T20:40:39.949Z (27 days ago)
- Topics: actor-model, compiler, llvm
- Language: OCaml
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Adjika
```
type Either[L, R] = Left (value: L) | Right (value: R)type List[A] = Cons(head: A, tail: List[A]) | Nil()
fun map(list, f) =
match list {
is Cons(head, tail) => Cons(f(head), map(tail, f))
is Nil() => Nil()
}actor PingPong {
Waiting();
Playing(counter: int64);
}type Info = Info(other: MailBox[PingPong])
type Ping = Ping(from: MailBox[PingPong])
handler Info with Waiting = {
mutate Playing(0);
send Ping(me) to message.other;
}handler Ping with Waiting = {
mutate Playing(0);
send Ping(me) to message.from;
}handler Ping with Playing = {
mutate Playing(counter + 1);
send Ping(me) to message.from;
}actor Main {
Starting();
}handler Starting with Starting = {
val player1 = spawn Waiting();
val player2 = spawn Waiting();
send Info(player2) to player1;
}
```