About using squeak to script...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Giovanni Corriga
Il giorno sab, 12/08/2006 alle 22.29 +0200, stéphane ducasse ha scritto:
> For the moment I would like to have the possibility to launch the vm  
> with a script and see the results on the command line
> like ruby.
> So OSProcees seems good for my goal. I will wrap it into Stdoutput to  
> have the same as in VW :)
> and play with it.
>

If you're on a Unix system, you should be able to use a WriteStream on
the special dev file /dev/stdout.

        Giovanni


Reply | Threaded
Open this post in threaded view
|

Re: Re: About using squeak to script...

Damien Pollet
On 8/16/06, Giovanni Corriga <[hidden email]> wrote:
> If you're on a Unix system, you should be able to use a WriteStream on
> the special dev file /dev/stdout.

Indeed it works :
FileStream fileNamed: '/dev/stdout'
        do: [:stdout |
                stdout nextPutAll: 'hello outside']

On mac I had to run squeak from a command-line by running this:
/Developer/Applications/Squeak/Squeak\
3.8.12beta4U.app/Contents/MacOS/Squeak\ VM\ Opt
/Developer/Applications/Squeak/3.9/base3.9g-7054.image

But that could be wrapped in a script or maybe using the unix VM.

--
 Damien Pollet
 type less, do more

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: About using squeak to script...

Damien Pollet
On 8/20/06, Damien Pollet <[hidden email]> wrote:
> On mac I had to run squeak from a command-line by running this:

I had to do that to see the output... I thought it would go to
system.log or console.log (visible using Console.app or a good ol'
tail -f) but apparently running apps by double-clicking them is not
exactly the same as executing the binary from a shell...
--
 Damien Pollet
 type less, do more

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Bert Freudenberg-3

Am 20.08.2006 um 18:52 schrieb Damien Pollet:

> On 8/20/06, Damien Pollet <[hidden email]> wrote:
>> On mac I had to run squeak from a command-line by running this:
>
> I had to do that to see the output... I thought it would go to
> system.log or console.log (visible using Console.app or a good ol'
> tail -f) but apparently running apps by double-clicking them is not
> exactly the same as executing the binary from a shell...

On OS X 10.4 you can use either Console.app or

        tail -f /Library/Logs/Console/`id -u`/console.log

This returns nil for me (might ask John, why)

        FileStream fileNamed: '/dev/stdout'

but this works (on the class-side of class StdOut):

        puts: aString
                <cdecl: void 'puts' (char*) module: 'libSystem.dylib'>
                ^ExternalFunction externalCallFailed

then

        StdOut puts: 'Hello World'


- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

stéphane ducasse-2
Thanks bert!
I think that this is the kind of features that could bring a lot of  
scripters to squeak.

> On OS X 10.4 you can use either Console.app or
>
> tail -f /Library/Logs/Console/`id -u`/console.log
>
> This returns nil for me (might ask John, why)
>
> FileStream fileNamed: '/dev/stdout'
>
> but this works (on the class-side of class StdOut):
>
> puts: aString
> <cdecl: void 'puts' (char*) module: 'libSystem.dylib'>
> ^ExternalFunction externalCallFailed
>
> then
>
> StdOut puts: 'Hello World'
>
>
> - Bert -
>
>


Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Giovanni Giorgi-2
In reply to this post by Giovanni Corriga
By the way take a look also to F-Script,
a scripting engine for Mac OS X.
It is a Smalltalk-like scripting engine and I find it very cool, with
some unique feature like message boradcasting:
http://www.oreillynet.com/pub/a/mac/2001/11/30/scripting_fscript.html
Bye bye

On 8/16/06, Giovanni Corriga <[hidden email]> wrote:

> Il giorno sab, 12/08/2006 alle 22.29 +0200, stéphane ducasse ha scritto:
> > For the moment I would like to have the possibility to launch the vm
> > with a script and see the results on the command line
> > like ruby.
> > So OSProcees seems good for my goal. I will wrap it into Stdoutput to
> > have the same as in VW :)
> > and play with it.
> >
>
> If you're on a Unix system, you should be able to use a WriteStream on
> the special dev file /dev/stdout.
>
>         Giovanni
>
>
>


--
Software Architect
http://www.objectsroot.com/
Software is nothing

Reply | Threaded
Open this post in threaded view
|

Re: Re: About using squeak to script...

Damien Pollet
On 8/22/06, Giovanni Giorgi <[hidden email]> wrote:
> By the way take a look also to F-Script,

I've had it installed for ages, but not doing as much cocoa
development as I'd like, I probably launched it for the third time
today :)

I quickly parsed the documentation, but didn't find if FScript can
declare methods of his own and how... is it done in the browser ? If
yes the problem is that the "message pattern+ body expression" syntax
isn't practical when there sould be several method declarations in a
single chunk of text...

--
 Damien Pollet
 type less, do more

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

stéphane ducasse-2
Philippe is working on that so that you can add class and methods.
So far if I remember correctly you can only define script.

I guess that this is the same that the pepsi syntax
[


]
On 23 août 06, at 12:11, Damien Pollet wrote:

> On 8/22/06, Giovanni Giorgi <[hidden email]> wrote:
>> By the way take a look also to F-Script,
>
> I've had it installed for ages, but not doing as much cocoa
> development as I'd like, I probably launched it for the third time
> today :)
>
> I quickly parsed the documentation, but didn't find if FScript can
> declare methods of his own and how... is it done in the browser ? If
> yes the problem is that the "message pattern+ body expression" syntax
> isn't practical when there sould be several method declarations in a
> single chunk of text...
>
> --
> Damien Pollet
> type less, do more
>


Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Mathieu SUEN
In reply to this post by Bert Freudenberg-3
2006/8/20, Bert Freudenberg <[hidden email]>:

>
> Am 20.08.2006 um 18:52 schrieb Damien Pollet:
>
> > On 8/20/06, Damien Pollet <[hidden email]> wrote:
> >> On mac I had to run squeak from a command-line by running this:
> >
> > I had to do that to see the output... I thought it would go to
> > system.log or console.log (visible using Console.app or a good ol'
> > tail -f) but apparently running apps by double-clicking them is not
> > exactly the same as executing the binary from a shell...
>
> On OS X 10.4 you can use either Console.app or
>
>         tail -f /Library/Logs/Console/`id -u`/console.log
>
> This returns nil for me (might ask John, why)
>
>         FileStream fileNamed: '/dev/stdout'
>
> but this works (on the class-side of class StdOut):
>
>         puts: aString
>                 <cdecl: void 'puts' (char*) module: 'libSystem.dylib'>
>                 ^ExternalFunction externalCallFailed
>
> then
>
>         StdOut puts: 'Hello World'
>
>
> - Bert -
>

Hi Bert,

Do you have an idea how can I do it on windows?

Thanks

      Math

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Bert Freudenberg
Mathieu SUEN wrote:

> 2006/8/20, Bert Freudenberg <[hidden email]>:
>>
>> Am 20.08.2006 um 18:52 schrieb Damien Pollet:
>>
>> > On 8/20/06, Damien Pollet <[hidden email]> wrote:
>> >> On mac I had to run squeak from a command-line by running this:
>> >
>> > I had to do that to see the output... I thought it would go to
>> > system.log or console.log (visible using Console.app or a good ol'
>> > tail -f) but apparently running apps by double-clicking them is not
>> > exactly the same as executing the binary from a shell...
>>
>> On OS X 10.4 you can use either Console.app or
>>
>>         tail -f /Library/Logs/Console/`id -u`/console.log
>>
>> This returns nil for me (might ask John, why)
>>
>>         FileStream fileNamed: '/dev/stdout'
>>
>> but this works (on the class-side of class StdOut):
>>
>>         puts: aString
>>                 <cdecl: void 'puts' (char*) module: 'libSystem.dylib'>
>>                 ^ExternalFunction externalCallFailed
>>
>> then
>>
>>         StdOut puts: 'Hello World'
>>
>>
>> - Bert -
>>
>
> Hi Bert,
>
> Do you have an idea how can I do it on windows?
>
> Thanks
>
>      Math

Upgrade to Linux.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Alan Grimes-2
>> Hi Bert,
>>
>> Do you have an idea how can I do it on windows?
>>
>> Thanks
>>
>>      Math
>
> Upgrade to Linux.
>
> - Bert -

NOOOOOOOO!!!!!!!!!!!

LINUX IS AWFUL.
AWFUL
AWFUL
AWFUL
AWFUL


YOU CAN'T HARDLY DO ANYTHING ON LINUX WITHOUT CRASHING THE FLAMING
MACHINE. EVERYONE WHO SAYS OTHERWISE IS A LIAR. THEY WILL PROTEST LOUDLY
THAT LINUX IS STABLE AND 'HAS NEVER CRASHED FOR THEM' BUT THEY LIE. IT
IS AN OCEAN OF UNMITIGATED SUCKEYNESS.

I HAVN'T BEEN ABLE TO WORK ON CROQUET FOR AGES NOW.

LINUX HAS DRIVEN ME INSANE!!!

WHATEVER YOU DO, STAY WITH WINDOWS. BILL GATES IS A HERO!!!


--
If you tell a linux advocate that you saw Bigfoot, he'd believe you.
If you tell him that you saw linux crash, he won't.

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Bert Freudenberg
Alan Grimes wrote:

> LINUX HAS DRIVEN ME INSANE!!!

No doubt about that.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: About using squeak to script...

Mathieu SUEN
In reply to this post by Alan Grimes-2
Alan Grimes a écrit :

>>> Hi Bert,
>>>
>>> Do you have an idea how can I do it on windows?
>>>
>>> Thanks
>>>
>>>      Math
>> Upgrade to Linux.
>>
>> - Bert -
>
> NOOOOOOOO!!!!!!!!!!!
>
> LINUX IS AWFUL.
> AWFUL
> AWFUL
> AWFUL
> AWFUL
>
>
> YOU CAN'T HARDLY DO ANYTHING ON LINUX WITHOUT CRASHING THE FLAMING
> MACHINE. EVERYONE WHO SAYS OTHERWISE IS A LIAR. THEY WILL PROTEST LOUDLY
> THAT LINUX IS STABLE AND 'HAS NEVER CRASHED FOR THEM' BUT THEY LIE. IT
> IS AN OCEAN OF UNMITIGATED SUCKEYNESS.
>
> I HAVN'T BEEN ABLE TO WORK ON CROQUET FOR AGES NOW.
>
> LINUX HAS DRIVEN ME INSANE!!!
>
> WHATEVER YOU DO, STAY WITH WINDOWS. BILL GATES IS A HERO!!!
>
>

I see I think the most difficlut problem is version number and that why it make things crach.

(Build the package 3.4.876.2 whith gcc 3.5.12-4 with the kernel 2.6.11-4 and the module a-v3.56.4 on
fedora core 4 and don't forget to use python 2.3.5 but you want to use a other cool package but it
don't work with kernel 2.6.11 and you try to load but.....biiiiiiiiip your a dead)

12