Related: Z80 assembler in Scheme
In 1983, Rescue on Fractalus and Ballblazer, the first releases from Lucasfilm Games, were built with a system written in Lisp. It was a 6502 assembler with Lisp syntax and a Lisp-style macro facility, written in Portable Standard Lisp, running in Berkeley Unix on a 4MB VAX 11/750. Unfortunately it was eventually abandoned because the developer had left and it was a bit of a strain on the VAX that was shared by the whole development team.
Yes, I wrote it. Yes, it was my first non-academic programming job. Yes, the users complained about the parentheses, and the slowness. But, they also took advantage of the powerful macro facility.
e.g. set the 3 bytes starting at bit 2 of x to the binary value 110:
(setf (ldb (byte 3 2) x) #b110)
(setf (ldb (byte 8 24) x) #xab)
; A4: 4883E1C6 AND RCX, -58
; A8: 4883C930 OR RCX, 48
For example SBCL
and its ARM64 instructions:
? (defun times13 (x) (* 13 x))
? (disassemble 'times13)
;;; (defun times13 (x) (* 13 x))
(recover-fn-from-rip) ; 
(cmpl ($ 8) (% nargs)) ; 
(jne L41) ; 
(pushq (% rbp)) ; 
(movq (% rsp) (% rbp)) ; 
(pushq (% arg_z)) ; 
;;; (* 13 x)
(movl ($ #x68) (% arg_y.l)) ; 
(movq (@ -8 (% rbp)) (% arg_z)) ; 
(movq (% rbp) (% rsp)) ; 
(popq (% rbp)) ; 
(jmp (@ .SPBUILTIN-TIMES)) ; 
;;; #<no source text>
L41 ; [@56]
(uuo-error-wrong-number-of-args) ; 
"CHIP-8 in Common Lisp: Disassembly"
It's powerful to re-code time critical snippets of code in Assembler, while still having access to a high level language like Lisp for the complex stuff.
It might interest people to know that Forth always offered this functionality and the ':' compiler lets one build ASM macros as well.
The old Lisp 1.5 manual documents an in-memory assembler in Appendix C, Page 73
Here's an example of GOAL code with inline code for the vector processors.
I'm working on a hobbyist rocketry project where I'm helping build the flight computer - basically an Arduino Nano connected to modules like a GPS system, accelerator, gyroscope, etc. Are there any Lisp dialects that someone would recommend for an Arduino? The Nano is technically replaceable so if there are better boards that can use Lisp I'd be interested too!
I had the most luck installing the Zulu Embedded version of Java, and I've had a Clojure webapp running on my Pi Zero for over a week now without any hiccups.
I'm a post or two behind on chronicling my adventures, but I did at least capture how I got Clojure running on the Zero here: https://ajpierce.com/2020-01-08_safe-to-wake-pt4/
I've played with drivers using ulisp and its fun and very fast on an adafruit SAMD51 board with plenty of storage. A Metro M4 Gran Central is a lovely dev board but too large for OP to launch.
Maybe an adafruit M4 feather board would work. I've not used one but its supposedly plug and play with ulisp, so I've heard.
I've never used one, but in theory a mattairtech.com product seems like what OP wants. ulisp should compile its just another SAMD51 board, right? And its available with some of the sensors OP wanted onboard. Note that "never used one" means OP will literally be breaking new ground. All I'm sure of its a physically very small SAMD51 board and I can't see any obvious reason ulisp wouldn't work.
The future of embeded dev is probably FPGA for custom hardware and interfaces with lisp or similar HLL (Straight up Clojure getting embedded?). No I don't mean tomorrow future, but maybe 2030.
I'm not an Arduino person, but maybe there's a Common Lisp variant available to you.
that said more powerful scheme features like tail recursion and macro systems may or may not be compatible with a more embedded scheme, so I wouldn't count on it being a full 'representative' of what scheme actually is - this may or may not matter, depending on the project
My plan at the time was to use a serial protocol and interface with a Nintendo GBA/DS for this kind of interactive Lisp programming.
It feels a bit dirty mixing implementation and target language like this, but it's great fun to program for.