Kyoto 京
ポータブルバイナリコードアセンブリのコンパイルに重点を置いて作成された並列プログラミング言語。
Lightweight programming language (designed to have very small memory footprint and with minimalist syntax and features) powered by LLVM that have as compilation target: WebAssembly.
pub myCustomFuction = String.toInt |> sum(2)
<!-- Will be transformed into WASM by webpack-kyoto-loader -->
<script type="text/javascript">
import myCustomFuction from "./main.kto";
console.log(myCustomFuction("1")); // 3
</script>
Features
- Lazy and async collections with streams.
- Built-in types based on unsigned memory.
- Memory lifecycle.
- Enforces use more memory only when it's really necessary.
Example Code
main.kto
"1" |> String.toInt |> sum(2) |> log
# 3
fib.kto
fn fibonacci() fn() Int64 {
x, y := 0, 1
<- fn() Int64 {
x, y = y, x + y
<- y - x
}
}
WebAssembly
WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.
Usage with WASM
Kyoto is made and focused exclusively for WASM usage. Here's an example using Kyoto Webpack loader:
import fib from 'fib.kto';
console.log(fib(13))
Kyoto 0.0.1
TODO Types
- Built-in types
-
Int
(8-bit unsigned integer)- Min:
–128
, Max:127
-
toString
- Min:
-
Int16
(16-bit unsigned integer)- Min:
–32768
, Max:32767
-
toString
- Min:
-
Int32
(16-bit unsigned integer)- Min:
–2147483648
, Max:2147483647
-
toString
- Min:
-
Int64
(64-bit unsigned integer)-
toString
-
-
Float
(64-bit unsigned float)-
toString
-
-
Function
(fn
) A reference to code chunk
-
- Data types
-
String
(UTF-8 encoded binaries representing characters) -
Map
-
List
-