On Sun, 28 Apr 2019 at 3:35 pm, Nicolas Cellier <[hidden email]> wrote:
Java's BigInteger applies different multiplication algorithms depending on the values to multiply: Maybe we could do something similar? Fabio
|
In reply to this post by timrowledge
Hi Tim, command-line scripts are executed *after* all other start-up calls were made using a deferred UI message. There is no need to fiddle around with the order in the start-up list. See: SmalltalkImage >> #processStartUpList: AutoStart class >> #startUp: (last line) ProjectLauncher >> #startUp ProjectLauncher >> #startUpAfterLogin Best, Marcel
|
Hi marcel -
> On 2019-04-28, at 11:40 PM, Marcel Taeumel <[hidden email]> wrote: > command-line scripts are executed *after* all other start-up calls were made using a deferred UI message. There is no need to fiddle around with the order in the start-up list. See: > > SmalltalkImage >> #processStartUpList: > AutoStart class >> #startUp: (last line) > ProjectLauncher >> #startUp > ProjectLauncher >> #startUpAfterLogin I see that; but then we have to work out why the stdin/out/err filehandles need (re)initialising. FileStream class>>startUp: (true) is supposed to do it as part of the normal startup sequence but I had to add it at the beginning of my doit-file. Not to mention why does it seem to not work at all on Windows? And also, there is still the point that things are not in the requested/required order in the StartUp list. As an extra excitement, how shall we allow for having startup files that want to avoid the UI starting up - say to support the idea of using Squeak for quick jobs as part of scripting? I'm not at all sure what a good answer would be here, it seems at first thought that we'd need either have two ways to specify the files in the commandline (say, -earlyfilein & -uifilein, which are both horrible and should not be used!) or to have some tags in the files to say where sections get evaluated - perhaps [preUI] & [postUI]. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Fell out of the family tree. |
In reply to this post by timrowledge
Years ago I was trying to rationalise all the various functionality of Smalltalk/SmalltalkImage across i.e. the startup process may load in or unload a number of classes from sources at an early stage, and when the time came to think about #startUp they may not have been #initialised, (the #startUp might be their initialisation). So I vaguely recollect that when I had a go at re-doing the startuplist I removed this responsibility to a class of its own, called StartupManager, and removed the class var that holds the list in favour of a voting system. I found some code hiding away (somewhat obfuscated) Looking through the comments I find StatupManager New simple startUp shutDown protocol classes implement #startUpPriority #shutDownPriority to register. The startUp and shutdownLists are compiled by looking at all implementors of:' startUpPriority and #shutDownPriority'Priorities are: #first #earliest #earlier #early #normal #late #later #latest #last' As you can imagine this was very much a first attempt at resolving these problems. Keith |
On 30 Apr 2019, at 0:15, Keith wrote:
One of the other goals was to support removable/loadable UI in the bootstrap process I found this code in there, which indicates that the vote was essentially on a numeric 0-999 scale. StartupManager class methodsFor: 'system-startup-shutdown' stamp: 'kph 2/4/2010 16:44'!" priorities^ IdentityDictionary new at: #first put: 0; "reserved for Delay" and some code, sorting on given priority value, followed by class name. startUpList | priorities list | priorities := self class priorities. self systemNavigation allClassesRespondingTo: #startUpPriority ^ list |
In reply to this post by timrowledge
On 29 Apr 2019, at 23:14, tim Rowledge wrote:
This was the functionality of my InstallSeries code. The idea was to aim to load a project as a series of file ins, from a hierarchy of directories whose structure would indicate the priority, such as #preUI, "I am the UI" and #postUI. The file out scheme, would create InstallSeries compatible changesets according to specific slice definitions, such as "methods in the image categorised as (startup-shutdown)." Thus a slice definition could be applied to more than one image or fork, for import or export. The aim was to patch each fork (pharo squeak cuis et al) at an early stage in the bootstrap so that subsequent slices of functionality could be held in common. I think I got as far as loading Seaside in Cuis. Keith |
In reply to this post by timrowledge
Hi Tim, a "GUI" that would represent a "headless" Squeak (instead of Morphic) could (or should?) also support a main loop with deferred messages. See SqueakShell. :-) Best, Marcel
|
In reply to this post by fniephaus
By sheer fluke I stumbled on an article that may be of interest here; apparently the 'ultimate multiplication' technique has now been found, building on the work of Karatsuba, Schönhage and Strassen, and lately Harvey & Van Der Hoeven.
Strange stuff but apparently achieving n log(n) steps for n digit multiplies. https://www.quantamagazine.org/mathematicians-discover-the-perfect-way-to-multiply-20190411/ and the original paper at https://hal.archives-ouvertes.fr/hal-02070778/document tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim "bOtHeR" said Pooh, mistaking the LSD tablet for aspirin |
Hi Tim, That's what i wrote 16 mails above in th thread :) Le jeu. 2 mai 2019 à 22:45, tim Rowledge <[hidden email]> a écrit : By sheer fluke I stumbled on an article that may be of interest here; apparently the 'ultimate multiplication' technique has now been found, building on the work of Karatsuba, Schönhage and Strassen, and lately Harvey & Van Der Hoeven. |
> On 2019-05-02, at 10:21 PM, Nicolas Cellier <[hidden email]> wrote: > > Hi Tim, > That's what i wrote 16 mails above in th thread :) I knew that, of course I did, absolutely, how could you possibly doubt me? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- So dumb, he faxes face up. |
A small but valuable improvement in the fibonacci algorithm blatantly stolen from a python version by gkreidel on the Pi forums seems to be ~25% faster for 4784969 fibonacci
!Integer methodsFor: 'mathematical functions' stamp: 'tpr 5/6/2019 12:22'! fibonacci "derived from https://www.nayuki.io/page/fast-fibonacci-algorithms" "4784969 fibonacci" | a b c | self <= 0 ifTrue: [^0]. "in case somebody tries an inappropriate number" a := 0. b := 1. self highBit to: 2 by: -1 do:[:i||d e| d := ((b bitShift: 1) - a) * a. e := a squared + b squared. a := d. b := e. (self bitAt: i) = 1 ifTrue:[ c := a + b. a := b. b := c] ]. ^self odd ifTrue:[a squared + b squared] ifFalse: [((b bitShift: 1) - a) * a]! ! About 75% of time goes on the #squared and 8% on WeakArray finalization. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- A room temperature IQ. |
In reply to this post by Nicolas Cellier
Remember the fun with we had calculating 4784969 fibonacci? There's an interesting article in the Comm.ACM this month about the maybe-final improvement in huge number multiplication; https://cacm.acm.org/magazines/2020/1/241707-multiplication-hits-the-speed-limit/fulltext
tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: RIW: Re-Invent Wheel |
|
That article was an interesting read. One thing I've always been curious about: what applications are people using the arbitrary precision stuff in Squeak for? (I generally make an effort to avoid straying into large integers due to the performance implications, but the things I'm working on don't require the precision they offer.) On Mon, Jan 27, 2020 at 8:28 PM David T. Lewis <[hidden email]> wrote: On Sun, Jan 26, 2020 at 01:59:21PM -0800, tim Rowledge wrote: |
Hi Phil, On Mon, Jan 27, 2020 at 6:07 PM Phil B <[hidden email]> wrote:
One thing I used it for was in implementing 64-bit Spur VM above the 32-bit Spur implementation.
_,,,^..^,,,_ best, Eliot |
Hi Phil, It is essential. Without it, it's very difficult to have correctly rounded conversion float -> ascii decimal ->float. Also, it may help to implement correctly rounded float functions. GNU libc uses gmp. Sometimes, you don't know the accuracy of a float calculus. There are several possible easy strategies like changing the rounding direction, or double the precision, and check the interval you obtain. It's far easier to implement multi precision with integer than with float (though possible). Chryptography heavily rely on large integer arithmetics. Symbolic computer algebra also rely on it (the p-adic factorization of polynomials may rapidly lead to huge integers). Le mar. 28 janv. 2020 à 04:56, Eliot Miranda <[hidden email]> a écrit :
|
Free forum by Nabble | Edit this page |