JeffBezanson / femtolisp

a lightweight, robust, scheme-like lisp implementation
BSD 3-Clause "New" or "Revised" License
1.58k stars 119 forks source link

Parsing Julia code #58

Closed kskyten closed 4 years ago

kskyten commented 5 years ago

I want to experiment with Julia and scheme interoperation. How do I parse Julia code with the included femtolisp repl?

rgobbel commented 4 years ago

In the src subdirectory of the Julia repository you'll find a few files with a .scm extension, including julia-parser.scm and julia-syntax.scm. Those are the actual lexical and parsing modules for the language.

JeffBezanson commented 4 years ago

Run ./julia --lisp to get to its embedded femtolisp. The scheme function julia-parse parses julia code.

kungfooman commented 3 years ago

You need more hardcoded C functions to use julia-parser.scm, for example the implementation of identifier-start-char? which is in https://github.com/JuliaLang/julia/blob/master/src/flisp/julia_extensions.c