Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kzh/lyca
programming language compiler w/ llvm
https://github.com/kzh/lyca
compiler llvm programming-language
Last synced: 6 days ago
JSON representation
programming language compiler w/ llvm
- Host: GitHub
- URL: https://github.com/kzh/lyca
- Owner: kzh
- Created: 2016-01-03T21:36:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-18T19:07:42.000Z (almost 7 years ago)
- Last Synced: 2024-10-18T19:32:19.903Z (19 days ago)
- Topics: compiler, llvm, programming-language
- Language: Go
- Homepage:
- Size: 74.2 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lyca
Lyca is a programming language that I am currently working on. The main goal for this project is to help me learn compiler design. Being in a very early development stage, Lyca is full of bugs, but here is a demo of some of the functioning features in the form of a Linked List implementation in Lyca.```
func () > main > () {
List list = make List < ();
list.append(make Node < (10));
list.append(make Node < (4));
list.append(make Node < (3));list.print();
}tmpl List {
Node head;
int length;constructor < () {
this.length = 0;
}func (Node node) > append > () {
if (this.length == 0) {
this.head = node;
} else {
Node last = this.get(this.length - 1);
last.next = node;
}this.length = this.length + 1;
}func (int depth) > get > (Node) {
Node node = this.head;
for (; depth != 0; depth = depth - 1) {
node = node.next;
}return node;
}func () > print > () {
Node node = this.head;
for (int i = 0; i != this.length; i = i + 1) {
printf("Index: %d Value: %d \n", i, node.value);
node = node.next;
}
}
}tmpl Node {
Node next;
int value;constructor < (int val) {
this.value = val;
}
}
```![alt tag](https://i.imgur.com/Vqqgm81.png)