Kite Programming Language

kite-llvm 0.2.0 released

Written by Mooneer Salem on Wednesday 26th of December, 2012 in Usage

kitellvm 0.2.0 has been released.

Changes from 0.1.0:

  • Now uses the same Flex/Bison based parser that nonLLVM Kite uses, significantly improving compile time. 100% of Kite syntax can now be parsed as well.
  • Added string|format to the standard library.
  • kdoc (System.doc) support and prerequisite System.object methods now fully functional.
  • eval statement now supported (e.g. eval 1|print;).
  • Code versioning support from nonLLVM Kite is now active.
  • Fixed compile errors on some systems.

Download: http://kitelanguage.org/files/kitellvm0.2.0.tar.gz
Github (development/issue tracking): https://github.com/tmiw/kitellvm

kite-llvm and eval support

Written by Mooneer Salem on Wednesday 5th of December, 2012 in Usage

Tonight, the eval construct was finally added to kitellvm. This feature has always been in the original Kite but was never added to the LLVM version.

What is eval, you ask? Think of it as a way to dynamically compile and execute code. Example:


harry-2:build mooneer$ bin/kite
eval "\"hello, world!\"|print;";
^D
hello, world!
harry-2:build mooneer$

You can also modify variables defined outside of the eval:


harry-2:kite-llvm mooneer$ cat tests/semantics/eval/modify_variables.kt
i = 0;
eval "i = i + 1;";
i|print;
harry-2:kite-llvm mooneer$ src/kite ./tests/semantics/eval/modify_variables.kt
1
harry-2:kite-llvm mooneer$

This works because eval is effectively equivalent to dynamically compiling a new method whose arguments are the contents of the symbol table at the eval call. :)

Feel free to leave a comment if you have any questions~

On a tangent

Written by Mooneer Salem on Thursday 29th of December, 2011 in Usage

harry:kite-llvm mooneer$ ./kite
class X [
    method z() [
        true;
    ];
    method y() [
        (make System.exceptions.NotImplemented())|throw;
    ];
];

v = make X();
v|y;
^D
System.exceptions.NotImplemented: Exception thrown
    in method X|y + 0xcc
    in (main program) + 0xfd

harry:kite-llvm mooneer$

Notice anything different? Hint: the exception trace looks a lot nicer. :)

Something fun to try

Written by Mooneer Salem on Wednesday 4th of August, 2010 in Usage

Today, I found out about a pretty nifty regular expression that will match if a number is not prime. Turns out that the regex is usable unmodified in Kite:

#!/usr/bin/kite

method is_prime(number)
[
    property rgx;
    property digit_str;
    rgx = r/^1?$|^(11+?)\1+$/;
    
    digit_str = "";
    until(number == 0)
    [
        digit_str = digit_str + "1";
        number = number - 1;
    ];
    (rgx|match(digit_str) is System.null);
];

(is_prime(17))|print;
(is_prime(3))|print;
(is_prime(20))|print;

Results:

true
true
false

Unfortunately, because of the way the regular expression engine in Kite works, it took much longer than 14 seconds to run the check for the large numbers tried in the article. This will be another facet of the overall Kite optimization effort in the future as well. :)

1.0.3 released

Written by Mooneer Salem on Monday 13th of April, 2009 in Usage

Kite 1.0.3 has been released.

New in this release:

  • Fixed problems with the Windows installer.
  • Fixed bugs in kdb.

Download:

Issue tracker URL (for bug reports): http://trac.kite-language.org/report/1
Getting help: http://trac.kite-language.org/wiki/GettingHelp