tiancaiamao / cora

Genius programmer should write his own lisp!
52 stars 8 forks source link

*: codegen for inspect.cora success #26

Closed tiancaiamao closed 7 months ago

tiancaiamao commented 7 months ago

inspect.cora is the interpreter written in cora lib/toc is the library to generate cora to C Now it can successfully codegen inspect.cora, so that I can get the native interpreter...

The performance of the generated interpreter is still too poor to be usable.

(do (set (quote sum) (lambda (r i) 
               (if (= i 0) 
               r 
             (sum (+ r 1) (- i 1))))) 
    (sum 0 500000))

It can support (sum 0 20) and not much more beyond that.

tiancaiamao commented 7 months ago

I can say it's the interpreter (inspect.cora) whose performance is too bad... The lib/toc itself is efficient enough.