Julia: export flisp in libjulia?

Created on 15 Aug 2016  路  10Comments  路  Source: JuliaLang/julia

Would it be crazy to export fl_* in libjulia?

I was thinking of putting together a Scheme mode in the Julia REPL that called the built-in Scheme interpreter, partly for fun (for the greater glory of Scheme!) and mostly because it would make it a lot easier to hack on the parser (the julia --lisp REPL sucks). But I'm stuck because I can't call the flisp API from Julia code.

(A few of the flisp functions are missing the fl_ prefix, but those should probably be renamed anyway.)

Most helpful comment

It would still be nice to have this. I don't think we need to commit to supporting the API indefinitely; just leave it undocumented for use in a package, if only to provide a full-featured lisp REPL for hacking on the parser.

All 10 comments

While a good idea, does this bind us to long term support for the scheme APIs? Perhaps they can be undocumented and the modes can be added in packages? Of course, APIs can also be deprecated if we switch to JuliaParser or something, if ever.

I think we can export a minimum amount of flisp api for a possible FlispREPL package that helps parser hacking like https://github.com/JuliaLang/julia/pull/17108

@stevengj
There are some rumors, that julia tries to solve the two-language problem with one language. Adding more languages follows a strange logic.

I see this more in the direction of having a scheme FFI, just like we do for many other languages.

In fact having a high level Julian API for working with the parser will even allow for a non scheme parser in the future.

@stevengj Using julia --lisp with rlwrap helps its repl situation.

Thanks Jeff, though rlwrap doesn't give tab completion.

Maybe I should just write a Guile.jl package instead, though I'd have to provide some Julia extensions in order to call the parser. (Jeff, besides the stuff in julia_extensions.c, how much of flisp deviates from standard Scheme?)

How about exposing the fl_ namespace if a compile-time option is set and if you've got Julia compiled that way, you get a Femtolisp mode?

@StefanKarpinski, it seems like too much work to implement a femtolisp mode that almost no one will be able to use.

It would still be nice to have this. I don't think we need to commit to supporting the API indefinitely; just leave it undocumented for use in a package, if only to provide a full-featured lisp REPL for hacking on the parser.

If we really don't want to expose everything as an exported API, we could conditionally stick the function pointers in a struct.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ararslan picture ararslan  路  3Comments

StefanKarpinski picture StefanKarpinski  路  3Comments

musm picture musm  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments