From 4abdbaabd69a5aac827cb4e2f98c27e5661885cf Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 25 Nov 2021 10:05:01 +0200 Subject: Add license and readme --- LICENSE | 7 +++++++ README.md | 28 ++++++++++++++++++++++++++++ samples/sample1.code | 14 -------------- samples/sample1.tunk | 14 ++++++++++++++ samples/sample2.code | 1 - samples/sample2.tunk | 1 + src/main.rs | 2 +- 7 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 LICENSE create mode 100644 README.md delete mode 100644 samples/sample1.code create mode 100644 samples/sample1.tunk delete mode 100644 samples/sample2.code create mode 100644 samples/sample2.tunk diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b876916 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2021, Jan Tuomi + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Source: http://opensource.org/licenses/ISC diff --git a/README.md b/README.md new file mode 100644 index 0000000..401671e --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Tunk + +**Tunk** is a + +- strongly and dynamically typed +- pure functional +- interpreted +- general use + +programming language. Tunk is a hobby project written for educational purposes. + +## Running Tunk + +Build the `tunk` interpreter with `cargo`: + + cargo build --release + +Run `tunk` on a source file: + + target/release/tunk run samples/sample1.tunk + +Run `tunk` REPL: + + target/release/tunk repl + +## Author + +Jan Tuomi, <> diff --git a/samples/sample1.code b/samples/sample1.code deleted file mode 100644 index 168421b..0000000 --- a/samples/sample1.code +++ /dev/null @@ -1,14 +0,0 @@ -triangle n = int.eq? n 1 - 1 - (int.add - n - (triangle (int.sub n 1))); - -triangle 500; - -# factorial n = -# int.eq? n 0 -# 1 -# (int.mul n (factorial (int.sub n 1))); - -# factorial 20; \ No newline at end of file diff --git a/samples/sample1.tunk b/samples/sample1.tunk new file mode 100644 index 0000000..168421b --- /dev/null +++ b/samples/sample1.tunk @@ -0,0 +1,14 @@ +triangle n = int.eq? n 1 + 1 + (int.add + n + (triangle (int.sub n 1))); + +triangle 500; + +# factorial n = +# int.eq? n 0 +# 1 +# (int.mul n (factorial (int.sub n 1))); + +# factorial 20; \ No newline at end of file diff --git a/samples/sample2.code b/samples/sample2.code deleted file mode 100644 index eedd45d..0000000 --- a/samples/sample2.code +++ /dev/null @@ -1 +0,0 @@ -lempi-numero = int.zero; diff --git a/samples/sample2.tunk b/samples/sample2.tunk new file mode 100644 index 0000000..eedd45d --- /dev/null +++ b/samples/sample2.tunk @@ -0,0 +1 @@ +lempi-numero = int.zero; diff --git a/src/main.rs b/src/main.rs index 3b09791..5546094 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,7 @@ fn main() -> Result<(), String> { use std::io::{stdin, stdout, Write}; use std::rc::Rc; - println!("REPL"); + println!("Tunk REPL"); println!("\"#exit\" to exit"); println!("\"#symbols\" to display symbol table\n"); -- cgit v1.3