Re: Small Prolog Compiler/Abstract Machine for Embedded Microcontrollers

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
This is definitely not the league for SWI-Prolog, although I didn't
expect it to run on my phone in the 90s either :-) You would have needed
SWI-Prolog 0.1. Unfortunately, the sources are lost :-( There must be
something like that, as writing a core Prolog engine is really simple.
And yes, I think that Prolog is a good language for the task these
microcontrollers typically perform.

The smallest main line system is most likely GNU Prolog, especially if
you can leave out some stuff. If you go back to really old SWI-Prolog
versions (which are still in the git repo), you still need 32-bits and a
few hundreds of Kb memory. There is no support for these versions though
:-)

I recall that Ciao also has some provisions to generate small runtime
systems.

	Success --- Jan

On 02/26/2014 05:15 PM, [email protected] wrote:
> 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. _______________________________________________ SWI-Prolog
> mailing list [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.