Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 3 participants
- 144636 messages
Re: [Pharo-dev] csv2html the Pharo version
by Luc Fabresse
Hi Sven,
Arg, you got us :-P
Shame on us!
You are completely right that we could have done that in Pharo.
But, Zhi is working since mont on doing realistic robotics simulation on
the cluster of the EMD.
The goal is to use the SAME code both in simulation and in the real robots.
For doing this, he is writing a lot (a LOT) of BASH scripts to
automatically prepare simulations on the cluster nodes.
Since he is not really fluent in Pharo and since it involves so much system
scripting, he is doing it in BASH.
I suspect that he took the least resistant path to code the csv to html ...
Anyway, at some point we will move from this first prototype to another one
so involve Pharo deeper using PhaROS and then we will have more Pharo in
the loop ;-)
Cheers,
#Luc
2014-09-18 10:28 GMT+02:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
> Hi,
>
> Today I came across some bash code on a web page that loves Smalltalk, ah
> the horror ;-)
>
> http://car.mines-douai.fr/2014/09/csv2html/
>
> The goal is to make it easier to look at CSV data, for which a conversion
> to HTML was done. To just look at CSV data in a nice tabular form, we do
> not have to leave Pharo at all.
>
> MultiColumnListModel new
> items: (FileLocator desktop / 'test.csv' readStreamDo: [ :in |
> (NeoCSVReader on: in) emptyFieldValue: ''; upToEnd ]);
> displayBlock: [ :x | x ];
> title: 'CSV Data';
> openWithSpec.
>
> Which results in this nice window:
>
>
> To do a conversion to HTML, debugging the code in Pharo should be
> preferable to doing the same with bash & sed (for most of us anyway).
>
> FileLocator desktop / 'csv.html' writeStreamDo: [ :out | | reader |
> out << '<html><head><title>CSV Data</title></head><body><table
> border=1>'.
> reader := NeoCSVReader on: (FileLocator desktop / 'test.csv') readStream.
> reader emptyFieldValue: ''.
> out << '<tr bgcolor=silver>'.
> reader readHeader do: [ :each | out << '<th>'; << each; << '</th>' ].
> out << '</tr>'.
> reader do: [ :each |
> out << '<tr>'.
> each do: [ :td | out << '<td>'; << td; << '</td>' ].
> out << '</table></body></html>'.
> reader close ].
>
> Which gives the following output:
>
> NeoCSVReader is way more powerful in interpreting CSV files than a simple
> sed one-liner. Doing the same for a collection of files is easy. Maybe a
> little browser could even be written. Who knows, maybe Doru will add
> another tool to GT (TableViewer class>>#openStructuredOn: would do the
> trick I guess) ;-)
>
> Sven
>
> PS: The bash script was actually quite well written, even I could
> read/understand it. Thanks for sharing, it was the inspiration to do this
> little hack.
>
>
Sept. 18, 2014
csv2html the Pharo version
by Sven Van Caekenberghe
Hi,
Today I came across some bash code on a web page that loves Smalltalk, ah the horror ;-)
http://car.mines-douai.fr/2014/09/csv2html/
The goal is to make it easier to look at CSV data, for which a conversion to HTML was done. To just look at CSV data in a nice tabular form, we do not have to leave Pharo at all.
MultiColumnListModel new
items: (FileLocator desktop / 'test.csv' readStreamDo: [ :in |
(NeoCSVReader on: in) emptyFieldValue: ''; upToEnd ]);
displayBlock: [ :x | x ];
title: 'CSV Data';
openWithSpec.
Which results in this nice window:
To do a conversion to HTML, debugging the code in Pharo should be preferable to doing the same with bash & sed (for most of us anyway).
FileLocator desktop / 'csv.html' writeStreamDo: [ :out | | reader |
out << '<html><head><title>CSV Data</title></head><body><table border=1>'.
reader := NeoCSVReader on: (FileLocator desktop / 'test.csv') readStream.
reader emptyFieldValue: ''.
out << '<tr bgcolor=silver>'.
reader readHeader do: [ :each | out << '<th>'; << each; << '</th>' ].
out << '</tr>'.
reader do: [ :each |
out << '<tr>'.
each do: [ :td | out << '<td>'; << td; << '</td>' ].
out << '</table></body></html>'.
reader close ].
Which gives the following output:
NeoCSVReader is way more powerful in interpreting CSV files than a simple sed one-liner. Doing the same for a collection of files is easy. Maybe a little browser could even be written. Who knows, maybe Doru will add another tool to GT (TableViewer class>>#openStructuredOn: would do the trick I guess) ;-)
Sven
PS: The bash script was actually quite well written, even I could read/understand it. Thanks for sharing, it was the inspiration to do this little hack.
Sept. 18, 2014
Re: [Pharo-dev] Why Bloc?
by Alain Plantec
On 18 sept. 2014, at 04:44, Sean P. DeNigris <sean(a)clipperadams.com> wrote:
> stepharo wrote
>> - look at what he is doing
>> - we try to document the classes
>> ...
>
> How do I start playing with Bloc? After loading the development version into
> Pharo 3.0 and doing "BlMorphToTestMouseEnterLeave new openInWorld" I get
> "MessageNotUnderstood: receiver of "activeWorld" is nil"
Hi Sean,
Notice that you must run Bloc (be in a Bloc world) before you can run any of the bloc examples.
You can run Morphic within Bloc but not Bloc examples within a Morphic world.
first make sure that you have loaded the 4 Bloc-* packages.
then, (an issue that I must dig) if you image is a fresh one, make sure the author full name is well initialized with:
Author requestFullName
then you are ready to run a Bloc world:
world menu>Bloc>New Bloc space
world menu>Bloc>Switch to Bloc space...
choose 'Bloc-1'
Normally, you should switch to a new world (with a random background color).
The world menu is opened with the right mouse click (not the left one as in Morphic).
You can come back to Morphic by using world menu>Bloc>Switch to Bloc space...
Then you can try examples:
see class side of BlMorphWithLayout, BlPluggableEventListener, BlScheduledProcessingQueue
you can also try BlUniverse>>moveBlBigPasteUp (and compare it to BlUniverse>>moveBigPasteUp but within the Morphic world).
the same for BlMorphWithLayout>>moveMorphWithTableLayoutAnd10000Children versus
BlMorphWithLayout>>moveMorphWithTableLayoutAnd10000Children_morphic under Morphic.
Cheers
Alain
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Why-Bloc-tp4771757p4778711.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
Sept. 18, 2014
Re: [Pharo-dev] Why Bloc?
by Sean P. DeNigris
stepharo wrote
> - look at what he is doing
> - we try to document the classes
> ...
How do I start playing with Bloc? After loading the development version into
Pharo 3.0 and doing "BlMorphToTestMouseEnterLeave new openInWorld" I get
"MessageNotUnderstood: receiver of "activeWorld" is nil"
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Why-Bloc-tp4771757p4778711.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Sept. 18, 2014
Re: [Pharo-dev] I'm confused about Process>>isTerminated
by Eliot Miranda
Hi Max,
On Wed, Sep 17, 2014 at 1:59 PM, Max Leske <maxleske(a)gmail.com> wrote:
> Hi Eliot
>
>
> On 16.09.2014, at 20:18, Eliot Miranda <eliot.miranda(a)gmail.com> wrote:
>
> Hi Max,
>
> On Tue, Sep 16, 2014 at 11:05 AM, Max Leske <maxleske(a)gmail.com> wrote:
>
>> Hi
>>
>> As always when I want to check if a process has died I get very confused
>> by #isTerminated and Iâm wondering if I just donât get how itâs supposed to
>> work or if there are others that share my confusion.
>>
>> Old implementation:
>>
>> isTerminated
>>
>> self isActiveProcess ifTrue: [^ false].
>> ^suspendedContext isNil
>> or: ["If the suspendedContext is the bottomContext it is the
>> block in Process>>newProcess.
>> If so, and the pc is greater than the startpc, the
>> bock has alrteady sent and returned
>> from value and there is nothing more to do."
>> suspendedContext isBottomContext
>> and: [ suspendedContext pc > suspendedContext startpc ] ]
>>
>>
>> Pharo 4 implementation:
>>
>> isTerminated
>> self isActiveProcess ifTrue: [^ false].
>> ^suspendedContext isNil
>> or: ["If the suspendedContext is the bottomContext it is the
>> block in Process>>newProcess.
>> If so, and the pc is greater than the startpc, the bock
>> has alrteady sent and returned
>> from value and there is nothing more to do.â
>> suspendedContext isBottomContext
>> and: [ suspendedContext isDead not
>> â<âââââââââââââââââââââââââ new"
>> and: [ suspendedContext pc > suspendedContext startpc ] ]
>> ]
>>
>>
>> The old implementation would break if the suspended context was dead
>> (i.e. the pc was nil) because the send of #> would produce an MNU.
>> The new implementation doesnât fix that, even though it looks like it at
>> first glance: if the pc is nil, the #> send will still happen -> MNU.
>>
>
> Off the top of my head it would seem that it should be isDead or: [] not
> isDead not and:
>
> isTerminated
> self isActiveProcess ifTrue: [^ false].
> ^suspendedContext isNil
> or: ["If the suspendedContext is the bottomContext it is the
> block in Process>>newProcess.
> If so, and the pc is greater than the startpc, the bock
> has alrteady sent and returned
> from value and there is nothing more to do.â
> suspendedContext isBottomContext
> and: [ suspendedContext isDead
> or: [ suspendedContext pc > suspendedContext
> startpc ] ] ]
>
>
> Phew. Glad you see that the same way.
>
> isDead
>> ^ pc isNil
>>
>
> and maybe (suspendedContext pc ifNil: [true] ifNotNil: [:pc| pc >
> suspendedContext startpc]) is more obvious.
>
> Anyway, neither implementation will reliably tell me if the process has
>> been terminated:
>> - an inactive process will be suspended when #terminate is sent and
>> report that it has not been terminated (#isSuspended -> true, #isTerminated
>> -> false)
>>
>
> except that it *hasn't* been terminated, it is merely in the process of
> termination. It isn't terminated until all unwind blocks have run, right?
>
>
> True. Easy to forget when you can just kill -9 on the console⦠:)
>
>
>
>> - a properly terminated process will raise an MNU (although apparently
>> not always�)
>>
>
> but that's a bug the change I suggested will fix.
>
>
>> - all the states in between: no clue
>>
>> I would like to know two things:
>> 1. how can I check if a process has already *received* a #terminate? (I
>> would then assume that the process will die eventually)
>>
>
> I don't think you can without putting a critical section around terminate
> and adding some process-specific variable that is set when you send
> terminate. termination is not instantaneous (unwind blocks have to be
> run), so it is potentially interruptible.
>
>
> Iâve thought about this a bit. I wouldnât really care if I donât get a
> correct answer about the termination status immediately but I want to have
> it before the process terminates. In case of something like the following:
>
> ([ 10 seconds asDelay wait ] forkAt: 11) terminate
>
> it can (potentially) take a very long time for the process to terminate.
> So if I have to poll 3 or 4 times thatâs ok but I donât want to wait for
> minutes.
> One solution would be to take your idea of the variable, but without the
> critical block:
>
> terminate
> "Stop the process that the receiver represents forever. Unwind to execute
> pending ensure:/ifCurtailed: blocks before terminating."
>
> | ctxt unwindBlock oldList |
> terminating := true. â<âââââââââââââââââââââââââââââââââââ changed"
> self isActiveProcess
> ifTrue: [
> ctxt := thisContext.
> [ ctxt := ctxt findNextUnwindContextUpTo: nil.
> ctxt isNil ] whileFalse:
> [ (ctxt tempAt: 2) ifNil:
> [ ctxt tempAt: 2 put: nil.
> unwindBlock := ctxt tempAt: 1.
> thisContext terminateTo: ctxt.
> unwindBlock value ]].
> thisContext terminateTo: nil.
> self suspend ]
> ifFalse: [
> "Always suspend the process first so it doesn't accidentally get woken up"
> oldList := self suspend.
> suspendedContext ifNotNil:[
> "Figure out if we are terminating the process while waiting in
> Semaphore>>critical:
> In this case, pop the suspendedContext so that we leave the ensure: block
> inside
> Semaphore>>critical: without signaling the semaphore."
> (oldList class == Semaphore and:[
> suspendedContext method == (Semaphore compiledMethodAt: #critical:)])
> ifTrue:[
> suspendedContext := suspendedContext home.].
> "If we are terminating a process halfways through an unwind, try to
> complete that unwind block first."
> (suspendedContext findNextUnwindContextUpTo: nil) ifNotNil: [ :outer |
> (suspendedContext findContextSuchThat: [ :c | c closure == (outer tempAt:
> 1)])
> ifNotNil: [ :inner |
> "This is an unwind block currently under evaluation"
> suspendedContext runUntilErrorOrReturnFrom: inner ]].
> ctxt := self popTo: suspendedContext bottomContext.
> ctxt == suspendedContext bottomContext ifFalse: [
> self debug: ctxt title: 'Unwind error during termination']] ].
>
>
>
> isTerminating
> ^ terminating ifNil: [ ^ false ]
>
>
> With this small modification I can run the example from above and
> immediately see that it will die eventually.
>
> Iâm aware that one process might not see the change to the variable
> immediately but as I said, I wouldnât really care.
>
>
> What do you think?
>
Yes that looks good. But given that branches are atomic (ifTrue: is not a
send) why not do
Process>>initialize
terminating := false.
terminate
"Stop the process that the receiver represents forever. Unwind to execute
pending ensure:/ifCurtailed: blocks before terminating."
| ctxt unwindBlock oldList |
terminating
ifTrue: [self error: 'Process is already terminated, or being terminated']
ifFalse: [terminating := true].
self isActiveProcess
ifTrue:
...
?
I would suggest a status inst var, as in
Process>>initialize
status := nil
terminate
"Stop the process that the receiver represents forever. Unwind to execute
pending ensure:/ifCurtailed: blocks before terminating."
| ctxt unwindBlock oldList |
status == #terminating
ifTrue: [self error: 'Process is already terminated, or being terminated']
ifFalse: [status := terminating].
self isActiveProcess
ifTrue:
...
but the temptation then is to have lots of different status values and I'm
leery of introducing that kind of complication without a strong
justification.
> Cheers,
> Max
>
>
>
>> 2. how can I check if a process is *actually* dead? (in case a âhalf
>> deadâ process will still unwind or whatever)
>>
>
> see above.
>
>
>>
>> What would be necessary to make those tests (or better ones) possible
>> (rewrite the whole process implementation?)?
>>
>>
>> Cheers,
>> Max
>>
>
> --
> best,
> Eliot
>
>
--
best,
Eliot
Sept. 17, 2014
Re: [Pharo-dev] I'm confused about Process>>isTerminated
by Max Leske
Hi Eliot
On 16.09.2014, at 20:18, Eliot Miranda <eliot.miranda(a)gmail.com> wrote:
> Hi Max,
>
> On Tue, Sep 16, 2014 at 11:05 AM, Max Leske <maxleske(a)gmail.com> wrote:
> Hi
>
> As always when I want to check if a process has died I get very confused by #isTerminated and Iâm wondering if I just donât get how itâs supposed to work or if there are others that share my confusion.
>
> Old implementation:
>
> isTerminated
>
> self isActiveProcess ifTrue: [^ false].
> ^suspendedContext isNil
> or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
> If so, and the pc is greater than the startpc, the bock has alrteady sent and returned
> from value and there is nothing more to do."
> suspendedContext isBottomContext
> and: [ suspendedContext pc > suspendedContext startpc ] ]
>
>
> Pharo 4 implementation:
>
> isTerminated
> self isActiveProcess ifTrue: [^ false].
> ^suspendedContext isNil
> or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
> If so, and the pc is greater than the startpc, the bock has alrteady sent and returned
> from value and there is nothing more to do.â
> suspendedContext isBottomContext
> and: [ suspendedContext isDead not â<âââââââââââââââââââââââââ new"
> and: [ suspendedContext pc > suspendedContext startpc ] ] ]
>
>
> The old implementation would break if the suspended context was dead (i.e. the pc was nil) because the send of #> would produce an MNU.
> The new implementation doesnât fix that, even though it looks like it at first glance: if the pc is nil, the #> send will still happen -> MNU.
>
> Off the top of my head it would seem that it should be isDead or: [] not isDead not and:
>
> isTerminated
> self isActiveProcess ifTrue: [^ false].
> ^suspendedContext isNil
> or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
> If so, and the pc is greater than the startpc, the bock has alrteady sent and returned
> from value and there is nothing more to do.â
> suspendedContext isBottomContext
> and: [ suspendedContext isDead
> or: [ suspendedContext pc > suspendedContext startpc ] ] ]
Phew. Glad you see that the same way.
> isDead
> ^ pc isNil
>
> and maybe (suspendedContext pc ifNil: [true] ifNotNil: [:pc| pc > suspendedContext startpc]) is more obvious.
>
> Anyway, neither implementation will reliably tell me if the process has been terminated:
> - an inactive process will be suspended when #terminate is sent and report that it has not been terminated (#isSuspended -> true, #isTerminated -> false)
>
> except that it *hasn't* been terminated, it is merely in the process of termination. It isn't terminated until all unwind blocks have run, right?
True. Easy to forget when you can just kill -9 on the console⦠:)
>
> - a properly terminated process will raise an MNU (although apparently not always�)
>
> but that's a bug the change I suggested will fix.
>
> - all the states in between: no clue
>
> I would like to know two things:
> 1. how can I check if a process has already *received* a #terminate? (I would then assume that the process will die eventually)
>
> I don't think you can without putting a critical section around terminate and adding some process-specific variable that is set when you send terminate. termination is not instantaneous (unwind blocks have to be run), so it is potentially interruptible.
Iâve thought about this a bit. I wouldnât really care if I donât get a correct answer about the termination status immediately but I want to have it before the process terminates. In case of something like the following:
([ 10 seconds asDelay wait ] forkAt: 11) terminate
it can (potentially) take a very long time for the process to terminate. So if I have to poll 3 or 4 times thatâs ok but I donât want to wait for minutes.
One solution would be to take your idea of the variable, but without the critical block:
terminate
"Stop the process that the receiver represents forever. Unwind to execute pending ensure:/ifCurtailed: blocks before terminating."
| ctxt unwindBlock oldList |
terminating := true. â<âââââââââââââââââââââââââââââââââââ changed"
self isActiveProcess
ifTrue: [
ctxt := thisContext.
[ ctxt := ctxt findNextUnwindContextUpTo: nil.
ctxt isNil ] whileFalse:
[ (ctxt tempAt: 2) ifNil:
[ ctxt tempAt: 2 put: nil.
unwindBlock := ctxt tempAt: 1.
thisContext terminateTo: ctxt.
unwindBlock value ]].
thisContext terminateTo: nil.
self suspend ]
ifFalse: [
"Always suspend the process first so it doesn't accidentally get woken up"
oldList := self suspend.
suspendedContext ifNotNil:[
"Figure out if we are terminating the process while waiting in Semaphore>>critical:
In this case, pop the suspendedContext so that we leave the ensure: block inside
Semaphore>>critical: without signaling the semaphore."
(oldList class == Semaphore and:[
suspendedContext method == (Semaphore compiledMethodAt: #critical:)]) ifTrue:[
suspendedContext := suspendedContext home.].
"If we are terminating a process halfways through an unwind, try to complete that unwind block first."
(suspendedContext findNextUnwindContextUpTo: nil) ifNotNil: [ :outer |
(suspendedContext findContextSuchThat: [ :c | c closure == (outer tempAt: 1)])
ifNotNil: [ :inner |
"This is an unwind block currently under evaluation"
suspendedContext runUntilErrorOrReturnFrom: inner ]].
ctxt := self popTo: suspendedContext bottomContext.
ctxt == suspendedContext bottomContext ifFalse: [
self debug: ctxt title: 'Unwind error during termination']] ].
isTerminating
^ terminating ifNil: [ ^ false ]
With this small modification I can run the example from above and immediately see that it will die eventually.
Iâm aware that one process might not see the change to the variable immediately but as I said, I wouldnât really care.
What do you think?
Cheers,
Max
>
> 2. how can I check if a process is *actually* dead? (in case a âhalf deadâ process will still unwind or whatever)
>
> see above.
>
>
> What would be necessary to make those tests (or better ones) possible (rewrite the whole process implementation?)?
>
>
> Cheers,
> Max
>
>
>
> --
> best,
> Eliot
Sept. 17, 2014
[Review: 12111] (Date readFrom: '4.2.2013' readStream pattern: 'd.m.yy') ==>> 4 February 2020
by Max Leske
In the spirit of Markusâ cleanup please review this suggested fix to date parsing (from november 2013 originallyâ¦). Iâve ported the fix forward to 40 (which has the same issue).
https://pharo.fogbugz.com/f/cases/12111/Date-readFrom-4-2-2013-readStream-p…
Cheers,
Max
Sept. 17, 2014
Re: [Pharo-dev] [squeak-dev] Re: The Dilemma: Building a Futuristic GUI for Ephestos
by Torsten Bergmann
Eliot wrote:
>We're getting there with fast. Â Tiny needs more definition, but the core Cog/Spur VM on Mac minus plugins and GUI >code is 568k, 506k code, 63k data; the newspeak VM which has fewer primitives but support for two bytecode sets is >453k, 386k code, 68k data. Â That includes the interpreter, JIT, core primitives and memory manager/GC. Add on >several k for the FFI, C library et al and a VM in a megabyte is realistic. Â Is that in the right ball park?
Yes, wet's my appetite :)
Tiny means easy to download and use for scripting, no other dependencies
for the out of the box REPL experience. But still powerfull to built one on another
and scale up to large programs.
Initially you provide just a simple VM executable for a "tiny smalltalk" (ts), for simple
things like:
c:\myscripts\ts.exe -e 3+4
7
where ts.exe is the VM in a few kB including a small initial kernel image (as part of
the PE DATA section). It should be able to run scripts:
c:\myscripst\ts.exe automate.st
It should be possible to easily build components (either with or without the sources):
ts.exe sunit.st -o sunit.sll
ts.exe sunit.st -noSource -o sunit.sll
So you can either include other scripts
ts.exe -i sunit.st mytests.st
or link the previously built binary components to form something new.
ts.exe -l junit.sll mytests.st
But it should be possible to build another vm+image easily:
ts.exe -i mykillerapp.st -o killerapp.exe
or ts.exe -l mykillerapp.sll -o killerapp.exe
by writing a new PE file for Windows either including a new kernel image or a combined
one based on the already built-in initial kernel of the previous one.
So I can deploy a killerapp or reassemble it to form the next language version.
SmallScript was very close to that and it was a nice thing to work with.
Especially since usually Smalltalk usually throws things out at the end - but
one never builds a house by carving it out of a rock. We need bricks to assemble.
With the above scheme you could build components, some of them portable, others
explicitly non-portable as the code includes native calls. The later have to
be rebuilt on the other platform - so if you have good design abstractions you
can implement a UI lib on Windows and one on Mac.
Some of the components are with the source code packaged in for debugging
(but not changeable), for closed source components you leave it out.
And still it should support pinnable objects (not moved by GC for callouts),
sandboxing, Classes with UUIDs to allow for side by side loading/migration
and an extensible meta-scheme as this is where Smalltalk is still the hero of all
und metaprogramming will be our future.
Also the VM should be available as a shared component - so it can run in-process
in other programs like a web browser. Always wished to write:
<script type="text/tinyscript">
BrowserLog write: 'HelloWorld'.
</script>
directly in HTML.
And this is only the beginning of the wish list...
>Yep. Â But personally I think Fuel is better and just as fast. Â Certainly that's the parcels experience.
>Â Â - but still with the ability to bootstrap up to a full saveable image
Yes, Fuel would be an option. At least it would be platform independent. Not sure
about other options (quick loading by mapping component using memory mapped files etc.)
 Â
>This we'll leave to the web framework designers, but it seems eminently doable no?
For sure.
Bye
Torsten
Sept. 17, 2014
Re: [Pharo-dev] [Vm-dev] re: Parsing Pharo syntax to C/C++
by Thierry Goubier
Hi Eliot
Le 17/09/2014 19:18, Eliot Miranda a écrit :
> Hi Thierry,
>
> Yes, and various dialects have a literal constructor for "compile-time
> expressions" (I did one for VW) that provide a manual (and hence
> fragile) way of doing this. As you pointed out this approach breaks
> when one changes the code previously compiled. Having Sista regenerate
> for you automatically is of course preferrable. But what do you mean
> "do not have any effect in Squeak/Pharo anymore"?
It works but has no effect on performance. Well, this is an
optimisation; you gain in certain circonstances, you loose in others and
you turn it off.
>
> I have colleagues in the same department working on localized,
> template based JiT of computational kernels and they do 3 inst of
> JiT for one instruction (and prove that they go faster on some
> matrix math code, including the JiT overhead, than anything
> statically optimised off-line).
>
>
> Sure. My JIT optimizes and cannot be reduced to a template approach.
> But it is still extremely fast. As I said, scanning code to
> relink/compact/GC is what takes the time, not compilation itself. And
> the pause times here are bounded (see below).
>
> At the same time, a one ms pause at 2.2GHz is a hell of a long time
> if your target is a MicroBlaze at 50 Mhz or an embedded powerpc at
> 25 MHz.
>
>
> Sure, there are bound to be contexts in which Cog can't meet the
> required deadlines. But that doesn't imply it can never do real time,
> does it? And processor speeds are climbing. Look at Raspberry Pi,
> 700MHz. Not too shabby.
This is the performance of an old desktop :) And a not so old at that.
ARM started as a desktop processor, after all.
But, look: Python works very well on the Pi ;) Fast enough, and if not,
you call a C lib.
> The problem is that even a simple JiT is considered too much Jitter :)
>
>
> But some in some contexts. But that doesn't define the entire real time
> world.
Yes.
>
> The Ocaml guys told once they had to do a special, interpreted VM
> for a real-time use case. The problem is not going fast, the problem
> is being predictable. They turn off CPU caches in some cases.
>
> Sure. But if one can show that the JIT's pause times are bounded and
> well spaced then there is no fundamental problem. People have been
> implementing real-time GCs and using GC in real time systems for over 20
> years now. This is no different. But you seem absolute in denying that
> there is any possibility of using a JIT in real time. I think that
> claim is clearly false.
If we consider that you would have to do a WCET analysis / stack
boundedness analysis to prove that the JIT pauses are deterministic,
bounded and are schedulable for the target times (i.e. suitable for a
significant part of what real time is about), then that claim will hold
true for a while.
If we change and adjust the definition of real-time and the required
processing power needed, then we can consider Cog JIT sufficiently
real-time as long as it is reasonably deterministic.
This is my opinion on that: for what I have done in the embedded world
and on FPGA so far, any gain on the determinism, performance and
portability of Cog is highly significant(*); but I would really like
that the language running on top of Cog, and Cog, be able to clearly let
a programmer specify bounds / determinism requirements / parallelism so
as to ensure that it may communicate well with real-time programs. And
then it would be a really nice fit, and a huge boost to both Cog and the
Embedded/RT community.
(*) And those benefits would also make it really cool to use everywhere.
(**) A nice target would be to be able to run Cog on a SoC with a
general purpose CPU core and a FPGA.
(***) and then I could reuse what I know about synthesizing logic
circuits on a FPGA from smalltalk code :)
Regards,
Thierry
Sept. 17, 2014
Re: [Pharo-dev] [squeak-dev] Re: The Dilemma: Building a Futuristic GUI for Ephestos
by Esteban A. Maringolo
2014-09-17 14:07 GMT-03:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
>> - tiny and fast VM with a command line and REPL
> We're getting there with fast. Tiny needs more definition, but the core
> Cog/Spur VM on Mac minus plugins and GUI code is 568k, 506k code, 63k data;
> the newspeak VM which has fewer primitives but support for two bytecode sets
> is 453k, 386k code, 68k data. That includes the interpreter, JIT, core
> primitives and memory manager/GC. Add on several k for the FFI, C library et
> al and a VM in a megabyte is realistic. Is that in the right ball park?
Those sizes are impressively small!
All those features in less than a megabyte are small even if we go
back in time ten years from now.
I'm eager to see and use those futuristic VMs even for mundane tasks.
Esteban A. Maringolo
Sept. 17, 2014