Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Aug 22, 2019
1 parent 0ab59a3 commit 788e9d5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<img align="right" src="images/Ark.png" width=200px>

* Documentation: [doc/main.md](doc/main.md)
* Documentation: [https://github.com/SuperFola/Ark/wiki](Wiki)

**Nota bene**: the project is referred as "Ark" and as "ArkScript". The official public name is "ArkScript" since "Ark" is already being used by [another language](https://github.com/ark-lang/ark)

Expand All @@ -15,7 +15,7 @@
* Ark is small: the compiler, and the virtual machines fit under 5000 lines, but also small in term of keywords (it has only 10)!
* Ark is a scripting language: it's very easy to embed it in your application. The FFI is quite easy to understand, so adding your own functions to the virtual machine is effortless
* Ark can run everywhere: it produces a bytecode which is run by its virtual machine, like Java but without the `OutOfMemoryException`
* Ark is a functional language: every parameters are by passed by value, everything is immutable unless you use `mut` to define a mutable variable
* Ark is a functional language: every parameters are passed by value, everything is immutable unless you use `mut` to define a mutable variable
* Ark can handle object oriented programming in a very elegant way with its closures and explicit captures (see examples/church-encoding)
* Ark is promoting functionalities before performances: expressiveness often brings more productivity, but performances aren't bad at all
* Ark handles first class objects, thus it has higher-order functions
Expand Down
45 changes: 33 additions & 12 deletions tests/unittest.ark
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
(set passed (+ 1 passed))
}))
(math-tests)
(print "Math tests passed")
(print " Math tests passed")

# --------------------------
# Strings
Expand Down Expand Up @@ -91,7 +91,7 @@
(set passed (+ 1 passed))
}))
(string-tests)
(print "String tests passed")
(print " String tests passed")

# --------------------------
# List
Expand Down Expand Up @@ -130,7 +130,7 @@
(set passed (+ 1 passed))
}))
(list-tests)
(print "List tests passed")
(print " List tests passed")

# --------------------------
# misc
Expand Down Expand Up @@ -182,7 +182,7 @@
(set passed (+ 1 passed))
}))
(misc-tests)
(print "Misc tests passed")
(print " Misc tests passed")

# --------------------------
# switch
Expand All @@ -201,7 +201,7 @@
])
}))
(switch-tests)
(print "Switch tests passed")
(print " Switch tests passed")

# --------------------------
# defer
Expand All @@ -225,7 +225,7 @@
(set passed (+ 1 passed))
}))
(defer-tests)
(print "Defer tests passed")
(print " Defer tests passed")

# --------------------------
# recursion
Expand Down Expand Up @@ -255,7 +255,7 @@
(assert (= (fibo 16) 987) "Fibo 16 test failed")
(set passed (+ 1 passed))

(print "Recursion tests passed")
(print " Recursion tests passed")

# --------------------------
# callbacks
Expand Down Expand Up @@ -293,7 +293,7 @@
(set passed (+ 1 passed))
}))
(callbacks-tests)
(print "Callback tests passed")
(print " Callback tests passed")

# --------------------------
# OOP
Expand Down Expand Up @@ -321,7 +321,7 @@
(set passed (+ 1 passed))
}))
(oop-test)
(print "OOP tests passed")
(print " OOP tests passed")

# --------------------------
# Errors
Expand All @@ -341,7 +341,7 @@
(set passed (+ 1 passed))
}))
(error-tests)
(print "Error tests passed")
(print " Error tests passed")

# --------------------------
# Ranges
Expand All @@ -358,7 +358,7 @@
(set passed (+ 1 passed))
}))
(range-test)
(print "Range tests passed")
(print " Range tests passed")

# --------------------------
# Del
Expand All @@ -371,7 +371,28 @@
(set passed (+ 1 passed))
}))
(del-test)
(print "Del tests passed")
(print " Del tests passed")

# --------------------------
# Scopes
# --------------------------
(let scope-tests (fun () {
(let foo (fun () {x}))

(let dummy1 (fun () {
(let x 5)
(foo)}))

(let dummy2 (fun () {
(let x 10)
(foo)}))

(assert (= 5 (dummy1)) "Scope test 1 failed")
(assert (= 10 (dummy2)) "Scope test 1°2 failed")
(set passed (+ 1 passed))
}))
(scope-tests)
(print " Scope tests passed")

(print passed "tests passed!")
(print "Completed in" (toString (- (time) start_time)) "seconds")
Expand Down

0 comments on commit 788e9d5

Please sign in to comment.