Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is the usage, which shows how many backends this supports (pretty impressive IMO).

    USAGE: waxc [options] code.wax                   
    
    OPTIONS:                                         
    --c     path/out.c     transpile to c            
    --java  path/out.java  transpile to java         
    --ts    path/out.ts    transpile to typescript   
    --py    path/out.py    transpile to python       
    --cs    path/out.cs    transpile to c#           
    --cpp   path/out.cpp   transpile to c++          
    --swift path/out.swift transpile to swift  
    --lua   path/out.lua   transpile to lua 
    --wat   path/out.wat   transpile to webassembly         
    --json  path/out.json  syntax tree to JSON file  
    --tokens               print tokenization        
    --ast                  print abstract syntax tree
    --silent               don't print info          
    --help                 print this message
I do think the syntax is a little bit jarring as someone who is used to LISP's omission of keywords like "then" and "do". Also, LISPers usually don't put parens on their own lines.


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.


Lisp 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)))


Can 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.


> instead of using tail call recursion

If your language supports that. TCO is not a standard feature of Lisp.


Regular recursion however is.


Why did this get downvoted? This is correct description of the project. It is even written in readme.


Maybe because people being pedantic gatekeepers about what is and isn't a true lisp is tedious.


Gatekeepers like the guy who wrote it. Words mean things.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: