remote lisp - a server side lisp interpreter

Whatever is on your mind, whether Lisp related or not.

remote lisp - a server side lisp interpreter

Postby Martin Kalbfuß » Fri Aug 21, 2015 12:42 pm

Hallo lisp community,

I want to share a link to my website http://remote-lisp.spdns.de. It is LISP command line interpreter in an early development stage. I put it here, so people can take look from time to time, an watch its development. Maybe someone find it usefull. I like to implement a standard conform common lisp interpreter. It's a long way to go, but maybe some day...
I had my first contact with lisp while working with AutoCAD at work. While the so called AutoLISP is not a very impressive variant of LISP, but it cought my interest. Most of our code is written in C++. But there is still a lot of legacy lisp code, which is really badly written. But I have to unserstand and fix it. I decided to improve both, my C++ and LISP skills, while writing a LISP interpreter. I hope you have fun with it! It would be interesting to know, which functions you are considder the most important. Please don't say defun or setq/setf. I will implement them as soon as possible. What do you think about the client. Which features are you interestet in. Which use cases can you imagine?

The used technologies are C++, g++, Boost, Poco, Dojo and CMake. Great tools an libraries.

best regards,

Martin Kalbfuß
Martin Kalbfuß
 
Posts: 12
Joined: Fri Jul 24, 2015 5:27 am

Re: remote lisp - a server side lisp interpreter

Postby edgar-rft » Fri Aug 21, 2015 3:54 pm

First of all: Thank you for sharing the link to this great Lisp interpreter! I had lots of fun during the last hour to type all kind of Lisp-nonsense into the input field and it survived all my attemts to crash the interpreter pretty well so far. :D

I think ATOMs, CONS cells, LISTs, and math functions (everything that has to do with numbers) are most important, and I see that you have already implemented most of them.

The third-useful thing after DEFUN and SETF would be DEFMACRO and everything that has to do with manipulating symbols like SYMBOL-NAME, SYMBOL-VALUE, SYMBOL-FUNCTION, SYMBOL-PLIST, etc.

Next-useful things were CHARACTERs and SEQUENCEs like STRINGs, VECTORs (where strings are vectors of characters), and ARRAYs (which also could be implemented on the Lisp user level as vectors of vectors).

Is the goal to be compatible with AutoLisp, Common Lisp, or both? I see function names like FAC and FIB that are no Common Lisp functions.

Do you know Tom Almy's XLISP-PLUS interpreter? It's an subset of Common Lisp with a Smalltalk-like object system (message passing instead of generic functions). The source code is available under:

It's written in C (not C++), but maybe it's useful fo looking-up how things are implemented?

The XLISP interpreter originally was written by David Betz, but Tom Almy got official permission to continue and maintain the old XLISP Lisp interpreter, while David Betz rewrote and maintains the same thing now as a XLISP Scheme interpreter (what is probably not what you want).

Practical problem while playing with your interpreter - how long does it take to compute:

Code: Select all
(expt 333333 444444)

I have waited approx. half an hour without any result, afterwards the website was "frozen", I couldn't even move my web browser's scrollbar anymore. But re-loading the page (what fortunately still worked) made the Remote-Lisp entry field work again. I hope I haven't damaged your program. :shock:

- edgar
edgar-rft
 
Posts: 224
Joined: Fri Aug 06, 2010 6:34 am
Location: Germany

Re: remote lisp - a server side lisp interpreter

Postby edgar-rft » Fri Aug 21, 2015 7:13 pm

Several hours later...

It looks as if the interpreter can't handle quoted lists:

Code: Select all
(car (list 1 2 3))   => 1  ; works
(car '(1 2 3))       => error: function 'CAR' expected (list) as arguments, but got ((1, 2, 3)
(car (quote 1 2 3))  => error: Undefined symbol 'QUOTE'

This is probably because the QUOTE operator isn't implemented or the single-quote isn't recognized as read-macro, or both. Please do not understand this as negative nagging, I only try to find out what's missing. I'm still having big fun with typing things into a web-based Lisp interpreter.

BTW, I like it very much how small instruction windows pop-up when I move the mouse over the functions listed on the right side. :P

- edgar
edgar-rft
 
Posts: 224
Joined: Fri Aug 06, 2010 6:34 am
Location: Germany

Re: remote lisp - a server side lisp interpreter

Postby Martin Kalbfuß » Sat Aug 22, 2015 5:53 am

Hi edgar,

thanks for you response It is really fun to work on this project. Too much fun! Sadly i have to concentrate on some exams I have to write in the near future. So in the next weeks there will be no new versions. I've allready started to implement some features. But none of them is production ready.
The functions FIB and FAC are extensions. The final result should be a superset of common lisp, with additional functions I like to have or someone else has requested. If you like to see a non-standard function, I will maybe introduce it, if I see its importance.

With the next release:

- At least the functions CADDR, CADDDR, CAADR, CAADDR, CAAADR and ENDP are introduced. Maybe the non-standard function BINOM-COEFF.
- The time of a request to the server will be meassured and the result will be shown in the command line. I need this mainly for myself, but why not show it to the user?! The plan is to meassure total execution time, the server processing time, and the difference of both, the communication time.
- A Bugfix to the parser. If there's a function call without arguments and there is no space after the function symbol, it responds with Unexpected token ')' instead of calling the function.
- Maybe more. We will see.

By the way. Your expt calculation was still running ;-), when I checked my sever state. My Server is only a tiny RespberryPI 2. This is far too much for it. I have to introduce an execution time limit or something similar.

best regards,

Martin Kalbfuß
Martin Kalbfuß
 
Posts: 12
Joined: Fri Jul 24, 2015 5:27 am

Re: remote lisp - a server side lisp interpreter

Postby Martin Kalbfuß » Wed Jan 06, 2016 2:07 pm

A new Version of my web page ist out. Version 0.4! It's currently not working on IE11 and maybe later. I will fix this soon. Have fun. If you find A bug please tell me. I have little time to test it.

What's new?

The client has been completely rewritten. This was a lot of work. So there aren't much new features. Hopefully this will change now. It is now possible to cancel long lasting requests. In the help tooltips there is a link to the HyperSpec to get further infos about a function. This will be the case until I have my own API reference. Not all Tooltips are complete. I will complete them soon. The planed Support for Sessions is missing. I havent desided yet, if it will be part of the next release. Maybe there are more important things to do.

Have fun

Best Regards
Martin
Martin Kalbfuß
 
Posts: 12
Joined: Fri Jul 24, 2015 5:27 am

Re: remote lisp - a server side lisp interpreter

Postby CADTechie » Sun Apr 10, 2016 11:18 am

I am developing an application for Land Surveyors in BricsCAD. I can accomplish most of what I need from inside using the internal lisp engine, but I will need to be able to hook into BricsCAD from the outside to implement certain features in the future. I am able to use Comtypes in Python to establish a link into BricsCAD fairly easily, but my mind thinks in lisp so I would rather use common lisp if at all possible. Do you know of a windows COM class wrapper for Commons Lisp?
Many Thanks,
Kevin
CADTechie
 
Posts: 2
Joined: Sun Apr 10, 2016 8:43 am
Location: Kentucky, USA

Re: remote lisp - a server side lisp interpreter

Postby Martin Kalbfuß » Sat Apr 16, 2016 8:58 am

I don't know a COM interface for Common-Lisp. That would be amazing. If you find one, please tell me.
You could embed ECL (Embeddable Common-Lisp) in an BRX application and implement the needed functions in C++. But this is not trivial. You have to know C++, ECL and BRX. Another problem is, that ECL is under GPL. You cannot use it in closed source applications. That's the reason I implement my own interpreter. It should run under AutoCAD/BricsCAD some day replacing the week VisualLisp. But it's a long way to go. Currently the easiest option is to use VisualLisp and its COM interface.
Martin Kalbfuß
 
Posts: 12
Joined: Fri Jul 24, 2015 5:27 am


Return to The Lounge

Who is online

Users browsing this forum: No registered users and 3 guests