4 ms·
This isn't a Lisp, this is a paren based serialization of the syntax tree of an Algol like language. Even the readme says as much: The syntax of wax is inspire
by konjin 6y ago
This isn't a Lisp, this is a paren based serialization of the syntax tree of an Algol like language.
Even the readme says as much: The syntax of wax is inspired by WebAssembly Text Format (wat), hence the name. Though it uses S-expressions reminiscent of the Lisp family, it is actually quite imperative and most resemblant of C in its design. The idea of transpiling to many languages is inspired by Haxe.
- priyanshuraj 6y agoWhy did this get downvoted? This is correct description of the project. It is even written in readme.
- lispm 6y agoLisp is imperative. This is actual standard Common Lisp and basically the same (minus slightly different syntax) as the quicksort example from the link: (defun qksort-inplace (a lo hi) (declare (type integer lo hi) (type (array float) a)) (if (>= lo hi) (return-from qksort-inplace)) (let ((pivot (aref a lo)) (left lo) (right hi)) (declare (type float pivot) (type integer lo hi)) (loop while (<= left right) do (loop while (< (aref a left) pivot) do (setf left (+ left 1))) (loop while (> (aref a right) pivot) do (setf right (- right 1))) (if (<= left right) (let ((tmp (aref a left))) (setf (aref a left) (aref A right) (aref a right) tmp left (+ left 1) right (- right 1))))) (qksort-inplace A lo right) (qksort-inplace A left hi)))
- konjin 6y agoCan be is not is. One can rewrite that in a functional not implace style. Less so for a language with a c like call stack. Which is why the op wrote it like that instead of using tail call recursion.