[Pharo-project] Command Line Interface using FFI

Guillermo Polito guillermopolito at gmail.com
Sun Jan 29 21:11:58 CET 2012


I've spent a few hours playing with Alien+FFI and I did want to have a
Command line interface to play and use as a quick browser.

Gofer it
    squeaksource: 'CLInterface';
    package: 'ConfigurationOfCLInterface';
    load.

ConfigurationOfCLInterface load.


To play with it write a script, for example startCLI.st, with the following:

*CLInterface start*



And then, from the command line

CogVM -vm-display-null <image> startCLI.st


What it does support?
- executes smalltalk expressions
- handles the errors and shows them into the stdout (so it does not explode
:P)
- stores variables as a workspace
Since I used standard C functions (fgets and printf only) this should work
on every platform from scratch (having a VM with FFI working, of course)...

The problems I've ran so far:
- blocking FFI blocks the vm.  I've not tried yet to use threads through
FFI (and I don't know if it works.  Does it?).  But It should be great to
start a headless seaside server with a command line :/.

Ok, it's a very simple thing, but it allows to execute a expression from a
remote server via ssh without doing much :).

Guille
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20120129/183301c4/attachment.htm>


More information about the Pharo-project mailing list