[Pharo-project] Support for stdout without OSProcess (issue 4065)
Hi: What needs to be done for issue 4065? http://code.google.com/p/pharo/issues/detail?id=4065 I would like to have an easy way to provide compatibility for the RoarVM primitive RVMOperations>print: which really just dumps a string to stdout. So, ideally, I don't want to many dependencies like OSProcess in SMark. What would need to be done for that? The issue is not to verbose. Is it a missing print primitive in the VM? Thanks Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
On Sun, May 15, 2011 at 06:44:30PM +0200, Stefan Marr wrote:
Hi:
What needs to be done for issue 4065? http://code.google.com/p/pharo/issues/detail?id=4065
I would like to have an easy way to provide compatibility for the RoarVM primitive RVMOperations>print: which really just dumps a string to stdout. So, ideally, I don't want to many dependencies like OSProcess in SMark.
What would need to be done for that? The issue is not to verbose. Is it a missing print primitive in the VM?
Thanks Stefan
FilePlugin>>primitiveFileStdioHandles is present in both the interpreter VM and Cog. It was added to the interpreter VM (SqueakSource/VMMaker) here: Name: VMMaker-dtl.213 Author: dtl Time: 28 December 2010, 2:06:59 am UUID: f2524f34-cfcb-46ea-80b6-81402f9a875f Ancestors: VMMaker-dtl.212 VMMaker 4.4.4 Add FilePlugin>>primitiveFileStdioHandles adapted from oscog. Reference Mantis 0007591: Add #primitiveFileStdioHandles to standard VM Notes r.e. adopting the oscog implementation of primitiveFileStdioHandles: Cog primitive uses "interpreterProxy topRemappableOop" which is defined for VM_PROXY_MINOR > 9 but standard VM support code is at VM_PROXY_MINOR 8 (Cog is at VM_PROXY_MINOR 11). Work around this by popping and pushing the result array rather than using topRemappableOop. Cog uses primitive failure return codes not yet supported in the interpreter VM. The primitive return codes need to be adopted in standard VM but this is not yet done.
david how do we use it from the image to print on stdout? Stef On May 15, 2011, at 6:55 PM, David T. Lewis wrote:
On Sun, May 15, 2011 at 06:44:30PM +0200, Stefan Marr wrote:
Hi:
What needs to be done for issue 4065? http://code.google.com/p/pharo/issues/detail?id=4065
I would like to have an easy way to provide compatibility for the RoarVM primitive RVMOperations>print: which really just dumps a string to stdout. So, ideally, I don't want to many dependencies like OSProcess in SMark.
What would need to be done for that? The issue is not to verbose. Is it a missing print primitive in the VM?
Thanks Stefan
FilePlugin>>primitiveFileStdioHandles is present in both the interpreter VM and Cog. It was added to the interpreter VM (SqueakSource/VMMaker) here:
Name: VMMaker-dtl.213 Author: dtl Time: 28 December 2010, 2:06:59 am UUID: f2524f34-cfcb-46ea-80b6-81402f9a875f Ancestors: VMMaker-dtl.212
VMMaker 4.4.4
Add FilePlugin>>primitiveFileStdioHandles adapted from oscog. Reference Mantis 0007591: Add #primitiveFileStdioHandles to standard VM
Notes r.e. adopting the oscog implementation of primitiveFileStdioHandles:
Cog primitive uses "interpreterProxy topRemappableOop" which is defined for VM_PROXY_MINOR > 9 but standard VM support code is at VM_PROXY_MINOR 8 (Cog is at VM_PROXY_MINOR 11). Work around this by popping and pushing the result array rather than using topRemappableOop.
Cog uses primitive failure return codes not yet supported in the interpreter VM. The primitive return codes need to be adopted in standard VM but this is not yet done.
On 15 May 2011, at 19:06, Stéphane Ducasse wrote:
david
how do we use it from the image to print on stdout? The primitive is supposed to return the file handles, and they can be used like normal files, I guess.
See http://permalink.gmane.org/gmane.comp.lang.smalltalk.squeak.general/154784 Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
Hi: On 15 May 2011, at 19:20, Stefan Marr wrote:
On 15 May 2011, at 19:06, Stéphane Ducasse wrote:
david
how do we use it from the image to print on stdout? The primitive is supposed to return the file handles, and they can be used like normal files, I guess.
See http://permalink.gmane.org/gmane.comp.lang.smalltalk.squeak.general/154784
After filing in Eliot's change set from this mail: http://forum.world.st/Re-squeak-dev-stdio-td949485.html StandardFileStream stdout nextPutAll: 'bar'. works beautifully with http://squeakvm.org/mac/release/Squeak%205.7.4.1.zip However, there is some regression with that VM, it does not take the image on the command line. I am used to: /Applications/Squeak\ 4.2.5beta1U.app/Contents/MacOS/Squeak\ VM\ Opt Pharo-1.2.image HelloWorld /Applications/Squeak\ 5.7.4.1.app/Contents/MacOS/Squeak Pharo-1.2.image HelloWorld just opens a file dialog. I have to give the full file name. Esteban: is that a know regression? Thanks Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
Hi Stefan, On Sun, May 15, 2011 at 11:08 AM, Stefan Marr <pharo@stefan-marr.de> wrote:
Hi:
On 15 May 2011, at 19:20, Stefan Marr wrote:
On 15 May 2011, at 19:06, Stéphane Ducasse wrote:
david
how do we use it from the image to print on stdout? The primitive is supposed to return the file handles, and they can be used like normal files, I guess.
See http://permalink.gmane.org/gmane.comp.lang.smalltalk.squeak.general/154784
After filing in Eliot's change set from this mail: http://forum.world.st/Re-squeak-dev-stdio-td949485.html
StandardFileStream stdout nextPutAll: 'bar'.
Please take Levente's code from Squeak 4.x trunk. He's done some important polishing. My change set was a first cut quick hack. Levente, do you have a changeset handy? best Eliot
works beautifully with http://squeakvm.org/mac/release/Squeak%205.7.4.1.zip
However, there is some regression with that VM, it does not take the image on the command line.
I am used to: /Applications/Squeak\ 4.2.5beta1U.app/Contents/MacOS/Squeak\ VM\ Opt Pharo-1.2.image HelloWorld
/Applications/Squeak\ 5.7.4.1.app/Contents/MacOS/Squeak Pharo-1.2.image HelloWorld just opens a file dialog. I have to give the full file name.
Esteban: is that a know regression?
Thanks Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
Thanks for the information. I will update the bug entry. Stef On May 16, 2011, at 7:06 PM, Eliot Miranda wrote:
Hi Stefan,
On Sun, May 15, 2011 at 11:08 AM, Stefan Marr <pharo@stefan-marr.de> wrote: Hi:
On 15 May 2011, at 19:20, Stefan Marr wrote:
On 15 May 2011, at 19:06, Stéphane Ducasse wrote:
david
how do we use it from the image to print on stdout? The primitive is supposed to return the file handles, and they can be used like normal files, I guess.
See http://permalink.gmane.org/gmane.comp.lang.smalltalk.squeak.general/154784
After filing in Eliot's change set from this mail: http://forum.world.st/Re-squeak-dev-stdio-td949485.html
StandardFileStream stdout nextPutAll: 'bar'.
Please take Levente's code from Squeak 4.x trunk. He's done some important polishing. My change set was a first cut quick hack. Levente, do you have a changeset handy?
best Eliot
works beautifully with http://squeakvm.org/mac/release/Squeak%205.7.4.1.zip
However, there is some regression with that VM, it does not take the image on the command line.
I am used to: /Applications/Squeak\ 4.2.5beta1U.app/Contents/MacOS/Squeak\ VM\ Opt Pharo-1.2.image HelloWorld
/Applications/Squeak\ 5.7.4.1.app/Contents/MacOS/Squeak Pharo-1.2.image HelloWorld just opens a file dialog. I have to give the full file name.
Esteban: is that a know regression?
Thanks Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
On Sun, May 15, 2011 at 07:06:35PM +0200, St?phane Ducasse wrote:
david
how do we use it from the image to print on stdout?
Stef
Of course I just use OSProcess ;-) But in Squeak trunk (http://source.squeak.org/trunk) the stdio updates are in Files-ul.96 and Files-ul.97. Name: Files-ul.96 Author: ul Time: 24 January 2011, 3:45:32.858 am UUID: d06be799-4c77-3b46-aff8-4abc589fafd3 Ancestors: Files-mtf.95 Stdio support changes: - Added stdio support code to FileStream. - Unified API for accessing stdio streams. All users should send #stdin, #stdout and #stderr to FileStream to access the streams. - MultiByteFileStream is used instead of CrLfFileStream. - CrLfFileStream class >> #new is now deprecated Name: Files-ul.97 Author: ul Time: 24 January 2011, 3:59:59.143 am UUID: 6f9985b2-9bce-a145-a3d2-276a76ce1fa7 Ancestors: Files-ul.96 - removed previous stdio support code from StandardFileStream, migration is done in the preamble
On May 15, 2011, at 6:55 PM, David T. Lewis wrote:
On Sun, May 15, 2011 at 06:44:30PM +0200, Stefan Marr wrote:
Hi:
What needs to be done for issue 4065? http://code.google.com/p/pharo/issues/detail?id=4065
I would like to have an easy way to provide compatibility for the RoarVM primitive RVMOperations>print: which really just dumps a string to stdout. So, ideally, I don't want to many dependencies like OSProcess in SMark.
What would need to be done for that? The issue is not to verbose. Is it a missing print primitive in the VM?
Thanks Stefan
FilePlugin>>primitiveFileStdioHandles is present in both the interpreter VM and Cog. It was added to the interpreter VM (SqueakSource/VMMaker) here:
Name: VMMaker-dtl.213 Author: dtl Time: 28 December 2010, 2:06:59 am UUID: f2524f34-cfcb-46ea-80b6-81402f9a875f Ancestors: VMMaker-dtl.212
VMMaker 4.4.4
Add FilePlugin>>primitiveFileStdioHandles adapted from oscog. Reference Mantis 0007591: Add #primitiveFileStdioHandles to standard VM
Notes r.e. adopting the oscog implementation of primitiveFileStdioHandles:
Cog primitive uses "interpreterProxy topRemappableOop" which is defined for VM_PROXY_MINOR > 9 but standard VM support code is at VM_PROXY_MINOR 8 (Cog is at VM_PROXY_MINOR 11). Work around this by popping and pushing the result array rather than using topRemappableOop.
Cog uses primitive failure return codes not yet supported in the interpreter VM. The primitive return codes need to be adopted in standard VM but this is not yet done.
Thanks this is what I guessed and I opened a ticket 4233 to check that. Stef On May 15, 2011, at 11:09 PM, David T. Lewis wrote:
On Sun, May 15, 2011 at 07:06:35PM +0200, St?phane Ducasse wrote:
david
how do we use it from the image to print on stdout?
Stef
Of course I just use OSProcess ;-) But in Squeak trunk (http://source.squeak.org/trunk) the stdio updates are in Files-ul.96 and Files-ul.97.
Name: Files-ul.96 Author: ul Time: 24 January 2011, 3:45:32.858 am UUID: d06be799-4c77-3b46-aff8-4abc589fafd3 Ancestors: Files-mtf.95
Stdio support changes: - Added stdio support code to FileStream. - Unified API for accessing stdio streams. All users should send #stdin, #stdout and #stderr to FileStream to access the streams. - MultiByteFileStream is used instead of CrLfFileStream. - CrLfFileStream class >> #new is now deprecated
Name: Files-ul.97 Author: ul Time: 24 January 2011, 3:59:59.143 am UUID: 6f9985b2-9bce-a145-a3d2-276a76ce1fa7 Ancestors: Files-ul.96
- removed previous stdio support code from StandardFileStream, migration is done in the preamble
On May 15, 2011, at 6:55 PM, David T. Lewis wrote:
On Sun, May 15, 2011 at 06:44:30PM +0200, Stefan Marr wrote:
Hi:
What needs to be done for issue 4065? http://code.google.com/p/pharo/issues/detail?id=4065
I would like to have an easy way to provide compatibility for the RoarVM primitive RVMOperations>print: which really just dumps a string to stdout. So, ideally, I don't want to many dependencies like OSProcess in SMark.
What would need to be done for that? The issue is not to verbose. Is it a missing print primitive in the VM?
Thanks Stefan
FilePlugin>>primitiveFileStdioHandles is present in both the interpreter VM and Cog. It was added to the interpreter VM (SqueakSource/VMMaker) here:
Name: VMMaker-dtl.213 Author: dtl Time: 28 December 2010, 2:06:59 am UUID: f2524f34-cfcb-46ea-80b6-81402f9a875f Ancestors: VMMaker-dtl.212
VMMaker 4.4.4
Add FilePlugin>>primitiveFileStdioHandles adapted from oscog. Reference Mantis 0007591: Add #primitiveFileStdioHandles to standard VM
Notes r.e. adopting the oscog implementation of primitiveFileStdioHandles:
Cog primitive uses "interpreterProxy topRemappableOop" which is defined for VM_PROXY_MINOR > 9 but standard VM support code is at VM_PROXY_MINOR 8 (Cog is at VM_PROXY_MINOR 11). Work around this by popping and pushing the result array rather than using topRemappableOop.
Cog uses primitive failure return codes not yet supported in the interpreter VM. The primitive return codes need to be adopted in standard VM but this is not yet done.
participants (4)
-
David T. Lewis -
Eliot Miranda -
Stefan Marr -
Stéphane Ducasse