|
|
|
|
|
by hyperpallium
2639 days ago
|
|
Is the first example's last line: var i = find [ 1, 2, 3 ]: _ > r
the same as?: var i = find ([ 1, 2, 3 ]) a: a > r
i.e. argument parantheses are optional for one argument; and _ is an implicit argument for a block.Would multiple functions arguments be done just with parentheses, like this?: var i = find [ 1, 2, 3 ] (: _ > r), (: _ < r)
Seems like the syntactic generality of lisp or haskell, with the predictability of performance of C. EDIT I see it's as fast as non-JIT Lua... are there any features that prevent it from theoretically approaching the speed of C?PS: small detail, but that's got to be the best for-loop I've ever seen. |
|
Multiple function arguments require a keyword in the caller, much like "else" introduces the second function argument in an if-then-else. So if "find" would take two functions, one for even and one for odd list elements, it would look like: "var i = find_even_odd [ 1, 2, 3 ]: _ > r odd: _ > r"
There are no features that prevent it from "approaching" C's speed, merely a question of implementation work. The language started out as very high level, so code generation needs to be improved to not do as many things at runtime as it currently does. The language semantics are totally able to be within 1.5x of C.