Small Prolog Compiler/Abstract Machine for Embedded Microcontrollers
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <20140226161503.F24OZ.213250.root@cdptpa-web05> |
This may be the wrong place to ask this, and if it is I do apologize. I would like to ask if anybody has an idea where i can get a hold of a very small abstract machine that can run Prolog. I'm looking to try to get Prolog running on a microcontroller ( AVR/Arduino for starters, Cortex later on ). Why? I think Prolog is a more natural choice for making work. When you program a microcontroller, most of what you are doing is constructing rules based on both analog and digital inputs so that some for of work can be done. Most of the time this is done in a C like language. While C maybe the default go to language, I think prolog is better choice. Prolog source code is easier to read, and more expressive. You can generally understand what is going on in a Prolog clause just by reading it. On the other hand, C can be quite confusing and obtuse. There have been a number of times that I have had to reread or dig around to figure out what is going on in a simple function. One of the tasks that Prolog handles well is the build of rules and relationships. Programming microcontrollers is basically about creating decision points if certain pieces of inputs. What should happen if the temperature is above 15C and the lights are turned? Questions like that are difficult and time-consuming to answer for C, but can be answered almost naturally by Prolog. The problem with microcontrollers is the limited amount of resources available to them. The prolog abstract machine would have to be small so we can still have room for bootloaders and user code. Does anyone know of a small prolog implementation that might fit the bill for this situation? Is anyone aware of something like this being tried in the past? Thank you.