Shen foreigner language interface

38 views
Skip to first unread message

josef...@gmail.com

unread,
Apr 16, 2015, 3:18:48 PM4/16/15
to qil...@googlegroups.com
I invented small DSL and implemented translation in DCG (SWI Prolog) and calling it in from Python. Shen yacc seams even more convenient. Is foreigner language interface question of underlying implementation. In my case SBCL.
I would like to call my Shen yacc main function from python or similar language

Greg Spurrier

unread,
Apr 16, 2015, 3:29:09 PM4/16/15
to qil...@googlegroups.com
The details of how you invoke Shen functions from the host language will vary with the platform. You can find documentation of how it works in Ruby here, for example.

There are a couple of python ports, but I do now know whether they are up-to-date with the recent Shen releases.

Greg

Mark Tarver

unread,
Apr 16, 2015, 4:00:33 PM4/16/15
to qil...@googlegroups.com
If you are using Shen/SBCL and driving your program from Python, then this is really a question of how you call SBCL from Python.  An alternative might be to use Shen/Python which will require no FFI.  However Ramil, the author of this port, would have to fill in the details of how you call a native Python function from his port.    It would be good to know this and then I would put this info into the Learn Shen pages.

Such an arrangement, though simpler, might have a performance hit because Python is slower than SBCL - last time I looked (2007) by an order of magnitude.  

Mark
Reply all
Reply to author
Forward
0 new messages