[Pharo-project] Command Line Interface using FFI
damien.pollet at gmail.com
Tue Jan 31 07:10:32 EST 2012
On 29 January 2012 21:11, Guillermo Polito <guillermopolito at gmail.com> wrote:
> 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.
This is something I'd like to have as a part of Coral.
What's your opinion on the FFI-libc approach compared to OSProcess? I
was actually thinking of doing something like that using NativeBoost
> Gofer it
> squeaksource: 'CLInterface';
> package: 'ConfigurationOfCLInterface';
> 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
> - 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 :).
type less, do more [ | ] http://people.untyped.org/damien.pollet
More information about the Pharo-dev