Skip to content

yrty2/BlueOcean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

関数宣言とループ処理が行える程度のwebで使えるプログラミング言語

コード(BlueOcean)->コンパイル(js)->評価(webAssembly)

構文解析の部分は自作のライブラリmidoriを元にしています。

ちなみにblueoceanはjsより基本的に遅いのでsimdが使えるくらいしか旨味はないです。

使い方

oceanCompiler.jsをダウンロード

blueocean.parse("filepath.bo",imports/*必要であれば,callbackfunction*/)

または、

blueocean.call("yourcode",imports)

importsは、

[
  {
    call:function add(x,y){return x+y}, //js関数
    param:["R","R"], //引数のbo型
    result:["R"] //返り値のbo型
  }
]

という風に書きます

ブルーオーシャン内では、

print add(1+2) //インポートした関数名

という風に使えます。

About

example↓

Resources

Stars

Watchers

Forks