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

Writing a Lisp transpiler is a great exercise, and becomes more involved but more also educational as the source and target language become more and more distant. Here's my Scheme to JS transpiler that supports higher order functions, variadic lambdas, set! and recursion.[0] The function that performs the conversion is https://github.com/siraben/lisp-to-js/blob/0251892e55d1a88f9...

- Lisp -> JS is quite easy, good practice for AST representation and working with trees

- Lisp -> C is more challenging, you'll need to perform closure conversion and generate C structures to hold the environment, see[1] as an example for another functional language

[0] https://github.com/siraben/lisp-to-js

[1] https://github.com/jozefg/pcf/blob/master/explanation.md



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

Search: