![](assets/binks.png?raw=true) binks is an interpreted dynamically typed enbededd scripting language trying to be as simple as python and as clean looking as possible, written 100% in rust **Project info:** [![Latest Version](https://img.shields.io/crates/v/binks.svg)](https://crates.io/crates/binks) ![Rust 1.44+ required](https://img.shields.io/badge/rust-1.44+-blue.svg?label=Rust) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fomrihhh%2Fbinks%2Fbadge&style=popout)](https://actions-badge.atrox.dev/omrihhh/binks/goto) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE) [![docs](https://docs.rs/binks/badge.svg?version=0.1.21)](https://docs.rs/binks) ## Features * simple and clean syntax * embedded * easy types extension * easy dynamic libraries loading ## Syntax binks's syntax is inspired by Python, Rust and Dart. variables are declared by the "let" keyword and can change their type throughout the program. function are declared by the "fn" keyword followed by the name, the arguments in parenthesis and the code in to block that start with { end end with } if/elif/else and while loop written with the keyword (if,elif...) followed by the boolean value (no need in parenthesis) and the code in a block that start with { end end with } calling code from dynamic libraries is done by using the "extern" keyword followed by the path the function name and the argument it takes is this pattern: extern "path":"func":arg1,arg2,arg3 type extension is done by using the "extend" keyword followed by the type to extend and then all the functions you want to add in a block, all function need to have at least one argument and can be called with a method call syntax ```fsharp use "binks:IO.binks" as Io fn fib(n) { if n == 1 || n == 2 { return n - 1 } return fib(n - 1) + fib(n - 2) } Io.println(fib(5)) extend str { fn str_method(self) { self = ": )" } fn str_method_2(self) { if self == ": )" { self = "0_o" } } } let s = ": (" s.str_method() s.str_method_2() Io.println(s) let x = 10 if 1 + 3 > 3.6 { Io.println("if statement!") } while x > 0 { x = x - 1 if x == 5 { continue } Io.print(x) Io.print(" ") } Io.print("\n") class XCounter { fn XCounter(self, x) { self.x = x } fn print_x(self) { Io.println(self.x) } fn increment(self) { self.x = self.x + 1 } } let o = new XCounter("hello") o.print_x() o.x.str_method() o.print_x() let o2 = new XCounter(1) o2.increment() o2.print_x() if o < o2 { Io.println("false") } if o != o2 { Io.println("true") } if o > o2 { Io.println("false") } ``` ## Installing #### latest version: requirements: rust, git ```bash $ git clone https://github.com/omrihhh/binks.git $ cd binks $ cargo build --release ``` then add target\release to your path #### stable: requirements: rust ```bash cargo install binks ``` ## Running ```bash $ binks ``` ## Try it online [The Binks playground](https://binks-playground.herokuapp.com) ## Next steps important features i want to implement for the language to be and feel more complete - [x] while loop - [ ] for loop - [x] classes - [ ] more complex classes and objects - [ ] operator overloading - [ ] default/named function arguments - [x] imports - [ ] syntactic sugar for index and update (array[1], array[0] = 1) - [ ] lambda functions - [ ] libstd - [x] embedded