Forth interpreter and readline library in Ada

May 30th, 2006 by Samuel Tardieu

For the 2006 French robotics cup, I wrote two utility packages for GNAT, the GNU Ada compiler:

  • areadline: access the readline library from Ada;
  • aforth: embeddable Forth interpreter written in Ada (uses the areadline library).

I haven’t put a license file in them yet, but you can get them under the GNU General Public License version 2.

5 Responses to “Forth interpreter and readline library in Ada”

  1. Frédéric PRACA Says:

    Hello,
    just a question : Why FORTH on a Linux robot ?

    Fred

  2. Samuel Tardieu Says:

    What other kind of programmable interpreter would you use for interactive testing? Forth is such a beast. For example, we could interface with four words: move, turn, moving and ms (for milliseconds).

    Testing a path with the robot was as simple as typing:

    : end-of-move begin moving while 50 ms repeat ;
    : full-move move end-of-move ;
    : full-turn turn end-of-move ;

    : side 100 move 90 turn ;
    : square side side side side ;

    square

    The robot would then make a square of 100 millimeters by 100 millimeters, waiting for the completion of each move before launching the next one, and ensuring 50ms pauses between successive pollings of the moving status to ensure that other tasks can be scheduled as well.

  3. Bruce Conroy Says:

    I like it. I was a Forth guru back in the TRS-80 days, but I seem to have forgotten most of it.

    In any case, I grabbed it from the web site, and it compiled on the second try. I’m going
    to dust off my Forth books and see if I can make it do amything useful.

    blc

  4. Samuel Tardieu Says:

    Be careful, it is not complete at all and even lacks some basic words. I will add them as time permits, but this was not a priority, I only implemented what we needed to test our robot.

    Alternatively, you may want to patch it and give me access to the patches so that I can integrate them :-)

  5. Luca Della Rocca Says:

    I used your utility packages for my final doctorate at university, thank you for all your work.

Leave a Reply


Creative Commons License