Hacker News new | past | comments | ask | show | jobs | submit login

Oddly enough I've been looking for a REPL that I can stick on a microcontroller. MicroPython is a candidate, and in fact I have one of the boards from the original Kickstarter. I looked into PicoLisp but see that it doesn't support floating point numbers. In fact I don't even know if floating point is "supposed" to be part of Lisp at all, and have read some comments to the effect that it might be frowned on by some. But my intended use would really benefit from it.

I tried adding floating point support to a small Lisp or Scheme interpreter (can't remember which one), and quickly got lost, as I'm not a great programmer.

This definitely looks cool, and I will play around with it. Maybe it's nostalgia, but I grew up with computers that booted into the BASIC prompt, so it brings back the fun of exploring computers for me.




It's not just Lisp, but it includes pilog, a built-in Prolog, a database and coroutines. PicoLisp is an amazing piece of work by essentially one man, and has been used in real-world database applications since the late 1980s. They were trying to build hardware to run it, hence PilMCU, but too much inertia has lead now to PilOS. Yeah, PilOS!

Now to get Shen running on PicoLisp after Alex adds networking!


> Now to get Shen running on PicoLisp after Alex adds networking!

That shouldn't be an issue :)


If you want to have a REPL on something like a microcontroller, there's a tool designed especially for that: Forth. You're going to find an implementation for any chip and platform you can think of (Forth is 40 years old and simple enough to be trivially portable to almost anything). Forth is strange and feels archaic at first, but I'd say it's roughly on par with Lisp in terms of expressivity and much better suited for systems with constrained resources than Python.


Interesting. Which microcontrollers are you considering? I didn't know about MicroPython but it's kind of blowing my mind; I mean, it feels weird to dynamically allocate anything in a microcontroller.


MicroPython was originally written for an ARM chip. Since then it's been ported to a number of other systems. What I do know is that it requires a fairly "big" micro. I have a particular interest in PIC chips, but would be happy with any version where I could compile and load the program on a circuit that I'm capable of building myself.

I have tried downloading and compiling large C programs in the past, and it's one of those things where if it works, great, but if the basic "make" comes back with an error for some reason, then I'm kinda lost. My experience with C programming has tended to be with programs numbering no more than a few hundred lines, that all fit in one file and didn't need any kind of "interesting" build process.

Wow, talk about a weird set of customer requirements. ;-)

These micro's have a fair amount of RAM, and the C compilers support memory management, e.g., basics such as malloc() and free(). I suppose somebody could even implement garbage collection.


In case you aren't aware of them, eLua [1] or PIC32Lua [2] may fit your needs.

  1. http://www.eluaproject.net/overview/status
  2. https://github.com/FMMT666/PIC32Lua


Also picobit for scheme goodness: https://github.com/stamourv/picobit

Doesn't support full numeric tower (no floats), but does implement 'unbound precision integers'. See §5.1 of this paper: http://www.iro.umontreal.ca/~feeley/papers/StAmourFeeleyIFL0...


That looks quite interesting. Thanks! I've actually got some PIC32 chips left over from another project.


I think MicroPython would be the best fit for your requirements, both because of the REPL, which really simplifies programming, and because the simplicity of python(i heard of quite a few guys that couldn't manage c , but we're fine with python).

On the other hand, why not the arduino ? there's no build process , plenty of documentation and libraries, and a reasonable chance you'll find some design close to yours.


So far I'm leaning towards the MicroPython. In fact, Python is my language of choice du jour, but I enjoy keeping my eye out for other possibilities.

At the same time, I've been using Arduino, and also have a fair amount of experience programming Microchip's MCU's in C. I'm actually fine with C, but not so good at wrapping my head around large programs that other people have written. This is probably because I've always been a lone wolf programmer.

The reasons why I want an interpreter on a micro is for some strictly hobby projects that require programmability on board. I started planning an absurd DIY pocket calculator, and actually ggot as far as writing my own parser and expression evaluator in C. But a programmable calculator that uses Python or even Lisp would be a fun novelty.


If you want a real trip check out leJOS - a JVM for the Hitachi H8 based Lego RCX (and now the much less esoteric ARM-based NXT bricks).


Older still is BrickOS.

Back in 2003, in grade 11, I built a LEGO robot that played the game Connect 4, compiling a mixed C/asm minimax implementation for the RCX via a cygwin toolchain. I can't find pictures of the actual competition, but there's a single pic from a hobby show where it was exhibited:

https://www.flickr.com/photos/sparky1701/4821407356/in/album...

Sometimes not knowing what's impossible is a really good thing.


Microcontrollers haven't really become 64-bit yet.

Also this project looks very PC-oriented in other ways (virtual memory management, VGA screen output, keyboard - all of them are PC and no microcontroller devices)

You might be better off starting with a different, more portable, project. As klibertp said, Forth is a possibility. I remember one guy writing a 'Forth bootstrapping framework' called BootForth [1] sometime in 2008, which unfortunately since disappeared off the net, but you may have luck inquiring for the sources.

[1] http://compgroups.net/comp.lang.forth/forth-bootstrapping-fr...


There's several Scheme implementations now built for microcontroller/embedded use, Picobit for example: https://github.com/stamourv/picobit




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: