7 ms·
I asked a question on HN but didn't get any answers - this might be an easier forum to get one. I'm working on a hobbyist rocketry project where I'm helping bu
by exdsq 7y ago
I asked a question on HN but didn't get any answers - this might be an easier forum to get one.
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!
- nerdponx 7y agoNot firsthand experience, but what about one of the Scheme dialects that compiles to C?
- mapcars 7y agoI don't think some specific lisp is required, the one which compiles to C should be good enough. Active example is https://gitlab.com/owl-lisp/owl https://gitlab.com/owl-lisp/owl
- antoinealb 7y agoI don't know anything about owl-lisp, but you also need a lisp that does not do any runtime memory allocation, as those are usually problematic in embedded projects, especially in those with as little RAM as the nano.
- cat199 7y agono direct arduino experience, but I'd imagine the potential would be greater for scheme than lisp since it is a more minimal subset - quick google reveals 'microscheme' https://news.ycombinator.com/item?id=11790630 https://news.ycombinator.com/item?id=11790630 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
- cmrdporcupine 7y agoWhat's wrong with the uLisp that the linked article is about?
- VLM 7y agoThe nano is basically a thin uno and has little storage for large projects, and OPs list of sensors is large. Something like three hundred cell limit. Its just not going to fit. 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.
- cmrdporcupine 7y agoI was browsing through the uLisp sources looking for places where I could maybe provide FPGA acceleration... Didn't come up with anything off the top of my head, but the thoughts are germinating :-) Might dust off my copy of the Rekursiv book...
- exdsq 7y agoI did just try uLisp but it used 96% of my storage and 74% of my RAM, so it's not viable. It was nice to set up though - it pretty much worked out the box - so I do suggest trying it out on slightly larger systems.
- reaperducer 7y agoAccording to recent articles on HN, NASA used to use Macintosh Common Lisp for many of its projects. I'm not an Arduino person, but maybe there's a Common Lisp variant available to you.
- gte525u 7y agoThey also had several megabytes of RAM.
- MarkMMullin 7y agoCommon LISP could certainly generate assembler for Arduino and other MCUs, but there's no way you're fitting that fat old beast (whom I do still love) on one . :-)
- crististm 7y agoYou might want to check this one: https://makerlisp.com/ https://makerlisp.com/
- dreamcompiler 7y agoAny Raspberry Pi should work fine for Lisp but if I had to use an Arduino I'd just write the code in Processing (or whatever they call the native Arduino compiler language these days) because fitting a Lisp into one would probably be more trouble than it's worth.
- pjmlp 7y agoLisp used to run in 60's hardware, I bet most embedded boards have more memory than those.
- dreamcompiler 7y agoOf course it can be done, but it would be a rather crippled Lisp. If the only Lisp I had was 60s Lisp, I'd probably choose Forth instead.
- exdsq 7y agoI just tried uLisp on my embedded board and it used 96% of the storage and 74% of the memory. Easy to set up but not viable.
- mCOLlSVIxp6c 7y agoYou might want to consider running something like the Raspberry Pi Zero. Looks like the Nano is 45mm x 18mm and the Pi Zero is 65mm x 30mm. If you could fit the Pi Zero it would probably make your life a lot easier.
- piercebot 7y agoThis is a great suggestion; the Zero has enough oomph to run the JVM, which gives you access to Clojure! 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/ https://ajpierce.com/2020-01-08_safe-to-wake-pt4/
- deleted 7y ago[deleted]