A programming language written in an "easy to understand" way

Overview

Trees

Trees は、ブロックプログラミング言語で、以下の特徴を備えています!

  • 分かりやすい (easy to understand)
  • 読みやすい (readable)
  • 曖昧性がない (clear)
        ┌─────┐
        │print│
        └───┬─┘
        ┌───┴─┐
    ┌───┤  *  ├──┐
    │   └─────┘  │
┌───┴─┐      ┌───┴─┐
│  3  │      │  4  │
└─────┘      └─────┘ 

チュートリアルは https://github.com/Snowman-s/trees/wiki を参照ください。

ビルド方法

$ git clone https://github.com/Snowman-s/Trees.git

$ cd Trees

$ cargo build --release

上記コマンドを実行すると、target/release 内に実行可能ファイルができているはずです。

Comments
  • ブロッククォートにおいて、各ブロックの束縛化

    ブロッククォートにおいて、各ブロックの束縛化

    現在のブロッククォートでは、他の所で exec されるに際して、そこでの名前空間の制約を受ける問題があります。(名前空間が衝突する恐れがある)

    ので、クォートされたブロックが実行するに際して、子孫のブロックに対する ProcedureOrVar を確定させます。

    • 現行の仕様でも用いることができるように(特に、$args や $0)、 $ から始まるプロシージャ名を持つブロック、または get にて参照される名前空間は固定しません
    opened by Snowman-s 2
  • 変数の中身が演算で破壊的変更を受ける

    変数の中身が演算で破壊的変更を受ける

    image

    同一スコープ同一変数の演算を繰り返すと値が破壊される

    ┌─────┐
    │ seq ├─────────────────────────────────┐
    └──┬──┘   ┌────┐                      ┌─┴───┐
    ┌──┴────┐ │  ┌─•───┐                  │print│
    │defproc├─┘  │exec ├────────────┐     └─┬───┘
    └──┬────┘    └─────┘          ┌─┴───┐ ┌─┴───┐
    ┌──┴──┐   ┌───────────────────┤if0  │ │ fib │
    │"fib"│ ┌─┴──┐                └─┬─┬─┘ └─┬───┘
    └─────┘ │ $0 │   ┌──────────────┘ │   ┌─┴──────────┐
            └────┘ ┌─•─┐          ┌───┴─┐ │ str to int │
                   │ 1 │   ┌──────┤ifn0 │ └───┬────────┘
                   └───┘ ┌─┴─┐    └─┬──┬┘   ┌─┴─────────┐
       ┌─────────────────┤ = │   ┌──┘  │    │ read line │
     ┌─┴──┐              └─┬─┘ ┌─•─┐  ┌•──┐ └───────────┘
     │ $0 │   ┌────────────┘   │ 1 │  │ + │
     └────┘ ┌─┴─┐              └───┘  └┬─┬┘
            │ 1 │     ┌────────────────┘ │
            └───┘  ┌──┴──┐          ┌────┴┐
                   │ fib │          │ fib │
                   └──┬──┘          └──┬──┘
                   ┌──┴──┐          ┌──┴──┐
                   │  -  │          │  -  │
                   └┬───┬┘          └┬───┬┘
                   ┌┴─┐┌┴┐          ┌┴─┐┌┴┐
                   │$0││1│          │$0││1│
                   └──┘└─┘          └──┘└─┘
    
    opened by raiga0310 2
  • fix: fibonacciは$0を環境キャプチャする必要があるためクロージャに修正(動作確認済み)

    fix: fibonacciは$0を環境キャプチャする必要があるためクロージャに修正(動作確認済み)

    変更前の実行結果

     .\target\release\trees.exe .\tutorial\fibonacci.tr
    2
    
    
    エラーが発生しました:Undefined Proc Name $0
    ◦
    └seq <-
     ├defproc = <Void>
     └print <-
      └fib <-
       └str to int = 2
    
    
    起因:
    ◦
    └exec <-
     └if0 = Block +
    
    
    起因:
    ◦
    └+ <-
     ├fib <-
     │└- <-
     │ ├$0 <-
     │ └1
     └fib
    
    名前空間:
    [cmd, if0, <=, =, if, ifn0, %, str to int, >=, for, split str, str to bytes, print, /, +, >, get, bytes to str, set, include, strcat, \0, export, [], exec, println, read line, -, \t, defset, and, listing, <, *, \r, seq, while, reexport, \n, or, xor, to str, len, defproc]
    []
    [fib]
    []
    [$args=[]]
    []
    []
    []
    

    $0が未定義になったのはクォートとクロージャの分離によっておきた者と考えられる

    opened by raiga0310 0
  • Proposal: 罫線の代替手段として`+` `|`を使用する

    Proposal: 罫線の代替手段として`+` `|`を使用する

    e.g.

    +-----+
    |  a  +----+
    +-----+    |
            +--+--+
            |  b  |
            +-----+
    

    実装としてはパースの変更と、罫線ほど分解能がないため幾分か記述の自由度が低くなりますが、等幅フォントでもCJK文脈に横罫線の長さが依存する問題などが解消できる手段の一つではあると思います (重要: ブロックプログラミング、ということを考えるとバカさ加減が薄れそうです)

    opened by raiga0310 3
  • 横罫線の長さの指定

    横罫線の長さの指定

    フォントによっては 「 」 の長さがアルファベット2つ分であることがあるのでこれを変更できるようにしたい。

    • コンパイラの変数とする?
      • コンパイラの設定によってソースコードが変わるのはよくなさそう
    • ファイルの先頭に #horizontal-line-length = 2 みたいな形で指定できるようにする?
      • 全部のファイルに書かなきゃいけないのであまりかっこよくない
    • その他??
    opened by Snowman-s 0
Owner
Snowman-s
Snowman-s
m2cgen (Model 2 Code Generator) - is a lightweight library which provides an easy way to transpile trained statistical models into a native code

Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies

Bayes' Witnesses 2.3k Dec 31, 2022
Framework and Language for Neuro-Symbolic Programming

Scallop Scallop is a declarative language designed to support rich symbolic reasoning in AI applications. It is based on Datalog, a logic rule-based q

null 27 Dec 14, 2022
A lesson in Humility - or how a boy teaches himself a new programming language.

Learning Rust - A Lesson in Humility J. M. Barrie - Author of Peter Pan Life is a long lesson in humility... and so is learning Rust. I tried to teach

Gary McDougall 6 Nov 1, 2022
A collection of CC-BY-SA course material to teach the Rust programming language, in different formats, levels, and focus points

A collection of CC-BY-SA course material to teach the Rust programming language, in different formats, levels, and focus points. Contact me for remote and on-site trainings!

Katharina Fey 13 Apr 13, 2023
zenoh-flow aims at providing a zenoh-based data-flow programming framework for computations that span from the cloud to the device.

Eclipse Zenoh-Flow Zenoh-Flow provides a zenoh-based dataflow programming framework for computations that span from the cloud to the device. ⚠️ This s

null 35 Dec 12, 2022
Rust language bindings for TensorFlow

TensorFlow Rust provides idiomatic Rust language bindings for TensorFlow. Notice: This project is still under active development and not guaranteed to

null 4.1k Jan 1, 2023
Rust language bindings for Faiss

Faiss-rs This project provides Rust bindings to Faiss, the state-of-the-art vector search and clustering library. Installing as a dependency Currently

Eduardo Pinho 86 Jan 7, 2023
[WIP] An experimental Java-like language and it's virtual machine, for learning Java and JVM.

Sky VM An experimental Java-like language and it's virtual machine, for learning Java and JVM. Dependencies Rust (rust-lang/rust) 2021 Edition, dual-l

Kk Shinkai 2 Jan 3, 2022
A tour of rust's language features

Tour of Rust Welcome to the source repo of Tour of Rust. Goals This project is meant to give an experienced programmer a swift introduction to Rust as

RICHΛRD ΛNΛYΛ 693 Jan 6, 2023
Masked Language Model on Wasm

Masked Language Model on Wasm This project is for OPTiM TECH BLOG. Please see below: WebAssemblyを用いてBERTモデルをフロントエンドで動かす Demo Usage Build image docker

OPTiM Corporation 20 Sep 23, 2022
Rust language bindings for the LIBLINEAR C/C++ library.

liblinear-rs Rust bindings for the liblinear C/C++ library. Provides a thin (but rustic) wrapper around the original C-interface exposed by the librar

Madeesh Kannan 8 Sep 22, 2022
Rust-like syntax for OpenGL Shading Language

Rust-like syntax for GLSL glassful translates a small subset of Rust to OpenGL Shading Language. Besides one's personal preferences regarding Rust-lik

Keegan McAllister 158 Sep 22, 2022
🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧

?? rust-gpu Rust as a first-class language and ecosystem for GPU graphics & compute shaders Current Status ?? Note: This project is still heavily in d

Embark 5.5k Jan 9, 2023
Deduplicating Training Data Makes Language Models Better

Deduplicating Training Data Makes Language Models Better This repository contains code to deduplicate language model datasets as descrbed in the paper

Google Research 431 Dec 27, 2022
Fwumious Wabbit, fast on-line machine learning toolkit written in Rust

Fwumious Wabbit is a very fast machine learning tool built with Rust inspired by and partially compatible with Vowpal Wabbit (much love! read more abo

Outbrain 115 Dec 9, 2022
Simple neural network library for classification written in Rust.

Cogent A note I continue working on GPU stuff, I've made some interesting things there, but ultimately it made me realise this is far too monumental a

Jonathan Woollett-Light 41 Dec 25, 2022
RustFFT is a high-performance FFT library written in pure Rust.

RustFFT is a high-performance FFT library written in pure Rust. It can compute FFTs of any size, including prime-number sizes, in O(nlogn) time.

Elliott Mahler 411 Jan 9, 2023
Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
l2 is a fast, Pytorch-style Tensor+Autograd library written in Rust

l2 • ?? A Pytorch-style Tensor+Autograd library written in Rust Installation • Contributing • Authors • License • Acknowledgements Made by Bilal Khan

Bilal Khan 163 Dec 25, 2022