ulisp icon indicating copy to clipboard operation
ulisp copied to clipboard

Cannot run ULisp to C on Arduino UNO

Open EvansJahja opened this issue 9 months ago • 1 comments

I saw the ULisp to C converter here

http://www.ulisp.com/show?2L5B

and I saw that it was mentioned that it should be able to run on Common Lisp and Arduino UNO, but I cannot run it on either.

On Arduino UNO, I got "No room".

On Common LISP (Portacle), I got error because eval doesn't work on function created using defun..

EvansJahja avatar Apr 09 '25 10:04 EvansJahja

Thanks for reporting these problems.

It will run on an Arduino platform, but unfortunately the Arduino Uno doesn't have enough memory to run the program. As I mentioned in the article I ran it on an Adafruit ItsyBitsy M4. It might also run on an M0, such as the Arduino Zero.

You're correct that it doesn't run on Common Lisp as it stands, but it will work if you supply the function you want to convert to C as a list argument to convert. For example:

> (convert '(defun area (w h) (print (* w h))))
// Function AREA
void AREA (int W, int H) {
  PRINT((W * H));
}
"}"

The function lisp-to-c is a shortcut to doing this for a function that's already defined in uLisp. I'll update the article to add this information; thanks for pointing it out!

technoblogy avatar Apr 09 '25 13:04 technoblogy