Skip to content

tatlook/kehu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kehu

Overview

Kehu is a toe language. Here is a compiler for this language. The compiler is LLVM-based. The language is imagining stub. Everything doesn't work.

Characteristic

Tiled Expression

In C tradition, a function call is like this:

insert_value_to_table(&table, 6, 0, "yes")

But you cannot understand directly what those arguments mean. Some languages, like Python, solve this problem with named arguments:

insert_value_to_table(table=table, line=6, column=5, value="yes")

In kehu, the thing is like:

insert "yes" at line 6 column 5 in table $table

Tokens

Token is very similar than lisp: many symbols in c are vaild identifiers!

# those are vaild identifiers
hey
$%@67988gb
r666~`
!!!!!!
=/?
hello^world
# string
"hello,\nworld"
# integer
0x123456789ABCDEF
123456789
# exception case, those are symbols!
.,()

Hello World

A hello world demo in kehu looks like: (helloworld.kehu)

define function
%int main %array(%string) $args
{
    print "Hello, World" to $stdout.
}.

Use kehu helloworld.kehu to compile this program. This will create a a.out executable file.

Building & Installing

This project uses CMake. To compile and install this program, you can do:

$ mkdir build && cd build
$ cmake ..
$ cmake --build
$ cmake --install

Contributing

This project is in a really initial phase. Functions aren't implemented at all. I have not any experiences to work on github. But if you are interested in, welcome to issue and pull request.

Releases

No releases published

Packages

No packages published