visket

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2020 License: MIT

README

GitHub Actions Licence MIT Coverage

A compiled programming language


Docker上での実行方法

コンパイラのビルド

以下のツールがインストールされていることを確認してください。

  • Git
  • GNU Make
  • Docker

確認できれば、以下のコマンドを任意のターミナルにて実行します。

$ git clone https://github.com/visket-lang/visket && cd visket
$ make docker/run

処理が完了するとコンテナの中に入った状態になるので、そのまま以下のコマンドを実行します。

# make build

これでコンパイラがビルドされ、準備が完了しました。

プログラムの実行

Visketのプログラムはコンテナ内で以下のコマンドを入力することにより実行できます。

# ./bin/visket -O -color <ファイル名>.sl && ./<ファイル名>

例として、/visket/examples/hello_world.slを実行する際のコマンドは以下のようになります。

# ./bin/visket -O -color ./examples/hello_world.sl && ./hello_world

サンプルプログラムは/visket/examplesディレクトリ以下に保存されています。

まだαバージョンの段階なのでバグを見つけた場合はIsuueを立てていただけると私が助かります。

Example

func main() {
  print(fib(41))
}

func fib(n: int): int {
  if n <= 1 {
    return n
  }
  return fib(n - 1) + fib(n - 2)
}

More examples can be found here.

Features

Language Features

  • variables
  • constants
  • functions
  • comments
  • modules
  • import
  • if / else / then
  • for
  • while
  • if expression

Types

  • bool
  • int
  • float
  • string
  • struct
  • array
  • map
  • func
  • tagged union

Dependencies

  • Clang == 9.x
  • GNU Make

Development

Building from source

  1. git clone https://github.com/arata-nvm/visket && cd visket
  2. make

Compiling a Visket program

  1. ./bin/visket -O <filename>

Directories

Path Synopsis
cmd
ast
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL