Written by Mooneer Salem on Wednesday 26th of December, 2012 in Usage
kite–llvm 0.2.0 has been released.
Changes from 0.1.0:
- Now uses the same Flex/Bison based parser that non–LLVM 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 non–LLVM Kite is now active.
- Fixed compile errors on some systems.
Github (development/issue tracking): https://github.com/tmiw/kite–llvm
Written by Mooneer Salem on Wednesday 5th of December, 2012 in Usage
Tonight, the eval construct was finally added to kite–llvm. 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;";
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;";
harry-2:kite-llvm mooneer$ src/kite ./tests/semantics/eval/modify_variables.kt
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~
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. :)
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;
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. :)
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.
- Source: http://www.kite-language.org/files/kite-1.0.3.tar.gz
- Debian packages: http://www.kite-language.org/files/binaries/deb/1.0.3/
- Windows installer: http://www.kite-language.org/files/kite-windows-1.0.3.msi
- kdoc documentation: http://www.kite-language.org/docs/kdoc-1.0.3/ (as tarball)
- General Kite documentation: http://www.kite-language.org/docs/kite-1.0.3-docs/ (as tarball)
- Kite API documentation: http://www.kite-language.org/docs/kite-1.0.3-api-docs/ (as tarball)