Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/technohippy/kaleidoscope.ja

日本語プログラミング言語 on LLVM
https://github.com/technohippy/kaleidoscope.ja

Last synced: 19 days ago
JSON representation

日本語プログラミング言語 on LLVM

Awesome Lists containing this project

README

        

# 日本語プログラミング言語「カレイドスコープ」

## 概要

LLVMで日本語プログラミング言語作れるのかなと思って試しに[Kaleidoscope](http://llvm.org/docs/tutorial/)の予約語や識別子を日本語にしてみました。

## ファイル説明

* 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

### REPL開始

$ bin/kaleidoscope

### サンプルの実行

$ bin/kaleidoscope sample/mandel.ksj

### サンプルの実行結果

*******************************************************************************
*******************************************************************************
****************************************++++++*********************************
************************************+++++...++++++*****************************
*********************************++++++++.. ...+++++***************************
*******************************++++++++++.. ..+++++**************************
******************************++++++++++. ..++++++*************************
****************************+++++++++.... ..++++++************************
**************************++++++++....... .....++++***********************
*************************++++++++. . ... .++**********************
***********************++++++++... ++**********************
*********************+++++++++.... .+++*********************
******************+++..+++++.... ..+++********************
**************++++++. .......... +++********************
***********++++++++.. .. .++********************
*********++++++++++... .++++*******************
********++++++++++.. .++++*******************
*******++++++..... ..++++*******************
*******+........ ...++++*******************
*******+... .... ...++++*******************
*******+++++...... ..++++*******************
*******++++++++++... .++++*******************
*********++++++++++... ++++*******************
**********+++++++++.. .. ..++********************
*************++++++.. .......... +++********************
******************+++...+++..... ..+++********************
*********************+++++++++.... ..++*********************
***********************++++++++... +++*********************
*************************+++++++.. . ... .++**********************
**************************++++++++....... ......+++***********************
****************************+++++++++.... ..++++++************************
*****************************++++++++++.. ..++++++*************************
*******************************++++++++++.. ...+++++**************************
*********************************++++++++.. ...+++++***************************
***********************************++++++....+++++*****************************
***************************************++++++++********************************
*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************

## 参考

* http://llvm.org/docs/tutorial/
* https://github.com/technohippy/Kaleidoscope.rb