LLVMで日本語プログラミング言語作れるのかなと思って試しにKaleidoscopeの予約語や識別子を日本語にしてみました。
- README.md : 本ファイル
- bin/kaleidoscope : コマンド
- src/kaleidoscope_ja.rb : 日本語プログラミング言語
- src/compat_ja.rb : C言語の関数を模擬
- src/print.cpp : 組み込み関数定義
- sample/mandel.ksj : マンデルブロ表示プログラム(サンプル)
$ clang++ -emit-llvm -S src/print.cpp -o print.ll
$ llvm-as print.ll
$ bin/kaleidoscope
$ bin/kaleidoscope sample/mandel.ksj
*******************************************************************************
*******************************************************************************
****************************************++++++*********************************
************************************+++++...++++++*****************************
*********************************++++++++.. ...+++++***************************
*******************************++++++++++.. ..+++++**************************
******************************++++++++++. ..++++++*************************
****************************+++++++++.... ..++++++************************
**************************++++++++....... .....++++***********************
*************************++++++++. . ... .++**********************
***********************++++++++... ++**********************
*********************+++++++++.... .+++*********************
******************+++..+++++.... ..+++********************
**************++++++. .......... +++********************
***********++++++++.. .. .++********************
*********++++++++++... .++++*******************
********++++++++++.. .++++*******************
*******++++++..... ..++++*******************
*******+........ ...++++*******************
*******+... .... ...++++*******************
*******+++++...... ..++++*******************
*******++++++++++... .++++*******************
*********++++++++++... ++++*******************
**********+++++++++.. .. ..++********************
*************++++++.. .......... +++********************
******************+++...+++..... ..+++********************
*********************+++++++++.... ..++*********************
***********************++++++++... +++*********************
*************************+++++++.. . ... .++**********************
**************************++++++++....... ......+++***********************
****************************+++++++++.... ..++++++************************
*****************************++++++++++.. ..++++++*************************
*******************************++++++++++.. ...+++++**************************
*********************************++++++++.. ...+++++***************************
***********************************++++++....+++++*****************************
***************************************++++++++********************************
*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************