Kite Programming Language

Boost Spirit experimentation

Written by Mooneer Salem on Saturday 25th of December, 2010 in General with 3 comments

Ive been playing with Boost Spirit as an alternative to Bison/Flex lately for Kite. So far, its actually pretty nice in terms of syntax; you only need to use C++ to describe your language. Ive already found a few disadvantages, as shown below:

harry:kite-llvm mooneer$ time sh 
Compiling src/apps/kite.cpp...
Compiling src/codegen/llvm_compile_state.cpp...
Compiling src/codegen/llvm_node_codegen.cpp...
Compiling src/codegen/syntax_tree_node_printer.cpp...
Compiling src/codegen/syntax_tree_printer.cpp...
Compiling src/parser/parser.cpp...

real    0m34.831s
user    0m32.598s
sys 0m2.048s
harry:kite-llvm mooneer$ ls -lh
total 12240
-rwxr-xr-x@ 1 mooneer  staff   238B Dec 25 00:42
-rwxr-xr-x  1 mooneer  staff   4.0M Dec 25 15:02 kite
-rw-r--r--  1 mooneer  staff   9.2K Dec 25 15:01 kite.o
-rw-r--r--  1 mooneer  staff    10K Dec 25 15:01 llvm_compile_state.o
-rw-r--r--  1 mooneer  staff    72K Dec 25 15:01 llvm_node_codegen.o
-rw-r--r--  1 mooneer  staff   1.8M Dec 25 15:02 parser.o
drwxr-xr-x  6 mooneer  staff   204B Dec 23 21:34 src
-rw-r--r--  1 mooneer  staff   5.7K Dec 25 15:01 syntax_tree_node_printer.o
-rw-r--r--  1 mooneer  staff   9.6K Dec 25 15:01 syntax_tree_printer.o
harry:kite-llvm mooneer$

(tl;dr: very large binaries, even with g++ Os, and very long compile times.) Ive only implemented the math operations so far for the above test.

Anyway, Ill put up the code when I have a bit more to show. :)


Rowan Lewis on Sunday 26th of December, 2010

If it is easier to maintain, then who cares about a few seconds of compile time and a couple of extra MB?

Mooneer Salem on Tuesday 28th of December, 2010

Not sure about maintainability yet. Theres still a lot of things not finalized with the new code. As for exact timings so far:

harry:kite-llvm mooneer$ time ./kite
Executing code

real 0m0.150s
user 0m0.083s
sys 0m0.010s
harry:kite-llvm mooneer$

John Riselvato on Thursday 6th of January, 2011

How the fundip do i contact you? I am having the hardest time finding any email or a way to ask questions about the code. I have some code i am working on and i made a complex (not really) structure of 3 classes and i need some help understanding why it wont work. Theres no reason for it not to work but its giving me errors. I dont want to get into it, but i would like to contact who ever to get some help.

Add comment