Catla Programming Language
Rustと連携しつつ 初学者にも優しいシンプルな仕様と速度の両立を目指すプログラミング言語
- にゃーん🐈
- 鋭意開発中
メモリ管理
Example
まだ部分的にしか動かないよ!
//T!はResult型
const result: String! = cat_validation()
//resultがエラーの場合は実行時エラー
//!!演算子はRustのResult.unwrap()と同じ
const meow: String = result!!
print(meow)
print("あなたの鳴き声に呼応している!")
function cat_validation() -> String! {
const input = std::console::get_next_input()
return if input == "にゃーん" {
const cat = new Cat()
cast.meow()
} else {
new NotCatException()
}
}
class Cat {
function meow() -> String {
return "にゃーん"
}
}