Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- 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
- 1 participants
- 144619 messages
Re: [Pharo-dev] Pharo+Git cons?
by Thierry Goubier
Hi Eliot,
thanks for that mail.
2014-12-04 23:59 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
> Hi Thierry,
>
> On Tue, Dec 2, 2014 at 10:25 PM, Thierry Goubier <
> thierry.goubier(a)gmail.com> wrote:
>
>>
>>
>> 2014-12-03 4:16 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
>>
>>>
>>> Yes, but *I* care about the Monticello metadata. IMO its *better* than
>>> the git metadata.
>>>
>>
>> Eliot, you'll have to do better than just IMO on that one.
>>
>
> Quite right. One benefit is that Monticello metadata, at least per-method
> time stamps, are available for introspection inside the image. Just today
> I was alerted of some bad code by a particular author and it was very
> convenient to read all the methods by that particular author, which helped
> me find another problem. I also like the free frorm of the middle of
> method timestamps; I can and do annotate with labels for specific
> refactorings.
>
I believe Dale will tell you that git will give you the ability to select a
particular author work on a per-line basis, per-file basis (method or
class, then), etc...
Interestingly, the ability to comment at the file level is provided by
github (well, in fact, it's a bit finer grained than that: it's commenting
on a change in a file which fits your use case particularly well).
So this means we could probably do better there.
>
> Another benefit is that Monticello is amenable for scripting much more
> easily than git. I've been working on the SPur bootstrap fro a while now.
> It is essentially complete. What the bootstrap does in Monticello is
> construct patched versions of four packages, substituting specific methods
> with replacements. Each patched package inherits both from its patched
> ancestor and the package that was patched (a ladder like structure). This
> allows Spur to keep up-to-date automatically w.r.t. Squeak trunk.
>
But this would also work over a git-based Monticello. And, as you describe
it, it probably even been seen as a simple merge (it's a kind of by-hand
merge you're doing, basically).
This is one of the features I'm waiting Max for: the time he spent dealing
with the low-level structure of the .git stuff(*) so that you can do
exactly what you describe (or a Monticello merge) and commit that, and have
it tracked as such.
(*) Honestly, I didn't want to do it myself :(
>
> I'm also delighted that work like Chris Muller's version server is out
> there. This is very nicely integrated to allow me to find out which
> package versions contain versions of a particular method or class
> definition.
>
I know that this version server exists, and I hoped that you would point it
out, because I believe it is significant. Even if it is not usable in many
professional settings, such as mine.
As you probably do as well, I know what features are needed from such a
server to make it distributed 'Ã la git'.
>
> Some of us work with *both*, and have code for going back and forth, so
>> the *better*; bah.
>>
>> I also happens to know how long it takes to parse hundreds of monticello
>> metadata files... and I wasn't impressed with the result.
>>
>
> Yes, but this can be reengineered. Most things can be optimized. This
> could be with a little effort. What's needed is to generate and maintain
> momentum. That's what worries me about git integration. It's a slippery
> slope towards giving up Monticello and just using git. And git itself will
> one day be viewed as old-hat. Monticello should be easy to keep evolving.
> It's in Smalltalk few chrissake.
>
Hey! You're talking to the guy who spent time making sure his git
infrastructure would look and feel perfectly like a normal Monticello
repository :)
But, having the on-demand version metadata, on-demand creation of a
specific history version, the speed at which you sync a remote, the fact
that you can commit locally and sync later, the fact that querying for
method or class versions is a lot faster... those are things that one
should consider when thinking of improving Monticello.
>
>
>
>>
>>> What's really lacking in Monticello is a) it's not high school so one
>>> can't preen in front of the world on github and b) it has no support for
>>> external files. Well, a) will be solved by growing up and b) can be solved
>>> by building the solution. I know what I'd rather do.
>>>
>>>
>>> [and apologies for being deliberately incendiary but I *hate* the
>>> movement away from tools in Squeak/Pharo. It is a movement towards stasis
>>> and death, and personally I'm enjoying life too much].
>>>
>>
>> You then have noticed that those threads are about working on tools?
>>
>
> Yes, and that's why I'm writing to the thread. I hope that work on
> integrating foreign file support, and integrating things like Chris
> Muller's version server continues in the Pharo community. More than
> anything I hope that Monticello remains a bridge between the Squeak and
> Pharo communities.
>
I entirely agree with that :)
Thierry
>
>
>>
>>
>> Thierry
>>
>>
>>
>>
>
>
> --
> best,
> Eliot
>
Dec. 5, 2014
Re: [Pharo-dev] Monticello and Fuel
by Thierry Goubier
2014-12-04 23:43 GMT+01:00 Ben Coman <btc(a)openinworld.com>:
> Thierry Goubier wrote:
>
>> Hi all,
>>
>> I'm just wondering.
>>
>> Would it work to have a package format based on Fuel?
>>
>> Would that make loading faster?
>>
>> Does it already exist?
>>
>> Thanks,
>>
>> Thierry
>>
>
> What is your use case for needing it faster?
> * Just every day developer use?
> * CI automation?
> * Something in production?
> * Other?
> cheers -ben
>
> The three first ones. Anything which improves loading speed / reduces
memory footprint, really.
Maybe the point to target is the version metadata.
Thierry
Dec. 5, 2014
Re: [Pharo-dev] Monticello and Fuel
by Thierry Goubier
2014-12-05 0:08 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
> Hi Thierry,
>
> On Thu, Dec 4, 2014 at 2:31 PM, Thierry Goubier <thierry.goubier(a)gmail.com
> > wrote:
>
>> Hi all,
>>
>> I'm just wondering.
>>
>> Would it work to have a package format based on Fuel?
>>
>
> It doesn't have to be based on Fuel. Monticello .mcz's are just zips that
> contain any number of files:
>
> Archive: trunkpackages/Kernel.spur-eem.866.mcz
> Length Date Time Name
> -------- ---- ---- ----
> 15 08-07-14 09:12 package
> 294780 08-07-14 09:12 version
> 1370995 08-07-14 09:12 snapshot/source.st
> 1442870 08-07-14 09:12 snapshot.bin
> -------- -------
> 3108660 4 files
>
> Right now package and version are juts textual, and you've been
> complaining about the parsing speed. It would be easy to extend the
> package to include e.g. version.fuel. It is also a huge advantage to keep
> both the .bin (a not-as-fast binary loading format similar in use to Fuel
> but more primitive) along side the source code, because the source can be
> extracted without a running system, and can be compiled if, for some
> reason, binary loading fails. So instead of changing the format you could
> simply augment it with a snapshot.fuel, modifying the writer to include it,
> and modify the reader to use the .fuel if it exists.
>
Yes, or use an entirely different format. Whatever works.
FileTree demonstrate that this can be done, and GitFileTree demonstrated
that it could totally reproduce the mcz view on another tech repo.
I'm more annoyed by the consequences of loading the full version file in
the image.
>
> Would that make loading faster?
>>
>
> Yes. But not hugely because the .bin already loads faster than the .st.
> You might do some profiling?
>
Good suggestion. This is what I wanted to know.
>
>
>> Does it already exist?
>>
>
> Much of what you need is there. Use the Pharo, Luke.
>
This is a part of Pharo where I know my way :)
Thanks,
Thierry
>
>
>>
>> Thanks,
>>
>> Thierry
>>
>
>
>
> --
> best,
> Eliot
>
Dec. 5, 2014
Woden
by volkert@nivoba.de
I want to play a bit with Woden.
What are the system requirements?
What VM do i need?
I tried to load Woden it into Pharo 3.0 (with Default Pharo VM)
System: Ubuntu 14.04 x64.
Volkert
Dec. 5, 2014
Re: [Pharo-dev] Code retrieval on primitive failed
by Eliot Miranda
Hi Vincent,
On Thu, Dec 4, 2014 at 7:39 AM, Blondeau Vincent <
vincent.blondeau(a)worldline.com> wrote:
> Finally, I succeeded to retrieve my code !
>
>
>
> I tried with the Cog VM Simulator to open my image.
>
> It opened my crashed image in the simulator without any problem (it seems
> that the failing primitive has been caught).
>
> But I cannot interact with the image through the simulator workspace and
> the morph.
>
> It seems that you can launch some code by doit to export a package named
> MyPackage:
>
>
>
> cos systemAttributes
>
> at: 2 put: '-doit';
>
> at: 3 put: (âRPackage
> named:ââMYPackageâ) fileout â]
>
>
>
> But this did not work because my code contains shared pools and it cannot
> be filed outâ¦
>
>
>
>
>
> In parallel, I tried the other solution of Clement by changing the
> bytecode in the .image itself.
>
>
>
> If the problem comes from a native boost primitive, you should use a cogvm
> : (e.g.
> http://www.mirandabanda.org/files/Cog/VM/VM.r3056/cogwin-14.29.3056.zip)
> to launch the failing image.
>
> After that, you should see the crash log and see which are the code that
> is failing (apparently one of the top method in the stack).
>
> The best is to have the Smalltalk code of this method because you have to
> retrieve the associated bytecode. Else either you try to remember exactly
> the content of the method or you take another method in the stack where you
> have the code.
>
>
>
> Once you have identified the method, extract the bytecode:
>
> on Pharo4 with the right click on the method name and by printing âself
> bytecode hexâ
>
> on Pharo3 inspect the class containing the method, find the right compiled
> method and print âself bytecode hexâ
>
>
>
> After that open the broken image with a hexadecimal editor (I use HxD
> under w7) (do a COPY before).
>
> Find the bytecode of the method and replace it by several 120 (78 in hex).
>
> As the bytecodes are not unique, it is possible to do several
> replacements. If you donât want that, you can find another bytecode
> available in the stack trace. Longest is the bytecode, less will be the
> number of finding matches.
>
>
>
> Try to reopen your image with the cogwm. If it doesnât work either you
> broke a critical method of your image (so try again with another bytecode)
> either you have another failure so you start again to find the good method.
>
You make me proud!! That's a great way to do it. Brings back memories of
similar holes I'v dug for myself and crawled out of. Well done!
>
>
> Once you can open it. Save your code!!!
>
> The file out didnât work for me so I commited with Monticello in local and
> it worked!
>
>
>
> So donât forget to commit!
>
>
>
> Vincent
>
>
>
>
>
> *De :* Blondeau Vincent
> *Envoyé :* mercredi 3 décembre 2014 18:41
> *Ã :* Pharo Development List
> *Objet :* RE: [Pharo-dev] Code retrieval on primitive failed
>
>
>
>
>
>
>
> *De :* Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org
> <pharo-dev-bounces(a)lists.pharo.org>] *De la part de* Clément Bera
> *Envoyé :* mercredi 3 décembre 2014 17:54
> *Ã :* Pharo Development List
> *Objet :* Re: [Pharo-dev] Code retrieval on primitive failed
>
>
>
> Please send the full stack trace. You don't have only three lines, do you ?
>
>
>
> No, indeed (the full stack is attached).
>
>
>
> There's one solution that Igor does sometimes that you can try...For that
> you need to remember what code you changed that now crashes the image in
> smalltalk. Do you know what code crash your image ?
>
> Could you rewrite it (exactly the same code) in a fresh image ?
>
> If so the process is as follow:
>
> - rewrite the crashing code in a fresh image
>
> - extract the bytecode from the compiled method
>
> - open a copy of your image with an hexadecimal editor, look for the
> bytecode pattern, replace it by returnself (byte 120 the number of times
> needed)
>
> - try open your copy. Do as little things as possible (typically, only
> file out your packages, monticello will most probably not work)
>
>
>
> Ok I will try this but this is more a generic printing method that is the
> problem (see trace)⦠And not a specific methodâ¦
>
> I tried but it seems not adapted to my caseâ¦
>
>
>
> The alternative is to open your image on top of the cog simulator. Word
> has been that there's a Pharo 3 image running the cog simulator, you can
> use that to debug the code and fix it. Alternatively use a squeak vmmaker
> image that you can build with this script:
>
> $ svn co http://www.squeakvm.org/svn/squeak/branches/Cog/image
>
> $ cd ./image
>
> $ ./buildsqueaktrunkvmmakerimage.sh
>
> You put a halt on the implementation of primitive 117 in the simulator
> (named primitives call such as NB calls) to catch the crash and fix it from
> there in the simulator.
>
>
>
> That seems better ! I am trying this way.
>
>
>
> Good luck and have fun :-)
>
>
>
> Thanks :)
>
>
>
>
>
> 2014-12-03 17:04 GMT+01:00 Blondeau Vincent <
> vincent.blondeau(a)worldline.com>:
>
> Hello everyone,
>
>
>
> I am doing some developments with NativeBoost and unfortunaly I succeed to
> save my image in a unstable state.
>
> I am using the last moose image i.e.: Pharo3.0 - Latest update: #30860.
>
>
>
> So when I want to launch my image, I get a primitive faillure.
>
> The interesting part of the stack trace is :
>
> Stack backtrace:
>
> [07EE7A1B] ??? + 0 in (null)
>
> [00539AB5] ??? + 1284789 in Pharo.exe
>
>
>
> Smalltalk stack dump:
>
> 0x2410b8 M NBFFICallout class(NBNativeCodeGen class)>retrySend:
> 0x4c70b4c: a(n) NBFFICallout class
>
> 0x2410ec I NBFFICallout class(NBNativeCodeGen class)>retrySend:
> 0x4c70b4c: a(n) NBFFICallout class
>
> 0x78a0d90 s RDoubleVector(OrderedCollection)>at:
>
>
>
> Then I wanted to retrieve my changes on a new image but, as the doIts are
> not recorded, I have neither the method deletions nor all the operations on
> classes nor the trait methods that are recorded as Doits with preamble:
> Trait method.
>
>
>
> I tried to launch my image with squeak (which doesnât support NativeBoost)
> to hope saving or commit my code. But as I am calling a primitive at
> startup of the image to initialize the external environement. I got the
> following trace :
>
> [31m==== Startup Error: PrimitiveFailed: primitive #isEnabled in
> NativeBoost class failed
>
> [0mNativeBoost class(Object)>>primitiveFailed:
>
> NativeBoost class(Object)>>primitiveFailed
>
> NativeBoost class>>isEnabled
>
> NativeBoost class>>forCurrentPlatform
>
> NativeBoost class>>loadSymbol:fromModule:
>
> RSession class(Object)>>nbGetSymbolAddress:module:
>
>
>
> So what can I do to retrieve all my code without loose a day to rewrite it?
>
>
>
> Thanks in advance
>
>
>
> Vincent
>
>
>
>
> ------------------------------
>
>
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
> être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout
> virus, l'expéditeur ne donne aucune garantie à cet égard et sa
> responsabilité ne saurait être recherchée pour tout dommage résultant d'un
> virus transmis.
>
> This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive this
> e-mail in error, please notify the sender immediately and destroy it. As
> its integrity cannot be secured on the Internet, the Worldline liability
> cannot be triggered for the message content. Although the sender endeavours
> to maintain a computer virus-free network, the sender does not warrant that
> this transmission is virus-free and will not be liable for any damages
> resulting from any virus transmitted.
>
>
>
> ------------------------------
>
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
> être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout
> virus, l'expéditeur ne donne aucune garantie à cet égard et sa
> responsabilité ne saurait être recherchée pour tout dommage résultant d'un
> virus transmis.
>
> This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive this
> e-mail in error, please notify the sender immediately and destroy it. As
> its integrity cannot be secured on the Internet, the Worldline liability
> cannot be triggered for the message content. Although the sender endeavours
> to maintain a computer virus-free network, the sender does not warrant that
> this transmission is virus-free and will not be liable for any damages
> resulting from any virus transmitted.
>
--
best,
Eliot
Dec. 4, 2014
Re: [Pharo-dev] Monticello and Fuel
by Eliot Miranda
Hi Thierry,
On Thu, Dec 4, 2014 at 2:31 PM, Thierry Goubier <thierry.goubier(a)gmail.com>
wrote:
> Hi all,
>
> I'm just wondering.
>
> Would it work to have a package format based on Fuel?
>
It doesn't have to be based on Fuel. Monticello .mcz's are just zips that
contain any number of files:
Archive: trunkpackages/Kernel.spur-eem.866.mcz
Length Date Time Name
-------- ---- ---- ----
15 08-07-14 09:12 package
294780 08-07-14 09:12 version
1370995 08-07-14 09:12 snapshot/source.st
1442870 08-07-14 09:12 snapshot.bin
-------- -------
3108660 4 files
Right now package and version are juts textual, and you've been complaining
about the parsing speed. It would be easy to extend the package to include
e.g. version.fuel. It is also a huge advantage to keep both the .bin (a
not-as-fast binary loading format similar in use to Fuel but more
primitive) along side the source code, because the source can be extracted
without a running system, and can be compiled if, for some reason, binary
loading fails. So instead of changing the format you could simply augment
it with a snapshot.fuel, modifying the writer to include it, and modify the
reader to use the .fuel if it exists.
Would that make loading faster?
>
Yes. But not hugely because the .bin already loads faster than the .st.
You might do some profiling?
> Does it already exist?
>
Much of what you need is there. Use the Pharo, Luke.
>
> Thanks,
>
> Thierry
>
--
best,
Eliot
Dec. 4, 2014
Re: [Pharo-dev] GTPlayground cache
by Tudor Girba
Done. It will be available in the next GT release.
Doru
On Thu, Dec 4, 2014 at 4:02 PM, Marcus Denker <marcus.denker(a)inria.fr>
wrote:
>
> On 04 Dec 2014, at 15:46, Marcus Denker <marcus.denker(a)inria.fr> wrote:
>
>
> On 04 Dec 2014, at 15:42, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> Aha. So, that's a bug, right?
>
>
> I think Playground needs to be resetted on #cleanUpForRelease.
>
> Else the image on the server thinks that it already has a playground file.
>
>
> Add to GTPlayBook
>
> cleanUp
> self reset
>
>
> Then this will be called on the build server.
>
> Marcus
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
Dec. 4, 2014
Re: [Pharo-dev] [Vm-dev] Re: [squeak-dev] Spur with Immediate Floating Point Support implies a break
by Eliot Miranda
On Thu, Dec 4, 2014 at 2:46 PM, Ben Coman <btc(a)openinworld.com> wrote:
> Bert Freudenberg wrote:
>
>> On 04.12.2014, at 04:18, Levente Uzonyi <leves(a)elte.hu> wrote:
>>>
>>> Hi Eliot,
>>>
>>> On Wed, 3 Dec 2014, Eliot Miranda wrote:
>>>
>>> SmallFloat64 is an immediate tagged representation, like SmallInteger,
>>>> so
>>>> they fit within an object pointer and have no header. In 64-bit Spur
>>>> there
>>>> is a 3-bit tag, leaving 61 bits. SmallFoat64 steals 3 bits from the
>>>> 11-bit
>>>> exponent to donate to the tags, representing a full double precision
>>>> floating-point value that is restricted to the ~ +/-10^+/-38 range.
>>>> There's really no practical way to shoe-horn a usable range of 64-bit
>>>> float
>>>> into a 30-bit value. Its possible but so few values would fit that the
>>>> effort would be counter-productive. DOes this make sense now?
>>>>
>>> I didn't mean to use 30-bit values. I meant to use the same 61-bit
>>> representation as with the 64-bit Spur.
>>> The object header is 64 bits long in both 32-bit and 64-bit Spur, right?
>>> If yes, then why is it not possible to detect the tag of SmallFloat64 in
>>> a 32-bit VM, and treat the object as immediate?
>>>
>>
>> Because that is not what "immediate" means. There is no header, and not
>> even an object. The value is encoded in the oop itself. You can't fit 61
>> bits in a 32 bit oop.
>>
>> I explained this previously, but I'll paste again:
>>
>> The Squeak VM (and Cog and Spur) traditionally use 32 bits to identify
>>> an object. When you store a reference to an object into some other object,
>>> the VM actually stores a 32 bit word to some place in main memory.
>>>
>>> When you use a Float in your code, the VM actually allocates 96 bits
>>> somewhere in memory (a 32-bit header for house keeping and 64 bits for the
>>> IEEE double) and gives you a 32-bit word back, which is a pointer to that
>>> object (we also call that an "oop"). This is called "boxing", it wraps the
>>> double inside an object. When you add two floats (say 3.0 + 4.0), the VM
>>> actually creates two objects and hands you back their oops (e.g. the two
>>> hexadecimal numbers @12345600 and @1ABCDE00). Then to add them, the VM
>>> reads 64 bits from the memory addresses 12345604 and 1ABCDE04 (skipping the
>>> object header), adds these two doubles, allocates another 96 bits in memory
>>> (say @56780000), and writes 64 bits of the result to the address 56780004.
>>> If this sounds expensive to you, that's because it is. It is even more
>>> expensive than that because we have just created 3*96 = 288 bits of garbage
>>> that needs to be cleaned up later, otherwise we would soon run out of
>>> memory if we keep allocating. Since everything in Smalltalk is an object,
>>> that is what the VM has to do.
>>>
>>> But there is a trick. The VM uses it to avoid all this allocating and
>>> memory fetching for the most common operations, namely working with
>>> smallish integers, which are used everywhere.
>>>
>>> That trick is to hide some data in the oop itself. In the 32 bits of
>>> object pointers, the lowest two bits are actually always 0, because objects
>>> are always allocated at addresses that are a multiple of 4 (32 bits = 4
>>> bytes). If these are always 0, we don't actually need to store them. But
>>> since there is no good way to store just 30 bits, we can also use those two
>>> bits for something else.
>>>
>>> And we do. The VM currently just uses one bit, the least significant bit
>>> (LSB). If the LSB is 0, this is a regular pointer to an object in main
>>> memory. If the LSB is 1, then the VM uses the other 31 bits to store an
>>> integer. Inside the oop itself, not at some place in memory! It does not
>>> need to be allocated, or garbage-collected. It's just there, hidden inside
>>> the 32-bit oop.
>>>
>>> This makes operations on these "small integers" extremely efficient. To
>>> add e.g. 3 and 4, the VM gets the oops @00000007 and @00000009, shifts them
>>> 1 bit to get the actual integers (7 >> 1 = 3 and 9 >> 1 = 4), adds them,
>>> and shifts it back, sets the LSB, and answers @0000000F. All this happens
>>> in CPU registers, no memory access needed, which is why this is so fast.
>>> Access to main memory is orders of magnitude slower than register access.
>>>
>>> We call that an "immediate object". The Squeak VM currently uses only
>>> one kind of immediate objects, although there could be more, since we still
>>> have an unused bit. It would be great to speed up floating point
>>> operations, too. But there is no way to hide a 64-bit double in a 32 bit
>>> oop.
>>>
>>> Which brings us to the proposed 64-bit object format. Objects are
>>> allocated in chunks of 64 bits = 8 bytes, meaning addresses are multiples
>>> of 8, leaving the the 3 lowest bits for identifying immediate objects.
>>>
>>> But there still is no way to hide a 64-bit double inside a 64-bit oop,
>>> because the VM needs at least 1 bit to distinguish between regular object
>>> pointers and immediate objects.
>>>
>>> So Eliot is proposing a 61-bit immediate Float which (just like
>>> SmallIntegers) the VM can process using register operations only. This will
>>> be a major boost for most floating point operations (as long as your values
>>> are not larger than 10^38).
>>>
>>
> btw, I forgot to say so when you last wrote that, it was enlightening -
> thanks for taking the time to write it.
>
If the information was in a class comment somewhere would you have found it
and read it?
> cheers -ben
>
>
--
best,
Eliot
Dec. 4, 2014
Re: [Pharo-dev] Pharo+Git cons?
by Eliot Miranda
Hi Thierry,
On Tue, Dec 2, 2014 at 10:25 PM, Thierry Goubier <thierry.goubier(a)gmail.com>
wrote:
>
>
> 2014-12-03 4:16 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
>
>>
>> Yes, but *I* care about the Monticello metadata. IMO its *better* than
>> the git metadata.
>>
>
> Eliot, you'll have to do better than just IMO on that one.
>
Quite right. One benefit is that Monticello metadata, at least per-method
time stamps, are available for introspection inside the image. Just today
I was alerted of some bad code by a particular author and it was very
convenient to read all the methods by that particular author, which helped
me find another problem. I also like the free frorm of the middle of
method timestamps; I can and do annotate with labels for specific
refactorings.
Another benefit is that Monticello is amenable for scripting much more
easily than git. I've been working on the SPur bootstrap fro a while now.
It is essentially complete. What the bootstrap does in Monticello is
construct patched versions of four packages, substituting specific methods
with replacements. Each patched package inherits both from its patched
ancestor and the package that was patched (a ladder like structure). This
allows Spur to keep up-to-date automatically w.r.t. Squeak trunk.
I'm also delighted that work like Chris Muller's version server is out
there. This is very nicely integrated to allow me to find out which
package versions contain versions of a particular method or class
definition.
Some of us work with *both*, and have code for going back and forth, so the
> *better*; bah.
>
> I also happens to know how long it takes to parse hundreds of monticello
> metadata files... and I wasn't impressed with the result.
>
Yes, but this can be reengineered. Most things can be optimized. This
could be with a little effort. What's needed is to generate and maintain
momentum. That's what worries me about git integration. It's a slippery
slope towards giving up Monticello and just using git. And git itself will
one day be viewed as old-hat. Monticello should be easy to keep evolving.
It's in Smalltalk few chrissake.
>
>> What's really lacking in Monticello is a) it's not high school so one
>> can't preen in front of the world on github and b) it has no support for
>> external files. Well, a) will be solved by growing up and b) can be solved
>> by building the solution. I know what I'd rather do.
>>
>>
>> [and apologies for being deliberately incendiary but I *hate* the
>> movement away from tools in Squeak/Pharo. It is a movement towards stasis
>> and death, and personally I'm enjoying life too much].
>>
>
> You then have noticed that those threads are about working on tools?
>
Yes, and that's why I'm writing to the thread. I hope that work on
integrating foreign file support, and integrating things like Chris
Muller's version server continues in the Pharo community. More than
anything I hope that Monticello remains a bridge between the Squeak and
Pharo communities.
>
>
> Thierry
>
>
>
>
--
best,
Eliot
Dec. 4, 2014
Semaphore seems to timeout prematurely
by Jan Vrany
Hi there,
I have encountered a situation where semaphore timeouts
prematurely when run in "non-interactive" mode (eval cmdline handler).
Setup (script prepare.sh)
1) Fresh Pharo image (3.0 / 4.0, both exhibits the same behaviour)
2) Evaluate:
==
Smalltalk at: #WaitBlock put: [:sema :tout | (sema waitTimeoutSeconds:
tout) ifTrue:[ Halt now ] ].
==
3. Save image
Run 1:
1) Run the image, open workspace
2) Evaluate:
==
| sema |
sema := Semaphore new.
[ 100 factorial. sema signal ] fork.
(Smalltalk at: #WaitBlock) value: sema value: 60*60.
'OK'
==
Returns 'OK' as expected (100 factorial should not take more than
hour :-)
Run 2 (script test.sh)
1) The same, but evaluate using command line handler:
./pharo Test.image eval "\
| sema |\
\
sema := Semaphore new.\
[ 100 factorial. sema signal ] fork.\
(Smalltalk at: #WaitBlock) value: sema value: 60*60.\
'OK'\
"
Halt triggers, which is what I would not expect.
Why is that? Bug? Or Am I missing something obvious?
Best, Jan
Dec. 4, 2014