From commits at source.squeak.org Wed Dec 2 00:41:36 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 2 Dec 2020 00:41:36 0000 Subject: [squeak-dev] The Trunk: Sound-eem.76.mcz Message-ID: Eliot Miranda uploaded a new version of Sound to project The Trunk: http://source.squeak.org/trunk/Sound-eem.76.mcz ==================== Summary ==================== Name: Sound-eem.76 Author: eem Time: 1 December 2020, 4:41:34.045008 pm UUID: bc35632b-366a-4d24-81f7-024beb3dbda7 Ancestors: Sound-eem.75 Fix a bug in SoundRecorder so that the following works: [:r| r resumeRecording. (Delay forSeconds: 5) wait. r playback] value: SoundRecorder new Arguably this should work too: [:r| r startRecording. (Delay forSeconds: 5) wait. r playback] value: SoundRecorder new i.e. startRecording should set paused to false. But this is a change in API that could affect clients so I'll oput the suggestion out there and leave it to others to judge. =============== Diff against Sound-eem.75 =============== Item was changed: ----- Method: SoundRecorder>>emitBuffer: (in category 'private') ----- emitBuffer: buffer + | sound ratio | - | sound ratio resultBuf | - "since some sound recording devices cannot (or will not) record below a certain sample rate, trim the samples down if the user really wanted fewer samples" + sound := (desiredSampleRate isNil or: [(ratio := samplingRate // desiredSampleRate) <= 1]) + ifTrue: [SampledSound new setSamples: buffer samplingRate: samplingRate] + ifFalse: + [| resultBuf | + resultBuf := SoundBuffer + averageEvery: ratio + from: buffer + upTo: buffer monoSampleCount. + SampledSound new setSamples: resultBuf samplingRate: samplingRate / ratio]. + recordedSound ifNil: + [recordedSound := SequentialSound new]. - (desiredSampleRate isNil or: [(ratio := samplingRate // desiredSampleRate) <= 1]) ifTrue: [ - sound := SampledSound new setSamples: buffer samplingRate: samplingRate. - ] ifFalse: [ - resultBuf := SoundBuffer - averageEvery: ratio - from: buffer - upTo: buffer monoSampleCount. - sound := SampledSound new setSamples: resultBuf samplingRate: samplingRate / ratio. - ]. - recordedSound add: (codec ifNil: [sound] ifNotNil: [codec compressSound: sound])! From stes at telenet.be Wed Dec 2 07:12:05 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Wed, 2 Dec 2020 08:12:05 +0100 (CET) Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> Message-ID: <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I've a request for enhancement. I like the DoItFirst package, but I think there should be -f option, like in AWK to read from a source file. For example: bash-4.4$ squeak squeak.image -- -help DoItFirst image arguments: -doit argumentlist "evaluate each argument as a doIt expression" -evaluate arg "evaluate arg, print result then exit" -filein filelist "file in each file named in fileList" -cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" -debug "enter a debugger as soon as possible in the startUp processing" -help "print this message" bash-4.4$ cat loop.st |cltn index| cltn _ OrderedCollection new. index _ 1. [index <= 10] whileTrue: [cltn add: index. index _ index + 1]. cltn bash-4.4$ squeak squeak.image -- -evaluate "`cat loop.st`" an OrderedCollection(1 2 3 4 5 6 7 8 9 10) What I'd propose is to add a -f which is like -evaluate and the 'cat'. bash-4.4$ squeak squeak.image -- -f loop.st an OrderedCollection(1 2 3 4 5 6 7 8 9 10) As far as I can see the DoItFirst package does not have this, because -filein is not quite the same. When I try bash-4.4$ squeak squeak.image -- -filein loop.st that doesn't work. So a -f option would be nice, or is there a solution that I don't see ? Also a short name like -c or -e as a shortcut for -evaluate would be nice. In any case, I've tried DoItFirst both with the squeak-4 from subversion, and the squeak-5 from OpenSmalltalk (Cog VM and Stack VM release 5.0 with Squeak6.0alpha images) and the DoItFirst package seems to work fine. Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfxz3AAAoJEAwpOKXMq1MaqY4IAI2Rdesu6SKMpXlMdbPrAHSB YxSkjICNFRY+0TF8irelEU4UhLOn8Rap7xKjD7ZmbvD4Q0TKxys0fMAYw2F9jjvD gNIvx7I4GcfGdH14QEmyNAUdEt0Rv88uReeZcoJxY54ycQuoEveeAGeMID5e38kw UDZ25WIX0l4/dKmblkAHrgwVfoKUr2ukOdSr2VsusE8Gc34+mvsNx93U1VNpBrgi EOWRq6r2FsqHmCfdvoW3H9FgnUYL80c0nRftLdU7EKZXdZTTWL1dclyckmVLTHqd pPO3UxXrluvAk+VqtvxsMLqFoiJdYhp9080FGAMJZh2LnLfhZy7aXbSaRF02KV4= =5Mia -----END PGP SIGNATURE----- From Marcel.Taeumel at hpi.de Wed Dec 2 09:23:25 2020 From: Marcel.Taeumel at hpi.de (marcel.taeumel) Date: Wed, 2 Dec 2020 03:23:25 -0600 (CST) Subject: [squeak-dev] The Trunk: Sound-eem.76.mcz In-Reply-To: References: Message-ID: <1606901005320-0.post@n4.nabble.com> Hi Eliot, do you know about: "5 seconds wait"? :-) Best, Marcel -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html From eliot.miranda at gmail.com Wed Dec 2 19:33:37 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Wed, 2 Dec 2020 11:33:37 -0800 Subject: [squeak-dev] The Trunk: Sound-eem.76.mcz In-Reply-To: <1606901005320-0.post@n4.nabble.com> References: <1606901005320-0.post@n4.nabble.com> Message-ID: On Wed, Dec 2, 2020 at 1:23 AM marcel.taeumel wrote: > Hi Eliot, > > do you know about: "5 seconds wait"? :-) > Yes, I do, but it isn't stuck in my memory like the things I learnt in 1983 Thanks, I'll go edit my workspace now ;-) _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 2 19:42:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 2 Dec 2020 19:42:15 0000 Subject: [squeak-dev] The Trunk: Chronology-Core-eem.63.mcz Message-ID: Eliot Miranda uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-eem.63.mcz ==================== Summary ==================== Name: Chronology-Core-eem.63 Author: eem Time: 2 December 2020, 11:42:13.044649 am UUID: 713cef96-205d-4f67-95f1-cabd0bb1b3f3 Ancestors: Chronology-Core-mt.62 Nicer code for a couple of Duration methods... I'm doing this to help me remember 5 seconds wait et al... =============== Diff against Chronology-Core-mt.62 =============== Item was changed: ----- Method: Duration>>asDelay (in category 'squeak protocol') ----- asDelay + ^Delay forMilliseconds: self asMilliSeconds - ^ Delay forDuration: self ! Item was changed: ----- Method: Duration>>wait (in category 'squeak protocol') ----- wait + "Convert this duration in a delay and wait once. Answer the created delay so that the client can wait on it again if needed." - "Convert this duration in a delay and wait once. Return the created delay so that the client can wait on it again if needed. + "[3 seconds wait] timeToRun" - Do-it: 3 minutes wait" + ^self asDelay wait! - | delay | - delay := self asDelay. - delay wait. - ^ delay! From lewis at mail.msen.com Thu Dec 3 01:58:23 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 2 Dec 2020 20:58:23 -0500 Subject: [squeak-dev] The Trunk: Chronology-Core-eem.63.mcz In-Reply-To: References: Message-ID: <20201203015823.GA87569@shell.msen.com> On Wed, Dec 02, 2020 at 07:42:15PM +0000, commits at source.squeak.org wrote: > Eliot Miranda uploaded a new version of Chronology-Core to project The Trunk: > http://source.squeak.org/trunk/Chronology-Core-eem.63.mcz > > ==================== Summary ==================== > > Name: Chronology-Core-eem.63 > Author: eem > Time: 2 December 2020, 11:42:13.044649 am > UUID: 713cef96-205d-4f67-95f1-cabd0bb1b3f3 > Ancestors: Chronology-Core-mt.62 > > Nicer code for a couple of Duration methods... > I'm doing this to help me remember 5 seconds wait et al... > Noting the change to Duration>>asDelay I wondered if there was any remaining benefit to Delay class>>forDuration:. Warning: This is definitely in the "angels dancing on the head of a pin" category, but hopefully still constructive. If we wanted to get rid of unnecessary methods, I would say that we should deprecate Delay class>>forDuration: because: 1) It has no users in the image and there is no obvious need for it. 2) Its implementation is redundant with Delay class>>forMilliseconds: However, I do not think we should deprecate this, and in fact I think I somewhat prefer the earlier implementation of Duration>>asDelay. Why? Because conceptually, Delay class>>forDuration: is better. It does not carry an implied precision for durations, and in fact there is no reason that we should expect delays to be restricted to some arbitrary precision (milliseconds in this case) even if the current implementation does exactly that. So IMHO the earlier idiom of "Delay forDuration: self" rather than "Delay forMilliseconds: self asMilliseconds" carries its weight based on conceptual clarity even if the implementation is pointlessly redundant. $0.02 and *please* don't change it, I'm just offering an observation. Dave > =============== Diff against Chronology-Core-mt.62 =============== > > Item was changed: > ----- Method: Duration>>asDelay (in category 'squeak protocol') ----- > asDelay > > + ^Delay forMilliseconds: self asMilliSeconds > - ^ Delay forDuration: self > ! > > Item was changed: > ----- Method: Duration>>wait (in category 'squeak protocol') ----- > wait > + "Convert this duration in a delay and wait once. Answer the created delay so that the client can wait on it again if needed." > - "Convert this duration in a delay and wait once. Return the created delay so that the client can wait on it again if needed. > > + "[3 seconds wait] timeToRun" > - Do-it: 3 minutes wait" > > + ^self asDelay wait! > - | delay | > - delay := self asDelay. > - delay wait. > - ^ delay! > > From commits at source.squeak.org Thu Dec 3 02:21:11 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 02:21:11 0000 Subject: [squeak-dev] The Trunk: WebClient-Core-dtl.127.mcz Message-ID: David T. Lewis uploaded a new version of WebClient-Core to project The Trunk: http://source.squeak.org/trunk/WebClient-Core-dtl.127.mcz ==================== Summary ==================== Name: WebClient-Core-dtl.127 Author: dtl Time: 2 December 2020, 9:21:11.256021 pm UUID: b29c5835-46cf-4f51-b822-b3494063f3f7 Ancestors: WebClient-Core-mt.126 Eliminate the only known use of DateAndTime class>>totalSeconds, use the proper method in class Time instead. =============== Diff against WebClient-Core-mt.126 =============== Item was changed: ----- Method: WebUtils class>>logEntryFor:response: (in category 'misc') ----- logEntryFor: request response: response "Create a log entry in common log format from the given request / response" | entry logdate logsize | "CLF prints date as [day/month/year:hour:min:sec zone]" logdate := String streamContents:[:s| | date | + date := DateAndTime fromSeconds: Time totalSeconds. - date := DateAndTime fromSeconds: DateAndTime totalSeconds. s nextPut: $[. date asDate printOn: s format: #( 1 2 3 $/ 2 1 2). s nextPut: $:. date asTime print24: true on: s. s nextPutAll:(' ', (date offset hours >= 0 ifTrue:['+'] ifFalse:['-']), (date offset hours abs asString padded: #left to: 2 with: $0), (date offset minutes abs asString padded: #left to: 2 with: $0) ). s nextPut: $]. ]. "CLF prints zero length as - " logsize := response contentLength ifNil:[0]. logsize = 0 ifTrue:[logsize := '-']. entry := String streamContents:[:s| s nextPutAll: (request remoteHost ifNil:[ "Substitute with the host header" (request headerAt: 'host') copyUpTo: $: ]); nextPutAll: ' -'; "RFC 1413 identity of client" nextPutAll: ' -'; "TODO: userid of authenticated user" nextPutAll: ' ', logdate; nextPutAll: ' "', request requestLine, '"'; nextPutAll: ' ', response code; nextPutAll: ' ', logsize. ]. ^entry ! From commits at source.squeak.org Thu Dec 3 02:43:41 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 02:43:41 0000 Subject: [squeak-dev] The Trunk: Chronology-Core-dtl.64.mcz Message-ID: David T. Lewis uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-dtl.64.mcz ==================== Summary ==================== Name: Chronology-Core-dtl.64 Author: dtl Time: 2 December 2020, 9:43:40.709057 pm UUID: b3804941-fd01-4700-a64b-b00c42165675 Ancestors: Chronology-Core-eem.63 Deprecate #totalSeconds and #millisecondClockValue in DateAndTime and refer senders to the canonical implementations in Time. =============== Diff against Chronology-Core-eem.63 =============== Item was removed: - ----- Method: DateAndTime class>>millisecondClockValue (in category 'smalltalk-80') ----- - millisecondClockValue - - ^ self clock millisecondClockValue! Item was removed: - ----- Method: DateAndTime class>>totalSeconds (in category 'smalltalk-80') ----- - totalSeconds - - ^ self clock totalSeconds! From commits at source.squeak.org Thu Dec 3 02:44:10 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 02:44:10 0000 Subject: [squeak-dev] The Trunk: 60Deprecated-dtl.85.mcz Message-ID: David T. Lewis uploaded a new version of 60Deprecated to project The Trunk: http://source.squeak.org/trunk/60Deprecated-dtl.85.mcz ==================== Summary ==================== Name: 60Deprecated-dtl.85 Author: dtl Time: 2 December 2020, 9:44:10.427748 pm UUID: 010bb2cd-bb23-4d42-aa88-84c21eefaa31 Ancestors: 60Deprecated-mt.84 Deprecate #totalSeconds and #millisecondClockValue in DateAndTime and refer senders to the canonical implementations in Time. =============== Diff against 60Deprecated-mt.84 =============== Item was added: + ----- Method: DateAndTime class>>millisecondClockValue (in category '*60Deprecated') ----- + millisecondClockValue + + self deprecated: 'Use Time class>>millisecondClockValue instead'. + ^ self clock millisecondClockValue! Item was added: + ----- Method: DateAndTime class>>totalSeconds (in category '*60Deprecated') ----- + totalSeconds + + self deprecated: 'Use Time class>>totalSeconds instead'. + ^ self clock totalSeconds! From commits at source.squeak.org Thu Dec 3 05:39:01 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:39:01 0000 Subject: [squeak-dev] The Trunk: SUnitGUI-eem.82.mcz Message-ID: Eliot Miranda uploaded a new version of SUnitGUI to project The Trunk: http://source.squeak.org/trunk/SUnitGUI-eem.82.mcz ==================== Summary ==================== Name: SUnitGUI-eem.82 Author: eem Time: 2 December 2020, 9:39:00.195693 pm UUID: 9864b164-83b4-4e18-ad3d-fdd041f13f9c Ancestors: SUnitGUI-ct.81 Allow the TestRunner's categories to be sorted, even if this doesn't persist past running the selected test(s). But for finding a category it can be more convenient than filtering. =============== Diff against SUnitGUI-ct.81 =============== Item was changed: ----- Method: TestRunner>>categoryMenu: (in category 'accessing-categories') ----- categoryMenu: aMenu ^ aMenu title: 'Categories'; add: 'Select all' action: #selectAllCategories; add: 'Select inversion' action: #selectInverseCategories; add: 'Select none' action: #selectNoCategories; addLine; add: 'Filter...' action: #filterCategories; addLine; add: 'Refresh' action: #updateCategories; + add: 'Sort' action: #sortCategories; yourself.! Item was added: + ----- Method: TestRunner>>sortCategories (in category 'accessing-categories') ----- + sortCategories + | selectedCategory | + selectedCategory := categoryIndex ifNotNil: [categories at: categoryIndex ifAbsent: []]. + categories := categories sort. + selectedCategory ifNotNil: + [categoryIndex := categories indexOf: selectedCategory]. + self changed: #categoryList! From commits at source.squeak.org Thu Dec 3 05:41:06 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:41:06 0000 Subject: [squeak-dev] The Trunk: Compiler-eem.452.mcz Message-ID: Eliot Miranda uploaded a new version of Compiler to project The Trunk: http://source.squeak.org/trunk/Compiler-eem.452.mcz ==================== Summary ==================== Name: Compiler-eem.452 Author: eem Time: 2 December 2020, 9:41:04.063795 pm UUID: 4799ba54-ed87-4188-a653-e36499d92994 Ancestors: Compiler-eem.451 Provide an acceptably accurate means to test if a SYmbol is probably a message selector, Scanner class>>isMessageSelector:. =============== Diff against Compiler-eem.451 =============== Item was added: + ----- Method: Scanner class>>isMessageSelector: (in category 'testing') ----- + isMessageSelector: aSymbol + "Answer if the argument is a valid message selector. + This is optimized for fast filtering." + | first last sz type | + (sz := aSymbol size) = 0 ifTrue: [^false]. + first := aSymbol at: 1. + last := aSymbol at: sz. + type := TypeTable at: first asciiValue. + + type == #xLetter ifTrue: + ["Alas some people (myself included) do create selectors with an initial capital. + But this is unusual, and it is even rarer for these to be unary selectors, so I think + it is better to exclude class names than include the few exceptions." + (first isUppercase and: [last ~~ $:]) ifTrue: + [^false]. + "Could be unary or keyword, may include underscores if AllowUnderscoreSelectors. + It is possible to be more agressive here, filtering out two successive colons, but I'm lazy" + ^aSymbol allSatisfy: (AllowUnderscoreSelectors + ifTrue: + [last == $: + ifTrue: [[:c| c == $: or: [c == $_ or: [c isAlphaNumeric]]]] + ifFalse: [[:c| c ~~ $: and: [c == $_ or: [c isAlphaNumeric]]]]] + ifFalse: + [last == $: + ifTrue: [[:c| c == $: or: [c isAlphaNumeric]]] + ifFalse: [[:c| c ~~ $: and: [c isAlphaNumeric]]]])]. + + type == #xBinary ifTrue: + [^aSymbol allSatisfy: [:c| c == $| or: [(TypeTable at: c asciiValue) == #xBinary]]]. + + ^type == #xUnderscore + and: [AllowUnderscoreSelectors + and: [self isMessageSelector: aSymbol allButFirst]] + + "| implemented | + implemented := Set new. + self systemNavigation allSelect: [:m| implemented add: m selector. false]. + ^Symbol allSubInstances select: [:s| (implemented includes: s) not and: [self isMessageSelector: s]]" + + "| implemented | + implemented := Set new. + self systemNavigation allSelect: [:m| implemented add: m selector. false]. + ^implemented reject: [:s| self isMessageSelector: s]"! From commits at source.squeak.org Thu Dec 3 05:49:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:49:03 0000 Subject: [squeak-dev] The Trunk: Collections-eem.920.mcz Message-ID: Eliot Miranda uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-eem.920.mcz ==================== Summary ==================== Name: Collections-eem.920 Author: eem Time: 2 December 2020, 9:49:01.130251 pm UUID: 3767683c-33f6-4874-9e6c-83719db04fe3 Ancestors: Collections-mt.919 Add Symbol>>isMessageSelector, implemented in terms of Scanner class>>isMessageSelector: =============== Diff against Collections-mt.919 =============== Item was added: + ----- Method: Symbol>>isMessageSelector (in category 'testing') ----- + isMessageSelector + "Answer if the receiver is a valid message selector. This method is not perfect. + The compiler does allow all caps to be selectors but these are not included. + If AllowUnderscoreSelectors is true then _ is a valid selector but this will be excluded + also. But it is IMO more useful to exclude class names and hence exclude some rarely + used selectors than to erroneously identify class names as message selectors." + + ^Scanner isMessageSelector: self! From commits at source.squeak.org Thu Dec 3 05:54:18 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:54:18 0000 Subject: [squeak-dev] The Trunk: Kernel-eem.1362.mcz Message-ID: Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.1362.mcz ==================== Summary ==================== Name: Kernel-eem.1362 Author: eem Time: 2 December 2020, 9:54:15.943794 pm UUID: c9a9d41d-b1f3-443d-94bd-916e18b2ccba Ancestors: Kernel-eem.1361 Provide CompiledMethod>>anyAndAllSelectors[Do:] that includes unsent symbols that might be selectors. e.g. HaloMorph>>#addRotateHandle: really does send #startRot:with: and #doRot:with:, albeit indirectly via perform:. =============== Diff against Kernel-eem.1361 =============== Item was added: + ----- Method: CompiledMethod>>anyAndAllMessages (in category 'literals') ----- + anyAndAllMessages + "Answer a Set of all the message selectors sent by this method, and all literals that look like message selectors." + + | result | + result := Set new. + self anyAndAllSelectorsDo: [:selector | result add: selector]. + ^result! Item was added: + ----- Method: CompiledMethod>>anyAndAllSelectorsDo: (in category 'literals') ----- + anyAndAllSelectorsDo: workBlock + "Evaluate aBlock with all the message selectors sent by me, including + my literals that look like selectors, and selectors in my pragmas. + Duplicate selectors are possible." + + | encoderClass selectorLiteralCollector | + encoderClass := self encoderClass. + selectorLiteralCollector := [:literal| + literal isCollection ifTrue: + [literal isSymbol + ifTrue: + [literal isMessageSelector ifTrue: + [workBlock value: literal]] + ifFalse: + [literal isArray ifTrue: + [literal do: selectorLiteralCollector]]]]. + self pragmas do: + [:pragma| + selectorLiteralCollector + value: pragma keyword; + value: pragma arguments]. + self isQuick ifTrue: [^self]. + self codeLiteralsDo: + [:compiledCode | | scanner limit | + limit := compiledCode size - 1. + (scanner := InstructionStream on: compiledCode) scanFor: + [:byte| | selector | + (selector := scanner selectorToSendOrSelf) ~~ scanner ifTrue: + [workBlock value: selector]. + ((encoderClass isExtension: byte) + and: [scanner pc < limit]) ifTrue: + [scanner pc: scanner pc + (encoderClass bytecodeSize: (compiledCode at: scanner pc + 2))]. + false "keep scanning"]. + compiledCode literalsDo: selectorLiteralCollector]! From commits at source.squeak.org Thu Dec 3 05:56:22 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:56:22 0000 Subject: [squeak-dev] The Trunk: Tools-eem.1017.mcz Message-ID: Eliot Miranda uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-eem.1017.mcz ==================== Summary ==================== Name: Tools-eem.1017 Author: eem Time: 2 December 2020, 9:56:20.281149 pm UUID: 03df7799-92b9-4912-bed6-c446397b0cf8 Ancestors: Tools-eem.1016 In the browsers use Compiledmethod>>anyAndAllMessages instead of CompiledMethod>>messages. false positives are more tolerable tnan omitted selectors sent via perform: et al. e.g. HaloMorph>>#addRotateHandle: really does send #startRot:with: and #doRot:with:, albeit indirectly via perform:. =============== Diff against Tools-eem.1016 =============== Item was changed: ----- Method: StringHolder>>withSelectorAndMessagesIn:evaluate: (in category '*Tools') ----- withSelectorAndMessagesIn: aCompiledMethod evaluate: aBlock "Allow the user to choose one selector, chosen from the currently selected message's selector, as well as those of all messages sent by it, and evaluate aBlock on behalf of chosen selector. If there is only one possible choice, simply make it; if there are multiple choices, put up a menu, and evaluate aBlock on behalf of the the chosen selector, doing nothing if the user declines to choose any" | selectorOrNil messages | selectorOrNil := aCompiledMethod selector. + messages := aCompiledMethod anyAndAllMessages. - messages := aCompiledMethod messages. messages remove: selectorOrNil ifAbsent: ["do nothing"]. messages ifEmpty: "If only one item, there is no choice" [^selectorOrNil ifNotNil: [aBlock value: selectorOrNil]]. self systemNavigation showMenuOf: messages withFirstItem: selectorOrNil ifChosenDo: aBlock! From commits at source.squeak.org Thu Dec 3 05:58:25 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 3 Dec 2020 05:58:25 0000 Subject: [squeak-dev] The Trunk: System-eem.1194.mcz Message-ID: Eliot Miranda uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-eem.1194.mcz ==================== Summary ==================== Name: System-eem.1194 Author: eem Time: 2 December 2020, 9:58:22.669121 pm UUID: e3212f4a-d84c-4e35-b05e-ab5e16af91c0 Ancestors: System-tonyg.1193 When computing SystemNavigation>>allSentMessagesWithout: use anyAndAllSelectorsDo: which does a much better job than the existing code, and uses (indirectly) Scanner>>isMessageSelector: which provides a single point of definition to maintain cnsistency across tools, etc. =============== Diff against System-tonyg.1193 =============== Item was changed: ----- Method: SystemNavigation>>allSentMessagesWithout: (in category 'query') ----- allSentMessagesWithout: classesAndMessagesPair "Answer the set of selectors which are sent somewhere in the system, computed in the absence of the supplied classes and messages." | sent absentClasses absentSelectors | sent := IdentitySet new: CompiledMethod instanceCount. absentClasses := classesAndMessagesPair first. absentSelectors := classesAndMessagesPair second. "sd 29/04/03" + Cursor execute showWhile: + [self environment allClassesAndTraitsDo: + [:cls | + ((absentClasses includes: cls) ifTrue: [{}] ifFalse: [{cls. cls classSide}]) do: + [:each | + (absentSelectors isEmpty - Cursor execute showWhile: [ - self environment allClassesAndTraitsDo: [:cls | - ((absentClasses includes: cls) - ifTrue: [{}] - ifFalse: [{cls. cls classSide}]) - do: [:each | (absentSelectors isEmpty ifTrue: [each selectors] + ifFalse: [each selectors copyWithoutAll: absentSelectors]) do: + [:sel | "Include all sels, but not if sent by self" + (each compiledMethodAt: sel) anyAndAllSelectorsDo: + [:m| + m == sel ifFalse: + [sent add: m]]]]]]. - ifFalse: [each selectors copyWithoutAll: absentSelectors]) - do: [:sel | "Include all sels, but not if sent by self" - (each compiledMethodAt: sel) allLiteralsDo: [:m | - self flag: #dicuss. "mt: How to distinguish a symbol from a selector?" - (m isSymbol and: [m size > 0 and: [m first isLowercase]]) - ifTrue: ["might be sent" - m == sel ifFalse: [sent add: m]]. - ]]]]]. "The following may be sent without being in any literal frame" Smalltalk specialSelectorNames do: [:sel | sent add: sel]. + Smalltalk presumedSentMessages do: [:sel | sent add: sel]. + ^sent! - Smalltalk presumedSentMessages do: [:sel | sent add: sel]. - ^ sent.! From stes at telenet.be Thu Dec 3 17:11:15 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Thu, 3 Dec 2020 18:11:15 +0100 (CET) Subject: [squeak-dev] Monticello and PackageInfo Message-ID: <353076801.6842177.1607015475431.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Here's a question related to PackageInfo and Monticello. I've also asked this question on the (moderated) Cuis mailing list. The Cuis Help system on code management says: "More details about how PackageInfo decides what code belongs in a package are available at http://wiki.squeak.org/squeak/3329 . To install packages (.pck.st files) in Cuis, use the FileList, navigate to the appropriate directory (on disk, or in a GitHub repository, etc), select the package file and click on [Install Package]." My question is whether there is a way to get PackageInfo .pkg.st files, from Monticello packages. I downloaded the Monticello package DoItFirst-System-Support-dtl.14.mcz and unzip'ed the file, from the UNIX command line. This results in some files in a directory but unfortunately without .pkg.st : bash-4.4$ find . . ./version ./snapshot.bin ./package ./DoItFirst-System-Support-dtl.14.mcz ./snapshot ./snapshot/source.st I was hoping to be able to fileIn the snapshot/source.st file, or to use another method to add this package to Cuis. Because I don't see a .pck.st file, I am trying to fileIn the source.st. Assuming the idea to fileIn the snapshot/source.st file is correct, I tried to fileIn the source.st file, however this fails. The initalize method of the DoItFirst class is doing: initialize Smalltalk addToStartUpList: self before: SmallInteger. When I try to load this class in a Cuis smalltalk image, it complains that the Smalltalk class in Cuis doesNotUnderstand addToStartUpList: before: However my main question is generally speaking whether it is possible to load Monticello packages into Squeak, for example by a method (unknown to me) to create .pkg.st files. Thanks! David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfyRvaAAoJEAwpOKXMq1MaaBwH/2BAVrDAOEN+LI1sotGE6Syk WtEp56nsAVKkINb6gW6I8+AvWpnpGgiPse9TrHIR9MR76ZyFKbh7HEC0M4f4zeZX zoi2IYGOoc5lpce2sEygjNQhaqTD4RfWwQ6Kh3Cr4pDnyabusYV/hTPDSeTmOABJ g1zWc6WPoL9wCIYeFRPJa9P0ShRH5c7WOEnd/RmQzzIlUsodqOaEkU+P01IXF6t0 EwwUTKMNevxuLTwyDIkxqQ+YxSoiA2ARuP9xeEnESYF4x3OFE8uNMZ7QekBkMETE HJoHw+Re+jl752W38TJudtIsu5FeQ4tOIzZ4BMEGieGRVtHxzcRBluygcQTPK8g= =iBnx -----END PGP SIGNATURE----- From frank-lesser at lesser-software.com Thu Dec 3 18:39:14 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Thu, 3 Dec 2020 19:39:14 +0100 Subject: [squeak-dev] [OffTopic] resume of DNG after a decade In-Reply-To: <7e328b44-0a94-cc0d-88ed-d97464b57ff0@lesser-software.com> References: <1584971006315-0.post@n4.nabble.com> <4e8e180c-48e5-d703-2797-5310e35c090f@gmail.com> <66aadeabcca04da9b98e008f92d4f315@student.hpi.uni-potsdam.de> <1605889979781-0.post@n4.nabble.com> <369888da-e220-6f0e-a96d-ecc9d0b4c21b@lesser-software.com> <20201123142017.GA64854@shell.msen.com> <99dd56ce-8098-c382-1574-d708a91a8c93@lesser-software.com> <7e328b44-0a94-cc0d-88ed-d97464b57ff0@lesser-software.com> Message-ID: I made good progress on porting Dolphin to LSWGVM - The D7 professional infrastructure is almost working. I just posted a screenshot on my twitter @LesserFrank From lists at fniephaus.com Sat Dec 5 08:33:26 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Sat, 5 Dec 2020 09:33:26 +0100 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201126200056.GA23775@shell.msen.com> References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> Message-ID: This is great! +1 for adding this to trunk, leaving the when to Dave. Two thoughts: - Since you've started to "mess" with some #startUp: methods, why not mess with the startUp routine as well? Let's say, you add a flag that lists all items in the startUpList and quits the image. You can then add another flag that lets you choose the position of the DoItFirst class within the list, and insert the class right before processing it (e.g. #processStartUpList:). And by default, the position could be set to some reasonable value (right after SmallInteger, FileStream, et al.). If I don't care about the position, I can just use the default. If I want a special position, I can print the current list and then rerun with an index. - I don't know how yet, but it'd be cool to be able to cut off the rest of the startUp list with this utility, or exclude certain classes from the startUp list. In TruffleSqueak, for example, we jump through some hoops to set up an image for headless execution [1] and it'd be nice if we could simplify that with your utility. Cheers, Fabio [1] https://github.com/hpi-swa/trufflesqueak/blob/4aa371a608bd73e9be1a6c65e727eb45370d23e8/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/image/SqueakImageContext.java#L191-L207 On Thu, Nov 26, 2020 at 9:01 PM David T. Lewis wrote: > On Sun, Jun 14, 2020 at 01:15:01PM -0400, David T. Lewis wrote: > > A few cups of coffee this morning led to some enhancements to my > DoItFirst > > utility, so I decided to put in on SqueakSource. > > > > http://www.squeaksource.com/DoItFirst > > > > I have been updating this since the original post, and I think it is > in pretty good shape at this point. Latest version on SqueakSource is > DoItFirst-System-Support-dtl.14.mcz. > > In order to make this work properly I also add a couple of references > to DoItFirst from other class startUp methods. That is messy to add to > a MCZ, so I'm attaching a change set containing the latest package plus > the two additional startUp calls. > > I think this is clean enough to consider adding to trunk now, so if > folks think it is a good idea, let me know and I'll add it. > > To summarize (from the -help command line option): > > DoItFirst image arguments: > -doit argumentlist "evaluate each argument as a doIt expression" > -evaluate arg "evaluate arg, print result then exit" > -filein filelist "file in each file named in fileList" > -cwd path "set FileDirectory defaultDirectory to path prior to > evaluating other options" > -debug "enter a debugger as soon as possible in the startUp > processing" > -help "print this message" > > Dave > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gettimothy at zoho.com Sat Dec 5 15:35:56 2020 From: gettimothy at zoho.com (gettimothy) Date: Sat, 05 Dec 2020 10:35:56 -0500 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? Message-ID: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> Hi folks. Ignore as appropriate. Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does not work in morphic when that happens. A not-so-subtle indicator that "caps lock is on" would be helpful. cheers and thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sat Dec 5 20:56:41 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 5 Dec 2020 15:56:41 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> Message-ID: <20201205205641.GA41809@shell.msen.com> Hi David, These are very good suggestions, sorry I did not reply earlier. It sounds like a good Sunday Squeaker project for tomorrow after I get a good pot of coffee going :-) Thanks, Dave On Wed, Dec 02, 2020 at 08:12:05AM +0100, stes at PANDORA.BE wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > I've a request for enhancement. > > I like the DoItFirst package, but I think there should be -f option, > like in AWK to read from a source file. > > For example: > > bash-4.4$ squeak squeak.image -- -help > DoItFirst image arguments: > -doit argumentlist "evaluate each argument as a doIt expression" > -evaluate arg "evaluate arg, print result then exit" > -filein filelist "file in each file named in fileList" > -cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" > -debug "enter a debugger as soon as possible in the startUp processing" > -help "print this message" > > bash-4.4$ cat loop.st > |cltn index| > cltn _ OrderedCollection new. > index _ 1. > [index <= 10] whileTrue: [cltn add: index. index _ index + 1]. > cltn > > bash-4.4$ squeak squeak.image -- -evaluate "`cat loop.st`" > an OrderedCollection(1 2 3 4 5 6 7 8 9 10) > > What I'd propose is to add a -f which is like -evaluate and the 'cat'. > > bash-4.4$ squeak squeak.image -- -f loop.st > an OrderedCollection(1 2 3 4 5 6 7 8 9 10) > > As far as I can see the DoItFirst package does not have this, because -filein > is not quite the same. > > When I try > bash-4.4$ squeak squeak.image -- -filein loop.st > > that doesn't work. So a -f option would be nice, > or is there a solution that I don't see ? > > Also a short name like -c or -e as a shortcut for -evaluate would be nice. > > In any case, I've tried DoItFirst both with the squeak-4 from subversion, > and the squeak-5 from OpenSmalltalk (Cog VM and Stack VM release 5.0 with > Squeak6.0alpha images) and the DoItFirst package seems to work fine. > > Regards, > David Stes > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJfxz3AAAoJEAwpOKXMq1MaqY4IAI2Rdesu6SKMpXlMdbPrAHSB > YxSkjICNFRY+0TF8irelEU4UhLOn8Rap7xKjD7ZmbvD4Q0TKxys0fMAYw2F9jjvD > gNIvx7I4GcfGdH14QEmyNAUdEt0Rv88uReeZcoJxY54ycQuoEveeAGeMID5e38kw > UDZ25WIX0l4/dKmblkAHrgwVfoKUr2ukOdSr2VsusE8Gc34+mvsNx93U1VNpBrgi > EOWRq6r2FsqHmCfdvoW3H9FgnUYL80c0nRftLdU7EKZXdZTTWL1dclyckmVLTHqd > pPO3UxXrluvAk+VqtvxsMLqFoiJdYhp9080FGAMJZh2LnLfhZy7aXbSaRF02KV4= > =5Mia > -----END PGP SIGNATURE----- > From tim at rowledge.org Sat Dec 5 22:42:14 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 5 Dec 2020 14:42:14 -0800 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201205205641.GA41809@shell.msen.com> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <20201205205641.GA41809@shell.msen.com> Message-ID: <71824FAE-5BA6-43DC-8F64-1E9C72C53E11@rowledge.org> That reminds me I promised you a copy of the fibonacci script. For some reason it simply won't work properly in a plain 5.3 release image (the stdout is in a bad state) but is ok if you use an image that has been saved from that. -------------- next part -------------- A non-text attachment was scrubbed... Name: FibonacciTestScript.st Type: application/octet-stream Size: 2587 bytes Desc: not available URL: -------------- next part -------------- tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "Bo***x" said Pooh when Piglet kneed him in the groin. From stes at telenet.be Sun Dec 6 14:46:25 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 6 Dec 2020 15:46:25 +0100 (CET) Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> Message-ID: <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Thanks for posting this interesting FibonacciTestScript.st. First of all the script also uses FileStream stdout, and shows how to use nextPutAll to write to stdout. Also it shows how to time a block. For me on Squeak VM 4.19.2 I get an error however from the first line: bash-4.4$ head -1 FibonacciTestScript.st #!/usr/bin/squeak /home/pi/Squeak/TPR-Squeak5.3-18560.image I think the error 'Invalid Character' in Squeak 4.6 is from the #! line. I ran the script as follows: bash-4.4$ squeak -nodisplay squeak.image -- -evaluate 'Smalltalk version' Squeak4.6 However I think I don't need the "DoItFirst" package, just to run the FibonacciTestScript, which is using FileStream stdout by itself : bash-4.4$ squeak -nodisplay squeak.image FibonacciTestScript.st Anyway thanks for posting the script. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfzO5kAAoJEAwpOKXMq1MaQNoIAL+iI6yVH3MtvG9zykLL4fOo BOVG9wwNQYSSXUZisjtn01Z0OmF/heplEsf4PWzyJGxhMYalXRs/v6/P0LxN/iR8 Rbm2rBTaF1ItXWaUjBbicnoNSVKciOPUhHt3CwqUXyuKV3co8pMRkoHefL+6jej3 MB7a25XBTW6rHzJR+FqETBPgsi8qcCyz/XTOMFHxUg00LnU1m0+MLmw8IuvtJ42y ENtiDK24kXRSFpFctFrSK0Isq6jUGHlIdiy1L9+S3u9v3V8R8Jhvne/x8a5JLMDZ i7zrM6K4SFY5PLDAY5JqemabYuT3GO3C8s60iEoptptTUNeTf6q9RkJlJj1RCHU= =nw27 -----END PGP SIGNATURE----- From lewis at mail.msen.com Sun Dec 6 15:03:25 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 6 Dec 2020 10:03:25 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201205205641.GA41809@shell.msen.com> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <20201205205641.GA41809@shell.msen.com> Message-ID: <20201206150325.GA22902@shell.msen.com> David, I added your enhancements in DoItFirst-System-Support-dtl.15 on SqueakSource: DoItFirst image arguments: --doit argumentlist "evaluate each argument as a doIt expression" --evaluate arg "evaluate arg, print result then exit" --file filename "evaluate contents of filename, print result then exit" --filein filelist "file in each file named in fileList" --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" --debug "enter a debugger as soon as possible in the startUp processing" --help "print this message" some arguments have single character synonyms, -f is a synonym for --file, -d for --doit single '-' may be used instead of '--', -help is interpreted as --help Dave On Sat, Dec 05, 2020 at 03:56:41PM -0500, David T. Lewis wrote: > Hi David, > > These are very good suggestions, sorry I did not reply earlier. > > It sounds like a good Sunday Squeaker project for tomorrow after > I get a good pot of coffee going :-) > > Thanks, > Dave > > On Wed, Dec 02, 2020 at 08:12:05AM +0100, stes at PANDORA.BE wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA256 > > > > > > I've a request for enhancement. > > > > I like the DoItFirst package, but I think there should be -f option, > > like in AWK to read from a source file. > > > > For example: > > > > bash-4.4$ squeak squeak.image -- -help > > DoItFirst image arguments: > > -doit argumentlist "evaluate each argument as a doIt expression" > > -evaluate arg "evaluate arg, print result then exit" > > -filein filelist "file in each file named in fileList" > > -cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" > > -debug "enter a debugger as soon as possible in the startUp processing" > > -help "print this message" > > > > bash-4.4$ cat loop.st > > |cltn index| > > cltn _ OrderedCollection new. > > index _ 1. > > [index <= 10] whileTrue: [cltn add: index. index _ index + 1]. > > cltn > > > > bash-4.4$ squeak squeak.image -- -evaluate "`cat loop.st`" > > an OrderedCollection(1 2 3 4 5 6 7 8 9 10) > > > > What I'd propose is to add a -f which is like -evaluate and the 'cat'. > > > > bash-4.4$ squeak squeak.image -- -f loop.st > > an OrderedCollection(1 2 3 4 5 6 7 8 9 10) > > > > As far as I can see the DoItFirst package does not have this, because -filein > > is not quite the same. > > > > When I try > > bash-4.4$ squeak squeak.image -- -filein loop.st > > > > that doesn't work. So a -f option would be nice, > > or is there a solution that I don't see ? > > > > Also a short name like -c or -e as a shortcut for -evaluate would be nice. > > > > In any case, I've tried DoItFirst both with the squeak-4 from subversion, > > and the squeak-5 from OpenSmalltalk (Cog VM and Stack VM release 5.0 with > > Squeak6.0alpha images) and the DoItFirst package seems to work fine. > > > > Regards, > > David Stes > > > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v2 > > > > iQEcBAEBCAAGBQJfxz3AAAoJEAwpOKXMq1MaqY4IAI2Rdesu6SKMpXlMdbPrAHSB > > YxSkjICNFRY+0TF8irelEU4UhLOn8Rap7xKjD7ZmbvD4Q0TKxys0fMAYw2F9jjvD > > gNIvx7I4GcfGdH14QEmyNAUdEt0Rv88uReeZcoJxY54ycQuoEveeAGeMID5e38kw > > UDZ25WIX0l4/dKmblkAHrgwVfoKUr2ukOdSr2VsusE8Gc34+mvsNx93U1VNpBrgi > > EOWRq6r2FsqHmCfdvoW3H9FgnUYL80c0nRftLdU7EKZXdZTTWL1dclyckmVLTHqd > > pPO3UxXrluvAk+VqtvxsMLqFoiJdYhp9080FGAMJZh2LnLfhZy7aXbSaRF02KV4= > > =5Mia > > -----END PGP SIGNATURE----- > > > From commits at source.squeak.org Sun Dec 6 17:03:26 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 6 Dec 2020 17:03:26 0000 Subject: [squeak-dev] The Inbox: Morphic-ct.1716.mcz Message-ID: Christoph Thiede uploaded a new version of Morphic to project The Inbox: http://source.squeak.org/inbox/Morphic-ct.1716.mcz ==================== Summary ==================== Name: Morphic-ct.1716 Author: ct Time: 6 December 2020, 6:03:02.43962 pm UUID: b5046c96-a83e-2543-b9e2-4b56a3e99a1a Ancestors: Morphic-mt.1713 Re-enables handling of #launchDrop events when the VM is configured as a singleton and has been invoked again, though currently only handled with a rudimentary fallback implementation. See http://forum.world.st/Changeset-Enhanced-integration-of-drag-n-drop-from-host-tp5123857p5124332.html. Thanks to Jakob (jr) for the feedback! Reuploaded as replacement for Morphic-ct.1715. Thanks also to Marcel for the feedback! :-) =============== Diff against Morphic-mt.1713 =============== Item was changed: ----- Method: HandMorph>>generateDropFilesEvent: (in category 'private events') ----- generateDropFilesEvent: evtBuf "Generate the appropriate mouse event for the given raw event buffer." | position buttons modifiers stamp numFiles dragType | stamp := evtBuf second. stamp = 0 ifTrue: [stamp := Time eventMillisecondClock]. dragType := evtBuf third. position := evtBuf fourth @ evtBuf fifth. buttons := MouseEvent redButton. "hacked because necessary for correct mouseMoveDragging handling" modifiers := evtBuf sixth. buttons := buttons bitOr: (modifiers bitShift: 3). numFiles := evtBuf seventh. dragType caseOf: { [1] -> [ "dragEnter" externalDropMorph := TransferMorph new dragTransferType: #filesAndDirectories; source: self; passenger: (numFiles = 0 "Usually, numFiles and drop paths are delivered on dragDrop only. Still reserving this possibility for able host implementations." ifTrue: [self flag: #vmCapabilityMissing. 'Unknown host content' translated] ifFalse: [self collectDropFilesAndDirectories: numFiles]); yourself. "During the drag operation, the host system is responsible for displaying the cursor." self grabMorph: externalDropMorph. self showTemporaryCursor: Cursor blank. externalDropMorph bottomRight: self topLeft. "Southeast area of the cursor is blocked by drawings from the source application. Display our drop morph at the opposite corner of the cursor." ]. [2] -> [ "dragMove" ^ MouseMoveEvent new setType: #mouseMove startPoint: self position endPoint: position trail: "{self position. position}"(self mouseDragTrailFrom: evtBuf) buttons: buttons hand: self stamp: stamp ]. [3] -> [ "dragLeave" externalDropMorph ifNotNil: #abandon. externalDropMorph := nil. self showTemporaryCursor: nil ]. [4] -> [ "dragDrop" + | oldButtons event | + oldButtons := lastEventBuffer fifth + bitOr: (lastEventBuffer sixth bitShift: 3). + event := MouseButtonEvent new + setType: #mouseUp + position: position + which: (oldButtons bitXor: buttons) + buttons: buttons + nClicks: 0 + hand: self + stamp: stamp. + - | oldButtons | externalDropMorph ifNil: [ + "dragDrop has been sent without prior dragging. This happens when the VM is configured as singleton application and has been invoked again with a new image file (aka #launchDrop, runAsSingleInstance on Unix, or RunSingleApp on Windows)." + self flag: #forLater. "ct: When we decouple event generation from Morphic, we will probably need to introduce a separate SystemLaunchEvent class for this event. See http://forum.world.st/Changeset-Enhanced-integration-of-drag-n-drop-from-host-tp5123857p5124332.html." + Project current + launchSystemFiles: (self collectDropFilesAndDirectories: numFiles) + event: event. + ^ nil]. - "dragDrop has been sent without prior dragging. This happens when the VM is configured as singleton application and has been called again (aka #launchDrop)." - ^ self error: 'Launch drop for singleton Squeak not yet implemented.']. self showTemporaryCursor: nil. externalDropMorph passenger isString ifTrue: [ self flag: #vmCapabilityMissing. "See above." externalDropMorph passenger: (self collectDropFilesAndDirectories: numFiles)]. externalDropMorph := nil. (Smalltalk classNamed: #DropFilesEvent) ifNotNil: [:eventClass | | classicEvent | "Generate classic DropFilesEvent, providing backward compatibility." classicEvent := eventClass new setPosition: position contents: numFiles hand: self. self processEvent: classicEvent. classicEvent wasHandled ifTrue: [^ nil]]. + ^ event ]. - oldButtons := lastEventBuffer fifth - bitOr: (lastEventBuffer sixth bitShift: 3). - ^ MouseButtonEvent new - setType: #mouseUp - position: position - which: (oldButtons bitXor: buttons) - buttons: buttons - nClicks: 0 - hand: self - stamp: stamp ]. [5] -> [ "drag request" "For dnd out. Not properly implemented at the moment." self shouldBeImplemented] }. ^ nil! Item was added: + ----- Method: MorphicProject>>launchSystemFiles:event: (in category 'utilities') ----- + launchSystemFiles: fileStreams event: genericMorphicEvent + "Handle a number of files the singleton VM was invoked with again." + + self flag: #todo. "Do something more useful with the image here, e. g. tell the VM to load it." + self inform: ('Cannot start a second instance of Squeak\with the image "{1}"\because the VM is configured as singleton application.' withCRs translated format: {fileStreams first localName}).! From lewis at mail.msen.com Sun Dec 6 17:44:28 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 6 Dec 2020 12:44:28 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201206150325.GA22902@shell.msen.com> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <20201205205641.GA41809@shell.msen.com> <20201206150325.GA22902@shell.msen.com> Message-ID: <20201206174428.GA46738@shell.msen.com> On Sun, Dec 06, 2020 at 10:03:25AM -0500, David T. Lewis wrote: > David, > > I added your enhancements in DoItFirst-System-Support-dtl.15 on SqueakSource: > > DoItFirst image arguments: > --doit argumentlist "evaluate each argument as a doIt expression" > --evaluate arg "evaluate arg, print result then exit" > --file filename "evaluate contents of filename, print result then exit" > --filein filelist "file in each file named in fileList" > --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" > --debug "enter a debugger as soon as possible in the startUp processing" > --help "print this message" > some arguments have single character synonyms, -f is a synonym for --file, -d for --doit > single '-' may be used instead of '--', -help is interpreted as --help > Please use DoItFirst-System-Support-dtl.16 which fixes a couple of slips in the DoItFirst-System-Support-dtl.15 commit. Not enough coffee this morning I guess, sorry about that. Dave From lewis at mail.msen.com Sun Dec 6 17:52:39 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 6 Dec 2020 12:52:39 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> Message-ID: <20201206175239.GB46738@shell.msen.com> On Sat, Dec 05, 2020 at 09:33:26AM +0100, Fabio Niephaus wrote: > This is great! +1 for adding this to trunk, leaving the when to Dave. > > Two thoughts: > > - Since you've started to "mess" with some #startUp: methods, why not mess > with the startUp routine as well? Let's say, you add a flag that lists all > items in the startUpList and quits the image. You can then add another flag > that lets you choose the position of the DoItFirst class within the > list, and insert the class right before processing it (e.g. > #processStartUpList:). And by default, the position could be set to some > reasonable value (right after SmallInteger, FileStream, et al.). If I don't > care about the position, I can just use the default. If I want a special > position, I can print the current list and then rerun with an index. > The way I handled this is by making DoItFirst be the first entry in the startup list, and having it invoke the startUp in other classes if and only if needed to process the command line options. The rationale for this is that the --debug option will enter a debugger at the earliest possible time before encountering any errors that might occur later in the startUp processing. This is a feature that you don't need very often, but when you need it, you really need it. > - I don't know how yet, but it'd be cool to be able to cut off the rest of > the startUp list with this utility, or exclude certain classes from the > startUp list. In TruffleSqueak, for example, we jump through some hoops to > set up an image for headless execution [1] and it'd be nice if we could > simplify that with your utility. > That might be a tricky problem, but I'm sure it can be done. In principle we could manipulate the startup from one of the existing argument hooks, but at that point we are already iterating over the startup list so it is presumably not good to manipulate the list at that time. One possible solution that comes to mind is to move DoItFirst out of the startup list, and just explictly call it right before processing the list. I note also that we do not have accessors for the StartUpList and ShutDownList, so we would probably want to add these too. Dave > Cheers, > Fabio > > [1] > https://github.com/hpi-swa/trufflesqueak/blob/4aa371a608bd73e9be1a6c65e727eb45370d23e8/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/image/SqueakImageContext.java#L191-L207 > > On Thu, Nov 26, 2020 at 9:01 PM David T. Lewis wrote: > > > On Sun, Jun 14, 2020 at 01:15:01PM -0400, David T. Lewis wrote: > > > A few cups of coffee this morning led to some enhancements to my > > DoItFirst > > > utility, so I decided to put in on SqueakSource. > > > > > > http://www.squeaksource.com/DoItFirst > > > > > > > I have been updating this since the original post, and I think it is > > in pretty good shape at this point. Latest version on SqueakSource is > > DoItFirst-System-Support-dtl.14.mcz. > > > > In order to make this work properly I also add a couple of references > > to DoItFirst from other class startUp methods. That is messy to add to > > a MCZ, so I'm attaching a change set containing the latest package plus > > the two additional startUp calls. > > > > I think this is clean enough to consider adding to trunk now, so if > > folks think it is a good idea, let me know and I'll add it. > > > > To summarize (from the -help command line option): > > > > DoItFirst image arguments: > > -doit argumentlist "evaluate each argument as a doIt expression" > > -evaluate arg "evaluate arg, print result then exit" > > -filein filelist "file in each file named in fileList" > > -cwd path "set FileDirectory defaultDirectory to path prior to > > evaluating other options" > > -debug "enter a debugger as soon as possible in the startUp > > processing" > > -help "print this message" > > > > Dave > > > > > > > From lewis at mail.msen.com Sun Dec 6 18:27:05 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 6 Dec 2020 13:27:05 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201206175239.GB46738@shell.msen.com> References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201206175239.GB46738@shell.msen.com> Message-ID: <20201206182705.GA53081@shell.msen.com> On Sun, Dec 06, 2020 at 12:52:39PM -0500, David T. Lewis wrote: > On Sat, Dec 05, 2020 at 09:33:26AM +0100, Fabio Niephaus wrote: > > > - I don't know how yet, but it'd be cool to be able to cut off the rest of > > the startUp list with this utility, or exclude certain classes from the > > startUp list. In TruffleSqueak, for example, we jump through some hoops to > > set up an image for headless execution [1] and it'd be nice if we could > > simplify that with your utility. > > > > That might be a tricky problem, but I'm sure it can be done. In principle > we could manipulate the startup from one of the existing argument hooks, > but at that point we are already iterating over the startup list so > it is presumably not good to manipulate the list at that time. One > possible solution that comes to mind is to move DoItFirst out of the > startup list, and just explictly call it right before processing the > list. > Actually I may have spoken too soon, because the existing --doit option seems to be able to manipulate the startup list directly with no problem at all. For example, I ran this command line: $ run squeak.image -- --doit 'Smalltalk removeFromStartUpList: PowerManagement' 'Smalltalk removeFromStartUpList: ExtendedClipboardInterface' & This removed PowerManagement and ExtendedClipboardInterface from the startup list, and the remaining elements of the list were processed without problems. So as far as I can tell, you will be able to customize the startup list in any way necessary just by adding some --doit snippets on the command line. Dave From tim at rowledge.org Sun Dec 6 18:50:13 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 6 Dec 2020 10:50:13 -0800 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> Message-ID: > On 2020-12-06, at 6:46 AM, stes at PANDORA.BE wrote: > > First of all the script also uses FileStream stdout, and shows how > to use nextPutAll to write to stdout. Also it shows how to time a block. I hope those are all useful things to learn; the stdout thing may be an issue, at least for the 5.3 release image. > > For me on Squeak VM 4.19.2 I get an error however from the first line: > > bash-4.4$ head -1 FibonacciTestScript.st > #!/usr/bin/squeak /home/pi/Squeak/TPR-Squeak5.3-18560.image Ah, right, now I remember. We had some fascinating discussions about this area and that line was added because it means you can set the file permissions to executable and simply run the fibonacci file as a unix script; the #!/usr/bin/squeak will actually run the vm, pass it the following words and thus run the system with this script. Neat, eh? Dig into the list archives for May 2019 (which was about 300 years ago IIRC) and subject 'Faster fibonacci' and related stuff. Subbu suggested some extra-neat ways of making Squeak do scripty-things using the unix script-handler. > > I think the error 'Invalid Character' in Squeak 4.6 is from the #! line. Yes, sometihng got added for 5.3 to make it able to skip that. I'm not sure what; digging into those emails should reveal it. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "Bother" said Pooh, as the IRS kicked his door in. From lewis at mail.msen.com Sun Dec 6 20:10:44 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 6 Dec 2020 15:10:44 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> Message-ID: <20201206201044.GA65394@shell.msen.com> On Sun, Dec 06, 2020 at 10:50:13AM -0800, tim Rowledge wrote: > > > > On 2020-12-06, at 6:46 AM, stes at PANDORA.BE wrote: > > > > First of all the script also uses FileStream stdout, and shows how > > to use nextPutAll to write to stdout. Also it shows how to time a block. > > I hope those are all useful things to learn; the stdout thing may be an issue, at least for the 5.3 release image. > > > > > For me on Squeak VM 4.19.2 I get an error however from the first line: > > > > bash-4.4$ head -1 FibonacciTestScript.st > > #!/usr/bin/squeak /home/pi/Squeak/TPR-Squeak5.3-18560.image > > Ah, right, now I remember. We had some fascinating discussions about this area and that line was added because it means you can set the file permissions to executable and simply run the fibonacci file as a unix script; the #!/usr/bin/squeak will actually run the vm, pass it the following words and thus run the system with this script. Neat, eh? Dig into the list archives for May 2019 (which was about 300 years ago IIRC) and subject 'Faster fibonacci' and related stuff. Subbu suggested some extra-neat ways of making Squeak do scripty-things using the unix script-handler. > There is a preference for "Read document at startup" that needs to be enabled in order for this to work. In addition, you will need to set the script file to be executable: $ chmod +x FibonacciTestScript.st Then edit the first line of the file to match your own local system. Tim's script starts with: #!/usr/bin/squeak /home/pi/Squeak/TPR-Squeak5.3-18560.image On my computer, the executable script for running Squeak VMs is called /usr/local/bin/run rather than /usr/bin/squeak, and the particular image that I am running at the moment is called squeak.12.image, so I edited the line in my script file to look like this: #!/usr/local/bin/spur64 squeak.12.image So now the FibonacciTestScript.st file is a Unix executable shell script, and I can run it like this: $ ./FibonacciTestScript.st You can google "unix shebang" to find explanations of how this works. The basic idea is that the script file runs some program specified in the comment (starts with #) on the first line of the script, then it passes itself as an additional parameter to whatever program it ran. So Unix thinks it's a shell script, and Squeak thinks it's a Smalltalk start document. The shell script starts Squeak, and then feeds itself back into Squeak as the start documemt. According to Wikipedia: "The shebang was introduced by Dennis Ritchie between Edition 7 and 8 at Bell Laboratories" Not bad for a 35-plus year old shell hack, eh? Dave From kksubbu.ml at gmail.com Mon Dec 7 08:13:12 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Mon, 7 Dec 2020 13:43:12 +0530 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201206201044.GA65394@shell.msen.com> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> <20201206201044.GA65394@shell.msen.com> Message-ID: <408eb1cb-915c-53fd-e8c3-eecdac6a4bb0@gmail.com> On 07/12/20 1:40 am, David T. Lewis wrote: > Tim's script starts with: > > #!/usr/bin/squeak /home/pi/Squeak/TPR-Squeak5.3-18560.image > > On my computer, the executable script for running Squeak VMs is > called /usr/local/bin/run rather than /usr/bin/squeak, and the > particular image that I am running at the moment is called squeak.12.image, > so I edited the line in my script file to look like this: > > #!/usr/local/bin/spur64 squeak.12.image > > So now the FibonacciTestScript.st file is a Unix executable shell > script, and I can run it like this: > > $ ./FibonacciTestScript.st On Linux, one can use the binfmt_misc (see update-binfmts(8)) to shorten launch times for interpreters like squeak. This kernel module can match command files with their interpreter based on extension or embedded code patterns. Python and Java already use this feature. update-binfmts can install, display, find, disable, enable or remove interpreters and their scripts/images based on file extensions or embedded magic codes. Executing .st scripts will require two registrations. One to match .st to its image and a second one to match the image to its vm. 1. To match .st to image, register a magic pattern with the binfmt_misc feature along with the specific image to be launched: $ sudo update-binfmts --install squeak5-64 /var/squeak/squeak5-3-64bit.image --magic '"#spur64"' --offset 0 This will execute all .st files beginning with "spur64" with the given image. $ chmod +x ./foo-bar.st /var/squeak/squeak5.3-64bit.image $ head -1 ./foo-bar.st "#spur64" Now the command $ ./foo-bar.st arg1 arg2 will be equivalent to: $ /var/squeak/squeak5.3-64bit.image ./foo-bar.st arg1 arg2 2. Register another pattern to match .image to spur64 interpreter. Then the line is equivalent to: $ /usr/local/bin/spur64 /var/squeak/squeak5.3-64bit.image ./foo-bar.st arg1 arg2 Registration is a one-time effort. Because the matching and loading is done in a kernel module, the startup time is reduced. This trick can be useful on platforms like RPi. HTH .. Subbu From stes at telenet.be Mon Dec 7 10:38:30 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Mon, 7 Dec 2020 11:38:30 +0100 (CET) Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> Message-ID: <1826164202.17772926.1607337510044.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 First of all, thanks for updating the DoItFirst package. I think that DoItFirst is a really nice package. I'm having some additional questions which I'll move to the "beginners" emailing list ! So I'll post some question on the beginners emailing list about DoItFirst. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfzgX5AAoJEAwpOKXMq1MatA8IAJPzrcnoUmwfBCUAkWL5XcqD LqxnHFMone8xwgQvabW3Ten+Q4flebCAffhQ9g5bL6mcojajW3CKkvX9pGZehmjE knxp3adeAKq4fXL2lhHPNX155int70iWGvjtE8uXuw37mWwz/70U59XzKHTiaKzN yeaQmT5dghCf8zjhEoJs/TZUxbgFiF+lZU82ewwos2lynlYCBE1vs2C3R41PhQvw AQ5uYQYTFHAhLkYBOHc0mhZWoZqMB83IHncSWfol4fLFMnt6m2OamLVTqd2bZsIR oJmW98p6+EG5HRQqqM8gOdINvEqsScl0K615tlw1NGAzF6vdzTfiZmh5hlsHChQ= =1zs8 -----END PGP SIGNATURE----- From marcel.taeumel at hpi.de Mon Dec 7 16:08:49 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 7 Dec 2020 17:08:49 +0100 Subject: [squeak-dev] Smalltalk specialObjectsArray at: 38 Message-ID: Hi Eliot. In current Trunk, which has SistaV1 enabled, "Smalltalk specialObjectsArray at: 38" is still "nil" but should be "FullBlockClosure". Is this good? How can the bytecode "pushFullClosure" work? CC squeak-dev Best, Marcel -------------- next part -------------- An HTML attachment was scrubbed... URL: From cunningham.cb at gmail.com Mon Dec 7 16:45:58 2020 From: cunningham.cb at gmail.com (Chris Cunningham) Date: Mon, 7 Dec 2020 08:45:58 -0800 Subject: [squeak-dev] Tool labels are ... odd (Senders/Implementors of) Message-ID: For Senders and Implementors, they work. If I click on the Vars button (to see where Instance Variables are used), the tool shows up as 'Sender of ', which isn't right. If I do Class References, the window/tool also shows up as Senders of. Being a person who has many windows open in Squeak, this makes it hard to track down where the right window is. If any one has an idea where this is (or, better yet, can fix it), wonderful. Failing that, I'll eventually get around to submitting my own fix. Thanks, cbc -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Dec 7 17:46:23 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 7 Dec 2020 17:46:23 0000 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz Message-ID: A new version of Collections was added to project The Inbox: http://source.squeak.org/inbox/Collections-ct.922.mcz ==================== Summary ==================== Name: Collections-ct.922 Author: ct Time: 7 December 2020, 6:46:19.160326 pm UUID: 633c2dcc-4586-e443-bf03-02ae9ae42ee6 Ancestors: Collections-mt.919 Proposal: Implements #add:put:during: as execution around method on Dictionary. This logic is not absolutely trivial, so I would not like to reimplement it again every time I need to build an execution around setter. =============== Diff against Collections-mt.919 =============== Item was added: + ----- Method: Dictionary>>at:put:during: (in category 'accessing') ----- + at: key put: anObject during: aBlock + + | revertBlock assoc | + revertBlock := self + at: key + ifPresent: [:value | [self at: key put: value]] + ifAbsent: [[self removeKey: key]]. + self at: key put: anObject. + assoc := self associationAt: key ifAbsent: [nil]. + ^ aBlock ensure: [ + | newAssoc | + ((newAssoc := self associationAt: key ifAbsent: [nil]) == assoc + and: [newAssoc value = anObject]) + ifTrue: [revertBlock value]]! From commits at source.squeak.org Mon Dec 7 17:47:36 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 7 Dec 2020 17:47:36 0000 Subject: [squeak-dev] The Inbox: CollectionsTests-ct.347.mcz Message-ID: A new version of CollectionsTests was added to project The Inbox: http://source.squeak.org/inbox/CollectionsTests-ct.347.mcz ==================== Summary ==================== Name: CollectionsTests-ct.347 Author: ct Time: 7 December 2020, 6:46:54.870326 pm UUID: 1de6ec63-21e0-7248-acc6-4b0e71a82475 Ancestors: CollectionsTests-mt.346 Tests Collections-ct.922 (Dictionary >> #at:put:during:). =============== Diff against CollectionsTests-mt.346 =============== Item was added: + ----- Method: DictionaryTest>>testAtPutDuring (in category 'tests - basic') ----- + testAtPutDuring + + | dictionary | + dictionary := Dictionary new. + + dictionary at: #a put: 3 during: [ + self assert: 3 equals: (dictionary at: #a)]. + self deny: (dictionary includesKey: #a). + + dictionary + at: #a put: 2; + at: #a put: 3 during: [ + self assert: 3 equals: (dictionary at: #a)]. + self assert: 2 equals: (dictionary at: #a). + + dictionary at: #a put: 3 during: [ + self assert: 3 equals: (dictionary at: #a). + dictionary at: #a put: 4]. + self assert: 4 equals: (dictionary at: #a). + self fail. + dictionary + at: #a put: 2; + at: #a put: 3 during: [ + self assert: 3 equals: (dictionary at: #a). + dictionary removeKey: #a]. + self deny: (dictionary includesKey: #a).! From tim at rowledge.org Mon Dec 7 17:52:58 2020 From: tim at rowledge.org (tim Rowledge) Date: Mon, 7 Dec 2020 09:52:58 -0800 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: References: Message-ID: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> > On 2020-12-07, at 9:46 AM, commits at source.squeak.org wrote: > > A new version of Collections was added to project The Inbox: > http://source.squeak.org/inbox/Collections-ct.922.mcz > > ==================== Summary ==================== > > Name: Collections-ct.922 > Author: ct > Time: 7 December 2020, 6:46:19.160326 pm > UUID: 633c2dcc-4586-e443-bf03-02ae9ae42ee6 > Ancestors: Collections-mt.919 > > Proposal: Implements #add:put:during: as execution around method on Dictionary. This logic is not absolutely trivial, so I would not like to reimplement it again every time I need to build an execution around setter. Possibly useful idea for this - instead of altering the original twice, how about copying the dictionary and adding to it, then simply abandoning it? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim All computers run at the same speed...with the power off. From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 7 17:55:22 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 7 Dec 2020 17:55:22 +0000 Subject: [squeak-dev] A discrepancy between bytecode execution and simulation Message-ID: Hi all, hi Eliot, I constructed the following code snippet which evaluates to true when running it using the production execution machinery: nil == thisContext pop I guess this is fine, because what alternatives would the execution machinery have? It could terminate the whole VM or we could introduce something like #cannotReturn: for invalid stack frame objects. Probably the current implementation is the best despite an invalid position in the context stack has been addressed. However, the simulation machinery treats the same snippet differently, and it throws: Error: subscript is out of bounds: 0 I wonder whether it is acceptable to have diverging behaviors for such an ill-defined edge case between simulation and production (btw did I choose the right terms for them? :)). Might it a better alternative to raise a Warning (#notify:) only and then return nil such as the VM appears to do? Best, Christoph -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 7 18:05:23 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 7 Dec 2020 18:05:23 +0000 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> References: , <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> Message-ID: IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? ________________________________ Von: Squeak-dev im Auftrag von tim Rowledge Gesendet: Montag, 7. Dezember 2020 18:52:58 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz > On 2020-12-07, at 9:46 AM, commits at source.squeak.org wrote: > > A new version of Collections was added to project The Inbox: > http://source.squeak.org/inbox/Collections-ct.922.mcz > > ==================== Summary ==================== > > Name: Collections-ct.922 > Author: ct > Time: 7 December 2020, 6:46:19.160326 pm > UUID: 633c2dcc-4586-e443-bf03-02ae9ae42ee6 > Ancestors: Collections-mt.919 > > Proposal: Implements #add:put:during: as execution around method on Dictionary. This logic is not absolutely trivial, so I would not like to reimplement it again every time I need to build an execution around setter. Possibly useful idea for this - instead of altering the original twice, how about copying the dictionary and adding to it, then simply abandoning it? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim All computers run at the same speed...with the power off. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Mon Dec 7 18:10:11 2020 From: tim at rowledge.org (tim Rowledge) Date: Mon, 7 Dec 2020 10:10:11 -0800 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: References: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> Message-ID: > On 2020-12-07, at 10:05 AM, Thiede, Christoph wrote: > > IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? Absolutely. Depends on what your deeper purpose is. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: LAG: Load and Garble From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 7 18:14:22 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 7 Dec 2020 18:14:22 +0000 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: References: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> , Message-ID: <69591d44085842ada63aeacac94b5479@student.hpi.uni-potsdam.de> I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary, just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended sandbox effects. :-) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von tim Rowledge Gesendet: Montag, 7. Dezember 2020 19:10:11 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz > On 2020-12-07, at 10:05 AM, Thiede, Christoph wrote: > > IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? Absolutely. Depends on what your deeper purpose is. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: LAG: Load and Garble -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 8 05:12:02 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 7 Dec 2020 21:12:02 -0800 Subject: [squeak-dev] A discrepancy between bytecode execution and simulation In-Reply-To: References: Message-ID: <3D3F224F-CD7E-4939-9A99-0377ED8AE0F5@gmail.com> Hi Christoph, > On Dec 7, 2020, at 9:55 AM, Thiede, Christoph wrote: > >  > Hi all, hi Eliot, > > > > I constructed the following code snippet which evaluates to true when running it using the production execution machinery: > > > > nil == thisContext pop > > > > I guess this is fine, because what alternatives would the execution machinery have? It could terminate the whole VM or we could introduce something like #cannotReturn: for invalid stack frame objects. Probably the current implementation is the best despite an invalid position in the context stack has been addressed. > Well, if you evaluated that snippet within some outer stack state I dare say you could generate invalid results. For example, I would wonder what this does: true == (nil == thisContext pop. true) and this (and the above) will likely generate different effects in the StackInterpreter and the Cog vm, because effectively the Cog JIT preprocesses the bytecodes and executes the code generated from that preprocessing, rather than a literal interpretation of the bytecode. > However, the simulation machinery treats the same snippet differently, and it throws: > > > > Error: subscript is out of bounds: 0 > > > > I wonder whether it is acceptable to have diverging behaviors for such an ill-defined edge case between simulation and production (btw did I choose the right terms for them? :)). Might it a better alternative to raise a Warning (#notify:) only and then return nil such as the VM appears to do? > It’s a very good question. I’m going to provide a very lazy and pragmatic answer, forced by lack of resources to address the issue properly. It’s clear that the behaviour is at best undefined. It is good that the simulation produces an error. The only regrettable thing is that what is reported is a low-level error rather than a high-level one that says, fir example, “undefined behaviour encountered”. Achieving a specification which states that this is undefined behaviour allows the JIT to get away with not dealing with the issue, and that’s important because dealing with the issue such that the JIT could detect this as an error would likely destroy lots of performance gains it is able to make by assuming it is given valid defined execution sequences. That’s a long winded way of saying that, given limited resources, I’m giving the same response as a doctor that when told by a patient that it hurts when the patient does X says “then stop doing X”. > Best, > > Christoph > _,,,^..^,,,_ (phone) -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 8 05:34:54 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 7 Dec 2020 21:34:54 -0800 Subject: [squeak-dev] Smalltalk specialObjectsArray at: 38 In-Reply-To: References: Message-ID: <01DA9AC1-246C-4AA6-B912-B318BAB7954A@gmail.com> Hi Marcel, > On Dec 7, 2020, at 8:08 AM, Marcel Taeumel wrote: > >  > Hi Eliot. > > In current Trunk, which has SistaV1 enabled, "Smalltalk specialObjectsArray at: 38" is still "nil" but should be "FullBlockClosure". Is this good? How can the bytecode "pushFullClosure" work? Ha, good catch! The answer is key to one of Spur’s performance gains over the old object representation. If you collect the identityHashes of all Behaviors in the specialObjectsArray you’ll notice they all have small values. In Spur an object header *does not* contain a full reference to the class of the object. Instead it contains a 22 bit field that contains the identityHash of its class. The heap contains a sparse array mapping class identityHash to class object. That’s why Behavior>>identityHash is a different primitive to Object>>identityHash, to ensure that Behaviors have unique identityHashes. Consequently when the vm instantiates FullBlockClosure, Array, Message, LargePositiveInteger et al, commonly used classes known to the VM, it is storing a constant into the object header, not fetching the class from the specialObjectsArray. In fact it writes the entire object header as a precomputed constant through the allocation pointer and hence instantiation in Spur is much faster than in V3. But yes, we should arrange that (specialObjectsArray at:38) == FullBlockClosure. > > CC squeak-dev > > Best, > Marcel -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Tue Dec 8 12:34:33 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Tue, 8 Dec 2020 13:34:33 +0100 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: <69591d44085842ada63aeacac94b5479@student.hpi.uni-potsdam.de> References: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> <,> <69591d44085842ada63aeacac94b5479@student.hpi.uni-potsdam.de> Message-ID: Hmm... Preferences does not expose the dictionary. It is rather an implementation detail. See: Preferences class >> #setPreference:toValue: Preferences class >> #setPreference:toValue:during: Hmm... there are implementations of #at:put: where a "nil" value deletes the key. See: Morph >> #setProperty:toValue: Hmm... I am not sure about the returned value. Shouldn't it be the object? Should it the block's last result? Depends on the purpose, I suppose. Hmm... I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection. What about this implementation? Seems to so "low level": | hasKey oldValue | self at: key ifPresent: [:v | oldValue := v. hasKey := true]. self at: key put: anObject. ^ aBlock ensure: [ hasKey == true ifTrue: [self at: key put: oldValue] ifFalse: [self removeKey: key]] Best, Marcel Am 07.12.2020 19:14:30 schrieb Thiede, Christoph : I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary, just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended sandbox effects. :-) [http://www.hpi.de/] Best, Christoph Von: Squeak-dev im Auftrag von tim Rowledge Gesendet: Montag, 7. Dezember 2020 19:10:11 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz   > On 2020-12-07, at 10:05 AM, Thiede, Christoph wrote: > > IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? Absolutely. Depends on what your deeper purpose is. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim [http://www.rowledge.org/tim] Strange OpCodes: LAG: Load and Garble -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Tue Dec 8 12:44:09 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Tue, 8 Dec 2020 13:44:09 +0100 Subject: [squeak-dev] A discrepancy between bytecode execution and simulation In-Reply-To: References: Message-ID: Hi Christoph > [...] between simulation and production (btw did I choose the right terms for them? :) Since code simulation needs code execution, I think that "simulation" is a part of "execution". Maybe it makes sense to think in terms of "simulation depth"? In a non-debugging scenario, that "simulation depth" is 0 because no simulation code is executed. When you debug/simulate your application code, depth is 1. When you debug/simulate the simulation code, depth is 2. If one would construct deeper "simulate the simulating simulator" processes, depth can be greater than 2. :-) "Production" is then simulation depth 0. :-D Best, Marcel Am 07.12.2020 18:55:31 schrieb Thiede, Christoph : Hi all, hi Eliot, I constructed the following code snippet which evaluates to true when running it using the production execution machinery: nil == thisContext pop I guess this is fine, because what alternatives would the execution machinery have? It could terminate the whole VM or we could introduce something like #cannotReturn: for invalid stack frame objects. Probably the current implementation is the best despite an invalid position in the context stack has been addressed. However, the simulation machinery treats the same snippet differently, and it throws: Error: subscript is out of bounds: 0 I wonder whether it is acceptable to have diverging behaviors for such an ill-defined edge case between simulation and production (btw did I choose the right terms for them? :)). Might it a better alternative to raise a Warning (#notify:) only and then return nil such as the VM appears to do? Best, Christoph -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Tue Dec 8 13:19:24 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Tue, 8 Dec 2020 13:19:24 +0000 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: References: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> <,> <69591d44085842ada63aeacac94b5479@student.hpi.uni-potsdam.de>, Message-ID: <2d10cac3607f417aa91c065be3669304@student.hpi.uni-potsdam.de> Hi Marcel, > Preferences does not expose the dictionary. It is rather an implementation detail. Yes, but #setPreference:toValue:during: *could* reuse #at:put:during: instead of reinventing this - though small - wheel. :-) > there are implementations of #at:put: where a "nil" value deletes the key. Isn't this a completely domain-specific design decision? I think we should look at this at a different level of abstraction. > I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection. But the semantics of an execution-around method do not need to be timeless as mentioned earlier. Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window is open. In this example, forbidding the manipulation of extensions during aBlock would rule out the use of #at:put:during: ... > What about this implementation? Seems to so "low level": Might be less efficient (I haven't measured it) but provides better readability. :-) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Taeumel, Marcel Gesendet: Dienstag, 8. Dezember 2020 13:34:33 An: squeak-dev Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz Hmm... Preferences does not expose the dictionary. It is rather an implementation detail. See: Preferences class >> #setPreference:toValue: Preferences class >> #setPreference:toValue:during: Hmm... there are implementations of #at:put: where a "nil" value deletes the key. See: Morph >> #setProperty:toValue: Hmm... I am not sure about the returned value. Shouldn't it be the object? Should it the block's last result? Depends on the purpose, I suppose. Hmm... I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection. What about this implementation? Seems to so "low level": | hasKey oldValue | self at: key ifPresent: [:v | oldValue := v. hasKey := true]. self at: key put: anObject. ^ aBlock ensure: [ hasKey == true ifTrue: [self at: key put: oldValue] ifFalse: [self removeKey: key]] Best, Marcel Am 07.12.2020 19:14:30 schrieb Thiede, Christoph : I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary, just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended sandbox effects. :-) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von tim Rowledge Gesendet: Montag, 7. Dezember 2020 19:10:11 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz > On 2020-12-07, at 10:05 AM, Thiede, Christoph wrote: > > IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? Absolutely. Depends on what your deeper purpose is. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: LAG: Load and Garble -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Dec 8 21:10:44 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 8 Dec 2020 21:10:44 0000 Subject: [squeak-dev] The Trunk: System-dtl.1195.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1195.mcz ==================== Summary ==================== Name: System-dtl.1195 Author: dtl Time: 8 December 2020, 4:10:40.495367 pm UUID: 88a0ce82-643e-47c4-83e9-27404ce5f71f Ancestors: System-eem.1194 Add DoItFirst to be the first thing in the system startup list, processing certain command line options prior to any additional image initialization. DoItFirst image arguments: --doit argumentlist "evaluate each argument as a doIt expression" --evaluate arg "evaluate arg, print result then exit" --file filename "evaluate contents of filename, print result then exit" --filein filelist "file in each file named in fileList" --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" --debug "enter a debugger as soon as possible in the startUp processing" --help "print this message" Some arguments have single character synonyms, -f is a synonym for --file, -d for --doit A single '-' may be used instead of '--', -help is interpreted as --help =============== Diff against System-eem.1194 =============== Item was added: + Object subclass: #DoItFirst + instanceVariableNames: 'actions' + classVariableNames: 'Current' + poolDictionaries: '' + category: 'System-Support'! + + !DoItFirst commentStamp: 'dtl 12/6/2020 14:39' prior: 0! + Be the first thing in the system startup list, and do things that should be done prior to any additional image initialization. If the first image argument is a recognized option, evaluate it. Image arguments are typically preceded by a '--' token on the command line. + + DoItFirst image arguments: + --doit argumentlist "evaluate each argument as a doIt expression" + --evaluate arg "evaluate arg, print result then exit" + --file filename "evaluate contents of filename, print result then exit" + --filein filelist "file in each file named in fileList" + --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" + --debug "enter a debugger as soon as possible in the startUp processing" + --help "print this message" + + Some arguments have single character synonyms, -f is a synonym for --file, -d for --doit + A single '-' may be used instead of '--', -help is interpreted as --help + ! Item was added: + ----- Method: DoItFirst class>>current (in category 'class initialization') ----- + current + "Protect against nil in case package was reloaded and existing startUp + methods refer to the current instance." + ^Current ifNil: [ Current := self new ]! Item was added: + ----- Method: DoItFirst class>>initialize (in category 'class initialization') ----- + initialize + Smalltalk addToStartUpList: self before: SmallInteger.! Item was added: + ----- Method: DoItFirst class>>reevaluateCwd (in category 'reevaluate options') ----- + reevaluateCwd + "If a -cwd option was specified on the command line, reevaluate it now. + May be called from FileDirectory class>>startUp: to reevaluate the command line + option to ensure that the default directory is ultimately set as specified by the -cwd + image command line option." + + ^ self current evaluateArg: #cwd.! Item was added: + ----- Method: DoItFirst class>>reevaluateDebug (in category 'reevaluate options') ----- + reevaluateDebug + "The -debug option cannot be evaluated at DoInNow startUp time, but may be called + later in the startUp processing. If -debug was not specified as a command option this + method does nothing. + + May be called from Delay>>startup to invoke a debugger at the earliest possible time." + + ^ self current evaluateArg: #debug.! Item was added: + ----- Method: DoItFirst class>>startUp: (in category 'system startup') ----- + startUp: resuming + resuming ifTrue: [ Current := self new. Current evaluateArgs ] + ! Item was added: + ----- Method: DoItFirst>>actions (in category 'private') ----- + actions + ^actions! Item was added: + ----- Method: DoItFirst>>add:to:at: (in category 'private') ----- + add: valuable to: actionList at: key + "Add valuable to the end of action list, and register it at key so that it may + be reevaluated at a later time if necessary." + actionList addLast: valuable. + actions at: key put: valuable.! Item was added: + ----- Method: DoItFirst>>addFirst:to:at: (in category 'private') ----- + addFirst: valuable to: actionList at: key + "Add valuable to the beginning of action list, and register it at key so that it may + be reevaluated at a later time if necessary." + actionList addFirst: valuable. + actions at: key put: valuable.! Item was added: + ----- Method: DoItFirst>>addWithoutEvaluation:at: (in category 'private') ----- + addWithoutEvaluation: valuable at: key + "Register action at key so that it may be reevaluated at a later time. Do not + evaluate in the startUp of DoItNow. Used when the action cannot yet be + evaluated because it requires startUp processing later in the startup list." + actions at: key put: valuable.! Item was added: + ----- Method: DoItFirst>>cwd: (in category 'actions') ----- + cwd: path + "Evaluate arg and print the result on stdout, or error message on stderr. + Exit immediately without saving the image." + (FileDirectory on: path) exists + ifTrue: [ FileDirectory setDefaultDirectory: path ] + ifFalse: [ FileStream stderr nextPutAll: path, ': directory does not exist'; lf; flush. + Smalltalk quitPrimitive ] + ! Item was added: + ----- Method: DoItFirst>>debug (in category 'actions') ----- + debug + "halt and enter a debugger" + Halt new signal: self class name, ' inserted break in StartUpList processing'.! Item was added: + ----- Method: DoItFirst>>doIt: (in category 'actions') ----- + doIt: arguments + "Evaluate arguments and print the result on stdout, or error message on stderr. + Exit the image after any error." + arguments do: [ :arg | + [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] + on: Error + do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. + Smalltalk quitPrimitive ]]! Item was added: + ----- Method: DoItFirst>>evaluateArg: (in category 'evaluating') ----- + evaluateArg: actionKey + "If actionKey is registered, then evaluate its action. This is intended to allow + a previously evaluated option to be reevaluated at a later point in the system + startup list if necessary." + (actions at: actionKey ifAbsent: []) ifNotNil: [:action | action value]! Item was added: + ----- Method: DoItFirst>>evaluateArgs (in category 'evaluating') ----- + evaluateArgs + | actionQueue | + actionQueue := self parse readStream. + [ actionQueue atEnd ] whileFalse: [ actionQueue next value ]. + ! Item was added: + ----- Method: DoItFirst>>evaluateFileContents: (in category 'actions') ----- + evaluateFileContents: fileName + "Evaluate the contents of a file and print the result on stdout, or error + message on stderr. Exit immediately without saving the image." + + | fs arg | + [ [ fs := FileStream oldFileNamed: fileName. ] + on: FileDoesNotExistException + do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. + Smalltalk quitPrimitive ]. + arg := fs contentsOfEntireFile. + ^ self evaluateOption: arg. + ] ensure: [ fs close ]. + ! Item was added: + ----- Method: DoItFirst>>evaluateOption: (in category 'actions') ----- + evaluateOption: arg + "Evaluate option and print the result on stdout, or error message on stderr. + Exit immediately without saving the image." + [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] + on: Error + do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush ]. + Smalltalk quitPrimitive! Item was added: + ----- Method: DoItFirst>>fileIn: (in category 'actions') ----- + fileIn: fileNames + "File in each named file. On error, print a message to stderr and exit the image." + fileNames do: [ :arg | + [ | fs | + fs := FileStream oldFileNamed: arg. + FileStream stdout nextPutAll: 'file in ', fs name; lf; flush. + fs fileIn ] + on: Error + do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. + Smalltalk quitPrimitive ]]! Item was added: + ----- Method: DoItFirst>>help (in category 'actions') ----- + help + FileStream stdout nextPutAll: self class name, ' image arguments:'; lf. + { '--doit argumentlist "evaluate each argument as a doIt expression"' . + '--evaluate arg "evaluate arg, print result then exit"' . + '--file filename "evaluate contents of filename, print result then exit"' . + '--filein filelist "file in each file named in fileList"' . + '--cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options"' . + '--debug "enter a debugger as soon as possible in the startUp processing"'. + '--help "print this message"' + } do: [ :e | FileStream stdout tab; nextPutAll: e; lf ]. + FileStream stdout + nextPutAll: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'; lf; + nextPutAll: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help'; lf; + flush. + Smalltalk quitPrimitive. + + ! Item was added: + ----- Method: DoItFirst>>initialize (in category 'initialize-release') ----- + initialize + actions := Dictionary new. + ! Item was added: + ----- Method: DoItFirst>>isArg: (in category 'private') ----- + isArg: token + ^ token isEmpty not and: [ token beginsWith: '-' ].! Item was added: + ----- Method: DoItFirst>>keyFor: (in category 'evaluating') ----- + keyFor: argument + "Interpret an argument key from the command line. Be permissive in + allowing '-somearg' to be treated as '--somearg', and where possible let + '-s' be the single character synonym for '--somearg' " + ^ argument caseOf: { + "print help to stdout then exit" + [ '--help' ] -> [ #help ] . + [ '-help' ] -> [ #help ] . + [ '-h' ] -> [ #help ] . + "enter debugger as soon as possible" + [ '--debug' ] -> [ #debug ] . + [ '-debug' ] -> [ #debug ] . + "evaluate each argument string as a doIt" + [ '--doit' ] -> [ #doit ] . + [ '-doit' ] -> [ #doit ] . + [ '-d' ] -> [ #doit ] . + "evaluate expression and exit" + [ '--evaluate' ] -> [ #evaluate ] . + [ '-evaluate' ] -> [ #evaluate ] . + [ '-e' ] -> [ #evaluate ] . + "evaluate contents of file and exit" + [ '--file' ] -> [ #file ] . + [ '-file' ] -> [ #file ] . + [ '-f' ] -> [ #file ] . + "file in one or more files" + [ '--filein' ] -> [ #filein ] . + [ '-filein' ] -> [ #filein ] . + "change FileDirectory default directory" + [ '--cwd' ] -> [ #cwd ] . + [ '-cwd' ] -> [ #cwd ] . + [ '-c' ] -> [ #cwd ] + } otherwise: [ #ignore ]. + ! Item was added: + ----- Method: DoItFirst>>nextTokensFrom: (in category 'evaluating') ----- + nextTokensFrom: argumentStream + "Next available tokens up to the next parseable argument, for commands + that expect an argument list of names or doIt expressions." + + | list | + list := OrderedCollection new. + [ argumentStream atEnd or: [ self isArg: argumentStream peek ]] + whileFalse: [ list add: argumentStream next ]. + ^ list! Item was added: + ----- Method: DoItFirst>>parse (in category 'evaluating') ----- + parse + "Parse the argument list and answer a list of action selectors to be performed" + ^ self parse: Smalltalk arguments. + ! Item was added: + ----- Method: DoItFirst>>parse: (in category 'evaluating') ----- + parse: argumentList + "Iterate over the argument list, adding action blocks to the actions dictionary. + If any action blocks require files or directory initialization send the appropriate + startUp message to do it now. Answer a list of option selectors that should be + evaluated." + + | args actions needsFiles needsDirectory | + needsFiles := needsDirectory := false. + args := argumentList readStream. + actions := OrderedCollection new. + [ args atEnd ] whileFalse: [ | key | + (key := self keyFor: args next) caseOf: { + [ #help ] -> [ self addFirst: [ self help ] to: actions at: key. needsFiles := true] . + [ #debug ] -> [ self addWithoutEvaluation: [ self debug ] at: key] . + [ #doit ] -> [ | list | list := self nextTokensFrom: args. self add:[ self doIt: list ] to: actions at: key. needsFiles := true] . + [ #evaluate ] -> [ | arg | arg := args next. self add:[ self evaluateOption: arg ] to: actions at: key. needsFiles := true] . + [ #file ] -> [ | arg | arg := args next. self add:[ self evaluateFileContents: arg ] to: actions at: key. needsFiles := true] . + [ #filein ] -> [ | list | list := self nextTokensFrom: args. self add:[ self fileIn: list ] to: actions at: key. needsFiles := needsDirectory := true] . + [ #cwd ] -> [ | arg | arg := args next. self addFirst:[ self cwd: arg ] to: actions at: key. needsFiles := needsDirectory := true] . + } otherwise: [] ]. + needsFiles ifTrue: [ FileStream startUp: true. "initialize stdout and stderr" ]. + needsDirectory ifTrue: [ FileDirectory startUp "set default directory" ]. + ^ actions. + ! From commits at source.squeak.org Tue Dec 8 21:12:10 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 8 Dec 2020 21:12:10 0000 Subject: [squeak-dev] The Trunk: Tests-dtl.443.mcz Message-ID: David T. Lewis uploaded a new version of Tests to project The Trunk: http://source.squeak.org/trunk/Tests-dtl.443.mcz ==================== Summary ==================== Name: Tests-dtl.443 Author: dtl Time: 8 December 2020, 4:12:09.524558 pm UUID: 7c308020-16a4-4b76-83c9-5bc4ba13fd98 Ancestors: Tests-mt.442 Add DoItFirstTest to verify command line parsing for DoitFirst and confirm mapping of command line tokens to known options. =============== Diff against Tests-mt.442 =============== Item was added: + TestCase subclass: #DoItFirstTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'Tests-System-Support'! + + !DoItFirstTest commentStamp: 'dtl 12/6/2020 20:02' prior: 0! + A DoItFirstTest verifies command line parsing for DoitFirst to confirm mapping of command line tokens to known options. + ! Item was added: + ----- Method: DoItFirstTest>>testEvaluateFileContents (in category 'tests') ----- + testEvaluateFileContents + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--file' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-file' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-f' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--file' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-file' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-f' . 'arg1' . 'arg2' . 'arg3' } + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #file). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 'arg1' equals: blockArg. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testEvaluateOption (in category 'tests') ----- + testEvaluateOption + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--evaluate' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-evaluate' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-e' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--evaluate' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-evaluate' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-e' . 'arg1' . 'arg2' . 'arg3' } + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #evaluate). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 'arg1' equals: blockArg. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseCwd (in category 'tests') ----- + testParseCwd + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--cwd' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-cwd' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-c' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--cwd' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-cwd' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-c' . 'arg1' . 'arg2' . 'arg3' } + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #cwd). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 'arg1' equals: blockArg. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseDebug (in category 'tests') ----- + testParseDebug + "Debug is a deferred action, registered in the actions but not added + to the list of actions to be immediately evaluated" + | doItFirst actionBlocks deferredAction | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--debug' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-debug' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--debug' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-debug' . 'arg1' . 'arg2' . 'arg3' } . + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 0 equals: actionBlocks size. "deferred action" + deferredAction := doItFirst actions at: #debug. + self assert: 0 equals: deferredAction numArgs. + self assert: 0 equals: deferredAction numTemps + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseDoit (in category 'tests') ----- + testParseDoit + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' } + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #doit). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseDoitArgsListWithFileArg (in category 'tests') ----- + testParseDoitArgsListWithFileArg + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 2 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #doit). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + + ! Item was added: + ----- Method: DoItFirstTest>>testParseDoitArgsListWithHelpArg (in category 'tests') ----- + testParseDoitArgsListWithHelpArg + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { 'foo' . 'bar' . '--doit' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { 'foo' . 'bar' . '-doit' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { 'foo' . 'bar' . '-d' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 2 equals: actionBlocks size. + action := actionBlocks second. + self assert: action equals: (doItFirst actions at: #doit). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseFIleinArgsListWithHelpArg (in category 'tests') ----- + testParseFIleinArgsListWithHelpArg + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + { 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' . '-help' . 'arg4'} . + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 2 equals: actionBlocks size. + action := actionBlocks second. + self assert: action equals: (doItFirst actions at: #filein). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseFilein (in category 'tests') ----- + testParseFilein + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' } . + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #filein). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + ! Item was added: + ----- Method: DoItFirstTest>>testParseFileinArgsListWithFileArg (in category 'tests') ----- + testParseFileinArgsListWithFileArg + | doItFirst actionBlocks action blockArg | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { '--' . 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { 'foo' . 'bar' . '--filein' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + { 'foo' . 'bar' . '-filein' . 'arg1' . 'arg2' . 'arg3' . '-f' . 'arg4'} . + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 2 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #filein). + self assert: 0 equals: action numArgs. + self assert: 1 equals: action numTemps. + blockArg := (action at: 1) first. + self assert: 3 equals: blockArg size. + self assert: 'arg1' equals: blockArg first. + self assert: 'arg2' equals: blockArg second. + self assert: 'arg3' equals: blockArg third. + ]. + + ! Item was added: + ----- Method: DoItFirstTest>>testParseHelp (in category 'tests') ----- + testParseHelp + | doItFirst actionBlocks action | + doItFirst := DoItFirst new. + { + { '--' . 'foo' . 'bar' . '--help' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-help' . 'arg1' . 'arg2' . 'arg3' } . + { '--' . 'foo' . 'bar' . '-h' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '--help' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-help' . 'arg1' . 'arg2' . 'arg3' } . + { 'foo' . 'bar' . '-h' . 'arg1' . 'arg2' . 'arg3' } + } do: [ :args | + actionBlocks := doItFirst parse: args. + self assert: 1 equals: actionBlocks size. + action := actionBlocks first. + self assert: action equals: (doItFirst actions at: #help). + self assert: 0 equals: action numArgs. + self assert: 0 equals: action numTemps + ]. + ! From commits at source.squeak.org Tue Dec 8 21:13:06 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 8 Dec 2020 21:13:06 0000 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz Message-ID: David T. Lewis uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-dtl.1363.mcz ==================== Summary ==================== Name: Kernel-dtl.1363 Author: dtl Time: 8 December 2020, 4:13:03.533263 pm UUID: dc65867e-37e6-4295-aa44-ef26c62ba250 Ancestors: Kernel-eem.1362 Let Delay class>>startup invoke DoItFirst class>>reevaluateDebug. If a DoItFirst command line option has requested a debugger, then invoke it now after Delay startUp processing.. =============== Diff against Kernel-eem.1362 =============== Item was changed: ----- Method: Delay class>>startUp (in category 'snapshotting') ----- startUp "Restart active delay, if any, when resuming a snapshot." DelaySuspended ifFalse:[^self error: 'Trying to activate Delay twice']. DelaySuspended := false. self restoreResumptionTimes. AccessProtect signal. + (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateDebug]. + + ! From commits at source.squeak.org Tue Dec 8 21:13:55 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 8 Dec 2020 21:13:55 0000 Subject: [squeak-dev] The Trunk: Files-dtl.185.mcz Message-ID: David T. Lewis uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-dtl.185.mcz ==================== Summary ==================== Name: Files-dtl.185 Author: dtl Time: 8 December 2020, 4:13:54.809395 pm UUID: 722a668c-0449-4292-8076-fe77438b3ddd Ancestors: Files-eem.184 Let DoItFirstTest>>startup invoke DoItFirst>>reevaluateCwd. If a DoItFirst command line option has specified a new FileDirectory default, apply it now. =============== Diff against Files-eem.184 =============== Item was changed: ----- Method: FileDirectory class>>startUp (in category 'name utilities') ----- startUp "Establish the platform-specific FileDirectory subclass. Do any platform-specific startup." self setDefaultDirectoryClass. self setDefaultDirectory: (self dirPathFor: Smalltalk imageName). Preferences startInUntrustedDirectory ifTrue:[ "The SecurityManager may override the default directory to prevent unwanted write access etc." self setDefaultDirectory: SecurityManager default untrustedUserDirectory. "Make sure we have a place to go to" DefaultDirectory assureExistence]. Smalltalk openSourceFiles. + (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateCwd ]. ! From lewis at mail.msen.com Tue Dec 8 21:20:14 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 8 Dec 2020 16:20:14 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> Message-ID: <20201208212014.GA57531@shell.msen.com> On Sat, Dec 05, 2020 at 09:33:26AM +0100, Fabio Niephaus wrote: > This is great! +1 for adding this to trunk, leaving the when to Dave. > Done. To see available command line options on a unix-like system: $ squeak squeak.image -- -h DoItFirst image arguments: --doit argumentlist "evaluate each argument as a doIt expression" --evaluate arg "evaluate arg, print result then exit" --file filename "evaluate contents of filename, print result then exit" --filein filelist "file in each file named in fileList" --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" --debug "enter a debugger as soon as possible in the startUp processing" --help "print this message" some arguments have single character synonyms, -f is a synonym for --file, -d for --doit single '-' may be used instead of '--', -help is interpreted as --help Dave From eliot.miranda at gmail.com Wed Dec 9 05:39:01 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 8 Dec 2020 21:39:01 -0800 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: Message-ID: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> Hi David, > On Dec 8, 2020, at 1:13 PM, commits at source.squeak.org wrote: > > David T. Lewis uploaded a new version of Kernel to project The Trunk: > http://source.squeak.org/trunk/Kernel-dtl.1363.mcz > > ==================== Summary ==================== > > Name: Kernel-dtl.1363 > Author: dtl > Time: 8 December 2020, 4:13:03.533263 pm > UUID: dc65867e-37e6-4295-aa44-ef26c62ba250 > Ancestors: Kernel-eem.1362 > > Let Delay class>>startup invoke DoItFirst class>>reevaluateDebug. If a DoItFirst command line option has requested a debugger, then invoke it now after Delay startUp processing.. > > =============== Diff against Kernel-eem.1362 =============== > > Item was changed: > ----- Method: Delay class>>startUp (in category 'snapshotting') ----- > startUp > "Restart active delay, if any, when resuming a snapshot." > > DelaySuspended ifFalse:[^self error: 'Trying to activate Delay twice']. > DelaySuspended := false. > self restoreResumptionTimes. > AccessProtect signal. > + (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateDebug]. > + > + > ! I don’t understand why this is necessary/what this code does. A comment in the startUp method would go a long way. Also do we really need two lines of white space tacked onto the end of the method? From commits at source.squeak.org Wed Dec 9 10:08:38 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 9 Dec 2020 10:08:38 0000 Subject: [squeak-dev] The Trunk: System-mt.1196.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1196.mcz ==================== Summary ==================== Name: System-mt.1196 Author: mt Time: 9 December 2020, 11:08:33.726163 am UUID: 93f95297-e0dd-43a5-84a8-16fa9ea4c6e2 Ancestors: System-dtl.1195 Removes duplication for author initials "md". =============== Diff against System-dtl.1195 =============== Item was changed: ----- Method: SystemNavigation class>>privateAuthorsRaw (in category 'class initialization') ----- (excessive size, no diff calculated) Item was changed: + (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors....'! - (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors...'! From marcel.taeumel at hpi.de Wed Dec 9 10:21:15 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 9 Dec 2020 11:21:15 +0100 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> Message-ID: Hi David. Thanks for working on this! :-) That special case in "Delay" reminds me of the suggestion to just put "DoItFirst" at a more sensible place in the start-up list. But then it would not be "do it first" anymore. :-D Same for FileDirectory. What about a little bit more "double dispatch"? (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromDelay ]. (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromFileDirectory ]. Best, Marcel Am 09.12.2020 06:39:15 schrieb Eliot Miranda : Hi David, > On Dec 8, 2020, at 1:13 PM, commits at source.squeak.org wrote: > > David T. Lewis uploaded a new version of Kernel to project The Trunk: > http://source.squeak.org/trunk/Kernel-dtl.1363.mcz > > ==================== Summary ==================== > > Name: Kernel-dtl.1363 > Author: dtl > Time: 8 December 2020, 4:13:03.533263 pm > UUID: dc65867e-37e6-4295-aa44-ef26c62ba250 > Ancestors: Kernel-eem.1362 > > Let Delay class>>startup invoke DoItFirst class>>reevaluateDebug. If a DoItFirst command line option has requested a debugger, then invoke it now after Delay startUp processing.. > > =============== Diff against Kernel-eem.1362 =============== > > Item was changed: > ----- Method: Delay class>>startUp (in category 'snapshotting') ----- > startUp > "Restart active delay, if any, when resuming a snapshot." > > DelaySuspended ifFalse:[^self error: 'Trying to activate Delay twice']. > DelaySuspended := false. > self restoreResumptionTimes. > AccessProtect signal. > + (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateDebug]. > + > + > ! I don’t understand why this is necessary/what this code does. A comment in the startUp method would go a long way. Also do we really need two lines of white space tacked onto the end of the method? -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Wed Dec 9 10:23:37 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 9 Dec 2020 11:23:37 +0100 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <20201208212014.GA57531@shell.msen.com> References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> Message-ID: Hi Dave. Thanks! Would you mind adding a page on wiki.squeak.org? :-) Best, Marcel Am 08.12.2020 22:20:25 schrieb David T. Lewis : On Sat, Dec 05, 2020 at 09:33:26AM +0100, Fabio Niephaus wrote: > This is great! +1 for adding this to trunk, leaving the when to Dave. > Done. To see available command line options on a unix-like system: $ squeak squeak.image -- -h DoItFirst image arguments: --doit argumentlist "evaluate each argument as a doIt expression" --evaluate arg "evaluate arg, print result then exit" --file filename "evaluate contents of filename, print result then exit" --filein filelist "file in each file named in fileList" --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" --debug "enter a debugger as soon as possible in the startUp processing" --help "print this message" some arguments have single character synonyms, -f is a synonym for --file, -d for --doit single '-' may be used instead of '--', -help is interpreted as --help Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Wed Dec 9 10:30:43 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 9 Dec 2020 11:30:43 +0100 Subject: [squeak-dev] The Inbox: Collections-ct.922.mcz In-Reply-To: <2d10cac3607f417aa91c065be3669304@student.hpi.uni-potsdam.de> References: <1546F06A-06F9-417C-8B80-207ED8C344C5@rowledge.org> <,> <69591d44085842ada63aeacac94b5479@student.hpi.uni-potsdam.de> <,> <2d10cac3607f417aa91c065be3669304@student.hpi.uni-potsdam.de> Message-ID: > Might be less efficient (I haven't measured it) but provides better readability. :-) Mine is actually faster than yours. ;o)  > Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window is open. You want to optimize for the functional style around "DialogWindow >> getUserResponse"? I wouldn't do that. Most of Morphic is state-based. Maybe we find a better way for showing dialogs as well. It is tricky to support [CMD]+[Dot] along with nested UI loops. Best, Marcel Am 08.12.2020 14:19:34 schrieb Thiede, Christoph : Hi Marcel, > Preferences does not expose the dictionary. It is rather an implementation detail. Yes, but #setPreference:toValue:during: *could* reuse #at:put:during: instead of reinventing this - though small - wheel. :-) > there are implementations of #at:put: where a "nil" value deletes the key. Isn't this a completely domain-specific design decision? I think we should look at this at a different level of abstraction. > I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection. But the semantics of an execution-around method do not need to be timeless as mentioned earlier. Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window is open. In this example, forbidding the manipulation of extensions during aBlock would rule out the use of #at:put:during: ... [http://www.hpi.de/] > What about this implementation? Seems to so "low level": Might be less efficient (I haven't measured it) but provides better readability. :-) Best, Christoph Von: Squeak-dev im Auftrag von Taeumel, Marcel Gesendet: Dienstag, 8. Dezember 2020 13:34:33 An: squeak-dev Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz   Hmm... Preferences does not expose the dictionary. It is rather an implementation detail. See: Preferences class >> #setPreference:toValue: Preferences class >> #setPreference:toValue:during: Hmm... there are implementations of #at:put: where a "nil" value deletes the key. See: Morph >> #setProperty:toValue: Hmm... I am not sure about the returned value. Shouldn't it be the object? Should it the block's last result? Depends on the purpose, I suppose. Hmm... I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection. What about this implementation? Seems to so "low level": | hasKey oldValue | self at: key ifPresent: [:v | oldValue := v. hasKey := true]. self at: key put: anObject. ^ aBlock ensure: [ hasKey == true ifTrue: [self at: key put: oldValue] ifFalse: [self removeKey: key]] Best, Marcel Am 07.12.2020 19:14:30 schrieb Thiede, Christoph : I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary, just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended sandbox effects. :-) [http://www.hpi.de/] Best, Christoph Von: Squeak-dev im Auftrag von tim Rowledge Gesendet: Montag, 7. Dezember 2020 19:10:11 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Collections-ct.922.mcz   > On 2020-12-07, at 10:05 AM, Thiede, Christoph wrote: > > IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method? Absolutely. Depends on what your deeper purpose is. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim [http://www.rowledge.org/tim] Strange OpCodes: LAG: Load and Garble -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Wed Dec 9 14:06:55 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Wed, 9 Dec 2020 15:06:55 +0100 Subject: [squeak-dev] Error in inspector for WideCharacterSet Message-ID: Hi all, Just looked through some of the tests and found an issue with WideCharacterSets: Inspect the following: `CharacterSet newFrom: (String with: 811 asCharacter with: $c)` Would be great if someone could have a look. Thanks, Fabio [image: image.png] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 121382 bytes Desc: not available URL: From commits at source.squeak.org Wed Dec 9 15:22:45 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 9 Dec 2020 15:22:45 0000 Subject: [squeak-dev] The Trunk: Tools-mt.1018.mcz Message-ID: Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1018.mcz ==================== Summary ==================== Name: Tools-mt.1018 Author: mt Time: 9 December 2020, 4:22:42.675366 pm UUID: 97109dc8-cea7-45fd-ace9-833fcbec96a4 Ancestors: Tools-eem.1017 Adds a simple (but working) inspector for CharacterSet. =============== Diff against Tools-eem.1017 =============== Item was added: + ----- Method: CharacterSet>>inspectorClass (in category '*Tools-Inspector') ----- + inspectorClass + + ^ CharacterSetInspector! Item was added: + CollectionInspector subclass: #CharacterSetInspector + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'Tools-Inspector'! Item was added: + ----- Method: CharacterSetInspector>>canAddOrRemoveElements (in category 'private') ----- + canAddOrRemoveElements + + ^ false! Item was added: + ----- Method: CharacterSetInspector>>elementGetterAt: (in category 'private') ----- + elementGetterAt: element + + ^ [:set | element]! Item was added: + ----- Method: CharacterSetInspector>>elementIndices (in category 'private') ----- + elementIndices + + ^ self object canBeEnumerated + ifTrue: [self object asArray] + ifFalse: [#()]! Item was added: + ----- Method: CharacterSetInspector>>elementSetterAt: (in category 'private') ----- + elementSetterAt: index + + ^ [:set :element | self error: 'Character sets cannot be changed.']! From marcel.taeumel at hpi.de Wed Dec 9 15:23:15 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 9 Dec 2020 16:23:15 +0100 Subject: [squeak-dev] Error in inspector for WideCharacterSet In-Reply-To: References: Message-ID: Hi Fabio. Fixed in Tools-mt.1018 (Trunk). Best, Marcel Am 09.12.2020 15:07:30 schrieb Fabio Niephaus : Hi all, Just looked through some of the tests and found an issue with WideCharacterSets: Inspect the following: `CharacterSet newFrom: (String with: 811 asCharacter with: $c)` Would be great if someone could have a look. Thanks, Fabio [image.png] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 121382 bytes Desc: not available URL: From marcel.taeumel at hpi.de Wed Dec 9 15:33:01 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 9 Dec 2020 16:33:01 +0100 Subject: [squeak-dev] The Trunk: Tools-mt.1018.mcz In-Reply-To: References: Message-ID: Hmm... we could show the character code in either the field list or the value pane .. what do you prefer? Am 09.12.2020 16:22:54 schrieb commits at source.squeak.org : Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1018.mcz ==================== Summary ==================== Name: Tools-mt.1018 Author: mt Time: 9 December 2020, 4:22:42.675366 pm UUID: 97109dc8-cea7-45fd-ace9-833fcbec96a4 Ancestors: Tools-eem.1017 Adds a simple (but working) inspector for CharacterSet. =============== Diff against Tools-eem.1017 =============== Item was added: + ----- Method: CharacterSet>>inspectorClass (in category '*Tools-Inspector') ----- + inspectorClass + + ^ CharacterSetInspector! Item was added: + CollectionInspector subclass: #CharacterSetInspector + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'Tools-Inspector'! Item was added: + ----- Method: CharacterSetInspector>>canAddOrRemoveElements (in category 'private') ----- + canAddOrRemoveElements + + ^ false! Item was added: + ----- Method: CharacterSetInspector>>elementGetterAt: (in category 'private') ----- + elementGetterAt: element + + ^ [:set | element]! Item was added: + ----- Method: CharacterSetInspector>>elementIndices (in category 'private') ----- + elementIndices + + ^ self object canBeEnumerated + ifTrue: [self object asArray] + ifFalse: [#()]! Item was added: + ----- Method: CharacterSetInspector>>elementSetterAt: (in category 'private') ----- + elementSetterAt: index + + ^ [:set :element | self error: 'Character sets cannot be changed.']! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 54904 bytes Desc: not available URL: From lists at fniephaus.com Wed Dec 9 15:47:28 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Wed, 9 Dec 2020 16:47:28 +0100 Subject: [squeak-dev] Error in inspector for WideCharacterSet In-Reply-To: References: Message-ID: Excellent, thanks Marcel! On Wed, Dec 9, 2020 at 4:23 PM Marcel Taeumel wrote: > Hi Fabio. > > Fixed in Tools-mt.1018 (Trunk). > > Best, > Marcel > > Am 09.12.2020 15:07:30 schrieb Fabio Niephaus : > Hi all, > > Just looked through some of the tests and found an issue with > WideCharacterSets: > > Inspect the following: `CharacterSet newFrom: (String with: 811 > asCharacter with: $c)` > > Would be great if someone could have a look. > > Thanks, > Fabio > > [image: image.png] > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 121382 bytes Desc: not available URL: From lewis at mail.msen.com Wed Dec 9 16:41:41 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 9 Dec 2020 11:41:41 -0500 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> Message-ID: <20201209164141.GA49626@shell.msen.com> On Tue, Dec 08, 2020 at 09:39:01PM -0800, Eliot Miranda wrote: > Hi David, > > > On Dec 8, 2020, at 1:13 PM, commits at source.squeak.org wrote: > > > > ???David T. Lewis uploaded a new version of Kernel to project The Trunk: > > http://source.squeak.org/trunk/Kernel-dtl.1363.mcz > > > > ==================== Summary ==================== > > > > Name: Kernel-dtl.1363 > > Author: dtl > > Time: 8 December 2020, 4:13:03.533263 pm > > UUID: dc65867e-37e6-4295-aa44-ef26c62ba250 > > Ancestors: Kernel-eem.1362 > > > > Let Delay class>>startup invoke DoItFirst class>>reevaluateDebug. If a DoItFirst command line option has requested a debugger, then invoke it now after Delay startUp processing.. > > > > =============== Diff against Kernel-eem.1362 =============== > > > > Item was changed: > > ----- Method: Delay class>>startUp (in category 'snapshotting') ----- > > startUp > > "Restart active delay, if any, when resuming a snapshot." > > > > DelaySuspended ifFalse:[^self error: 'Trying to activate Delay twice']. > > DelaySuspended := false. > > self restoreResumptionTimes. > > AccessProtect signal. > > + (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateDebug]. > > + > > + > > ! > > I don???t understand why this is necessary/what this code does. > A comment in the startUp method would go a long way. > Would this be better? Asking first here because I don't want to clutter up the ancestry with small commits. Kernel>>startUp "Restart active delay, if any, when resuming a snapshot." DelaySuspended ifFalse:[^self error: 'Trying to activate Delay twice']. DelaySuspended := false. self restoreResumptionTimes. AccessProtect signal. "If --debug was specified as a DoItFirst command line option, invoke it now. Use perform to avoid hard dependency on DoItFirst." (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateDebug]. > > Also do we really need two lines of white space tacked onto the end of the method? > No, sorry about that. Dave From craig at blackpagedigital.com Wed Dec 9 19:39:41 2020 From: craig at blackpagedigital.com (Craig Latta) Date: Wed, 9 Dec 2020 11:39:41 -0800 Subject: [squeak-dev] The Trunk: Tools-mt.1018.mcz In-Reply-To: References: Message-ID: > Hmm... we could show the character code in either the field list or > the value pane .. what do you prefer? The value pane... but if the character has a meaningful visual rendering, I'd appreciate it seeing it in parentheses after its index in the field list. -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE From lewis at mail.msen.com Wed Dec 9 19:59:33 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 9 Dec 2020 14:59:33 -0500 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> Message-ID: <20201209195933.GA77665@shell.msen.com> Hi Marcel, On Wed, Dec 09, 2020 at 11:21:15AM +0100, Marcel Taeumel wrote: > Hi David. > > Thanks for working on this! :-) > > That special case in "Delay" reminds me of the suggestion to just put "DoItFirst" at a more sensible place in the start-up list. But then it would not be "do it first" anymore. :-D Same for FileDirectory. > Pretty much everything I tried needed a bit of hackery someplace, and in the end it seemed simplest to do everything from the first position in the startup list, with whatever minimal hacks were needed to make this work. I found that the only command option that could not be processed from the first entry in the startup list was --debug. It works when run after the Delay startup, but not before. So I arranged for the command "action" to be registered in the DoItFirst startup, but not actually invoked until the end of the Delay startup. The FileDirectory hack is not strictly required, but without it the --cwd setting gets reset to the normal default later in the startup processing. Thus it would be active for e.g. any --doit options, but would be reset by the time the image finishes startup processing. Arguably that behavior might be considered more correct, but it would be confusing to someone who specified a --cwd option and expected it to take effect for the image overall. The "solution" was to add a second invocation of the --cwd option at the end of the FileDirectory startup. > What about a little bit more "double dispatch"? > > (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromDelay ]. > > (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromFileDirectory ]. > The tricky part is still there - how do you arrange for the option blocks to be evaluated at the earliest possible time, but no sooner? Dave From lewis at mail.msen.com Wed Dec 9 22:05:30 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 9 Dec 2020 17:05:30 -0500 Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> Message-ID: <20201209220530.GA99095@shell.msen.com> On Wed, Dec 09, 2020 at 11:23:37AM +0100, Marcel Taeumel wrote: > Hi Dave. > > Thanks! Would you mind adding a page on wiki.squeak.org? :-) Good idea, I will do this some time soon. Dave > > Best, > Marcel > Am 08.12.2020 22:20:25 schrieb David T. Lewis : > On Sat, Dec 05, 2020 at 09:33:26AM +0100, Fabio Niephaus wrote: > > This is great! +1 for adding this to trunk, leaving the when to Dave. > > > > Done. > > To see available command line options on a unix-like system: > > $ squeak squeak.image -- -h > DoItFirst image arguments: > --doit argumentlist "evaluate each argument as a doIt expression" > --evaluate arg "evaluate arg, print result then exit" > --file filename "evaluate contents of filename, print result then exit" > --filein filelist "file in each file named in fileList" > --cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options" > --debug "enter a debugger as soon as possible in the startUp processing" > --help "print this message" > some arguments have single character synonyms, -f is a synonym for --file, -d for --doit > single '-' may be used instead of '--', -help is interpreted as --help > > Dave > > From marcel.taeumel at hpi.de Thu Dec 10 07:02:05 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 10 Dec 2020 08:02:05 +0100 Subject: [squeak-dev] The Trunk: Tools-mt.1018.mcz In-Reply-To: References: Message-ID: > [...] after its index in the field list. Would it make sense to show that (fabricated) index at all? It is a set ... Or do you mean the character code, which you wanted to see in the value pane.. Hmm... Here are the representations we have for elements in a character set: - an index (fabricated via #do:) - Character >> #printOn: - Character >> #printAsLiteralOn: (used in #printOn: for meaningful visual rendering) - Character >> #asInteger (aka. character code) So? :-D Best, Marcel Am 09.12.2020 20:39:57 schrieb Craig Latta : > Hmm... we could show the character code in either the field list or > the value pane .. what do you prefer? The value pane... but if the character has a meaningful visual rendering, I'd appreciate it seeing it in parentheses after its index in the field list. -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Thu Dec 10 07:07:48 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 10 Dec 2020 08:07:48 +0100 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: <20201209195933.GA77665@shell.msen.com> References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> Message-ID: Hi Dave. > The tricky part is still there - how do you arrange for the option > blocks to be evaluated at the earliest possible time, but no sooner? Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: DoItFirst class >> startUpFromDelay    self reevaluateDebug. DoItFirst class >> startUpFromFileDirectory    self reevaluateCwd. Best, Marcel Am 09.12.2020 20:59:42 schrieb David T. Lewis : Hi Marcel, On Wed, Dec 09, 2020 at 11:21:15AM +0100, Marcel Taeumel wrote: > Hi David. > > Thanks for working on this! :-) > > That special case in "Delay" reminds me of the suggestion to just put "DoItFirst" at a more sensible place in the start-up list. But then it would not be "do it first" anymore. :-D Same for FileDirectory. > Pretty much everything I tried needed a bit of hackery someplace, and in the end it seemed simplest to do everything from the first position in the startup list, with whatever minimal hacks were needed to make this work. I found that the only command option that could not be processed from the first entry in the startup list was --debug. It works when run after the Delay startup, but not before. So I arranged for the command "action" to be registered in the DoItFirst startup, but not actually invoked until the end of the Delay startup. The FileDirectory hack is not strictly required, but without it the --cwd setting gets reset to the normal default later in the startup processing. Thus it would be active for e.g. any --doit options, but would be reset by the time the image finishes startup processing. Arguably that behavior might be considered more correct, but it would be confusing to someone who specified a --cwd option and expected it to take effect for the image overall. The "solution" was to add a second invocation of the --cwd option at the end of the FileDirectory startup. > What about a little bit more "double dispatch"? > > (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromDelay ]. > > (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromFileDirectory ]. > The tricky part is still there - how do you arrange for the option blocks to be evaluated at the earliest possible time, but no sooner? Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Thu Dec 10 12:11:11 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Thu, 10 Dec 2020 13:11:11 +0100 (CET) Subject: [squeak-dev] [ANN] DoItFirst command line goodie on SqueakSource In-Reply-To: <1826164202.17772926.1607337510044.JavaMail.zimbra@telenet.be> References: <2082661127.42527248.1606664590924.JavaMail.zimbra@telenet.be> <628062678.474108.1606893125003.JavaMail.zimbra@telenet.be> <1078727820.15594260.1607265985757.JavaMail.zimbra@telenet.be> <1826164202.17772926.1607337510044.JavaMail.zimbra@telenet.be> Message-ID: <827807683.29081913.1607602271144.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 tim Rowledge wrote: > I hope those are all useful things to learn; Yes they are ... thanks for posting the Fibonacci category and script. > the stdout thing may be an issue, at least for the 5.3 release image. My personal impression is that the best way to run the Fibonacci program, is through the "DoItFirst" package. For example I tested both with a 5.3 and a 6.0alpha image: # pfexec squeak squeak.image InstallDoItFirst.st # pfexec squeak squeak.image -- -e 'Smalltalk version' Squeak5.3 # pfexec squeak squeak.image -- --filein Fibonacci.st --evaluate '100 fibonacci' file in /export/home/stes/5.3/Fibonacci.st 354224848179261915075 but the same result in 6.0alpha: # pfexec squeak squeak.image -- --filein Fibonacci.st -e '100 fibonacci' file in /export/home/stes/Fibonacci.st 354224848179261915075 # pfexec squeak squeak.image -- -e 'Smalltalk version' Squeak6.0alpha This is with a recent Stack VM , version 5.0.2885 (from VMMaker-oscog-eem.2885) Note that I use a "pfexec" (profile exec) to raise the privilege of the VM, to be able to set priorities (proc_prioctrl privilege) just to suppress the warning about pthread_setsched. In any case as far as I can see the "DoItFirst" package is a convenient way, to file in small pieces of code like the fibonacci method that you posted, and then evaluate some code in a batch oriented command-line way. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf0g/zAAoJEAwpOKXMq1MalvIIAIYz3bgTn5DX+tbUtFze/DyG xSIHEVlVqvWf0idecCBmog9kufZzyiLE+G7+Ia7WK8bPVkyLMgqD6r1YRe46WeZT O8a6w8sttMkqiCpbgBR9fUDhpc81ZGbm898e2PENNq/kAJNRBbFkdicA/S3yd6+R mC75JasFRh+a4pEJsr9e8hc8sZoaCEyBSsE9DYptcxCd5ZHR7OYyO57clkfgVhY1 fnVclQNp5U4026+arthjeIShR0U7AlF5sJUZmlRlT7pUNaY9isVtLQ/jOz30ZL2e /56soGHphRpTm97G8tV4mOgLAAp7V5rf2nn42fSFtzazHkwlmebsXbh5EdySreo= =dc5v -----END PGP SIGNATURE----- From craig at blackpagedigital.com Thu Dec 10 22:55:09 2020 From: craig at blackpagedigital.com (Craig Latta) Date: Thu, 10 Dec 2020 14:55:09 -0800 Subject: [squeak-dev] The Trunk: Tools-mt.1018.mcz In-Reply-To: References: Message-ID: > Would it make sense to show that (fabricated) index at all? It is a > set... Right, I guess I'm just used to that. I suppose it could mislead a newcomer into thinking the collection under inspection is indexable. It's useful, though, when you're scrolling around the field list of a collection, to temporarily remember the fabricated indices of some elements of interest. For a set with the first element being the character with value 65, I guess I'd like to see "1: $A" in the field list and "Character value: 65" in the value pane. I want the contents of the value pane to be something I can evaluate (and, especially, "debug it"), and which presents on sight a meaningful class to browse. thanks for asking! -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE From commits at source.squeak.org Fri Dec 11 09:30:46 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 11 Dec 2020 09:30:46 0000 Subject: [squeak-dev] The Trunk: Tools-mt.1019.mcz Message-ID: Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1019.mcz ==================== Summary ==================== Name: Tools-mt.1019 Author: mt Time: 11 December 2020, 10:30:43.719926 am UUID: bdc455f1-6d58-4dc1-8c2f-5f6b3a9765d4 Ancestors: Tools-mt.1018 Makes inspector for character sets more useful. See: http://forum.world.st/The-Trunk-Tools-mt-1018-mcz-td5125215.html Adds two extensions to the inspector framework: - truncated field streaming now provides object and index if needed (via #cull:) - representation of indices in collections can be overwritten via #elementNameAt: (like #elementGetterAt: and #elementSetterAt:) Note that the character-set inspector is the first collection inspector that uses its contents as keys/indices. Even the set inspector was simplier, because its internal array could be exposed. Also note that the elements of CharacterSetComplement and LazyCharacterSet cannot be shown as they are not enumerable. =============== Diff against Tools-mt.1018 =============== Item was added: + ----- Method: CharacterSetInspector>>characterNameFor: (in category 'private') ----- + characterNameFor: character + "Extracted from Character >> #printOn:." + + ^ String streamContents: [:stream | | integerValue | + ((integerValue := character asInteger) > 32 and: [integerValue ~= 127]) + ifTrue: [ + character printAsLiteralOn: stream. + stream space]. + stream nextPut: $(; print: integerValue; nextPut: $)].! Item was added: + ----- Method: CharacterSetInspector>>characterValueFor: (in category 'private') ----- + characterValueFor: character + "Extracted from Character >> #printOn: (and #storeOn:)." + + ^ String streamContents: [:stream | + (character class constantNameFor: character) + ifNotNil: [:name | stream nextPutAll: character class name; space; nextPutAll: name] + ifNil: [stream nextPutAll: character class name; nextPutAll: ' value: '; print: character asInteger]].! Item was added: + ----- Method: CharacterSetInspector>>elementAt: (in category 'menu - private') ----- + elementAt: indexOrKey + "All field keys are characters." + + ^ indexOrKey! Item was changed: ----- Method: CharacterSetInspector>>elementGetterAt: (in category 'private') ----- + elementGetterAt: character - elementGetterAt: element + self shouldNotImplement.! - ^ [:set | element]! Item was changed: ----- Method: CharacterSetInspector>>elementIndices (in category 'private') ----- elementIndices + self shouldNotImplement.! - ^ self object canBeEnumerated - ifTrue: [self object asArray] - ifFalse: [#()]! Item was added: + ----- Method: CharacterSetInspector>>elementNameAt: (in category 'private') ----- + elementNameAt: index + + self shouldNotImplement.! Item was changed: ----- Method: CharacterSetInspector>>elementSetterAt: (in category 'private') ----- elementSetterAt: index + self shouldNotImplement.! - ^ [:set :element | self error: 'Character sets cannot be changed.']! Item was added: + ----- Method: CharacterSetInspector>>streamElementsOn: (in category 'fields - streaming') ----- + streamElementsOn: aStream + "Overwritten to realize array representation of character sets if they can be enumerated. Assume that enumeration is deterministic." + + self object canBeEnumerated ifFalse: [^ self]. + + self + streamOn: aStream + truncate: self object asArray "Requires character set to be enumerable." + collectFields: [:character :index | + (self newFieldForType: #element key: index) + name: ('{1}: {2}' format: {index. self characterNameFor: character}); + valueGetter: [:characterSet | self characterValueFor: character]; printValueAsIs; + yourself]! Item was added: + ----- Method: CollectionInspector>>elementNameAt: (in category 'private') ----- + elementNameAt: index + + ^ index printString! Item was changed: ----- Method: CollectionInspector>>streamElementsOn: (in category 'fields - streaming') ----- streamElementsOn: aStream "Create a field for each element in the collection. Use the index' #printString (and not #asString) to reveal the nature of the key, which are usually integers (1, 2, 3, ...), but can be symbols (#apple, #tree, ...) or other objects (aMorph, aSocket, ...) in dictionary-like collections. Maybe #storeString would be even better but can be very expensive to compute." self streamOn: aStream truncate: self elementIndices collectFields: [:index | (self newFieldForType: #element key: index) + name: (self elementNameAt: index); - name: index printString; valueGetter: (self elementGetterAt: index); valueSetter: (self elementSetterAt: index); yourself]! Item was changed: ----- Method: Inspector>>streamOn:truncate:collectFields:ellipsisFrom: (in category 'fields - truncation') ----- streamOn: aStream truncate: someObjects collectFields: fieldBlock ellipsisFrom: ellipsisBlock "Create fields for someObjects using fieldBlock. Using the current #truncationLimit, create an extra ellipsis field to hide objects that go beyond this limit." (someObjects size <= self truncationLimit or: [self truncationLimit < 0]) + ifTrue: [^ aStream nextPutAll: (someObjects withIndexCollect: [:each :index | fieldBlock cull: each cull: index])]. - ifTrue: [^ aStream nextPutAll: (someObjects collect: [:each | fieldBlock value: each])]. + someObjects readStream in: [:readStream | | offset | + offset := readStream size - self truncationTail. - someObjects readStream in: [:readStream | aStream nextPutAll: ((readStream next: self truncationLimit - self truncationTail - 1) + withIndexCollect: [:each :index | fieldBlock cull: each cull: index]); + nextPut: (ellipsisBlock value: (readStream upToPosition: offset)); - collect: [:each | fieldBlock value: each]); - nextPut: (ellipsisBlock value: (readStream upToPosition: readStream size - self truncationTail)); nextPutAll: (readStream upToEnd + withIndexCollect: [:each :index | fieldBlock cull: each cull: index + offset])].! - collect: [:each | fieldBlock value: each])].! From marcel.taeumel at hpi.de Fri Dec 11 09:32:27 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Fri, 11 Dec 2020 10:32:27 +0100 Subject: [squeak-dev] The Trunk: Tools-mt.1019.mcz In-Reply-To: References: Message-ID: Am 11.12.2020 10:30:56 schrieb commits at source.squeak.org : Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1019.mcz ==================== Summary ==================== Name: Tools-mt.1019 Author: mt Time: 11 December 2020, 10:30:43.719926 am UUID: bdc455f1-6d58-4dc1-8c2f-5f6b3a9765d4 Ancestors: Tools-mt.1018 Makes inspector for character sets more useful. See: http://forum.world.st/The-Trunk-Tools-mt-1018-mcz-td5125215.html Adds two extensions to the inspector framework: - truncated field streaming now provides object and index if needed (via #cull:) - representation of indices in collections can be overwritten via #elementNameAt: (like #elementGetterAt: and #elementSetterAt:) Note that the character-set inspector is the first collection inspector that uses its contents as keys/indices. Even the set inspector was simplier, because its internal array could be exposed. Also note that the elements of CharacterSetComplement and LazyCharacterSet cannot be shown as they are not enumerable. =============== Diff against Tools-mt.1018 =============== Item was added: + ----- Method: CharacterSetInspector>>characterNameFor: (in category 'private') ----- + characterNameFor: character + "Extracted from Character >> #printOn:." + + ^ String streamContents: [:stream | | integerValue | + ((integerValue := character asInteger) > 32 and: [integerValue ~= 127]) + ifTrue: [ + character printAsLiteralOn: stream. + stream space]. + stream nextPut: $(; print: integerValue; nextPut: $)].! Item was added: + ----- Method: CharacterSetInspector>>characterValueFor: (in category 'private') ----- + characterValueFor: character + "Extracted from Character >> #printOn: (and #storeOn:)." + + ^ String streamContents: [:stream | + (character class constantNameFor: character) + ifNotNil: [:name | stream nextPutAll: character class name; space; nextPutAll: name] + ifNil: [stream nextPutAll: character class name; nextPutAll: ' value: '; print: character asInteger]].! Item was added: + ----- Method: CharacterSetInspector>>elementAt: (in category 'menu - private') ----- + elementAt: indexOrKey + "All field keys are characters." + + ^ indexOrKey! Item was changed: ----- Method: CharacterSetInspector>>elementGetterAt: (in category 'private') ----- + elementGetterAt: character - elementGetterAt: element + self shouldNotImplement.! - ^ [:set | element]! Item was changed: ----- Method: CharacterSetInspector>>elementIndices (in category 'private') ----- elementIndices + self shouldNotImplement.! - ^ self object canBeEnumerated - ifTrue: [self object asArray] - ifFalse: [#()]! Item was added: + ----- Method: CharacterSetInspector>>elementNameAt: (in category 'private') ----- + elementNameAt: index + + self shouldNotImplement.! Item was changed: ----- Method: CharacterSetInspector>>elementSetterAt: (in category 'private') ----- elementSetterAt: index + self shouldNotImplement.! - ^ [:set :element | self error: 'Character sets cannot be changed.']! Item was added: + ----- Method: CharacterSetInspector>>streamElementsOn: (in category 'fields - streaming') ----- + streamElementsOn: aStream + "Overwritten to realize array representation of character sets if they can be enumerated. Assume that enumeration is deterministic." + + self object canBeEnumerated ifFalse: [^ self]. + + self + streamOn: aStream + truncate: self object asArray "Requires character set to be enumerable." + collectFields: [:character :index | + (self newFieldForType: #element key: index) + name: ('{1}: {2}' format: {index. self characterNameFor: character}); + valueGetter: [:characterSet | self characterValueFor: character]; printValueAsIs; + yourself]! Item was added: + ----- Method: CollectionInspector>>elementNameAt: (in category 'private') ----- + elementNameAt: index + + ^ index printString! Item was changed: ----- Method: CollectionInspector>>streamElementsOn: (in category 'fields - streaming') ----- streamElementsOn: aStream "Create a field for each element in the collection. Use the index' #printString (and not #asString) to reveal the nature of the key, which are usually integers (1, 2, 3, ...), but can be symbols (#apple, #tree, ...) or other objects (aMorph, aSocket, ...) in dictionary-like collections. Maybe #storeString would be even better but can be very expensive to compute." self streamOn: aStream truncate: self elementIndices collectFields: [:index | (self newFieldForType: #element key: index) + name: (self elementNameAt: index); - name: index printString; valueGetter: (self elementGetterAt: index); valueSetter: (self elementSetterAt: index); yourself]! Item was changed: ----- Method: Inspector>>streamOn:truncate:collectFields:ellipsisFrom: (in category 'fields - truncation') ----- streamOn: aStream truncate: someObjects collectFields: fieldBlock ellipsisFrom: ellipsisBlock "Create fields for someObjects using fieldBlock. Using the current #truncationLimit, create an extra ellipsis field to hide objects that go beyond this limit." (someObjects size + ifTrue: [^ aStream nextPutAll: (someObjects withIndexCollect: [:each :index | fieldBlock cull: each cull: index])]. - ifTrue: [^ aStream nextPutAll: (someObjects collect: [:each | fieldBlock value: each])]. + someObjects readStream in: [:readStream | | offset | + offset := readStream size - self truncationTail. - someObjects readStream in: [:readStream | aStream nextPutAll: ((readStream next: self truncationLimit - self truncationTail - 1) + withIndexCollect: [:each :index | fieldBlock cull: each cull: index]); + nextPut: (ellipsisBlock value: (readStream upToPosition: offset)); - collect: [:each | fieldBlock value: each]); - nextPut: (ellipsisBlock value: (readStream upToPosition: readStream size - self truncationTail)); nextPutAll: (readStream upToEnd + withIndexCollect: [:each :index | fieldBlock cull: each cull: index + offset])].! - collect: [:each | fieldBlock value: each])].! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 101815 bytes Desc: not available URL: From Marcel.Taeumel at hpi.de Fri Dec 11 10:34:30 2020 From: Marcel.Taeumel at hpi.de (marcel.taeumel) Date: Fri, 11 Dec 2020 04:34:30 -0600 (CST) Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> Message-ID: <1607682870301-0.post@n4.nabble.com> Hi there. This should work: | capsLockFilter | capsLockFilter := PluggableEventFilter on: [:keyboardEvent | (keyboardEvent isKeystroke and: [keyboardEvent keyCharacter isUppercase and: [keyboardEvent shiftPressed not]]) ifTrue: [self inform: 'CAPS LOCK ON']. keyboardEvent]. self currentHand addKeyboardCaptureFilter: capsLockFilter. Be sure to find a safe place for that capsLockFilter so that it won't be garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't know. Best, Marcel Squeak - Dev mailing list wrote > Hi folks. > > > > Ignore as appropriate. > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does > not work in morphic when that happens. > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > cheers and thanks. -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html From giovanni at corriga.net Fri Dec 11 11:28:13 2020 From: giovanni at corriga.net (Giovanni Corriga) Date: Fri, 11 Dec 2020 11:28:13 +0000 Subject: [squeak-dev] UK Smalltalk User Group Meeting - Wednesday, December 30th Message-ID: The UK Smalltalk User Group will have an extra meeting this year on Wednesday, December 30th. feenk's Tudor Girba will present the latest in moldable development with Glamorous Toolkit. Moldable development is an approach to programming through which we make the inside of software systems explainable. Glamorous Toolkit makes it practical. And beautiful. Given the current COVID-19 restrictions, this will be an online meeting from home. If you'd like to join us, please sign up in advance on the meeting's Meetup page ( https://www.meetup.com/UKSTUG/events/275119813/ ) to receive the meeting details. Don’t forget to bring your laptop and drinks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Fri Dec 11 15:47:32 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Fri, 11 Dec 2020 16:47:32 +0100 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Message-ID: Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio From tim at rowledge.org Fri Dec 11 17:34:31 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 11 Dec 2020 09:34:31 -0800 Subject: [squeak-dev] The Trunk: Tools-mt.1019.mcz In-Reply-To: References: Message-ID: <4F3D3D0F-FE29-415C-B812-5903C2414DB9@rowledge.org> Like. > On 2020-12-11, at 1:32 AM, Marcel Taeumel wrote: > > >> Am 11.12.2020 10:30:56 schrieb commits at source.squeak.org : >> >> Marcel Taeumel uploaded a new version of Tools to project The Trunk: >> http://source.squeak.org/trunk/Tools-mt.1019.mcz >> >> ==================== Summary ==================== >> >> Name: Tools-mt.1019 >> Author: mt >> Time: 11 December 2020, 10:30:43.719926 am >> UUID: bdc455f1-6d58-4dc1-8c2f-5f6b3a9765d4 >> Ancestors: Tools-mt.1018 >> >> Makes inspector for character sets more useful. See: http://forum.world.st/The-Trunk-Tools-mt-1018-mcz-td5125215.html tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: SBB: Store in Bit Bucket From gettimothy at zoho.com Fri Dec 11 20:27:40 2020 From: gettimothy at zoho.com (gettimothy) Date: Fri, 11 Dec 2020 15:27:40 -0500 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: <1607682870301-0.post@n4.nabble.com> References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> <1607682870301-0.post@n4.nabble.com> Message-ID: <176537cde38.11771a575546483.6073519555069539022@zoho.com> Thank you! I will give it a go tomorrow! ---- On Fri, 11 Dec 2020 05:34:30 -0500 Marcel.Taeumel at hpi.de wrote ---- Hi there. This should work: | capsLockFilter | capsLockFilter := PluggableEventFilter on: [:keyboardEvent |     (keyboardEvent isKeystroke         and: [keyboardEvent keyCharacter isUppercase         and: [keyboardEvent shiftPressed not]])             ifTrue: [self inform: 'CAPS LOCK ON'].     keyboardEvent]. self currentHand addKeyboardCaptureFilter: capsLockFilter. Be sure to find a safe place for that capsLockFilter so that it won't be garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't know. Best, Marcel Squeak - Dev mailing list wrote > Hi folks. > > > > Ignore as appropriate. > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does > not work in morphic when that happens. > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > cheers and thanks. -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Fri Dec 11 22:16:44 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 11 Dec 2020 17:16:44 -0500 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> Message-ID: <20201211221644.GA75781@shell.msen.com> Hi Marcel, On Thu, Dec 10, 2020 at 08:07:48AM +0100, Marcel Taeumel wrote: > Hi Dave. > > >??The tricky part is still there - how do you arrange for the option > > blocks to be evaluated at the earliest possible time, but no sooner? > > Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: > > DoItFirst class >> startUpFromDelay > > ?? ??self reevaluateDebug. > > DoItFirst class >> startUpFromFileDirectory > > ?? ??self reevaluateCwd. > I think I am misunderstanding this, but as you earlier suggested I should write something for the wiki to explain how it works (or should work). Dave From eliot.miranda at gmail.com Fri Dec 11 23:08:05 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:08:05 -0800 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus wrote: > Hi all, > > I'm not sure this is already known, but > CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly > crashes the VM on macOS. I tried it with an older VM from last year > and the latest bleeding edge (202012050134). > I just tried it on macOS in a bleeding edge VM and see a failing test (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. When you run under a debugger what stack trace do you see? _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Fri Dec 11 23:09:20 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:09:20 -0800 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda wrote: > Hi Fabio, > > On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus > wrote: > >> Hi all, >> >> I'm not sure this is already known, but >> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >> crashes the VM on macOS. I tried it with an older VM from last year >> and the latest bleeding edge (202012050134). >> > > I just tried it on macOS in a bleeding edge VM and see a failing test > (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. > When you run under a debugger what stack trace do you see? > Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > > _,,,^..^,,,_ > best, Eliot > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Fri Dec 11 23:11:53 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:11:53 -0800 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 3:09 PM Eliot Miranda wrote: > Hi Fabio, > > On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda > wrote: > >> Hi Fabio, >> >> On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus >> wrote: >> >>> Hi all, >>> >>> I'm not sure this is already known, but >>> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >>> crashes the VM on macOS. I tried it with an older VM from last year >>> and the latest bleeding edge (202012050134). >>> >> >> I just tried it on macOS in a bleeding edge VM and see a failing test >> (Error: subscript out of bounds: 38 from testValuePaneModify) but no >> crash. When you run under a debugger what stack trace do you see? >> > > Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > And the test should be rewritten to do e.g. self object initialPC + N so it works with both 64-bit and 32-bit images. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Dec 11 23:28:16 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 11 Dec 2020 23:28:16 0000 Subject: [squeak-dev] The Trunk: ToolsTests-eem.101.mcz Message-ID: Eliot Miranda uploaded a new version of ToolsTests to project The Trunk: http://source.squeak.org/trunk/ToolsTests-eem.101.mcz ==================== Summary ==================== Name: ToolsTests-eem.101 Author: eem Time: 11 December 2020, 3:28:14.410649 pm UUID: d3404ed0-924c-4e6f-8f3f-2256cfad73f4 Ancestors: ToolsTests-mt.100 Rewrite CompiledCodeInspectorTest>>testValuePaneModify to work in both 32- and 64- bits, and to check/document the dependency on the SistaV1 bytecode set. =============== Diff against ToolsTests-mt.100 =============== Item was changed: ----- Method: CompiledCodeInspectorTest>>testValuePaneModify (in category 'tests') ----- testValuePaneModify + "Overridden to specify the kind of value to modify in a compiled-code object: the bytecodes. Looking at #createObject, we try to replace the pushConstant of the second bytecode with the one for the third bytcode. So, the beginning of the resulting string will change from 'CarpeSqueak' to 'SqueakSqueak'." + + | initialPC | + self assert: 'SistaV1' equals: self object bytecodeSetName. "the test hard codes some bytecodes..." + initialPC := self object initialPC. + self assert: 35 equals: (self object at: initialPC + 1). "pushConstant: #[ ... ]" + self assert: 36 equals: (self object at: initialPC + 2). "pushConstant: #Squeak" - "Overridden to specify the kind of value to modify in a compiled-code object: the bytecodes. Looking at #createObject, we try to replace the pushConstant of the byte array at 34 with the one at 35. So, the beginning of the resulting string will change from 'CarpeSqueak' to 'SqueakSqueak'." - - self assert: 35 equals: (self object at: 38). "pushConstant: #[ ... ]" - self assert: 36 equals: (self object at: 39). "pushConstant: #Squeak" self assert: (self evaluateObject beginsWith: 'CarpeSqueak'). + self inspector selectFieldNamed: (initialPC + 1) printString. "pushConstant: #[ ... ]" + self assertFieldSelected: (initialPC + 1) printString. + self inValuePaneTypeAndAccept: 36. "pushConstant: #Squeak" - self inspector selectFieldNamed: '38'. "pushConstant: #[ ... ]" - self assertFieldSelected: '38'. - self inValuePaneTypeAndAccept: '36'. "pushConstant: #Squeak" + self assert: 36 equals: (self object at: initialPC + 1). "pushConstant: #Squeak" + self assert: 36 equals: (self object at: initialPC + 2). "pushConstant: #Squeak" + self assert: (self evaluateObject beginsWith: 'SqueakSqueak')! - self assert: 36 equals: (self object at: 38). "pushConstant: #Squeak" - self assert: 36 equals: (self object at: 39). "pushConstant: #Squeak" - self assert: (self evaluateObject beginsWith: 'SqueakSqueak').! From lists at fniephaus.com Sat Dec 12 13:26:17 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Sat, 12 Dec 2020 14:26:17 +0100 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Eliot, Interesting that you can't reproduce this. I've opened https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/542 with additional information. Fabio On Sat, Dec 12, 2020 at 12:12 AM Eliot Miranda wrote: > > Hi Fabio, > > On Fri, Dec 11, 2020 at 3:09 PM Eliot Miranda wrote: >> >> Hi Fabio, >> >> On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda wrote: >>> >>> Hi Fabio, >>> >>> On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus wrote: >>>> >>>> Hi all, >>>> >>>> I'm not sure this is already known, but >>>> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >>>> crashes the VM on macOS. I tried it with an older VM from last year >>>> and the latest bleeding edge (202012050134). >>> >>> >>> I just tried it on macOS in a bleeding edge VM and see a failing test (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. When you run under a debugger what stack trace do you see? >> >> >> Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > > > And the test should be rewritten to do e.g. self object initialPC + N so it works with both 64-bit and 32-bit images. > > _,,,^..^,,,_ > best, Eliot > From lewis at mail.msen.com Sat Dec 12 18:22:45 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 12 Dec 2020 13:22:45 -0500 Subject: [squeak-dev] DoIfFirst command option processing documentation (was: [ANN] DoItFirst command line goodie on SqueakSource) In-Reply-To: References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> Message-ID: <20201212182245.GA66459@shell.msen.com> On Wed, Dec 09, 2020 at 11:23:37AM +0100, Marcel Taeumel wrote: > Hi Dave. > > Thanks! Would you mind adding a page on wiki.squeak.org? :-) > I made a new swiki page for "DoItFirst command option processing": http://wiki.squeak.org/squeak/6655 I have tried to describe the full process starting with VM command line processing, then later explaining how DoItFirst participates in the process, as well as and how and when it parses and evaluates the command line options that it recognizes. This has always been a somewhat confusing topic and I am sure that I will have made some errors and omissions, but hopefully this helps to tie the pieces together. Note that I am writing from the perspective of a VM invoked from unix command line, so some details will be different for other platforms. But the explanations of option processing in the image are applicable for any platform or VM. Dave From tim at rowledge.org Sat Dec 12 18:52:58 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 12 Dec 2020 10:52:58 -0800 Subject: [squeak-dev] DoIfFirst command option processing documentation (was: [ANN] DoItFirst command line goodie on SqueakSource) In-Reply-To: <20201212182245.GA66459@shell.msen.com> References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> <20201212182245.GA66459@shell.msen.com> Message-ID: > On 2020-12-12, at 10:22 AM, David T. Lewis wrote: > > On Wed, Dec 09, 2020 at 11:23:37AM +0100, Marcel Taeumel wrote: >> Hi Dave. >> >> Thanks! Would you mind adding a page on wiki.squeak.org? :-) >> > > I made a new swiki page for "DoItFirst command option processing": > > http://wiki.squeak.org/squeak/6655 I made a couple of readability edits that seem to help in Safari - take a look to see if it causes any issues with other browsers. Mostly I changed the really annoyingly ugly --- stuff that gets merged into a single line with non-breaking hyphen, which keeps the little gap and makes it easy to tell a singe - from a -- tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim All the simple programs have been written, and all the good names taken. From lewis at mail.msen.com Sat Dec 12 19:25:28 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 12 Dec 2020 14:25:28 -0500 Subject: [squeak-dev] DoIfFirst command option processing documentation (was: [ANN] DoItFirst command line goodie on SqueakSource) In-Reply-To: References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> <20201212182245.GA66459@shell.msen.com> Message-ID: <20201212192528.GA72655@shell.msen.com> On Sat, Dec 12, 2020 at 10:52:58AM -0800, tim Rowledge wrote: > > > > On 2020-12-12, at 10:22 AM, David T. Lewis wrote: > > > > On Wed, Dec 09, 2020 at 11:23:37AM +0100, Marcel Taeumel wrote: > >> Hi Dave. > >> > >> Thanks! Would you mind adding a page on wiki.squeak.org? :-) > >> > > > > I made a new swiki page for "DoItFirst command option processing": > > > > http://wiki.squeak.org/squeak/6655 > > I made a couple of readability edits that seem to help in Safari - take a look to see if it causes any issues with other browsers. > Mostly I changed the really annoyingly ugly --- stuff that gets merged into a single line with non-breaking hyphen, which keeps the little gap and makes it easy to tell a singe - from a -- > > tim > Thanks a lot Tim, it looks good on Firefox. I don't really want to admit how much time I wasted this morning trying to get those little dash thingies to render on the swiki, thanks for doing it the right way. Dave From tim at rowledge.org Sat Dec 12 19:29:49 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 12 Dec 2020 11:29:49 -0800 Subject: [squeak-dev] DoIfFirst command option processing documentation (was: [ANN] DoItFirst command line goodie on SqueakSource) In-Reply-To: <20201212192528.GA72655@shell.msen.com> References: <20200614171501.GA25790@shell.msen.com> <20201126200056.GA23775@shell.msen.com> <20201208212014.GA57531@shell.msen.com> <20201212182245.GA66459@shell.msen.com> <20201212192528.GA72655@shell.msen.com> Message-ID: <42D6448C-074B-4C0E-922A-FD3C3EF146FD@rowledge.org> > On 2020-12-12, at 11:25 AM, David T. Lewis wrote: > > I don't really want to admit how much time I wasted this morning > trying to get those little dash thingies to render on the swiki, The page history will reveal how many times it took me... tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Useful random insult:- If what you don't know can't hurt you, she's practically invulnerable. From eliot.miranda at gmail.com Sat Dec 12 19:30:35 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 12 Dec 2020 11:30:35 -0800 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: <1607682870301-0.post@n4.nabble.com> References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> <1607682870301-0.post@n4.nabble.com> Message-ID: On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel wrote: > Hi there. > > This should work: > > | capsLockFilter | > capsLockFilter := PluggableEventFilter on: [:keyboardEvent | > (keyboardEvent isKeystroke > and: [keyboardEvent keyCharacter isUppercase > and: [keyboardEvent shiftPressed not]]) > ifTrue: [self inform: 'CAPS LOCK ON']. > keyboardEvent]. > self currentHand addKeyboardCaptureFilter: capsLockFilter. > > Be sure to find a safe place for that capsLockFilter so that it won't be > garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't > know. > Would it not be possible to add something next to the time & full screen button in the menu bar top right? Or maybe embolden the Squeak icon in the top left when shift is down? Some keyboards have a nice light when shift lock is on (Mac). I find it very annoying to use keyboards that don't indicate shift lock. But I don't suffer badly enough to have Timothy's issue. > Best, > Marcel > > > Squeak - Dev mailing list wrote > > Hi folks. > > > > > > > > Ignore as appropriate. > > > > > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste > does > > not work in morphic when that happens. > > > > > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > > > > > cheers and thanks. > > > > > > -- > Sent from: http://forum.world.st/Squeak-Dev-f45488.html > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From Das.Linux at gmx.de Sat Dec 12 20:14:20 2020 From: Das.Linux at gmx.de (Tobias Pape) Date: Sat, 12 Dec 2020 21:14:20 +0100 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> <1607682870301-0.post@n4.nabble.com> Message-ID: <75B84095-D8CC-4998-9B10-B1CD1B2B391F@gmx.de> > On 12. Dec 2020, at 20:30, Eliot Miranda wrote: > > > > On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel wrote: > Hi there. > > This should work: > > | capsLockFilter | > capsLockFilter := PluggableEventFilter on: [:keyboardEvent | > (keyboardEvent isKeystroke > and: [keyboardEvent keyCharacter isUppercase > and: [keyboardEvent shiftPressed not]]) > ifTrue: [self inform: 'CAPS LOCK ON']. > keyboardEvent]. > self currentHand addKeyboardCaptureFilter: capsLockFilter. > > Be sure to find a safe place for that capsLockFilter so that it won't be > garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't > know. > > Would it not be possible to add something next to the time & full screen button in the menu bar top right? > Or maybe embolden the Squeak icon in the top left when shift is down? > > Some keyboards have a nice light when shift lock is on (Mac). I find it very annoying to use keyboards that don't indicate shift lock. But I don't suffer badly enough to have Timothy's issue. > FWIW, I always map my caps lock to control. much better imho :D (easy to do on a mac, too) -t > > Best, > Marcel > > > Squeak - Dev mailing list wrote > > Hi folks. > > > > > > > > Ignore as appropriate. > > > > > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does > > not work in morphic when that happens. > > > > > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > > > > > cheers and thanks. > > > > > > -- > Sent from: http://forum.world.st/Squeak-Dev-f45488.html From commits at source.squeak.org Sat Dec 12 22:33:14 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 12 Dec 2020 22:33:14 0000 Subject: [squeak-dev] The Inbox: Tools-ct.1020.mcz Message-ID: Christoph Thiede uploaded a new version of Tools to project The Inbox: http://source.squeak.org/inbox/Tools-ct.1020.mcz ==================== Summary ==================== Name: Tools-ct.1020 Author: ct Time: 12 December 2020, 11:33:05.41462 pm UUID: 0413bef6-8f81-9241-8f8b-47274aa31cd1 Ancestors: Tools-mt.1019 Fixes code styling in change sorters. Funnily, #aboutToStyle: was already implemented on ChangeSorter, only the toolbuilder method needed a small update ... :-) =============== Diff against Tools-mt.1019 =============== Item was changed: ----- Method: ChangeSorter>>buildWith:in:rect: (in category 'toolbuilder') ----- buildWith: builder in: window rect: rect | csListHeight msgListHeight csMsgListHeight listSpec textSpec | contents := ''. csListHeight := 0.25. msgListHeight := 0.25. csMsgListHeight := csListHeight + msgListHeight. listSpec := builder pluggableListSpec new. listSpec model: self; list: #changeSetList; getSelected: #currentCngSet; setSelected: #showChangeSetNamed:; menu: #changeSetMenu:shifted:; keyPress: #changeSetListKey:from:; dragItem: #dragChangeSet:; autoDeselect: false; frame: (((0 at 0 extent: 0.5 at csListHeight) scaleBy: rect extent) translateBy: rect origin). window children add: listSpec. listSpec := builder pluggableListSpec new. listSpec model: self; list: #classList; getSelected: #currentClassName; setSelected: #currentClassName:; menu: #classListMenu:shifted:; keyPress: #classListKey:from:; dragItem: #dragClass:; frame: (((0.5 at 0 extent: 0.5 at csListHeight) scaleBy: rect extent) translateBy: rect origin). window children add: listSpec. listSpec := builder pluggableListSpec new. listSpec model: self; list: #messageList; getSelected: #currentSelector; setSelected: #currentSelector:; menu: #messageMenu:shifted:; keyPress: #messageListKey:from:; dragItem: #dragMessage:; frame: (((0 at csListHeight extent: 1 at msgListHeight) scaleBy: rect extent) translateBy: rect origin). window children add: listSpec. + textSpec := builder pluggableCodePaneSpec new. - textSpec := builder pluggableTextSpec new. textSpec model: self; getText: #contents; setText: #contents:notifying:; selection: #contentsSelection; menu: #codePaneMenu:shifted:; frame: (((0 at csMsgListHeight corner: 1 at 1) scaleBy: rect extent) translateBy: rect origin). window children add: textSpec. ^window! From commits at source.squeak.org Sun Dec 13 04:53:27 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 13 Dec 2020 04:53:27 0000 Subject: [squeak-dev] The Inbox: System-dtl.1197.mcz Message-ID: A new version of System was added to project The Inbox: http://source.squeak.org/inbox/System-dtl.1197.mcz ==================== Summary ==================== Name: System-dtl.1197 Author: dtl Time: 12 December 2020, 11:39:02.946469 pm UUID: 98a9eb0b-d360-473f-a718-f1f7ae883ac7 Ancestors: System-mt.1196 Enable removal of preference for 'Read document at startup'. Simplify code such that #readDocumentAtStartup is assumed always true and document specifiers begining with '-' are not treated as start documents. The actual preference setting is no longer referenced. Assumptions: if the start document resource name starts with '-' then it is unlikely to be a document. For the case of the first argument appearing to be a document but the user wishing to use it otherwise, the '--' token (or any other argument beginning with '-') may be used in the command line to protect the argument from evaluation. This allows the traditional start document processing to work normally in the general case, and allows start document processing to be bypassed from the command line if desired. No preference setting is required. The #readDocumentAtStartup may be removed in a future update. =============== Diff against System-mt.1196 =============== Item was changed: ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') ----- startUpAfterLogin | scriptName loader isUrl | self setupFlaps. + Smalltalk firstArgMightBeDocument + ifTrue: [scriptName := Smalltalk documentPath. - Preferences readDocumentAtStartup - ifTrue: [scriptName := Smalltalk documentPath - ifNil: ['']. scriptName := scriptName convertFromSystemString. scriptName isEmpty ifFalse: ["figure out if script name is a URL by itself" isUrl := (scriptName asLowercase beginsWith: 'http://') or: [(scriptName asLowercase beginsWith: 'file://') or: [scriptName asLowercase beginsWith: 'ftp://']]. isUrl ifFalse: [| encodedPath pathTokens | "Allow for ../dir/scriptName arguments" pathTokens := scriptName splitBy: FileDirectory slash. pathTokens := pathTokens collect: [:s | s encodeForHTTP]. encodedPath := pathTokens reduce: [:acc :each | acc , FileDirectory slash , each]. scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]] ifFalse: [scriptName := '']. scriptName isEmptyOrNil ifTrue: [^ Preferences eToyFriendly ifTrue: [self currentWorld addGlobalFlaps]]. loader := CodeLoader new. loader loadSourceFiles: (Array with: scriptName). (scriptName asLowercase endsWith: '.pr') ifTrue: [self installProjectFrom: loader] ifFalse: [loader installSourceFiles]! Item was changed: ----- Method: SmalltalkImage>>arguments (in category 'command line') ----- arguments "Answer an array with all the command line arguments. + This does not include imagePath, documentPath nor any option. + The '--' token on the command line indicates that remaining arguments should + be passed to the image without interpretation, and should not be treated as e.g. + specification of a start script." + - This does not include imagePath, documentPath nor any option." - "Smalltalk commandLine arguments" + | args | - | args strm | args := self rawArguments. + (args includes: '--' ) + ifTrue: [ ^ args copyAfter: '--' ] + ifFalse: [ | rs | rs := args readStream. + rs next. "skip image name" + self firstArgMightBeDocument + ifTrue: [rs next "skip startup document name"]. + ^ rs upToEnd ]. - (args includes: '--') - ifTrue: [ ^args copyAfter: self imageArgumentsMarker ]. - strm := args readStream. - strm atEnd ifFalse: [ strm next. "skip image name" - (Preferences readDocumentAtStartup and: [ strm atEnd not ]) - ifTrue: [ strm next "skip startup document name" ]]. - ^ strm upToEnd. ! Item was changed: ----- Method: SmalltalkImage>>documentPath (in category 'command line') ----- documentPath "Answer the absolute path of the document passed to the VM or nil if none." "Smalltalk commandLine documentPath" + ^ (self getSystemAttribute: 2) ifNil: [ '' ] - ^ (self getSystemAttribute: 2) - ifNotNil: [ :arg | arg = self imageArgumentsMarker - ifTrue: [nil] ifFalse: [arg]]. - ! Item was added: + ----- Method: SmalltalkImage>>firstArgMightBeDocument (in category 'private') ----- + firstArgMightBeDocument + "If the first argument begins with '-' then it is unlikely to be a document specification" + ^ (self documentPath beginsWith: '-') not + ! Item was removed: - ----- Method: SmalltalkImage>>imageArgumentsMarker (in category 'command line') ----- - imageArgumentsMarker - "The '--' token on the command line indicates that remaining arguments should - be passed to the image without interpretation, and should not be treated as e.g. - specification of a start script." - - ^ '--'! From gettimothy at zoho.com Sun Dec 13 13:40:19 2020 From: gettimothy at zoho.com (gettimothy) Date: Sun, 13 Dec 2020 08:40:19 -0500 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> <1607682870301-0.post@n4.nabble.com> Message-ID: <1765c54a470.d47ea39b584401.5275107563319265577@zoho.com> I second Eliot's proposal. I rarely look at the keyboard and never notice the caps light until I have muttered a few obsceneties trying to ctrl-foo or alt-foo to no avail. ---- On Sat, 12 Dec 2020 14:30:35 -0500 eliot.miranda at gmail.com wrote ---- On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel wrote: Hi there. This should work: | capsLockFilter | capsLockFilter := PluggableEventFilter on: [:keyboardEvent |         (keyboardEvent isKeystroke                 and: [keyboardEvent keyCharacter isUppercase                 and: [keyboardEvent shiftPressed not]])                         ifTrue: [self inform: 'CAPS LOCK ON'].         keyboardEvent]. self currentHand addKeyboardCaptureFilter: capsLockFilter. Be sure to find a safe place for that capsLockFilter so that it won't be garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't know. Would it not be possible to add something next to the time & full screen button in the menu bar top right? Or maybe embolden the Squeak icon in the top left when shift is down? Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue. Best, Marcel Squeak - Dev mailing list wrote > Hi folks. > > > > Ignore as appropriate. > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does > not work in morphic when that happens. > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > cheers and thanks. -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sun Dec 13 17:18:01 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 13 Dec 2020 12:18:01 -0500 Subject: [squeak-dev] The Inbox: System-dtl.1197.mcz In-Reply-To: References: Message-ID: <20201213171801.GA93230@shell.msen.com> This update addresses a couple of annoyances in our current startup argument processing. Annoyance #1: If someone starts the image like this: $ squeak squeak.image -e '3 + 4' Then is it clear that the '-e' parameter should not be interpreted as a start document. Annoyance #2: Having a preference for #readDocumentAtStartup makes the startup logic more complicated than it needs to be. It's just one more thing to keep track of, and if my command line does not work as expected I have to remember to go check the setting. So if we can get rid of a preference and make the system a little bit simpler, that would be a good thing. I cannot think of any use case on a unix-like system for which these changes would cause a problem, but it is possible that I am overlooking an issue that would affect Windows or other platforms. If someone with Windows experience could have a look at this update, I would appreciate any feedback. Thanks, Dave On Sun, Dec 13, 2020 at 04:53:27AM +0000, commits at source.squeak.org wrote: > A new version of System was added to project The Inbox: > http://source.squeak.org/inbox/System-dtl.1197.mcz > > ==================== Summary ==================== > > Name: System-dtl.1197 > Author: dtl > Time: 12 December 2020, 11:39:02.946469 pm > UUID: 98a9eb0b-d360-473f-a718-f1f7ae883ac7 > Ancestors: System-mt.1196 > > Enable removal of preference for 'Read document at startup'. > > Simplify code such that #readDocumentAtStartup is assumed always true and document specifiers begining with '-' are not treated as start documents. The actual preference setting is no longer referenced. > > Assumptions: if the start document resource name starts with '-' then it is unlikely to be a document. For the case of the first argument appearing to be a document but the user wishing to use it otherwise, the '--' token (or any other argument beginning with '-') may be used in the command line to protect the argument from evaluation. This allows the traditional start document processing to work normally in the general case, and allows start document processing to be bypassed from the command line if desired. No preference setting is required. > > The #readDocumentAtStartup may be removed in a future update. > > =============== Diff against System-mt.1196 =============== > > Item was changed: > ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') ----- > startUpAfterLogin > | scriptName loader isUrl | > self setupFlaps. > + Smalltalk firstArgMightBeDocument > + ifTrue: [scriptName := Smalltalk documentPath. > - Preferences readDocumentAtStartup > - ifTrue: [scriptName := Smalltalk documentPath > - ifNil: ['']. > scriptName := scriptName convertFromSystemString. > scriptName isEmpty > ifFalse: ["figure out if script name is a URL by itself" > isUrl := (scriptName asLowercase beginsWith: 'http://') > or: [(scriptName asLowercase beginsWith: 'file://') > or: [scriptName asLowercase beginsWith: 'ftp://']]. > isUrl > ifFalse: [| encodedPath pathTokens | > "Allow for ../dir/scriptName arguments" > pathTokens := scriptName splitBy: FileDirectory slash. > pathTokens := pathTokens > collect: [:s | s encodeForHTTP]. > encodedPath := pathTokens > reduce: [:acc :each | acc , FileDirectory slash , each]. > scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]] > ifFalse: [scriptName := '']. > scriptName isEmptyOrNil > ifTrue: [^ Preferences eToyFriendly > ifTrue: [self currentWorld addGlobalFlaps]]. > loader := CodeLoader new. > loader > loadSourceFiles: (Array with: scriptName). > (scriptName asLowercase endsWith: '.pr') > ifTrue: [self installProjectFrom: loader] > ifFalse: [loader installSourceFiles]! > > Item was changed: > ----- Method: SmalltalkImage>>arguments (in category 'command line') ----- > arguments > "Answer an array with all the command line arguments. > + This does not include imagePath, documentPath nor any option. > + The '--' token on the command line indicates that remaining arguments should > + be passed to the image without interpretation, and should not be treated as e.g. > + specification of a start script." > + > - This does not include imagePath, documentPath nor any option." > - > "Smalltalk commandLine arguments" > > + | args | > - | args strm | > args := self rawArguments. > + (args includes: '--' ) > + ifTrue: [ ^ args copyAfter: '--' ] > + ifFalse: [ | rs | rs := args readStream. > + rs next. "skip image name" > + self firstArgMightBeDocument > + ifTrue: [rs next "skip startup document name"]. > + ^ rs upToEnd ]. > - (args includes: '--') > - ifTrue: [ ^args copyAfter: self imageArgumentsMarker ]. > - strm := args readStream. > - strm atEnd ifFalse: [ strm next. "skip image name" > - (Preferences readDocumentAtStartup and: [ strm atEnd not ]) > - ifTrue: [ strm next "skip startup document name" ]]. > - ^ strm upToEnd. > ! > > Item was changed: > ----- Method: SmalltalkImage>>documentPath (in category 'command line') ----- > documentPath > "Answer the absolute path of the document passed to the VM or nil if none." > "Smalltalk commandLine documentPath" > + ^ (self getSystemAttribute: 2) ifNil: [ '' ] > - ^ (self getSystemAttribute: 2) > - ifNotNil: [ :arg | arg = self imageArgumentsMarker > - ifTrue: [nil] ifFalse: [arg]]. > - > ! > > Item was added: > + ----- Method: SmalltalkImage>>firstArgMightBeDocument (in category 'private') ----- > + firstArgMightBeDocument > + "If the first argument begins with '-' then it is unlikely to be a document specification" > + ^ (self documentPath beginsWith: '-') not > + ! > > Item was removed: > - ----- Method: SmalltalkImage>>imageArgumentsMarker (in category 'command line') ----- > - imageArgumentsMarker > - "The '--' token on the command line indicates that remaining arguments should > - be passed to the image without interpretation, and should not be treated as e.g. > - specification of a start script." > - > - ^ '--'! > > From marcel.taeumel at hpi.de Mon Dec 14 08:08:14 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 14 Dec 2020 09:08:14 +0100 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: <1765c54a470.d47ea39b584401.5275107563319265577@zoho.com> References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> <1607682870301-0.post@n4.nabble.com> <1765c54a470.d47ea39b584401.5275107563319265577@zoho.com> Message-ID: Hi all! > Would it not be possible to add something next to the time & full screen button in the menu bar top right? > Or maybe embolden the Squeak icon in the top left when shift is down? At the moment, we have no access to the state of caps lock from within the image. My solution thus exploits input-event processing and #shiftPressed. Well, you could map the effect to anything on the screen. However, even if we get a keyDown on caps lock, we don't know its state. Only after the next regular keyStroke event. So, any constant indication of the caps-lock state in the image could be misleading. Best, Marcel Am 13.12.2020 14:40:31 schrieb gettimothy via Squeak-dev : I second Eliot's proposal. I rarely look at the keyboard and never notice the caps light until I have muttered a few obsceneties trying to ctrl-foo or alt-foo to no avail. ---- On Sat, 12 Dec 2020 14:30:35 -0500 eliot.miranda at gmail.com wrote ---- On Fri, Dec 11, 2020 at 2:34 AM marcel.taeumel wrote: Hi there. This should work: | capsLockFilter | capsLockFilter := PluggableEventFilter on: [:keyboardEvent |         (keyboardEvent isKeystroke                 and: [keyboardEvent keyCharacter isUppercase                 and: [keyboardEvent shiftPressed not]])                         ifTrue: [self inform: 'CAPS LOCK ON'].         keyboardEvent]. self currentHand addKeyboardCaptureFilter: capsLockFilter. Be sure to find a safe place for that capsLockFilter so that it won't be garbage collected. :-) Maybe that "inform:" is too noisy for you. I don't know. Would it not be possible to add something next to the time & full screen button in the menu bar top right? Or maybe embolden the Squeak icon in the top left when shift is down? Some keyboards have a nice light when shift lock is on (Mac).  I find it very annoying to use keyboards that don't indicate shift lock.  But I don't suffer badly enough to have Timothy's issue. Best, Marcel Squeak - Dev mailing list wrote > Hi folks. > > > > Ignore as appropriate. > > > > Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does > not work in morphic when that happens. > > > > A not-so-subtle indicator that "caps lock is on" would be helpful. > > > > cheers and thanks. -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html [http://forum.world.st/Squeak-Dev-f45488.html] -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Mon Dec 14 10:33:37 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 14 Dec 2020 11:33:37 +0100 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: <20201211221644.GA75781@shell.msen.com> References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> <20201211221644.GA75781@shell.msen.com> Message-ID: Hi Dave. Maybe this change set helps. :-) Well ... that "--debug" still seems fishy. You must go past "Project" to show any interactive debugger. Why would "Delay" be enough? Hmmm... Still playing around with it. :-) This does not work: ./Squeak.exe Squeak-Trunk-32bit.image --evaluate 3+4 Best, Marcel Am 11.12.2020 23:16:54 schrieb David T. Lewis : Hi Marcel, On Thu, Dec 10, 2020 at 08:07:48AM +0100, Marcel Taeumel wrote: > Hi Dave. > > >??The tricky part is still there - how do you arrange for the option > > blocks to be evaluated at the earliest possible time, but no sooner? > > Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: > > DoItFirst class >> startUpFromDelay > > ?? ??self reevaluateDebug. > > DoItFirst class >> startUpFromFileDirectory > > ?? ??self reevaluateCwd. > I think I am misunderstanding this, but as you earlier suggested I should write something for the wiki to explain how it works (or should work). Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 309310 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DoItFirst-mt.1.cs URL: From marcel.taeumel at hpi.de Mon Dec 14 11:32:05 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 14 Dec 2020 12:32:05 +0100 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> <20201211221644.GA75781@shell.msen.com> Message-ID: Ah! :-) Windows-specific quirks ahead. :-D This works fine: ./SqueakConsole.exe -- --evaluate '3+4' This locks up the image (i.e. no clock tick): ./Squeak.exe -- --evaluate '3+4' And all combinations with an actual image name end up in ProjetLauncher >> startUpAfterLogin (via AutoStart): ./Squeak.exe Squeak-Trunk-32bit.image --evaluate '3+4' ./SqueakConsole.exe Squeak-Trunk-32bit.image --evaluate '3+4' This locks up the image but clock keeps ticking: ./SqueakConsole.exe -- --debug (Note that "Attach tools to mouse cursor" preference is enabled. ^__^) Best, Marcel Am 14.12.2020 11:33:37 schrieb Marcel Taeumel : Hi Dave. Maybe this change set helps. :-) Well ... that "--debug" still seems fishy. You must go past "Project" to show any interactive debugger. Why would "Delay" be enough? Hmmm... Still playing around with it. :-) This does not work: ./Squeak.exe Squeak-Trunk-32bit.image --evaluate 3+4 Best, Marcel Am 11.12.2020 23:16:54 schrieb David T. Lewis : Hi Marcel, On Thu, Dec 10, 2020 at 08:07:48AM +0100, Marcel Taeumel wrote: > Hi Dave. > > >??The tricky part is still there - how do you arrange for the option > > blocks to be evaluated at the earliest possible time, but no sooner? > > Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: > > DoItFirst class >> startUpFromDelay > > ?? ??self reevaluateDebug. > > DoItFirst class >> startUpFromFileDirectory > > ?? ??self reevaluateCwd. > I think I am misunderstanding this, but as you earlier suggested I should write something for the wiki to explain how it works (or should work). Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 58405 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 309310 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 171845 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 348618 bytes Desc: not available URL: From marcel.taeumel at hpi.de Mon Dec 14 11:43:16 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 14 Dec 2020 12:43:16 +0100 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> <20201211221644.GA75781@shell.msen.com> Message-ID: Hi Dave. We might want to move the following behind "Project": 12 - MessageTally 15 - ImageSegment (!! Does not even have #startUp implemented !!) 16 - PowerManagement 17 - ExternalSettings 18 - SecurityManager (maybe) Best, Marcel Am 14.12.2020 12:32:05 schrieb Marcel Taeumel : Ah! :-) Windows-specific quirks ahead. :-D This works fine: ./SqueakConsole.exe -- --evaluate '3+4' This locks up the image (i.e. no clock tick): ./Squeak.exe -- --evaluate '3+4' And all combinations with an actual image name end up in ProjetLauncher >> startUpAfterLogin (via AutoStart): ./Squeak.exe Squeak-Trunk-32bit.image --evaluate '3+4' ./SqueakConsole.exe Squeak-Trunk-32bit.image --evaluate '3+4' This locks up the image but clock keeps ticking: ./SqueakConsole.exe -- --debug (Note that "Attach tools to mouse cursor" preference is enabled. ^__^) Best, Marcel Am 14.12.2020 11:33:37 schrieb Marcel Taeumel : Hi Dave. Maybe this change set helps. :-) Well ... that "--debug" still seems fishy. You must go past "Project" to show any interactive debugger. Why would "Delay" be enough? Hmmm... Still playing around with it. :-) This does not work: ./Squeak.exe Squeak-Trunk-32bit.image --evaluate 3+4 Best, Marcel Am 11.12.2020 23:16:54 schrieb David T. Lewis : Hi Marcel, On Thu, Dec 10, 2020 at 08:07:48AM +0100, Marcel Taeumel wrote: > Hi Dave. > > >??The tricky part is still there - how do you arrange for the option > > blocks to be evaluated at the earliest possible time, but no sooner? > > Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: > > DoItFirst class >> startUpFromDelay > > ?? ??self reevaluateDebug. > > DoItFirst class >> startUpFromFileDirectory > > ?? ??self reevaluateCwd. > I think I am misunderstanding this, but as you earlier suggested I should write something for the wiki to explain how it works (or should work). Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 107229 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 58405 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 309310 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 171845 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 348618 bytes Desc: not available URL: From lists at fniephaus.com Mon Dec 14 21:33:03 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Mon, 14 Dec 2020 22:33:03 +0100 Subject: [squeak-dev] FullBlockClosures and ignoreOuterContext? Message-ID: Hi all, While digging through the implementation of FullBlockClosure with Hernan, we were wondering about full closures that ignore their outerContext. We noticed that the following method has two senders: EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext: One of them seems to be the only one in use, and it's passing in false as defaults for both receiverOnstack and ignoreOuterContext. The other sender (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:), in turn, doesn't seem to have any further senders. Unless we missed something, it looks like the outerContext will never be ignored at the moment. Similarly, the receiver is never on the stack. Is this something only Scorch can do or is this just "not yet implemented"? When can the outerContext be ignored? When does it make sense to pop the receiver from the stack? And where can we find the latest version of Scorch. Is it still the one at [1]? Cheers, Fabio [1] https://github.com/clementbera/Scorch From lewis at mail.msen.com Mon Dec 14 22:32:14 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Mon, 14 Dec 2020 17:32:14 -0500 Subject: [squeak-dev] The Trunk: Kernel-dtl.1363.mcz In-Reply-To: References: <2FAD900B-5CDA-42C7-AFD7-6473A517BA10@gmail.com> <20201209195933.GA77665@shell.msen.com> <20201211221644.GA75781@shell.msen.com> Message-ID: <20201214223214.GA80711@shell.msen.com> Hi Marcel, Thanks very much for looking at this. I do not have access to Windows at the present time, so I appreciate you taking the time to do this. I loaded your change set, so I understand now what you were suggesting. The image lockups are a big concern, I don't understand what's happening there. But here some things that might help figure it out: The "Error: no content to install" errors are all related to the start document loading. For purposes of testing DoItFirst, you may want to disable the "Read document at startup" preference to prevent the errors. This is BTW the reason for System-dtl.1197 in the inbox. The preference for start document loading is a long standing source of confusion, and I would like to get rid of it if possible. I do not know what is happening with the '--' handling, but it might be a problem for Windows. The unix VMs handle this in the VM prior to passing it on to the image, and I suspect that the Windows VM will not do anything with it at all except pass it in to the image. The '--' token is a unix shell convention that probably does not make sense on other platforms. The --debug handling is an interesting one. My goal was to be able to open a functional debugger at the earliest possible time in the startup processing. When I use the --debug option, I can open a functional debugger. It does not yet have access to the sources file (hence code appears as decompiled) but it does work, and I can use the debugger to proceed carefully through the rest of the startup list. On the other hand, if I try to use the --debug option for an image that was saved in MVC, I cannot find a way to proceed from the pre-debugger window to the full debugger, so the feature is useless. So I think you are right, we probably should rearrange the startup list, and do the --debug only after Project startup. Also I think that it does make sense for the Project startup to be done at the earliest possible time, since it is fundamental for anything involving UI tools such as a debugger. Thanks again for looking at this, I know that it's a pain to work through this stuff. And if inbox System-dtl.1197 is useful (or not) on Windows to help simplify this mess, I'd be happy to hear about that too. Dave On Mon, Dec 14, 2020 at 12:43:16PM +0100, Marcel Taeumel wrote: > Hi Dave. > > > > We might want to move the following behind "Project": > > 12 - MessageTally > 15 - ImageSegment (!! Does not even have #startUp implemented !!) > 16 - PowerManagement > 17 - ExternalSettings > 18 - SecurityManager (maybe) > > Best, > Marcel > Am 14.12.2020 12:32:05 schrieb Marcel Taeumel : > Ah! :-) Windows-specific quirks ahead. :-D > > This works fine: > ./SqueakConsole.exe -- --evaluate '3+4' > > > This locks up the image (i.e. no clock tick): > ./Squeak.exe -- --evaluate '3+4' > > > > > And all combinations with an actual image name end up in ProjetLauncher >> startUpAfterLogin (via AutoStart): > ./Squeak.exe Squeak-Trunk-32bit.image --evaluate '3+4' > > ./SqueakConsole.exe Squeak-Trunk-32bit.image --evaluate '3+4' > > > > > This locks up the image but clock keeps ticking: > ./SqueakConsole.exe -- --debug > > > (Note that "Attach tools to mouse cursor" preference is enabled. ^__^) > > Best, > Marcel > Am 14.12.2020 11:33:37 schrieb Marcel Taeumel : > Hi Dave. > > Maybe this change set helps. :-) Well ... that "--debug" still seems fishy. You must go past "Project" to show any interactive debugger. Why would "Delay" be enough? Hmmm... Still playing around with it. :-) > > This does not work: > > ./Squeak.exe Squeak-Trunk-32bit.image --evaluate 3+4 > > > > > Best, > Marcel > Am 11.12.2020 23:16:54 schrieb David T. Lewis : > Hi Marcel, > > On Thu, Dec 10, 2020 at 08:07:48AM +0100, Marcel Taeumel wrote: > > Hi Dave. > > > > >??The tricky part is still there - how do you arrange for the option > > > blocks to be evaluated at the earliest possible time, but no sooner? > > > > Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear: > > > > DoItFirst class >> startUpFromDelay > > > > ?? ??self reevaluateDebug. > > > > DoItFirst class >> startUpFromFileDirectory > > > > ?? ??self reevaluateCwd. > > > > I think I am misunderstanding this, but as you earlier suggested I should > write something for the wiki to explain how it works (or should work). > > Dave > > > From eliot.miranda at gmail.com Tue Dec 15 02:06:12 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 14 Dec 2020 18:06:12 -0800 Subject: [squeak-dev] FullBlockClosures and ignoreOuterContext? In-Reply-To: References: Message-ID: Hi Fabio, On Mon, Dec 14, 2020 at 1:33 PM Fabio Niephaus wrote: > Hi all, > > While digging through the implementation of FullBlockClosure with > Hernan, we were wondering about full closures that ignore their > outerContext. We noticed that the following method has two senders: > > EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext: > > One of them seems to be the only one in use, and it's passing in false > as defaults for both receiverOnstack and ignoreOuterContext. The other > sender > (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:), > in turn, doesn't seem to have any further senders. > > Unless we missed something, it looks like the outerContext will never > be ignored at the moment. Similarly, the receiver is never on the > stack. Is this something only Scorch can do or is this just "not yet > implemented"? > > When can the outerContext be ignored? When the Sista optimizer determines that it isn't needed. i.e. this option is nover used in vanilla code but exists for an optimizing compiler to avoid the overhead in cases where it wants to avoid inlining but knows there is no real suspension point during some evaluation. Now, whether we'll ever use this facility I can't say, but it was certainly in Clément's mind to do so at some point. > When does it make sense to pop the receiver from the stack? The point isn't really to pop the receiver from the stack. The point is to be able to take the closures receiver form the stack rather than it being implicitly the receiver of the current method. If closure creation gets inlined by the optimizer then there will be potentially a mismatch between the current method's receiver and an inlined closure's receiver, which necessitates having the facility to specify a distinct receiver. > And where can we find the latest version > of Scorch. Is it still the one at [1]? > http://smalltalkhub.com/mc/ClementBera/Scorch/main If you're interested in looking at Scorch I'm very interested in collaborating. And there ius one significant modification to perform first which will make development much easier, and that is to restructure the interface between the optimizer and the image via mirrors, allowing the optimizer to be mated with an image being simulated, rather than having to be a full peer of the image it is optimizing. > Cheers, > Fabio > > [1] https://github.com/clementbera/Scorch > _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Dec 15 02:53:37 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 15 Dec 2020 02:53:37 0000 Subject: [squeak-dev] The Trunk: Multilingual-eem.253.mcz Message-ID: Eliot Miranda uploaded a new version of Multilingual to project The Trunk: http://source.squeak.org/trunk/Multilingual-eem.253.mcz ==================== Summary ==================== Name: Multilingual-eem.253 Author: eem Time: 14 December 2020, 6:53:34.900606 pm UUID: c157caaa-e69e-4431-9d90-6b94f7c76463 Ancestors: Multilingual-nice.252 Fix several osVersion tests on mac OS that fail for Big Sur (11.x). The old code read '10*' match: osVersion which fails on Big Sur, e.g. '1100.1', '1101.0'. The new code tests for the index of the period being > 4. Arguably the old code is obsolete. I'm guessing as to the old format. If in fact it was only three digits then my code is wrong, and should be e.g. Smalltalk osVersion includes: $. Please let me know. One method SimplifiedChineseEnvironment class>>#inputInterpreterClass is simplified, eliminating redundant tests. =============== Diff against Multilingual-nice.252 =============== Item was changed: ----- Method: JapaneseEnvironment class>>defaultEncodingName (in category 'public query') ----- defaultEncodingName + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. - osVersion := Smalltalk osVersion. (#('Win32' 'ZaurusOS') includes: platformName) ifTrue: [^'shift-jis']. + platformName = 'Mac OS' ifTrue: + [^(Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc" - platformName = 'Mac OS' - ifTrue: - [^('10*' match: osVersion) ifTrue: ['utf-8'] ifFalse: ['shift-jis']]. ^'unix' = platformName ifTrue: ['euc-jp'] ifFalse: ['mac-roman']! Item was changed: ----- Method: JapaneseEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass + | platformName encoding | - | platformName osVersion encoding | platformName := Smalltalk platformName. + platformName = 'Win32' ifTrue: + [^self win32VMUsesUnicode + ifTrue: [UTF32JPInputInterpreter] + ifFalse: [WinShiftJISInputInterpreter]]. + platformName = 'Mac OS' ifTrue: + [^((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc" + and: [(Smalltalk getSystemAttribute: 3) isNil]) - osVersion := Smalltalk osVersion. - platformName = 'Win32' - ifTrue: [^ (self win32VMUsesUnicode) ifTrue: [UTF32JPInputInterpreter] ifFalse: [WinShiftJISInputInterpreter]]. - platformName = 'Mac OS' - ifTrue: [^ (('10*' match: osVersion) - and: [(Smalltalk getSystemAttribute: 3) isNil]) ifTrue: [MacUnicodeInputInterpreter] ifFalse: [MacShiftJISInputInterpreter]]. + platformName = 'unix' ifTrue: + [encoding := X11Encoding encoding. + (EUCJPTextConverter encodingNames includes: encoding) ifTrue: + [^UnixEUCJPInputInterpreter]. + (UTF8TextConverter encodingNames includes: encoding) ifTrue: + [^UnixUTF8JPInputInterpreter]. + (ShiftJISTextConverter encodingNames includes: encoding) ifTrue: + [^ MacShiftJISInputInterpreter]]. - platformName = 'unix' - ifTrue: [encoding := X11Encoding encoding. - (EUCJPTextConverter encodingNames includes: encoding) - ifTrue: [^ UnixEUCJPInputInterpreter]. - (UTF8TextConverter encodingNames includes: encoding) - ifTrue: [^ UnixUTF8JPInputInterpreter]. - (ShiftJISTextConverter encodingNames includes: encoding) - ifTrue: [^ MacShiftJISInputInterpreter]]. ^ MacRomanInputInterpreter! Item was changed: ----- Method: JapaneseEnvironment class>>systemConverterClass (in category 'subclass responsibilities') ----- systemConverterClass + | platformName | - | platformName osVersion encoding | platformName := Smalltalk platformName. + platformName = 'Win32' ifTrue: + [^UTF8TextConverter]. + platformName = 'ZaurusOS' ifTrue: + [^ShiftJISTextConverter]. + platformName = 'Mac OS' ifTrue: + [^(Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc" + ifTrue: [UTF8TextConverter] + ifFalse: [ShiftJISTextConverter]]. + platformName = 'unix' ifTrue: + [X11Encoding encoding + ifNil: [^EUCJPTextConverter] + ifNotNil: + [:encoding| + (encoding = 'utf-8') ifTrue: + [^UTF8TextConverter]. + (encoding = 'shiftjis' or: [encoding = 'sjis']) ifTrue: + [^ShiftJISTextConverter]]. + ^EUCJPTextConverter]. - osVersion := Smalltalk osVersion. - platformName = 'Win32' - ifTrue: [^UTF8TextConverter]. - platformName = 'ZaurusOS' - ifTrue: [^ShiftJISTextConverter]. - platformName = 'Mac OS' - ifTrue: - [^('10*' match: osVersion) - ifTrue: [UTF8TextConverter] - ifFalse: [ShiftJISTextConverter]]. - platformName = 'unix' - ifTrue: - [encoding := X11Encoding encoding. - encoding ifNil: [^EUCJPTextConverter]. - (encoding = 'utf-8') - ifTrue: [^UTF8TextConverter]. - (encoding = 'shiftjis' or: [ encoding = 'sjis' ]) - ifTrue: [^ShiftJISTextConverter]. - ^EUCJPTextConverter]. ^MacRomanTextConverter! Item was changed: ----- Method: KoreanEnvironment class>>clipboardInterpreterClass (in category 'subclass responsibilities') ----- clipboardInterpreterClass + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. - osVersion := Smalltalk osVersion. platformName = 'Win32' ifTrue: [^WinKSX1001ClipboardInterpreter]. platformName = 'Mac OS' ifTrue: + [((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") - [('10*' match: osVersion) ifTrue: [^NoConversionClipboardInterpreter] ifFalse: [^WinKSX1001ClipboardInterpreter]]. platformName = 'unix' ifTrue: [(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding) ifTrue: [^WinKSX1001ClipboardInterpreter] ifFalse: [^NoConversionClipboardInterpreter]]. ^NoConversionClipboardInterpreter! Item was changed: ----- Method: KoreanEnvironment class>>defaultEncodingName (in category 'public query') ----- defaultEncodingName + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. + (#('unix' 'Win32' 'Mac OS' 'ZaurusOS') includes: platformName) ifTrue: + [^'euc-kr']. - osVersion := Smalltalk osVersion. - (#('Win32' 'Mac OS' 'ZaurusOS') includes: platformName) - ifTrue: [^'euc-kr']. - (#('unix') includes: platformName) ifTrue: [^'euc-kr']. ^'mac-roman'! Item was changed: ----- Method: KoreanEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass + | platformName encoding | - | platformName osVersion encoding | platformName := Smalltalk platformName. - osVersion := Smalltalk osVersion. platformName = 'Win32' ifTrue: [^WinKSX1001InputInterpreter]. platformName = 'Mac OS' ifTrue: + [((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") - [('10*' match: osVersion) ifTrue: [^MacUnicodeInputInterpreter] ifFalse: [^WinKSX1001InputInterpreter]]. platformName = 'unix' ifTrue: [encoding := X11Encoding encoding. (EUCJPTextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]. (UTF8TextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]. (ShiftJISTextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]]. ^MacRomanInputInterpreter! Item was changed: ----- Method: Latin1Environment class>>defaultEncodingName (in category 'subclass responsibilities') ----- defaultEncodingName + (#('unix' 'Win32' 'Mac OS' 'ZaurusOS') includes: Smalltalk platformName) ifTrue: + [^'iso8859-1']. - | platformName osVersion | - platformName := Smalltalk platformName. - osVersion := Smalltalk osVersion. - (#('Win32' 'Mac OS' 'ZaurusOS') includes: platformName) - ifTrue: [^'iso8859-1']. - (#('unix') includes: platformName) ifTrue: [^'iso8859-1']. ^'mac-roman'! Item was changed: ----- Method: Latin1Environment class>>systemConverterClass (in category 'subclass responsibilities') ----- systemConverterClass + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. + platformName = 'Win32' ifTrue: + [^self win32VMUsesUnicode + ifTrue: [UTF8TextConverter] + ifFalse: [ISO88591TextConverter]]. + platformName = 'Mac OS' ifTrue: + [^((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") + ifTrue: [UTF8TextConverter] + ifFalse: [MacRomanTextConverter]]. + platformName = 'unix' ifTrue: + [^UTF8TextConverter]. + ^MacRomanTextConverter! - osVersion := Smalltalk getSystemAttribute: 1002. - platformName = 'Win32' - ifTrue: [^ (self win32VMUsesUnicode) ifTrue: [UTF8TextConverter] ifFalse: [ISO88591TextConverter]]. - platformName = 'Mac OS' - ifTrue: [^ ('10*' match: Smalltalk osVersion) - ifTrue: [UTF8TextConverter] - ifFalse: [MacRomanTextConverter]]. - platformName = 'unix' - ifTrue: [^ UTF8TextConverter]. - ^ MacRomanTextConverter! Item was changed: ----- Method: Latin2Environment class>>defaultEncodingName (in category 'subclass responsibilities') ----- defaultEncodingName + ^Smalltalk platformName caseOf: { + ['Win32'] -> ['cp-1250']. + ['unix'] -> ['iso8859-2'] + } + otherwise: ['mac-roman']! - | platformName | - platformName := Smalltalk platformName. - (#('Win32') includes: platformName) - ifTrue: [^'cp-1250']. - (#('unix') includes: platformName) ifTrue: [^'iso8859-2']. - ^'mac-roman'! Item was changed: ----- Method: MultiByteFileStream class>>guessDefaultLineEndConvention (in category 'system startup') ----- guessDefaultLineEndConvention "Lets try to guess the line end convention from what we know about the path name delimiter from FileDirectory." + FileDirectory pathNameDelimiter = $: ifTrue: + [^self defaultToCR]. + FileDirectory pathNameDelimiter = $/ ifTrue: + [^(Smalltalk platformName = 'Mac OS' + and: [(Smalltalk osVersion indexOf: $.) <= 4]) "i.e. 9xx.n, not 10xx.n, 11xx.n etc" + ifTrue: [self defaultToCR] + ifFalse: [self defaultToLF]]. + FileDirectory pathNameDelimiter = $\ ifTrue: + [^self defaultToCRLF]. - FileDirectory pathNameDelimiter = $: - ifTrue: [^ self defaultToCR]. - FileDirectory pathNameDelimiter = $/ - ifTrue: [((Smalltalk osVersion) - beginsWith: 'darwin') - ifTrue: [^ self defaultToCR] - ifFalse: [^ self defaultToLF]]. - FileDirectory pathNameDelimiter = $\ - ifTrue: [^ self defaultToCRLF]. "in case we don't know" + ^self defaultToCR! - ^ self defaultToCR! Item was changed: ----- Method: RussianEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass | platformName | platformName := Smalltalk platformName. platformName = 'Win32' ifTrue: [^UTF32RussianInputInterpreter]. platformName = 'Mac OS' + ifTrue: [^ (((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") - ifTrue: [^ (('10*' match: Smalltalk osVersion) and: [(Smalltalk getSystemAttribute: 3) isNil]) ifTrue: [MacUnicodeInputInterpreter] ifFalse: [MacRomanInputInterpreter]]. platformName = 'unix' ifTrue: [^ UTF32RussianInputInterpreter]. ^ MacRomanInputInterpreter! Item was changed: ----- Method: SimplifiedChineseEnvironment class>>clipboardInterpreterClass (in category 'subclass responsibilities') ----- clipboardInterpreterClass + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. + platformName = 'Win32' ifTrue: + [^WinGB2312ClipboardInterpreter]. + platformName = 'Mac OS' ifTrue: + [^((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") + ifTrue: [NoConversionClipboardInterpreter] + ifFalse: [WinGB2312ClipboardInterpreter]]. + platformName = 'unix' ifTrue: + [^(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding) + ifTrue: [MacShiftJISClipboardInterpreter] + ifFalse: [NoConversionClipboardInterpreter]]. - osVersion := Smalltalk osVersion. - platformName = 'Win32' ifTrue: [^WinGB2312ClipboardInterpreter]. - platformName = 'Mac OS' - ifTrue: - [('10*' match: osVersion) - ifTrue: [^NoConversionClipboardInterpreter] - ifFalse: [^WinGB2312ClipboardInterpreter]]. - platformName = 'unix' - ifTrue: - [(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding) - ifTrue: [^MacShiftJISClipboardInterpreter] - ifFalse: [^NoConversionClipboardInterpreter]]. ^NoConversionClipboardInterpreter! Item was changed: ----- Method: SimplifiedChineseEnvironment class>>defaultEncodingName (in category 'public query') ----- defaultEncodingName + | platformName | - | platformName osVersion | platformName := Smalltalk platformName. + (#('Win32' 'Mac OS' 'ZaurusOS') includes: platformName) ifTrue: + [^'gb2312']. + 'unix' = platformName ifTrue: + [^'euc-cn']. - osVersion := Smalltalk osVersion. - (#('Win32' 'Mac OS' 'ZaurusOS') includes: platformName) - ifTrue: [^'gb2312']. - (#('unix') includes: platformName) ifTrue: [^'euc-cn']. ^'mac-roman'! Item was changed: ----- Method: SimplifiedChineseEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass + | platformName | - | platformName osVersion encoding | platformName := Smalltalk platformName. + platformName = 'Win32' ifTrue: + [^WinGB2312InputInterpreter]. + platformName = 'Mac OS' ifTrue: + [^((Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc") + ifTrue: [MacUnicodeInputInterpreter] + ifFalse: [WinGB2312InputInterpreter]]. - osVersion := Smalltalk osVersion. - platformName = 'Win32' ifTrue: [^WinGB2312InputInterpreter]. - platformName = 'Mac OS' - ifTrue: - [('10*' match: osVersion) - ifTrue: [^MacUnicodeInputInterpreter] - ifFalse: [^WinGB2312InputInterpreter]]. - platformName = 'unix' - ifTrue: - [encoding := X11Encoding encoding. - (EUCJPTextConverter encodingNames includes: encoding) - ifTrue: [^MacRomanInputInterpreter]. - (UTF8TextConverter encodingNames includes: encoding) - ifTrue: [^MacRomanInputInterpreter]. - (ShiftJISTextConverter encodingNames includes: encoding) - ifTrue: [^MacRomanInputInterpreter]]. ^MacRomanInputInterpreter! From eliot.miranda at gmail.com Tue Dec 15 03:19:52 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 14 Dec 2020 19:19:52 -0800 Subject: [squeak-dev] Big Sur broken update stream [see The Trunk: Multilingual-eem.253.mcz] Message-ID: Hi All, those of you using Big Sur will notice that update is broken, MNUs and errors occurring in character code conversion in trying to write to the changes file. This is die to some non-future-proof code written to distinguish Mac OS prior to OS X. The old code asked ('10*' match: Smalltalk osVersion) which fell flat when confronted with '1100.1', '1101.0' etc. I've committed fixes, alas the bug won't allow you to update on Big Sur. So if you only have access to Big Sur here is how to get your system to update. The trick here is to save an image with the relevant fixes installed manually and then restart that image to get functional character conversion code that can update. It's a three step dance. 1a. Locate Multilingual-eem.253 in a repository inspector on source.squeak.org/trunk. *do not load it* 1b. select Changes and in the resulting MCPatchBrowser manually install all changes *except* JapaneseEnvironment class>>#flapTabTextFor:in: JapaneseEnvironment class>>#isBreakableAt:in: 1c. save and quit and restart 2. in a workspace evaluate SourceFiles do: [:ea| ea initializeConverter] 3. update HTH _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Tue Dec 15 14:55:35 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Tue, 15 Dec 2020 15:55:35 +0100 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? Message-ID: Hi all, The latest Squeak trunk (6.0alpha-20097) is still using EncoderForV3PlusClosures as the preferred bytecode set encoder class. So new methods are still being compiled with it (not necessarily a problem, because the VM can handle both V3 and Sista at the same time). Is this something we've done on purpose or something we should fix? Best, Fabio From lewis at mail.msen.com Tue Dec 15 18:27:49 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 15 Dec 2020 13:27:49 -0500 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? In-Reply-To: References: Message-ID: <20201215182749.GA95149@shell.msen.com> On Tue, Dec 15, 2020 at 03:55:35PM +0100, Fabio Niephaus wrote: > Hi all, > > The latest Squeak trunk (6.0alpha-20097) is still using > EncoderForV3PlusClosures as the preferred bytecode set encoder class. > So new methods are still being compiled with it (not necessarily a > problem, because the VM can handle both V3 and Sista at the same > time). > > Is this something we've done on purpose or something we should fix? > > Best, > Fabio > As far as I know it was not done on purpose, and yes it is something we should fix. We switched trunk to Sista back in March: Name: Kernel-dtl.1310 Author: dtl Time: 6 March 2020, 7:29:11.316779 pm UUID: 683e4e14-fc18-4d55-a776-eece91f579f5 Ancestors: Kernel-mt.1309 Change the Squeak default bytecode set to Sista in trunk. Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the VM that Sista is in use, see VMMaker.oscog-dtl.2711 and http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html. Add CompiledCode>>useSista: convenience method for switching to and from Sista bytecodes. Package postscript activates the change to Sista bytecodes, which can be reversed by evaluating CompiledCode useSista: false. I don't know where things went wrong in the update stream, but I thought that we were running Sista encoding all of this time :-( This is also a good time to mention that the planned update for image format number (to identify images requiring multiple bytecode support) was discussed but not implemented in the VM. I'm not sure if there is any further interest in this? http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html Dave From eric.gade at gmail.com Tue Dec 15 19:53:52 2020 From: eric.gade at gmail.com (Eric Gade) Date: Tue, 15 Dec 2020 14:53:52 -0500 Subject: [squeak-dev] Custom FillStyles (Morphic) Message-ID: Hello all, Does anyone have pointers on creating highly-customized fill styles for Morphs? I have some interface elements that require specific canvas drawing operations as their fills. I had originally done this work in Pharo, but they treat FillStyle differently. In that system whenever Canvas >> fillRectangle:fillStyle: is sent, the result is simply: ``` fillRectangle: aRect fillStyle: aFillStyle aFillStyle fillRectangle: aRect on: self ``` This gives each FillStyle subclass the chance to perform explicit operations on the passed canvas. I would like to keep this library (a recreation of the Platinum interface) as cross platform as possible. Right now I see the following options: 1. Add a new kind of FillStyle check in the various Canvas operations that require it (ie isSolidFill and friends), which requires modifying base methods; 2. Forget using FillStyles at all and fold all drawing operations into my Morphs themselves; 3. Something else I'm hoping there's a slight chance someone on this list might have a #3! Thanks for any pointers, -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 16 08:06:17 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 08:06:17 0000 Subject: [squeak-dev] The Trunk: ToolBuilder-MVC-mt.62.mcz Message-ID: Marcel Taeumel uploaded a new version of ToolBuilder-MVC to project The Trunk: http://source.squeak.org/trunk/ToolBuilder-MVC-mt.62.mcz ==================== Summary ==================== Name: ToolBuilder-MVC-mt.62 Author: mt Time: 16 December 2020, 9:06:17.554602 am UUID: 7fbc702d-3163-5441-a7ec-66fd8e9055e3 Ancestors: ToolBuilder-MVC-mt.61 Tool components (or widgets) can be built without a parent (e.g. window) present. Makes MVCToolBuilderTests green again. =============== Diff against ToolBuilder-MVC-mt.61 =============== Item was changed: ----- Method: MVCToolBuilder>>setFrame:in: (in category 'private') ----- setFrame: fractionsRectangleOrLayoutFrame in: widget | win | fractionsRectangleOrLayoutFrame ifNil: [ "Translate subviews to position the viewport of each subView relative to the widget window origin. If subviews are repositioned, as in a row of button views arranged within a view, then the transformations will later be rescaled to fit the subviews within the widget window." self flag: #nonProportionalLayout. "See #setLayout:in:." + parent ifNotNil: [widget setTransformation: (widget transformation translateBy: parent window origin - widget window origin)]. - widget setTransformation: (widget transformation translateBy: parent window origin - widget window origin). ^ self]. win := fractionsRectangleOrLayoutFrame isRectangle ifTrue: [self asWindow: fractionsRectangleOrLayoutFrame] ifFalse: [fractionsRectangleOrLayoutFrame layout: nil in: topSize]. "assume LayoutFrame" widget window: win.! From commits at source.squeak.org Wed Dec 16 08:33:34 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 08:33:34 0000 Subject: [squeak-dev] The Trunk: Kernel-mt.1364.mcz Message-ID: Marcel Taeumel uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-mt.1364.mcz ==================== Summary ==================== Name: Kernel-mt.1364 Author: mt Time: 16 December 2020, 9:33:32.156464 am UUID: 138652b8-3f41-45fa-b272-13d99680d2d3 Ancestors: Kernel-dtl.1363 Changes default bytecode set to SistaV1. (This is a regression from when I enabled reset for all pragma preferences.) =============== Diff against Kernel-dtl.1363 =============== Item was changed: ----- Method: CompiledCode class>>preferredBytecodeSetEncoderClass (in category 'preferences') ----- preferredBytecodeSetEncoderClass + ^PreferredBytecodeSetEncoderClass ifNil: [SecondaryBytecodeSetEncoderClass]! - ^PreferredBytecodeSetEncoderClass ifNil: [PrimaryBytecodeSetEncoderClass]! From marcel.taeumel at hpi.de Wed Dec 16 08:34:36 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 16 Dec 2020 09:34:36 +0100 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? In-Reply-To: <20201215182749.GA95149@shell.msen.com> References: <20201215182749.GA95149@shell.msen.com> Message-ID: Hi Fabio, hi Dave, hi all! Fixed in Kernel-mt.1364. I introduced that regression. Sorry. Best, Marcel Am 15.12.2020 19:27:56 schrieb David T. Lewis : On Tue, Dec 15, 2020 at 03:55:35PM +0100, Fabio Niephaus wrote: > Hi all, > > The latest Squeak trunk (6.0alpha-20097) is still using > EncoderForV3PlusClosures as the preferred bytecode set encoder class. > So new methods are still being compiled with it (not necessarily a > problem, because the VM can handle both V3 and Sista at the same > time). > > Is this something we've done on purpose or something we should fix? > > Best, > Fabio > As far as I know it was not done on purpose, and yes it is something we should fix. We switched trunk to Sista back in March: Name: Kernel-dtl.1310 Author: dtl Time: 6 March 2020, 7:29:11.316779 pm UUID: 683e4e14-fc18-4d55-a776-eece91f579f5 Ancestors: Kernel-mt.1309 Change the Squeak default bytecode set to Sista in trunk. Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the VM that Sista is in use, see VMMaker.oscog-dtl.2711 and http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html. Add CompiledCode>>useSista: convenience method for switching to and from Sista bytecodes. Package postscript activates the change to Sista bytecodes, which can be reversed by evaluating CompiledCode useSista: false. I don't know where things went wrong in the update stream, but I thought that we were running Sista encoding all of this time :-( This is also a good time to mention that the planned update for image format number (to identify images requiring multiple bytecode support) was discussed but not implemented in the VM. I'm not sure if there is any further interest in this? http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Wed Dec 16 08:36:51 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 16 Dec 2020 09:36:51 +0100 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? In-Reply-To: References: <20201215182749.GA95149@shell.msen.com> Message-ID: Hi all! Please know that this regression only affects some downloads from files.squeak.org. If you maintain your local Trunk through the update stream, you should be with SistaV1 since March. Best, Marcel Am 16.12.2020 09:34:36 schrieb Marcel Taeumel : Hi Fabio, hi Dave, hi all! Fixed in Kernel-mt.1364. I introduced that regression. Sorry. Best, Marcel Am 15.12.2020 19:27:56 schrieb David T. Lewis : On Tue, Dec 15, 2020 at 03:55:35PM +0100, Fabio Niephaus wrote: > Hi all, > > The latest Squeak trunk (6.0alpha-20097) is still using > EncoderForV3PlusClosures as the preferred bytecode set encoder class. > So new methods are still being compiled with it (not necessarily a > problem, because the VM can handle both V3 and Sista at the same > time). > > Is this something we've done on purpose or something we should fix? > > Best, > Fabio > As far as I know it was not done on purpose, and yes it is something we should fix. We switched trunk to Sista back in March: Name: Kernel-dtl.1310 Author: dtl Time: 6 March 2020, 7:29:11.316779 pm UUID: 683e4e14-fc18-4d55-a776-eece91f579f5 Ancestors: Kernel-mt.1309 Change the Squeak default bytecode set to Sista in trunk. Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the VM that Sista is in use, see VMMaker.oscog-dtl.2711 and http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html. Add CompiledCode>>useSista: convenience method for switching to and from Sista bytecodes. Package postscript activates the change to Sista bytecodes, which can be reversed by evaluating CompiledCode useSista: false. I don't know where things went wrong in the update stream, but I thought that we were running Sista encoding all of this time :-( This is also a good time to mention that the planned update for image format number (to identify images requiring multiple bytecode support) was discussed but not implemented in the VM. I'm not sure if there is any further interest in this? http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Wed Dec 16 08:38:27 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 16 Dec 2020 09:38:27 +0100 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? In-Reply-To: References: <20201215182749.GA95149@shell.msen.com> Message-ID: Hi all! I suppose this regression happened mid October: Name: ReleaseBuilder-mt.212 Author: mt Time: 15 October 2020, 2:24:29.226368 pm UUID: fc86eeb0-8a62-e04d-ae69-f8d7753835f7 Ancestors: ReleaseBuilder-mt.211 Best, Marcel Am 16.12.2020 09:36:51 schrieb Marcel Taeumel : Hi all! Please know that this regression only affects some downloads from files.squeak.org. If you maintain your local Trunk through the update stream, you should be with SistaV1 since March. Best, Marcel Am 16.12.2020 09:34:36 schrieb Marcel Taeumel : Hi Fabio, hi Dave, hi all! Fixed in Kernel-mt.1364. I introduced that regression. Sorry. Best, Marcel Am 15.12.2020 19:27:56 schrieb David T. Lewis : On Tue, Dec 15, 2020 at 03:55:35PM +0100, Fabio Niephaus wrote: > Hi all, > > The latest Squeak trunk (6.0alpha-20097) is still using > EncoderForV3PlusClosures as the preferred bytecode set encoder class. > So new methods are still being compiled with it (not necessarily a > problem, because the VM can handle both V3 and Sista at the same > time). > > Is this something we've done on purpose or something we should fix? > > Best, > Fabio > As far as I know it was not done on purpose, and yes it is something we should fix. We switched trunk to Sista back in March: Name: Kernel-dtl.1310 Author: dtl Time: 6 March 2020, 7:29:11.316779 pm UUID: 683e4e14-fc18-4d55-a776-eece91f579f5 Ancestors: Kernel-mt.1309 Change the Squeak default bytecode set to Sista in trunk. Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the VM that Sista is in use, see VMMaker.oscog-dtl.2711 and http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html. Add CompiledCode>>useSista: convenience method for switching to and from Sista bytecodes. Package postscript activates the change to Sista bytecodes, which can be reversed by evaluating CompiledCode useSista: false. I don't know where things went wrong in the update stream, but I thought that we were running Sista encoding all of this time :-( This is also a good time to mention that the planned update for image format number (to identify images requiring multiple bytecode support) was discussed but not implemented in the VM. I'm not sure if there is any further interest in this? http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Wed Dec 16 08:55:23 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Wed, 16 Dec 2020 09:55:23 +0100 Subject: [squeak-dev] EncoderForV3PlusClosures still the preferred bytecode set encoder class? In-Reply-To: References: <20201215182749.GA95149@shell.msen.com> Message-ID: Thank you, Marcel! On Wed, Dec 16, 2020 at 9:34 AM Marcel Taeumel wrote: > > Hi Fabio, hi Dave, hi all! > > Fixed in Kernel-mt.1364. I introduced that regression. Sorry. > > Best, > Marcel > > Am 15.12.2020 19:27:56 schrieb David T. Lewis : > > On Tue, Dec 15, 2020 at 03:55:35PM +0100, Fabio Niephaus wrote: > > Hi all, > > > > The latest Squeak trunk (6.0alpha-20097) is still using > > EncoderForV3PlusClosures as the preferred bytecode set encoder class. > > So new methods are still being compiled with it (not necessarily a > > problem, because the VM can handle both V3 and Sista at the same > > time). > > > > Is this something we've done on purpose or something we should fix? > > > > Best, > > Fabio > > > > As far as I know it was not done on purpose, and yes it is something > we should fix. > > We switched trunk to Sista back in March: > > Name: Kernel-dtl.1310 > Author: dtl > Time: 6 March 2020, 7:29:11.316779 pm > UUID: 683e4e14-fc18-4d55-a776-eece91f579f5 > Ancestors: Kernel-mt.1309 > > Change the Squeak default bytecode set to Sista in trunk. > > Add CompiledCode>>multipleBytecodeSetsActive: to optionally inform the > VM that Sista is in use, see VMMaker.oscog-dtl.2711 and > http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html. > > Add CompiledCode>>useSista: convenience method for switching to and > from Sista bytecodes. > > Package postscript activates the change to Sista bytecodes, which can > be reversed by evaluating CompiledCode useSista: false. > > > I don't know where things went wrong in the update stream, but I thought > that we were running Sista encoding all of this time :-( > > This is also a good time to mention that the planned update for image > format number (to identify images requiring multiple bytecode support) > was discussed but not implemented in the VM. I'm not sure if there is > any further interest in this? > > http://lists.squeakfoundation.org/pipermail/vm-dev/2020-January/032441.html > > Dave > > > From commits at source.squeak.org Wed Dec 16 09:03:23 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 09:03:23 0000 Subject: [squeak-dev] The Trunk: 60Deprecated-pre.86.mcz Message-ID: Patrick Rein uploaded a new version of 60Deprecated to project The Trunk: http://source.squeak.org/trunk/60Deprecated-pre.86.mcz ==================== Summary ==================== Name: 60Deprecated-pre.86 Author: pre Time: 16 December 2020, 10:02:51.427215 am UUID: 83016811-05f2-c04f-a169-6ac3c8a222d1 Ancestors: 60Deprecated-dtl.85 Deprecates several methods already marked as deprecated in comments. =============== Diff against 60Deprecated-dtl.85 =============== Item was added: + ----- Method: Preferences class>>parameterAt:default: (in category '*60Deprecated-parameters') ----- + parameterAt: aKey default: defaultValueBlock + "Deprecated interface; no surviving senders in the released image, but clients probably still use" + self deprecated: 'Use #parameterAt:ifAbsentPut: instead'. + ^ self parameterAt: aKey ifAbsentPut: defaultValueBlock! Item was added: + ----- Method: SMPackage>>maintainer (in category '*60Deprecated-accessing') ----- + maintainer + + self deprecated: 'Use #owner or #maintainers instead'. + ^self owner! Item was added: + ----- Method: SMPackage>>modulePath:moduleVersion:moduleTag:versionComment: (in category '*60Deprecated-deprecated') ----- + modulePath: p moduleVersion: v moduleTag: t versionComment: vc + "Deprecated. Only kept for migration from SM 1.0x. + Method used when recreating from storeOn: format." + + self deprecated. + self isReleased ifTrue: [self lastRelease note: vc]! Item was added: + ----- Method: SocketStream>>receiveDataIfAvailable (in category '*60Deprecated-private-socket') ----- + receiveDataIfAvailable + + self deprecated: 'Use #receiveAvailableData instead'. + ^ self receiveAvailableData! Item was added: + ----- Method: SugarLauncher class>>welcomeProjectName (in category '*60Deprecated-accessing') ----- + welcomeProjectName + "Deprecated" + ^Project home ifNotNil: [:p | p name]! From commits at source.squeak.org Wed Dec 16 09:19:36 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 09:19:36 0000 Subject: [squeak-dev] The Trunk: System-pre.1197.mcz Message-ID: Patrick Rein uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-pre.1197.mcz ==================== Summary ==================== Name: System-pre.1197 Author: pre Time: 16 December 2020, 10:19:29.678215 am UUID: 2a693e37-3279-b24e-87b6-c277ffbcf2ad Ancestors: System-mt.1196 Deprecates two methods in Preferences and rewrites one method in SARInstaller to not use a deprecated method. =============== Diff against System-mt.1196 =============== Item was removed: - ----- Method: Preferences class>>parameterAt:default: (in category 'parameters') ----- - parameterAt: aKey default: defaultValueBlock - "Deprecated interface; no surviving senders in the released image, but clients probably still use" - - ^ self parameterAt: aKey ifAbsentPut: defaultValueBlock! Item was changed: + ----- Method: Preferences class>>useFormsInPaintBox (in category 'standard queries') ----- - ----- Method: Preferences class>>useFormsInPaintBox (in category 'prefs - misc') ----- useFormsInPaintBox + ^ self + valueOfFlag: #useFormsInPaintBox + ifAbsent: [false]! - - ^ self valueOfFlag: #useFormsInPaintBox! Item was changed: ----- Method: SARInstaller class>>newCardForSqueakMap: (in category 'SqueakMap') ----- newCardForSqueakMap: aSqueakMap "Answer a new card." + | newCard | + newCard := (aSqueakMap newCardWithId: self squeakMapPackageID) + created: 3236292323 + updated:3236292323 + name: 'SARInstaller for 3.6' + currentVersion:'16' + summary: 'Lets you load SAR (Squeak ARchive) files from SqueakMap and the File List. For 3.6 and later images.' + description:'Support for installing SAR (Squeak ARchive) packages from SqueakMap and the File List. + For 3.6 and later images. - ^(aSqueakMap newCardWithId: self squeakMapPackageID) - created: 3236292323 - updated:3236292323 - name: 'SARInstaller for 3.6' - currentVersion:'16' - summary: 'Lets you load SAR (Squeak ARchive) files from SqueakMap and the File List. For 3.6 and later images.' - description:'Support for installing SAR (Squeak ARchive) packages from SqueakMap and the File List. - For 3.6 and later images. + SMSARInstaller will use this if it''s present to load SAR packages. - SMSARInstaller will use this if it''s present to load SAR packages. + Use SARBuilder for making these packages easily.' + url: 'http://bike-nomad.com/squeak/' + downloadUrl:'http://bike-nomad.com/squeak/SARInstallerFor36-nk.16.cs.gz' + author: 'Ned Konz ' + maintainer:'Ned Konz ' + registrator:'Ned Konz ' + password:240495131608326995113451940367316491071470713347 + categories: #('6ba57b6e-946a-4009-beaa-0ac93c08c5d1' '94277ca9-4d8f-4f0e-a0cb-57f4b48f1c8a' 'a71a6233-c7a5-4146-b5e3-30f28e4d3f6b' '8209da9b-8d6e-40dd-b23a-eb7e05d4677b' ); + yourself. + newCard lastRelease note: 'v16: same as v16 of SARInstaller for 3.4 but doesn''t include any classes other than SARInstaller. - Use SARBuilder for making these packages easily.' - url: 'http://bike-nomad.com/squeak/' - downloadUrl:'http://bike-nomad.com/squeak/SARInstallerFor36-nk.16.cs.gz' - author: 'Ned Konz ' - maintainer:'Ned Konz ' - registrator:'Ned Konz ' - password:240495131608326995113451940367316491071470713347 - categories: #('6ba57b6e-946a-4009-beaa-0ac93c08c5d1' '94277ca9-4d8f-4f0e-a0cb-57f4b48f1c8a' 'a71a6233-c7a5-4146-b5e3-30f28e4d3f6b' '8209da9b-8d6e-40dd-b23a-eb7e05d4677b' ); - modulePath: '' - moduleVersion:'' - moduleTag:'' - versionComment:'v16: same as v16 of SARInstaller for 3.4 but doesn''t include any classes other than SARInstaller. To be loaded into 3.6 images only. Will de-register the 3.4 version if it''s registered. Added a default (DWIM) mode in which SAR files that are missing both a preamble and postscript have all their members loaded in a default manner. Changed the behavior of #extractMemberWithoutPath: to use the same directory as the SAR itself. Added #extractMemberWithoutPath:inDirectory: Moved several change set methods to the class side. Made change set methods work with 3.5 or 3.6a/b Now supports the following file types: Projects (with or without construction of a ViewMorph) Genie gesture dictionaries Change sets DVS packages Monticello packages Graphics files (loaded as SketchMorphs) Text files (loaded as text editor windows) Morph(s) in files + Now keeps track of installed members.'. + + ^ newCard! - Now keeps track of installed members.'! From lists at fniephaus.com Wed Dec 16 09:24:19 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Wed, 16 Dec 2020 10:24:19 +0100 Subject: [squeak-dev] MoreVMs 2021 : Workshop on Modern Language Runtimes, Ecosystems, and VMs Message-ID: ============================================================================ Call for Extended Abstracts and Talks: MoreVMs’21 5th International Workshop on Modern Language Runtimes, Ecosystems, and VMs Co-located with ‹Programming›’21 March 22nd to 26th, 2021, Online, United Kingdom https://2021.programming-conference.org/home/MoreVMs-2021 ============================================================================ Following four previous successful editions, the MoreVMs’21 workshop aims to bring together industrial and academic programmers to discuss the design, implementation, and usage of modern languages and runtimes. This includes aspects such as reuse of language runtimes, modular implementation, language design, and compilation strategies. By bringing together both researchers and practitioners, the workshop aims to enable a diverse discussion on how languages and runtimes are currently being utilized, and where they need to improve further. In addition to conventional workshop-style submissions, MoreVMs also accepts (and encourages) submissions that present early-stage work and emerging ideas. Relevant topics include, but are definitely not limited to, the following: - Extensible VM design (compiler- or interpreter-based VMs) - Reusable components (e.g. interpreters, garbage collectors, ...) - Static and dynamic compilation techniques - Techniques for targeting high-level languages such as JavaScript - Interoperability between languages - Tooling support (e.g. debugging, profiling, etc.) - Programming language development environments - Case studies of existing language implementation approaches - Language implementation challenges and trade-offs - Surveys and usage reports to understand usage in the wild - Ideas for more predictable performance - Ideas for how VMs could take advantage of new hardware features - Ideas for how we should build languages in the future Workshop Format and Submissions ------------------------------- We welcome presentation proposals in the form of extended abstracts (2 to 4 pages long) and talk proposals (title and 400 words abstract) discussing new techniques, insights, experiences, works-in-progress, as well as future visions, from either an academic or industrial perspective. The extended abstracts and talk proposals, and if the speakers wish, their slides, will be published on the workshop's website. Alternatively, extended abstracts can be published as part of the companion of ‹Programming›’21 in the ACM DL. Publication in the ACM DL is conditional on the acceptance by the program committee. Please note that MoreVMs’21 is organized as an academic workshop, and as such, speakers will be required to register for the workshop. Author Instructions ------------------- Submissions should use the ACM `acmart` format: https://www.acm.org/publications/proceedings-template If you are using LaTeX, submissions should use the 'acmart' document class with the 'sigconf' option, and with a font size of 9 point. Please use the Libertine/Biolinum font family. Please include page numbers in your submission using the LaTeX command `\settopmatter{printfolios=true}`. All submissions should be in PDF format. Please also ensure that your submission is legible when printed on a black and white printer. In particular, please check that colors remain distinct and font sizes are legible. Submission Site: https://easychair.org/conferences/?conf=morevms21 Important Dates --------------- Extended abstract and talk submissions: 2021-01-13 Author notification: 2021-02-15 Camera Ready: 2021-02-26 Workshop: TBA (between 2021-03-22 and 2021-03-26) All deadlines are Anywhere on Earth (AoE), i.e. GMT/UTC-12:00 hour. Program Committee ----------------- Maya Armyanova, Google, Germany Maxime Chevalier-Boisvert, Université de Montréal, Canada Lukas Diekmann, King's College London, United Kingdom Charlie Gracie, Microsoft, Canada Daco Harkes, Google, Denmark Christian Humer, Oracle Labs, Switzerland Sophie Kaleba, University of Kent, United Kingdom Mikel Luján, University of Manchester, United Kingdom Ana Milanova, Rensselaer Polytechnic Institute, United States Tobias Pape, Hasso Plattner Institute, University of Potsdam, Germany Tomoharu Ugawa, University of Tokyo, Japan Organizers ---------- Fabio Niephaus, Hasso Plattner Institute, University of Potsdam, Germany David Leopoldseder, Oracle Labs, Austria From commits at source.squeak.org Wed Dec 16 09:27:28 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 09:27:28 0000 Subject: [squeak-dev] The Trunk: SMBase-pre.144.mcz Message-ID: Patrick Rein uploaded a new version of SMBase to project The Trunk: http://source.squeak.org/trunk/SMBase-pre.144.mcz ==================== Summary ==================== Name: SMBase-pre.144 Author: pre Time: 16 December 2020, 10:27:25.663215 am UUID: 422ce975-bd0c-e24d-95b1-aa060a1e5770 Ancestors: SMBase-nice.143 Deprecates two methods in SMPackage. =============== Diff against SMBase-nice.143 =============== Item was removed: - ----- Method: SMPackage>>maintainer (in category 'accessing') ----- - maintainer - "Deprecated" - - ^self owner! Item was removed: - ----- Method: SMPackage>>modulePath:moduleVersion:moduleTag:versionComment: (in category 'deprecated') ----- - modulePath: p moduleVersion: v moduleTag: t versionComment: vc - "Deprecated. Only kept for migration from SM 1.0x. - Method used when recreating from storeOn: format." - - self isReleased ifTrue: [self lastRelease note: vc]! From commits at source.squeak.org Wed Dec 16 09:29:57 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 09:29:57 0000 Subject: [squeak-dev] The Trunk: Network-pre.244.mcz Message-ID: Patrick Rein uploaded a new version of Network to project The Trunk: http://source.squeak.org/trunk/Network-pre.244.mcz ==================== Summary ==================== Name: Network-pre.244 Author: pre Time: 16 December 2020, 10:29:54.830215 am UUID: 12c7ade8-62d1-324d-b902-f9e561617100 Ancestors: Network-mt.243 Deprecates a private (already deprecated) method in SocketStream. =============== Diff against Network-mt.243 =============== Item was removed: - ----- Method: SocketStream>>receiveDataIfAvailable (in category 'private-socket') ----- - receiveDataIfAvailable - "Deprecated. Use #receiveAvailableData instead" - - ^self receiveAvailableData! From commits at source.squeak.org Wed Dec 16 09:31:20 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 09:31:20 0000 Subject: [squeak-dev] The Trunk: EToys-pre.415.mcz Message-ID: Patrick Rein uploaded a new version of EToys to project The Trunk: http://source.squeak.org/trunk/EToys-pre.415.mcz ==================== Summary ==================== Name: EToys-pre.415 Author: pre Time: 16 December 2020, 10:31:09.027215 am UUID: be5a3ed4-ef3d-b746-a38f-1811f5a439a1 Ancestors: EToys-mt.414 Deprecates an already deprecated method in SugarLauncher. =============== Diff against EToys-mt.414 =============== Item was removed: - ----- Method: SugarLauncher class>>welcomeProjectName (in category 'accessing') ----- - welcomeProjectName - "Deprecated" - ^Project home ifNotNil: [:p | p name]! From marcel.taeumel at hpi.de Wed Dec 16 10:27:03 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 16 Dec 2020 11:27:03 +0100 Subject: [squeak-dev] "Move to" is somehow broken in SqueakSource's Web Interface Message-ID: Hi all! Inbox commits keep on reappearing even after moved to Trunk: http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html [http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html] First moved on March 03, then again on November 04, it is now back in the Inbox again. -.-" Who has access to SqueakSource and can take a look at it? Best, Marcel -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Wed Dec 16 11:13:37 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Wed, 16 Dec 2020 12:13:37 +0100 Subject: [squeak-dev] "Move to" is somehow broken in SqueakSource's Web Interface In-Reply-To: References: Message-ID: I now moved them to Treated. Let's see how this works out... Best, Marcel Am 16.12.2020 11:27:03 schrieb Marcel Taeumel : Hi all! Inbox commits keep on reappearing even after moved to Trunk: http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html [http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html] First moved on March 03, then again on November 04, it is now back in the Inbox again. -.-" Who has access to SqueakSource and can take a look at it? Best, Marcel -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 16 11:30:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 11:30:15 0000 Subject: [squeak-dev] The Trunk: MorphicExtras-mt.281.mcz Message-ID: Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk: http://source.squeak.org/trunk/MorphicExtras-mt.281.mcz ==================== Summary ==================== Name: MorphicExtras-mt.281 Author: mt Time: 16 December 2020, 12:30:12.371306 pm UUID: bf976862-6782-48d3-a408-0bc2229d9e3f Ancestors: MorphicExtras-mt.280 (Recovers contents from inaccessible MorphicExtras-ct.2?82 from Inbox.) Adds Workspace examples for demonstration of Editor and Text.Reuploaded to fix bad dependency in #extraExample1 (it has to be #asTextFromHtml instead of #asHtmlText). Replaces MorphicExtras-ct.276, which can be moved to the treated inbox. This commit is part of reconstruction of Objectland (also known as "The Worlds of Squeak"). For more information, see: http://forum.world.st/The-Inbox-MorphicExtras-ct-267-mcz-td5104764.html =============== Diff against MorphicExtras-mt.280 =============== Item was added: + ----- Method: Workspace class>>extraExample1 (in category '*MorphicExtras-examples') ----- + extraExample1 + "ToolBuilder open: Workspace extraExample1" + + | quoteAttributes | + quoteAttributes := {TextEmphasis bold. TextColor color: Color mocha}. + ^ Workspace new + contents: (Text streamContents: [:stream | ({ + '"When in doubt, try it out!!"' asTextFromHtml + addAllAttributes: quoteAttributes; + yourself. + '-- Dan Ingalls' asText + addAllAttributes: quoteAttributes; + addAttribute: TextAlignment rightFlush; + yourself. + String empty. } + , ((self class sourceCodeAt: #extraExampleContents1) asString lines allButFirst: 3) + do: [:line | stream nextPutAll: line] + separatedBy: [stream cr])]); + shouldStyle: false; + yourself! Item was added: + ----- Method: Workspace class>>extraExample2 (in category '*MorphicExtras-examples') ----- + extraExample2 + "ToolBuilder open: Workspace extraExample2" + + ^ self new + contents: (((self class sourceCodeAt: #extraExampleContents2) + asString lines allButFirst: 3) + joinSeparatedBy: Character cr); + yourself! Item was added: + ----- Method: Workspace class>>extraExampleContents1 (in category '*MorphicExtras-examples') ----- + extraExampleContents1 + "This is example code for #extraExample1" + + "Run the following lines by pressing d:" + Transcript showln: 'Hello world!!'. + self inform: 'This is a dialog box. Quite easy, isn''t it?'. + + "Print the result of an expression using p" + 6 * 7. + Float pi i exp stringForReadout. + (16 factorial + 1) isPrime. + (Smalltalk allClasses gather: #selectors) size.! Item was added: + ----- Method: Workspace class>>extraExampleContents2 (in category '*MorphicExtras-examples') ----- + extraExampleContents2 + "This is example code for #extraExample2" + + "Inspect any (sub)expression result by pressing i" + (20 to: 40 by: 2) asOrderedCollection + addFirst: 16; + addLast: 42; + sort: [:x | x \\ 3] descending; + yourself. + + "Explore any (sub)expression result by pressing I" + Project current world. + + "Debug any (sub)expression using D" + (1 to: 9) join asNumber sqrt truncateTo: 1e-3. + (SystemWindow windowsIn: ActiveWorld) + select: [:window | window bounds isWide] + thenDo: [:window | window color: window color negated].! From tim at rowledge.org Wed Dec 16 18:30:42 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 16 Dec 2020 10:30:42 -0800 Subject: [squeak-dev] Squeak badges and other exciting swag Message-ID: <574B5901-A47A-4C42-8E20-65B669A736B5@rowledge.org> The Squeak 25th anniversary is fast approaching. You need badges, and T-shirts, and edible underwear, to help celebrate. Now, a long time ago I made a batch of exceedingly nice enamel pins and quite a few people still (I hope!) have them - but there are several batches out there around the world that I sent out to make local shipping easier. I know Craig has some but who else ? We also have a Spreadshirt site with our logo available on pretty much any kind of shirt, mug, apron (?), phone case, whatever - see https://shop.spreadshirt.com/Squeak/ tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: CPM: Change Programmer's Mind From asqueaker at gmail.com Wed Dec 16 19:30:56 2020 From: asqueaker at gmail.com (Chris Muller) Date: Wed, 16 Dec 2020 13:30:56 -0600 Subject: [squeak-dev] "Move to" is somehow broken in SqueakSource's Web Interface In-Reply-To: References: Message-ID: That version exists twice across all repositories, both in /trunk, once as Kernel-ct.1300.2020-11-04.10-39-54, and also as Kernel-ct.1300.mcz. They both produce the same md5 checksum. Yes, I can't believe "Move" isn't working, let's pay attention to see if it happens again. On Wed, Dec 16, 2020 at 5:13 AM Marcel Taeumel wrote: > I now moved them to Treated. Let's see how this works out... > > Best, > Marcel > > Am 16.12.2020 11:27:03 schrieb Marcel Taeumel : > Hi all! > > Inbox commits keep on reappearing even after moved to Trunk: > > http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html > http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html > http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html > > First moved on March 03, then again on November 04, it is now back in the > Inbox again. > > -.-" > > Who has access to SqueakSource and can take a look at it? > > Best, > Marcel > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Dec 16 22:52:07 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 16 Dec 2020 14:52:07 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises Message-ID: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> I've discovered that playing two or more sounds simultaneously can make truly appalling noises. I'm hoping somebody has a good solution. The problem started with playing a sound and using the pianokeyboardmorph at the same time. Ouch! Also, swizzling the mouse across the keyboard causes occasional quite audible 'scratchy-clicks' somehow. There can also be a quite noticeable sound between notes, not easily describable but sort of a 'dull thump'. I thought it was some issue with how the sound was played, maybe the note-end process as each piano key was released and the next pressed, timing issues.. but none of that had very much effect. The AbstractSound>>#stopGracefully method does seem to have a small bug, in that the decayInMs value surely ought not be the sum of the attack & decay times from the envelope? But carefully fudging the note shutdown to be faster didn't help a lot. After too much messing around I discovered that at least some of the problem is the mixing of sounds. Now, I know we did a small change to MixedSound>>#add:pan:volume: since 5.3, and that we made a small change to the SampledSound>>#mixSampleCount:into:startingAt:leftVol:rightVol: primitive. However, I'm running on a VM that has the prim change, and I've ported across the add:pan... change, with no real difference. This is, of course, on a Pi, but the same issue is audible on my iMac as well. Eventually I cottoned on to the fact that I was mixing two sounds with volumes set to 100%. Changing to 50% for both actually results in a perfectly fine end result - Yay! This doesn't seem like a robust solution though. What if I have four sounds playing each set to 40%? Why does it seem to work perfectly well for AbstractSound>>#stereoBachFugue play, which uses four? To make life even more fun, it doesn't seem like there is any volume control once a sound is playing. The AbstractSound>>#adjustVolumeTo:overMSecs: method appears to be the one to use but it has no audible effect. There is also #loudness: which does work, but produces pretty much exactly the glitch I hear from glissandoing(?) the keyboard. So - some workspace code to illustrate "awful noise when mixing" |snd| snd := FMSound organ1. snd setPitch: 440 dur: 10 loudness: 0.9; play. 1 second wait. FMSound brass1 setPitch: 470 dur:2 loudness: 0.9; play. 1 second wait. snd stopGracefully "OK, because both sound defualt to quieter" |snd | snd := FMSound organ1. snd duration: 5; play. 1 second wait. FMSound brass1 play. 1 second wait. snd stopGracefully. "nasty glitch using #loudness: plus mixing graunch" |snd | snd := FMSound organ1. snd duration: 5; play. 1 second wait. snd loudness: 1.0 . 1 second wait. FMSound brass1 play. 1 second wait. snd stopGracefully. "no effect from adjustVol..." |snd | snd := FMSound organ1. snd duration: 5; play. 1 second wait. snd adjustVolumeTo: 1.0 overMSecs: 500. 1 second wait. FMSound brass1 play. 1 second wait. snd stopGracefully. Aargh! tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim A computer program does what you tell it to do, not what you want it to do. From marcel.taeumel at hpi.de Thu Dec 17 07:33:47 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 17 Dec 2020 08:33:47 +0100 Subject: [squeak-dev] "Move to" is somehow broken in SqueakSource's Web Interface In-Reply-To: References: Message-ID: > Yes, I can't believe "Move" isn't working, let's pay attention to see if it happens again. Ah, sorry. I meant, that the "delete/cut" part of the "move" operation is not working properly in the long term. Versions keep on re-appearing in the Inbox after a while. Not sure, why. It somewhat impairs manual inbox processing. ^__^ Best, Marcel Am 16.12.2020 20:31:43 schrieb Chris Muller : That version exists twice across all repositories, both in /trunk, once as Kernel-ct.1300.2020-11-04.10-39-54, and also as Kernel-ct.1300.mcz.  They both produce the same md5 checksum. Yes, I can't believe "Move" isn't working, let's pay attention to see if it happens again. On Wed, Dec 16, 2020 at 5:13 AM Marcel Taeumel wrote: I now moved them to Treated. Let's see how this works out... Best, Marcel Am 16.12.2020 11:27:03 schrieb Marcel Taeumel : Hi all! Inbox commits keep on reappearing even after moved to Trunk: http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html [http://forum.world.st/The-Inbox-Kernel-ct-1300-mcz-tp5111778.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5112828.html] http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html [http://forum.world.st/The-Trunk-Kernel-ct-1300-mcz-tp5124375.html] First moved on March 03, then again on November 04, it is now back in the Inbox again. -.-" Who has access to SqueakSource and can take a look at it? Best, Marcel -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marcel.Taeumel at hpi.de Thu Dec 17 11:48:32 2020 From: Marcel.Taeumel at hpi.de (marcel.taeumel) Date: Thu, 17 Dec 2020 05:48:32 -0600 (CST) Subject: [squeak-dev] The Inbox: Collections-nice.869.mcz In-Reply-To: References: Message-ID: <1608205712090-0.post@n4.nabble.com> Hi all! I am in favor of improving RunArray. Treating RunArray as "array with run-length encoding" breaks information hiding by expecting a specific implementation strategy. RunArray feels like Bag, but ordered. Maybe "Collections-Abstract" deserves a new direct subclass? CompressedCollection? And then Bag and OrderedBag are two examples for such compression? We have already "Collections-Support", which lists several support classes such as "Bitset" and "CharacterSet". Such classes do not comply with the usual collection protocol anyway. For example, there is CharacterSet >> #canBeEnumerated. Maybe RunArray can go there and also help OrderedBag come to be? :-) Then, RunArray may also have its special semantics. Best, Marcel commits-2 wrote > Nicolas Cellier uploaded a new version of Collections to project The > Inbox: > http://source.squeak.org/inbox/Collections-nice.869.mcz > > ==================== Summary ==================== > > Name: Collections-nice.869 > Author: nice > Time: 31 December 2019, 11:14:43.388306 pm > UUID: e5a9bef5-16d3-4d8a-bf08-040d30e4e907 > Ancestors: Collections-nice.868 > > Remaster Collections-nice.464: opimize RunArray > > This should not be noticeable for Text, but as a general library, it's > important for any other potential use. > > Among those optimizations, notice one important change: some of the > enumerating methods like #collect: won't iterate on each element, but only > once per run. Be aware that providing blocks with side effects like (i := > i + 1) might lead to different behavior than ordinary ArrayedCollection. > > Move RunArray off ArrayedCollection which serves nothing to such subclass. > > Add the ability to remove: since it already has the hability to addFirst: > and addLast: > > Fix a few missing lastIndex cache flush, and advertise about the necessity > to do it in class comment. > > Deprecate mapValues: to the profit of replace:. > > =============== Diff against Collections-nice.868 =============== > > Item was changed: > + SequenceableCollection subclass: #RunArray > - ArrayedCollection subclass: #RunArray > instanceVariableNames: 'runs values lastIndex lastRun lastOffset' > classVariableNames: '' > poolDictionaries: '' > category: 'Collections-Arrayed'! > > + !RunArray commentStamp: 'nice 12/30/2019 00:57' prior: 0! > - !RunArray commentStamp: ' > > ' prior: 0! > My instances provide space-efficient storage of data which tends to be > constant over long runs of the possible indices. Essentially repeated > values are stored singly and then associated with a "run" length that > denotes the number of consecutive occurrences of the value. > > My two important variables are > runs An array of how many elements are in each run > values An array of what the value is over those elements > > The variables lastIndex, lastRun and lastOffset cache the last access > so that streaming through RunArrays is not an N-squared process. > + Beware: methods modifying the RunArray contents should reset the > lastIndex cache to nil. > > Many complexities of access can be bypassed by using the method > RunArray withStartStopAndValueDo:! > > Item was changed: > ----- Method: RunArray class>>newFrom: (in category 'instance creation') > ----- > newFrom: aCollection > "Answer an instance of me containing the same elements as aCollection." > > | newCollection | > newCollection := self new. > + newCollection fillFrom: aCollection with: [:each | each]. > - aCollection do: [:x | newCollection addLast: x]. > ^newCollection > > " RunArray newFrom: {1. 2. 2. 3} > {1. $a. $a. 3} as: RunArray > ({1. $a. $a. 3} as: RunArray) values > "! > > Item was added: > + ----- Method: RunArray>>allSatisfy: (in category 'enumerating') ----- > + allSatisfy: aBlock > + "Only evaluate once per run" > + > + ^values allSatisfy: aBlock! > > Item was added: > + ----- Method: RunArray>>anySatisfy: (in category 'enumerating') ----- > + anySatisfy: aBlock > + "Only evaluate once per run" > + > + ^values anySatisfy: aBlock! > > Item was added: > + ----- Method: RunArray>>asBag (in category 'converting') ----- > + asBag > + | aBag | > + aBag := Bag new: values size. > + self runsAndValuesDo: [:run :value | > + aBag add: value withOccurrences: run]. > + ^aBag! > > Item was added: > + ----- Method: RunArray>>asSet (in category 'converting') ----- > + asSet > + ^values asSet! > > Item was changed: > + ----- Method: RunArray>>coalesce (in category 'private') ----- > - ----- Method: RunArray>>coalesce (in category 'adding') ----- > coalesce > + "Coalesce theRuns and theValues if ever the values have adjacent equal > objects" > + > + | lastLength lastValue mustCoalesce coalescedRuns coalescedValued > runIndex | > + mustCoalesce := false. > + runIndex := 0. > + lastLength := 0. > + lastValue := Object new. > + runs with: values do: [:run :value | > + (lastValue = value or: [run = 0]) > + ifTrue: > + [mustCoalesce > + ifFalse: > + [coalescedRuns := (Array new: runs size) writeStream. > + coalescedValued := (Array new: values size) writeStream. > + coalescedRuns next: runIndex putAll: runs startingAt: 1. > + coalescedValued next: runIndex putAll: values startingAt: 1. > + mustCoalesce := true]. > + lastLength := lastLength + run] > + ifFalse: > + [lastLength > 0 > + ifTrue: > + [mustCoalesce > + ifTrue: > + [coalescedRuns nextPut: lastLength. > + coalescedValued nextPut: lastValue]. > + runIndex := runIndex + 1]. > + lastLength := run. > + lastValue := value]]. > + mustCoalesce > + ifTrue: > + [lastLength > 0 > + ifTrue: > + [coalescedRuns nextPut: lastLength. > + coalescedValued nextPut: lastValue]. > + self setRuns: coalescedRuns contents setValues: coalescedValued > contents]! > - "Try to combine adjacent runs" > - | ind | > - ind := 2. > - [ind > values size] whileFalse: [ > - (values at: ind-1) = (values at: ind) > - ifFalse: [ind := ind + 1] > - ifTrue: ["two are the same, combine them" > - values := values copyReplaceFrom: ind to: ind with: #(). > - runs at: ind-1 put: (runs at: ind-1) + (runs at: ind). > - runs := runs copyReplaceFrom: ind to: ind with: #(). > - "self error: 'needed to combine runs' "]]. > - ! > > Item was added: > + ----- Method: RunArray>>collect: (in category 'enumerating') ----- > + collect: aBlock > + "Beware, the block will be evaluated only once per group of values." > + ^(self class runs: runs copy values: (values collect: aBlock)) > coalesce! > > Item was added: > + ----- Method: RunArray>>copyUpThrough: (in category 'copying') ----- > + copyUpThrough: value > + "Optimized" > + > + | newSize newValues newRuns | > + newSize := values indexOf: value startingAt: 1. > + newSize = 0 ifTrue: [^self copy]. > + newRuns := runs copyFrom: 1 to: newSize. > + newRuns at: newSize put: 1. > + newValues := values copyFrom: 1 to: newSize. > + ^ self class > + runs: newRuns > + values: newValues! > > Item was added: > + ----- Method: RunArray>>copyUpTo: (in category 'copying') ----- > + copyUpTo: anElement > + "Optimized" > + > + | newValues | > + newValues := values copyUpTo: anElement. > + ^ self class > + runs: (runs copyFrom: 1 to: newValues size) > + values: newValues! > > Item was added: > + ----- Method: RunArray>>copyUpToLast: (in category 'copying') ----- > + copyUpToLast: value > + "Optimized" > + > + | newSize run newRuns newValues | > + newSize := values lastIndexOf: value startingAt: values size. > + newSize = 0 ifTrue: [^self copy]. > + run := runs at: newSize. > + run > 1 > + ifTrue: > + [newRuns := runs copyFrom: 1 to: newSize. > + newRuns at: newSize put: run - 1] > + ifFalse: > + [newSize := newSize - 1. > + newRuns := runs copyFrom: 1 to: newSize]. > + newValues := values copyFrom: 1 to: newSize. > + ^ self class > + runs: newRuns > + values: newValues! > > Item was added: > + ----- Method: RunArray>>count: (in category 'enumerating') ----- > + count: aBlock > + "Beware, the block will be evaluated only once per group of values." > + | count | > + count := 0. > + self runsAndValuesDo: [:run :value | > + (aBlock value: value) > + ifTrue: > + [count := count + run]]. > + ^count! > > Item was added: > + ----- Method: RunArray>>detect:ifNone: (in category 'enumerating') ----- > + detect: aBlock ifNone: exceptionBlock > + "Only evaluate once per run" > + > + ^values detect: aBlock ifNone: exceptionBlock ! > > Item was added: > + ----- Method: RunArray>>detectMax: (in category 'enumerating') ----- > + detectMax: aBlock > + "Only evaluate once per run" > + > + ^values detectMax: aBlock! > > Item was added: > + ----- Method: RunArray>>detectMin: (in category 'enumerating') ----- > + detectMin: aBlock > + "Only evaluate once per run" > + > + ^values detectMin: aBlock! > > Item was added: > + ----- Method: RunArray>>detectSum: (in category 'enumerating') ----- > + detectSum: aBlock > + "Only loop on runs" > + | sum | > + sum := 0. > + self runsAndValuesDo: [:run :value | > + sum := (aBlock value: value) * run + sum]. > + ^ sum! > > Item was added: > + ----- Method: RunArray>>do: (in category 'enumerating') ----- > + do: aBlock > + "This is refined for speed" > + > + 1 to: runs size do: [:i | > + | r v | > + v := values at: i. > + r := runs at: i. > + [( r := r - 1) >= 0] > + whileTrue: [aBlock value: v]].! > > Item was added: > + ----- Method: RunArray>>fillFrom:with: (in category 'private') ----- > + fillFrom: aCollection with: aBlock > + "Evaluate aBlock with each of aCollections's elements as the argument. > + Collect the resulting values into self. Answer self." > + > + | newRuns newValues lastLength lastValue | > + newRuns := (Array new: aCollection size) writeStream. > + newValues := (Array new: aCollection size) writeStream. > + lastLength := 0. > + lastValue := Object new. > + lastIndex := nil. "flush access cache" > + aCollection do: [:each | > + | value | > + value := aBlock value: each. > + lastValue = value > + ifTrue: [lastLength := lastLength + 1] > + ifFalse: > + [lastLength > 0 > + ifTrue: > + [newRuns nextPut: lastLength. > + newValues nextPut: lastValue]. > + lastLength := 1. > + lastValue := value]]. > + lastLength > 0 > + ifTrue: > + [newRuns nextPut: lastLength. > + newValues nextPut: lastValue]. > + self setRuns: newRuns contents setValues: newValues contents! > > Item was added: > + ----- Method: RunArray>>findFirst: (in category 'enumerating') ----- > + findFirst: aBlock > + | index | > + index := 1. > + self runsAndValuesDo: [ :run :value | > + (aBlock value: value) ifTrue: [^index]. > + index := index + run]. > + ^0! > > Item was added: > + ----- Method: RunArray>>findLast: (in category 'enumerating') ----- > + findLast: aBlock > + | index | > + index := values size + 1. > + [(index := index - 1) >= 1] whileTrue: > + [(aBlock value: (values at: index)) ifTrue: [^(1 to: index) detectSum: > [:i | runs at: i]]]. > + ^0! > > Item was added: > + ----- Method: RunArray>>includes: (in category 'testing') ----- > + includes: anObject > + "Answer whether anObject is one of the receiver's elements." > + > + ^values includes: anObject! > > Item was added: > + ----- Method: RunArray>>indexOf:startingAt: (in category 'accessing') > ----- > + indexOf: anElement startingAt: start > + "Answer the index of the first occurence of anElement after start > + within the receiver. If the receiver does not contain anElement, > + answer 0." > + > + | index | > + index := 1. > + self runsAndValuesDo: [ :run :value | > + (index >= start and: [value = anElement]) ifTrue: [^index]. > + index := index + run]. > + ^0! > > Item was added: > + ----- Method: RunArray>>indexOfAnyOf:startingAt: (in category > 'accessing') ----- > + indexOfAnyOf: aCollection startingAt: start > + "Answer the index of the first occurence of any element included in > aCollection after start within the receiver. > + If the receiver does not contain anElement, answer zero, which is an > invalid index." > + > + | index | > + index := 1. > + self runsAndValuesDo: [ :run :value | > + (index >= start and: [aCollection includes: value]) ifTrue: [^index]. > + index := index + run]. > + ^0! > > Item was added: > + ----- Method: RunArray>>isSorted (in category 'testing') ----- > + isSorted > + ^values isSorted! > > Item was added: > + ----- Method: RunArray>>isSortedBy: (in category 'testing') ----- > + isSortedBy: aBlock > + ^values isSortedBy: aBlock! > > Item was added: > + ----- Method: RunArray>>lastIndexOf:startingAt: (in category > 'accessing') ----- > + lastIndexOf: anElement startingAt: lastIndex > + "Answer the index of the last occurence of anElement within the > + receiver. If the receiver does not contain anElement, answer 0." > + > + | lastValueIndex | > + lastValueIndex := values lastIndexOf: anElement startingAt: values > size. > + [lastValueIndex > 0] whileTrue: > + [| i index | > + i := index := 0. > + [index <= lastIndex and: [(i := i + 1) <= lastValueIndex]] > + whileTrue: [index := index + (runs at: i)]. > + index <= lastIndex ifTrue: [^index]. > + index - (runs at: lastValueIndex) < lastIndex ifTrue: [^lastIndex]. > + lastValueIndex := values lastIndexOf: anElement startingAt: > lastValueIndex - 1]. > + ^0! > > Item was added: > + ----- Method: RunArray>>lastIndexOfAnyOf:startingAt: (in category > 'accessing') ----- > + lastIndexOfAnyOf: aCollection startingAt: lastIndex > + "Answer the index of the last occurence of any element of aCollection > + within the receiver. If the receiver does not contain any of those > + elements, answer 0" > + > + | lastValueIndex | > + lastValueIndex := values lastIndexOfAnyOf: aCollection startingAt: > values size. > + [lastValueIndex > 0] whileTrue: > + [| i index | > + i := index := 0. > + [index <= lastIndex and: [(i := i + 1) <= lastValueIndex]] > + whileTrue: [index := index + (runs at: i)]. > + index <= lastIndex ifTrue: [^index]. > + index - (runs at: lastValueIndex) < lastIndex ifTrue: [^lastIndex]. > + lastValueIndex := values lastIndexOfAnyOf: aCollection startingAt: > lastValueIndex - 1]. > + ^0! > > Item was removed: > - ----- Method: RunArray>>mapValues: (in category 'private') ----- > - mapValues: mapBlock > - "NOTE: only meaningful to an entire set of runs" > - > - values := values collect: mapBlock! > > Item was added: > + ----- Method: RunArray>>noneSatisfy: (in category 'enumerating') ----- > + noneSatisfy: aBlock > + "Only evaluate once per run" > + > + ^values noneSatisfy: aBlock! > > Item was changed: > + ----- Method: RunArray>>rangeOf:startingAt: (in category 'accessing') > ----- > - ----- Method: RunArray>>rangeOf:startingAt: (in category 'adding') ----- > rangeOf: attr startingAt: startPos > "Answer an interval that gives the range of attr at index position > startPos. An empty interval with start value startPos is returned when the > attribute attr is not present at position startPos. self size > 0 is > assumed, it is the responsibility of the caller to test for emptiness of > self. > Note that an attribute may span several adjancent runs. " > > self at: startPos > setRunOffsetAndValue: > [:run :offset :value | > ^(value includes: attr) > ifFalse: [startPos to: startPos - 1] > ifTrue: > [ | firstRelevantPosition lastRelevantPosition > idxOfCandidateRun | > lastRelevantPosition := startPos - offset + (runs > at: run) - 1. > firstRelevantPosition := startPos - offset. > idxOfCandidateRun := run + 1. > [idxOfCandidateRun <= runs size > and: [(values at: idxOfCandidateRun) > includes: attr]] > whileTrue: > [lastRelevantPosition := lastRelevantPosition > + (runs at: idxOfCandidateRun). > idxOfCandidateRun := idxOfCandidateRun + 1]. > idxOfCandidateRun := run - 1. > [idxOfCandidateRun >= 1 > and: [(values at: idxOfCandidateRun) > includes: attr]] > whileTrue: > [firstRelevantPosition := > firstRelevantPosition - (runs at: idxOfCandidateRun). > idxOfCandidateRun := idxOfCandidateRun - 1]. > > firstRelevantPosition to: lastRelevantPosition] > ]! > > Item was added: > + ----- Method: RunArray>>remove:ifAbsent: (in category 'removing') ----- > + remove: anObject ifAbsent: exceptionBlock > + | index mustCoalesce run | > + lastIndex := nil. "flush access cache" > + index := values indexOf: anObject ifAbsent: [^exceptionBlock value]. > + (run := runs at: index) > 1 > + ifTrue: [runs at: index put: run - 1] > + ifFalse: > + [mustCoalesce := index > 1 and: [index < values size and: [(values > at: index - 1) = (values at: index + 1)]]. > + runs := runs copyWithoutIndex: index. > + values := values copyWithoutIndex: index. > + mustCoalesce > + ifTrue: > + [runs at: index - 1 put: (runs at: index - 1) + (runs at: index). > + runs := runs copyWithoutIndex: index. > + values := values copyWithoutIndex: index]]. > + ^anObject! > > Item was added: > + ----- Method: RunArray>>removeAll (in category 'removing') ----- > + removeAll > + lastIndex := nil. "flush access cache" > + runs := Array new. > + values := Array new! > > Item was added: > + ----- Method: RunArray>>replace: (in category 'enumerating') ----- > + replace: aBlock > + "destructively replace the values in this RunArray with the ones > transformed by aBlock." > + lastIndex := nil. "flush access cache" > + values := values replace: aBlock. > + self coalesce! > > Item was added: > + ----- Method: RunArray>>reverseDo: (in category 'enumerating') ----- > + reverseDo: aBlock > + "This is refined for speed" > + > + | i | > + i := runs size. > + [i > 0] > + whileTrue: > + [ | r v | > + v := values at: i. > + r := runs at: i. > + i := i - 1. > + [( r := r - 1) >= 0] > + whileTrue: [aBlock value: v]].! > > Item was added: > + ----- Method: RunArray>>select: (in category 'enumerating') ----- > + select: aBlock > + "Beware, the block will be evaluated only once per group of values." > + | newRuns newValues | > + newRuns := (Array new: runs size) writeStream. > + newValues := (Array new: values size) writeStream. > + self runsAndValuesDo: [:run :value | > + (aBlock value: value) > + ifTrue: > + [newRuns nextPut: run. > + newValues nextPut: value]]. > + ^(self class runs: newRuns contents values: newValues contents) > coalesce! > > Item was changed: > ----- Method: SequenceableCollection>>lastIndexOf:startingAt: (in > category 'accessing') ----- > lastIndexOf: anElement startingAt: lastIndex > "Answer the index of the last occurence of anElement within the > + receiver. If the receiver does not contain anElement, answer 0." > - receiver. If the receiver does not contain anElement, answer the > - result of evaluating the argument, exceptionBlock." > > lastIndex to: 1 by: -1 do: [ :index | > (self at: index) = anElement ifTrue: [ ^index ] ]. > ^0! > > Item was changed: > ----- Method: Text>>addAttribute:from:to: (in category 'emphasis') ----- > addAttribute: att from: start to: stop > "Set the attribute for characters in the interval start to stop." > runs := runs copyReplaceFrom: start to: stop > with: ((runs copyFrom: start to: stop) > + replace: > - mapValues: > [:attributes | Text addAttribute: att toArray: attributes]) > ! > > Item was changed: > ----- Method: Text>>removeAttribute:from:to: (in category 'emphasis') > ----- > removeAttribute: att from: start to: stop > "Remove the attribute over the interval start to stop." > runs := runs copyReplaceFrom: start to: stop > with: ((runs copyFrom: start to: stop) > + replace: > - mapValues: > [:attributes | attributes copyWithout: att]) > ! -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html From herbertkoenig at gmx.net Thu Dec 17 13:14:45 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 17 Dec 2020 14:14:45 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: Hi Tim, tl,dr Let's build a limiter. I stopped using Squeak for Audio with 3.8 :-) With that in mind: I believe that all sound goes out through SoundPlayer playing SoundBuffers. The samples get created via mixSsampleCountInto.... which seems to be implemented by many classes and there they all seem to do clipping. After running some of your examples I found several SoundBuffers containing samples 32767 and -32768 which indicates clipping.  I didn't find enough consecutive clipped samples (you shouldn't hear a single one) but that's because I only found a few SoundBuffers. BTW running your example labelled "OK because.." also clipped when run several times. I didn't find the place where float values are changed to Integers for output. I did not find any limiter. --> baaad! So if the above is true and the problem is really the clipping (I had the impression I also heard some wrapping where 32768 uses the top bit as a sign) I suggest: -No clipping during the mixing -Find the place where the SoundBuffers go to the hardware -Implement a limiter there Basically you need a controlled gain. You look ahead in your SoundBuffer for min and max. In case of overflow you calculate the necessary gain and gradually reduce your actual gain in the time you have until that sample really gets output. (attack phase). If no over/underflow is found you (more) gradually raise your gain back to 1 (release phase). Maybe introduce some delay before raising your gain again (hold phase). For live real time audio you may not have the luxury to look ahead. You still reduce your gain gradually (let's say in 10 ms) and clip until you reached your final gain. Human's ears tend to tolerate this. There's tons of compromises to evaluate with a limiter we should go with a bit over TSTTCPW to save CPU. Maybe have another preference to choose the system wide limiter. SCNR :-))) I can help with rough implementations and audiowise discussions but have no idea where to hook it in and cannot convert it to a primitive or optimize it. Let's wait until Stef chimes in, I'm sure he has solved that for muO already. Best regards, Herbert Am 16.12.2020 um 23:52 schrieb tim Rowledge: > I've discovered that playing two or more sounds simultaneously can make truly appalling noises. I'm hoping somebody has a good solution. > > The problem started with playing a sound and using the pianokeyboardmorph at the same time. Ouch! Also, swizzling the mouse across the keyboard causes occasional quite audible 'scratchy-clicks' somehow. There can also be a quite noticeable sound between notes, not easily describable but sort of a 'dull thump'. > > I thought it was some issue with how the sound was played, maybe the note-end process as each piano key was released and the next pressed, timing issues.. but none of that had very much effect. > > The AbstractSound>>#stopGracefully method does seem to have a small bug, in that the decayInMs value surely ought not be the sum of the attack & decay times from the envelope? But carefully fudging the note shutdown to be faster didn't help a lot. > > After too much messing around I discovered that at least some of the problem is the mixing of sounds. > > Now, I know we did a small change to MixedSound>>#add:pan:volume: since 5.3, and that we made a small change to the SampledSound>>#mixSampleCount:into:startingAt:leftVol:rightVol: primitive. However, I'm running on a VM that has the prim change, and I've ported across the add:pan... change, with no real difference. This is, of course, on a Pi, but the same issue is audible on my iMac as well. > > Eventually I cottoned on to the fact that I was mixing two sounds with volumes set to 100%. Changing to 50% for both actually results in a perfectly fine end result - Yay! This doesn't seem like a robust solution though. What if I have four sounds playing each set to 40%? Why does it seem to work perfectly well for AbstractSound>>#stereoBachFugue play, which uses four? > > To make life even more fun, it doesn't seem like there is any volume control once a sound is playing. The AbstractSound>>#adjustVolumeTo:overMSecs: method appears to be the one to use but it has no audible effect. There is also #loudness: which does work, but produces pretty much exactly the glitch I hear from glissandoing(?) the keyboard. > > So - some workspace code to illustrate > > "awful noise when mixing" > |snd| > snd := FMSound organ1. > snd setPitch: 440 dur: 10 loudness: 0.9; > play. > 1 second wait. > > FMSound brass1 setPitch: 470 dur:2 loudness: 0.9; > play. > 1 second wait. > snd stopGracefully > > "OK, because both sound defualt to quieter" > |snd | > snd := FMSound organ1. > snd > duration: 5; > play. > 1 second wait. > > FMSound brass1 > play. > > 1 second wait. > snd stopGracefully. > > "nasty glitch using #loudness: plus mixing graunch" > |snd | > snd := FMSound organ1. > snd duration: 5; > play. > 1 second wait. > snd loudness: 1.0 . > > 1 second wait. > FMSound brass1 > play. > > 1 second wait. > snd stopGracefully. > > > "no effect from adjustVol..." > |snd | > snd := FMSound organ1. > snd > duration: 5; > play. > 1 second wait. > snd adjustVolumeTo: 1.0 overMSecs: 500. > 1 second wait. > FMSound brass1 > play. > > 1 second wait. > snd stopGracefully. > > Aargh! > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > A computer program does what you tell it to do, not what you want it to do. > > > From commits at source.squeak.org Thu Dec 17 16:04:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 17 Dec 2020 16:04:15 0000 Subject: [squeak-dev] The Trunk: System-mt.1198.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1198.mcz ==================== Summary ==================== Name: System-mt.1198 Author: mt Time: 17 December 2020, 5:04:11.447084 pm UUID: 0e532d14-69bc-3e4f-9e1b-67f880aa3001 Ancestors: System-pre.1197, System-mt.1175 Refines System-mt.1175, which adds a way to compute a space tally for objects up to a certain depth. Updates class comment to provide more examples. (See http://forum.world.st/The-Inbox-System-mt-1175-mcz-tp5122678.html) =============== Diff against System-pre.1197 =============== Item was changed: Object subclass: #SpaceTally + instanceVariableNames: 'results depth' - instanceVariableNames: 'results' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! + !SpaceTally commentStamp: '' prior: 0! + I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem. - !SpaceTally commentStamp: 'sd 6/20/2003 22:31' prior: 0! - I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem + Here are some examples to inspect: + SpaceTally new spaceTally: (Array with: TextMorph with: Point). + SpaceTally new systemWideSpaceTally. + SpaceTally new depth: 2; spaceTally: (PackageInfo named: #Morphic) classes. + SpaceTally new depth: 1; spaceTally: (PackageInfo named: #Monticello) classes. "Includes cached source code" + SpaceTally new spaceForInstancesOf: Form depth: 2. "Includes bitmaps and large integers"! - try something like: - - ((SpaceTally new spaceTally: (Array with: TextMorph with: Point)) - asSortedCollection: [:a :b | a spaceForInstances > b spaceForInstances]) - - SpaceTally new systemWideSpaceTally - - - This class has been created from a part of SystemDictionary. It still deserves a nice - clean, such as using object instead of array having 4 slots. - - sd-20 June 2003! Item was changed: ----- Method: SpaceTally>>computeSpaceUsage (in category 'class analysis') ----- computeSpaceUsage + | seenObjects | + seenObjects := self depth > 0 ifTrue: [IdentitySet new]. results do: [ :entry | | class instanceSpaceAndCount | class := self class environment at: entry analyzedClassName. Smalltalk garbageCollectMost. + instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth seen: seenObjects. - instanceSpaceAndCount := self spaceForInstancesOf: class. entry codeSize: class spaceUsed; instanceCount: instanceSpaceAndCount second; + spaceForInstances: instanceSpaceAndCount first; + depthOfSpace: self depth ] - spaceForInstances: instanceSpaceAndCount first ] displayingProgress: 'Taking statistics...'! Item was added: + ----- Method: SpaceTally>>depth (in category 'accessing') ----- + depth + + ^ depth ifNil: [0]! Item was added: + ----- Method: SpaceTally>>depth: (in category 'accessing') ----- + depth: anInteger + + depth := anInteger.! Item was added: + ----- Method: SpaceTally>>spaceForInstance: (in category 'instance size') ----- + spaceForInstance: anObject + + ^ self spaceForInstance: anObject depth: self depth! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger + + ^ self spaceForInstance: anObject depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger seen: seenObjectsOrNil + + | ctxt class basicSize depth total | + seenObjectsOrNil ifNotNil: [ + (seenObjectsOrNil ifAbsentAdd: anObject) ifFalse: [^ 0]]. + ctxt := thisContext. + class := ctxt objectClass: anObject. + basicSize := 0. + total := class isVariable + ifTrue: [class byteSizeOfInstanceOfSize: (basicSize := ctxt objectSize: anObject)] + ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class byteSizeOfInstance]]. + (depth := anInteger - 1) >= 0 ifTrue: [ + anObject isCompiledCode + ifTrue: [ + anObject literalsDo: [:literal | + total := total + (self spaceForInstance: literal depth: depth seen: seenObjectsOrNil)]] + ifFalse: [ + 1 to: basicSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject basicAt: index) depth: depth seen: seenObjectsOrNil)]. + 1 to: class instSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject instVarAt: index) depth: depth seen: seenObjectsOrNil)]]]. + ^ total! Item was changed: ----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') ----- spaceForInstancesOf: aClass - "Answer a pair of the number of bytes consumed by all instances of the - given class, including their object headers, and the number of instances." + ^ self spaceForInstancesOf: aClass depth: self depth! - | instances total | - instances := aClass allInstances. - instances isEmpty ifTrue: [^#(0 0)]. - total := 0. - aClass isVariable - ifTrue: - [instances do: - [:i| total := total + (aClass byteSizeOfInstanceOfSize: i basicSize)]] - ifFalse: - [total := instances size * aClass byteSizeOfInstance]. - ^{ total. instances size }! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger + + ^ self spaceForInstancesOf: aClass depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth:seen: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger seen: seenObjects + "Answer a pair of the number of bytes consumed by all instances of the given class, including their object headers, and the number of instances. Follow each instance's fields up to the given depth. Beware of cycles to shared objects, which will tamper the resulting numbers. + + SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as #spaceForInstancesOf: + SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory footprint for bits etc. + SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes LargePositiveIntegers in bitmaps ;-) + " + + | instances total | + instances := aClass allInstances. + instances isEmpty ifTrue: [^#(0 0)]. + total := 0. + instances do: [:each | total := total + (self spaceForInstance: each depth: anInteger seen: seenObjects)]. + ^{ total. instances size }! Item was changed: Object subclass: #SpaceTallyItem + instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances depthOfSpace' - instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! !SpaceTallyItem commentStamp: 'sd 6/20/2003 22:02' prior: 0! I'm represent an entry in the spaceTally.! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace (in category 'accessing') ----- + depthOfSpace + + ^ depthOfSpace! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace: (in category 'accessing') ----- + depthOfSpace: aNumber + + depthOfSpace := aNumber! Item was changed: ----- Method: SpaceTallyItem>>printOn: (in category 'printing') ----- printOn: aStream analyzedClassName ifNotNil: [ aStream nextPutAll: analyzedClassName asString]. aStream nextPutAll: ' ('. codeSize ifNotNil: [ aStream nextPutAll: 'code size: ' ; nextPutAll: codeSize asString]. instanceCount ifNotNil: [ aStream nextPutAll: ' instance count: ' ; nextPutAll: instanceCount asString]. spaceForInstances ifNotNil: [ aStream nextPutAll: ' space for instances: ' ; nextPutAll: spaceForInstances asBytesDescription]. + depthOfSpace + ifNotNil: [ aStream nextPutAll: ' depth of space: ' ; nextPutAll: depthOfSpace asString]. aStream nextPut: $). ! From commits at source.squeak.org Thu Dec 17 16:10:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 17 Dec 2020 16:10:09 0000 Subject: [squeak-dev] The Trunk: System-mt.1175.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1175.mcz ==================== Summary ==================== Name: System-mt.1175 Author: mt Time: 29 September 2020, 1:16:45.233157 pm UUID: f0acc060-a48b-2c4f-8b56-aaf2f55601b4 Ancestors: System-topa.1174 Adds a way to compute a space tally for objects up to a certain depth. Questions: - Is the interface (i.e. "depth" and "seen") OK? - Is the use of IdentitySet OK? - Can we speed this up somehow? - Do we need depth-messages for the "class analysis" protocol, too? =============== Diff against System-topa.1174 =============== Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger + + ^ self spaceForInstance: anObject depth: anInteger seen: IdentitySet new! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger seen: someObjects + + | class depth total | + (someObjects includes: anObject) ifTrue: [^ 0]. + someObjects add: anObject. + class := anObject class. + depth := anInteger - 1. + total := class isVariable + ifTrue: [class byteSizeOfInstanceOfSize: anObject basicSize] + ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class byteSizeOfInstance]]. + depth >= 0 ifTrue: [ + anObject isCompiledCode + ifTrue: [ + anObject literalsDo: [:literal | + total := total + (self spaceForInstance: literal depth: depth seen: someObjects)]] + ifFalse: [ + 1 to: anObject basicSize do: [:index | + total := total + (self spaceForInstance: (anObject basicAt: index) depth: depth seen: someObjects)]. + 1 to: class instSize do: [:index | + total := total + (self spaceForInstance: (anObject instVarAt: index) depth: depth seen: someObjects)]]]. + ^ total! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: aNumber + "Answer a pair of the number of bytes consumed by all instances of the given class, including their object headers, and the number of instances. Follow each instance's fields up to the given depth. Beware of cycles to shared objects, which will tamper the resulting numbers. + + SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as #spaceForInstanecsOf: + SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory footprint for bits etc. + SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes LargePositiveIntegers in bitmaps ;-) + " + + | instances total sub depth | + instances := aClass allInstances. + instances isEmpty ifTrue: [^#(0 0)]. + total := 0. + instances do: [:each | total := total + (self spaceForInstance: each depth: aNumber)]. + ^{ total. instances size }! From Marcel.Taeumel at hpi.de Thu Dec 17 16:17:37 2020 From: Marcel.Taeumel at hpi.de (marcel.taeumel) Date: Thu, 17 Dec 2020 10:17:37 -0600 (CST) Subject: [squeak-dev] The Inbox: System-mt.1175.mcz In-Reply-To: References: Message-ID: <1608221857295-0.post@n4.nabble.com> Hi Levente, hi Chris. Thanks for the suggestions! I put the changes into Trunk. > [1] I wrote some code using various optimizations. If you want me to, I > can upload it to the Inbox with or without mirror primitives. Feel free to further optimize SpaceTally >> #spaceForInstance:depth:seen:. Yes, proxy classes should work, too. Best, Marcel Levente Uzonyi wrote > Hi Marcel, > > On Tue, 29 Sep 2020, > commits at .squeak > wrote: > >> A new version of System was added to project The Inbox: >> http://source.squeak.org/inbox/System-mt.1175.mcz >> >> ==================== Summary ==================== >> >> Name: System-mt.1175 >> Author: mt >> Time: 29 September 2020, 1:16:45.233157 pm >> UUID: f0acc060-a48b-2c4f-8b56-aaf2f55601b4 >> Ancestors: System-topa.1174 >> >> Adds a way to compute a space tally for objects up to a certain depth. >> >> Questions: >> - Is the interface (i.e. "depth" and "seen") OK? > > Yes, except for the variable names. IMHO they should be called depth and > seenObjects instead of anInteger and someObjects, respectively. > >> - Is the use of IdentitySet OK? > > Yes, it is, however the set should be shared when you iterate over > #allInstances to avoid calculating duplicates. > >> - Can we speed this up somehow? > > Yes. 2x speedup is possible[1] for Forms with depth 2. However, the code > only > works for Objects, so the first non-Object proxy will halt the code. > If you want to make it work for all objects, you'll have to use mirror > primitives, which will reduce the speedup to about 1.25x. > >> - Do we need depth-messages for the "class analysis" protocol, too? > > No idea, never really used SpaceTally :) > > > Levente > > [1] I wrote some code using various optimizations. If you want me to, I > can upload it to the Inbox with or without mirror primitives. > >> >> =============== Diff against System-topa.1174 =============== >> >> Item was added: >> + ----- Method: SpaceTally>>spaceForInstance:depth: (in category >> 'instance size') ----- >> + spaceForInstance: anObject depth: anInteger >> + >> + ^ self spaceForInstance: anObject depth: anInteger seen: IdentitySet >> new! >> >> Item was added: >> + ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category >> 'instance size') ----- >> + spaceForInstance: anObject depth: anInteger seen: someObjects >> + >> + | class depth total | >> + (someObjects includes: anObject) ifTrue: [^ 0]. >> + someObjects add: anObject. >> + class := anObject class. >> + depth := anInteger - 1. >> + total := class isVariable >> + ifTrue: [class byteSizeOfInstanceOfSize: anObject basicSize] >> + ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class >> byteSizeOfInstance]]. >> + depth >= 0 ifTrue: [ >> + anObject isCompiledCode >> + ifTrue: [ >> + anObject literalsDo: [:literal | >> + total := total + (self spaceForInstance: literal depth: depth >> seen: someObjects)]] >> + ifFalse: [ >> + 1 to: anObject basicSize do: [:index | >> + total := total + (self spaceForInstance: (anObject basicAt: index) >> depth: depth seen: someObjects)]. >> + 1 to: class instSize do: [:index | >> + total := total + (self spaceForInstance: (anObject instVarAt: >> index) depth: depth seen: someObjects)]]]. >> + ^ total! >> >> Item was added: >> + ----- Method: SpaceTally>>spaceForInstancesOf:depth: (in category >> 'instance size') ----- >> + spaceForInstancesOf: aClass depth: aNumber >> + "Answer a pair of the number of bytes consumed by all instances of the >> given class, including their object headers, and the number of instances. >> Follow each instance's fields up to the given depth. Beware of cycles to >> shared objects, which will tamper the resulting numbers. >> + >> + SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as >> #spaceForInstanecsOf: >> + SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory >> footprint for bits etc. >> + SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes >> LargePositiveIntegers in bitmaps ;-) >> + " >> + >> + | instances total sub depth | >> + instances := aClass allInstances. >> + instances isEmpty ifTrue: [^#(0 0)]. >> + total := 0. >> + instances do: [:each | total := total + (self spaceForInstance: each >> depth: aNumber)]. >> + ^{ total. instances size }! -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html From marcel.taeumel at hpi.de Thu Dec 17 16:39:11 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 17 Dec 2020 17:39:11 +0100 Subject: [squeak-dev] The Trunk: System-mt.1198.mcz In-Reply-To: References: Message-ID: Hmmm... this one generates LargePositiveIntegers while counting ... it never finishes: SpaceTally new spaceForInstancesOf: Bitmap depth: 1.  Any ideas? =) The use of IdentitySet for depth > 0 might require some blacklisting ... Best, Marcel Am 17.12.2020 17:04:33 schrieb commits at source.squeak.org : Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1198.mcz ==================== Summary ==================== Name: System-mt.1198 Author: mt Time: 17 December 2020, 5:04:11.447084 pm UUID: 0e532d14-69bc-3e4f-9e1b-67f880aa3001 Ancestors: System-pre.1197, System-mt.1175 Refines System-mt.1175, which adds a way to compute a space tally for objects up to a certain depth. Updates class comment to provide more examples. (See http://forum.world.st/The-Inbox-System-mt-1175-mcz-tp5122678.html) =============== Diff against System-pre.1197 =============== Item was changed: Object subclass: #SpaceTally + instanceVariableNames: 'results depth' - instanceVariableNames: 'results' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! + !SpaceTally commentStamp: '' prior: 0! + I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem. - !SpaceTally commentStamp: 'sd 6/20/2003 22:31' prior: 0! - I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem + Here are some examples to inspect: + SpaceTally new spaceTally: (Array with: TextMorph with: Point). + SpaceTally new systemWideSpaceTally. + SpaceTally new depth: 2; spaceTally: (PackageInfo named: #Morphic) classes. + SpaceTally new depth: 1; spaceTally: (PackageInfo named: #Monticello) classes. "Includes cached source code" + SpaceTally new spaceForInstancesOf: Form depth: 2. "Includes bitmaps and large integers"! - try something like: - - ((SpaceTally new spaceTally: (Array with: TextMorph with: Point)) - asSortedCollection: [:a :b | a spaceForInstances > b spaceForInstances]) - - SpaceTally new systemWideSpaceTally - - - This class has been created from a part of SystemDictionary. It still deserves a nice - clean, such as using object instead of array having 4 slots. - - sd-20 June 2003! Item was changed: ----- Method: SpaceTally>>computeSpaceUsage (in category 'class analysis') ----- computeSpaceUsage + | seenObjects | + seenObjects := self depth > 0 ifTrue: [IdentitySet new]. results do: [ :entry | | class instanceSpaceAndCount | class := self class environment at: entry analyzedClassName. Smalltalk garbageCollectMost. + instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth seen: seenObjects. - instanceSpaceAndCount := self spaceForInstancesOf: class. entry codeSize: class spaceUsed; instanceCount: instanceSpaceAndCount second; + spaceForInstances: instanceSpaceAndCount first; + depthOfSpace: self depth ] - spaceForInstances: instanceSpaceAndCount first ] displayingProgress: 'Taking statistics...'! Item was added: + ----- Method: SpaceTally>>depth (in category 'accessing') ----- + depth + + ^ depth ifNil: [0]! Item was added: + ----- Method: SpaceTally>>depth: (in category 'accessing') ----- + depth: anInteger + + depth := anInteger.! Item was added: + ----- Method: SpaceTally>>spaceForInstance: (in category 'instance size') ----- + spaceForInstance: anObject + + ^ self spaceForInstance: anObject depth: self depth! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger + + ^ self spaceForInstance: anObject depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger seen: seenObjectsOrNil + + | ctxt class basicSize depth total | + seenObjectsOrNil ifNotNil: [ + (seenObjectsOrNil ifAbsentAdd: anObject) ifFalse: [^ 0]]. + ctxt := thisContext. + class := ctxt objectClass: anObject. + basicSize := 0. + total := class isVariable + ifTrue: [class byteSizeOfInstanceOfSize: (basicSize := ctxt objectSize: anObject)] + ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class byteSizeOfInstance]]. + (depth := anInteger - 1) >= 0 ifTrue: [ + anObject isCompiledCode + ifTrue: [ + anObject literalsDo: [:literal | + total := total + (self spaceForInstance: literal depth: depth seen: seenObjectsOrNil)]] + ifFalse: [ + 1 to: basicSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject basicAt: index) depth: depth seen: seenObjectsOrNil)]. + 1 to: class instSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject instVarAt: index) depth: depth seen: seenObjectsOrNil)]]]. + ^ total! Item was changed: ----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') ----- spaceForInstancesOf: aClass - "Answer a pair of the number of bytes consumed by all instances of the - given class, including their object headers, and the number of instances." + ^ self spaceForInstancesOf: aClass depth: self depth! - | instances total | - instances := aClass allInstances. - instances isEmpty ifTrue: [^#(0 0)]. - total := 0. - aClass isVariable - ifTrue: - [instances do: - [:i| total := total + (aClass byteSizeOfInstanceOfSize: i basicSize)]] - ifFalse: - [total := instances size * aClass byteSizeOfInstance]. - ^{ total. instances size }! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger + + ^ self spaceForInstancesOf: aClass depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth:seen: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger seen: seenObjects + "Answer a pair of the number of bytes consumed by all instances of the given class, including their object headers, and the number of instances. Follow each instance's fields up to the given depth. Beware of cycles to shared objects, which will tamper the resulting numbers. + + SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as #spaceForInstancesOf: + SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory footprint for bits etc. + SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes LargePositiveIntegers in bitmaps ;-) + " + + | instances total | + instances := aClass allInstances. + instances isEmpty ifTrue: [^#(0 0)]. + total := 0. + instances do: [:each | total := total + (self spaceForInstance: each depth: anInteger seen: seenObjects)]. + ^{ total. instances size }! Item was changed: Object subclass: #SpaceTallyItem + instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances depthOfSpace' - instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! !SpaceTallyItem commentStamp: 'sd 6/20/2003 22:02' prior: 0! I'm represent an entry in the spaceTally.! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace (in category 'accessing') ----- + depthOfSpace + + ^ depthOfSpace! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace: (in category 'accessing') ----- + depthOfSpace: aNumber + + depthOfSpace := aNumber! Item was changed: ----- Method: SpaceTallyItem>>printOn: (in category 'printing') ----- printOn: aStream analyzedClassName ifNotNil: [ aStream nextPutAll: analyzedClassName asString]. aStream nextPutAll: ' ('. codeSize ifNotNil: [ aStream nextPutAll: 'code size: ' ; nextPutAll: codeSize asString]. instanceCount ifNotNil: [ aStream nextPutAll: ' instance count: ' ; nextPutAll: instanceCount asString]. spaceForInstances ifNotNil: [ aStream nextPutAll: ' space for instances: ' ; nextPutAll: spaceForInstances asBytesDescription]. + depthOfSpace + ifNotNil: [ aStream nextPutAll: ' depth of space: ' ; nextPutAll: depthOfSpace asString]. aStream nextPut: $). ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Thu Dec 17 17:01:58 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 17 Dec 2020 18:01:58 +0100 Subject: [squeak-dev] The Trunk: System-mt.1198.mcz In-Reply-To: References: Message-ID: Could it be that LargePositiveIntegers are created on-the-fly when accessing a Bitmap via #basicAt: (or the mirror primitive)? Best, Marcel Am 17.12.2020 17:39:11 schrieb Marcel Taeumel : Hmmm... this one generates LargePositiveIntegers while counting ... it never finishes: SpaceTally new spaceForInstancesOf: Bitmap depth: 1.  Any ideas? =) The use of IdentitySet for depth > 0 might require some blacklisting ... Best, Marcel Am 17.12.2020 17:04:33 schrieb commits at source.squeak.org : Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1198.mcz ==================== Summary ==================== Name: System-mt.1198 Author: mt Time: 17 December 2020, 5:04:11.447084 pm UUID: 0e532d14-69bc-3e4f-9e1b-67f880aa3001 Ancestors: System-pre.1197, System-mt.1175 Refines System-mt.1175, which adds a way to compute a space tally for objects up to a certain depth. Updates class comment to provide more examples. (See http://forum.world.st/The-Inbox-System-mt-1175-mcz-tp5122678.html) =============== Diff against System-pre.1197 =============== Item was changed: Object subclass: #SpaceTally + instanceVariableNames: 'results depth' - instanceVariableNames: 'results' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! + !SpaceTally commentStamp: '' prior: 0! + I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem. - !SpaceTally commentStamp: 'sd 6/20/2003 22:31' prior: 0! - I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem + Here are some examples to inspect: + SpaceTally new spaceTally: (Array with: TextMorph with: Point). + SpaceTally new systemWideSpaceTally. + SpaceTally new depth: 2; spaceTally: (PackageInfo named: #Morphic) classes. + SpaceTally new depth: 1; spaceTally: (PackageInfo named: #Monticello) classes. "Includes cached source code" + SpaceTally new spaceForInstancesOf: Form depth: 2. "Includes bitmaps and large integers"! - try something like: - - ((SpaceTally new spaceTally: (Array with: TextMorph with: Point)) - asSortedCollection: [:a :b | a spaceForInstances > b spaceForInstances]) - - SpaceTally new systemWideSpaceTally - - - This class has been created from a part of SystemDictionary. It still deserves a nice - clean, such as using object instead of array having 4 slots. - - sd-20 June 2003! Item was changed: ----- Method: SpaceTally>>computeSpaceUsage (in category 'class analysis') ----- computeSpaceUsage + | seenObjects | + seenObjects := self depth > 0 ifTrue: [IdentitySet new]. results do: [ :entry | | class instanceSpaceAndCount | class := self class environment at: entry analyzedClassName. Smalltalk garbageCollectMost. + instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth seen: seenObjects. - instanceSpaceAndCount := self spaceForInstancesOf: class. entry codeSize: class spaceUsed; instanceCount: instanceSpaceAndCount second; + spaceForInstances: instanceSpaceAndCount first; + depthOfSpace: self depth ] - spaceForInstances: instanceSpaceAndCount first ] displayingProgress: 'Taking statistics...'! Item was added: + ----- Method: SpaceTally>>depth (in category 'accessing') ----- + depth + + ^ depth ifNil: [0]! Item was added: + ----- Method: SpaceTally>>depth: (in category 'accessing') ----- + depth: anInteger + + depth := anInteger.! Item was added: + ----- Method: SpaceTally>>spaceForInstance: (in category 'instance size') ----- + spaceForInstance: anObject + + ^ self spaceForInstance: anObject depth: self depth! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger + + ^ self spaceForInstance: anObject depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category 'instance size') ----- + spaceForInstance: anObject depth: anInteger seen: seenObjectsOrNil + + | ctxt class basicSize depth total | + seenObjectsOrNil ifNotNil: [ + (seenObjectsOrNil ifAbsentAdd: anObject) ifFalse: [^ 0]]. + ctxt := thisContext. + class := ctxt objectClass: anObject. + basicSize := 0. + total := class isVariable + ifTrue: [class byteSizeOfInstanceOfSize: (basicSize := ctxt objectSize: anObject)] + ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class byteSizeOfInstance]]. + (depth := anInteger - 1) >= 0 ifTrue: [ + anObject isCompiledCode + ifTrue: [ + anObject literalsDo: [:literal | + total := total + (self spaceForInstance: literal depth: depth seen: seenObjectsOrNil)]] + ifFalse: [ + 1 to: basicSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject basicAt: index) depth: depth seen: seenObjectsOrNil)]. + 1 to: class instSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject instVarAt: index) depth: depth seen: seenObjectsOrNil)]]]. + ^ total! Item was changed: ----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') ----- spaceForInstancesOf: aClass - "Answer a pair of the number of bytes consumed by all instances of the - given class, including their object headers, and the number of instances." + ^ self spaceForInstancesOf: aClass depth: self depth! - | instances total | - instances := aClass allInstances. - instances isEmpty ifTrue: [^#(0 0)]. - total := 0. - aClass isVariable - ifTrue: - [instances do: - [:i| total := total + (aClass byteSizeOfInstanceOfSize: i basicSize)]] - ifFalse: - [total := instances size * aClass byteSizeOfInstance]. - ^{ total. instances size }! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger + + ^ self spaceForInstancesOf: aClass depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForInstancesOf:depth:seen: (in category 'instance size') ----- + spaceForInstancesOf: aClass depth: anInteger seen: seenObjects + "Answer a pair of the number of bytes consumed by all instances of the given class, including their object headers, and the number of instances. Follow each instance's fields up to the given depth. Beware of cycles to shared objects, which will tamper the resulting numbers. + + SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as #spaceForInstancesOf: + SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory footprint for bits etc. + SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes LargePositiveIntegers in bitmaps ;-) + " + + | instances total | + instances := aClass allInstances. + instances isEmpty ifTrue: [^#(0 0)]. + total := 0. + instances do: [:each | total := total + (self spaceForInstance: each depth: anInteger seen: seenObjects)]. + ^{ total. instances size }! Item was changed: Object subclass: #SpaceTallyItem + instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances depthOfSpace' - instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! !SpaceTallyItem commentStamp: 'sd 6/20/2003 22:02' prior: 0! I'm represent an entry in the spaceTally.! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace (in category 'accessing') ----- + depthOfSpace + + ^ depthOfSpace! Item was added: + ----- Method: SpaceTallyItem>>depthOfSpace: (in category 'accessing') ----- + depthOfSpace: aNumber + + depthOfSpace := aNumber! Item was changed: ----- Method: SpaceTallyItem>>printOn: (in category 'printing') ----- printOn: aStream analyzedClassName ifNotNil: [ aStream nextPutAll: analyzedClassName asString]. aStream nextPutAll: ' ('. codeSize ifNotNil: [ aStream nextPutAll: 'code size: ' ; nextPutAll: codeSize asString]. instanceCount ifNotNil: [ aStream nextPutAll: ' instance count: ' ; nextPutAll: instanceCount asString]. spaceForInstances ifNotNil: [ aStream nextPutAll: ' space for instances: ' ; nextPutAll: spaceForInstances asBytesDescription]. + depthOfSpace + ifNotNil: [ aStream nextPutAll: ' depth of space: ' ; nextPutAll: depthOfSpace asString]. aStream nextPut: $). ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Thu Dec 17 17:15:13 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 17 Dec 2020 17:15:13 0000 Subject: [squeak-dev] The Trunk: System-mt.1199.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1199.mcz ==================== Summary ==================== Name: System-mt.1199 Author: mt Time: 17 December 2020, 6:15:09.310895 pm UUID: 00f96e57-9bc5-d044-bcb7-2dd90b55507b Ancestors: System-mt.1198 Fixes SpaceTally. Only enumerate objects in variable classes, not bytes or words. Thus, avoid to create LargePositiveIntegers while counting. =============== Diff against System-mt.1198 =============== Item was changed: Object subclass: #SpaceTally instanceVariableNames: 'results depth' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! !SpaceTally commentStamp: '' prior: 0! I'm responsible to help getting information about system space usage. The information I compute is represented by a spaceTallyItem. Here are some examples to inspect: SpaceTally new spaceTally: (Array with: TextMorph with: Point). SpaceTally new systemWideSpaceTally. SpaceTally new depth: 2; spaceTally: (PackageInfo named: #Morphic) classes. SpaceTally new depth: 1; spaceTally: (PackageInfo named: #Monticello) classes. "Includes cached source code" + SpaceTally new spaceForInstancesOf: Form depth: 1. "Includes footprint for bitmaps"! - SpaceTally new spaceForInstancesOf: Form depth: 2. "Includes bitmaps and large integers"! Item was changed: ----- Method: SpaceTally>>spaceForInstance:depth:seen: (in category 'instance size') ----- spaceForInstance: anObject depth: anInteger seen: seenObjectsOrNil | ctxt class basicSize depth total | seenObjectsOrNil ifNotNil: [ (seenObjectsOrNil ifAbsentAdd: anObject) ifFalse: [^ 0]]. ctxt := thisContext. class := ctxt objectClass: anObject. basicSize := 0. total := class isVariable ifTrue: [class byteSizeOfInstanceOfSize: (basicSize := ctxt objectSize: anObject)] ifFalse: [class isImmediateClass ifTrue: [0] ifFalse: [class byteSizeOfInstance]]. (depth := anInteger - 1) >= 0 ifTrue: [ anObject isCompiledCode ifTrue: [ anObject literalsDo: [:literal | total := total + (self spaceForInstance: literal depth: depth seen: seenObjectsOrNil)]] ifFalse: [ + (class instSpec between: 2 and: 4) ifTrue: [ "only indexable objects, no bytes etc." + 1 to: basicSize do: [:index | + total := total + (self spaceForInstance: (ctxt object: anObject basicAt: index) depth: depth seen: seenObjectsOrNil)]]. - 1 to: basicSize do: [:index | - total := total + (self spaceForInstance: (ctxt object: anObject basicAt: index) depth: depth seen: seenObjectsOrNil)]. 1 to: class instSize do: [:index | total := total + (self spaceForInstance: (ctxt object: anObject instVarAt: index) depth: depth seen: seenObjectsOrNil)]]]. ^ total! Item was changed: ----- Method: SpaceTally>>spaceForInstancesOf:depth:seen: (in category 'instance size') ----- spaceForInstancesOf: aClass depth: anInteger seen: seenObjects "Answer a pair of the number of bytes consumed by all instances of the given class, including their object headers, and the number of instances. Follow each instance's fields up to the given depth. Beware of cycles to shared objects, which will tamper the resulting numbers. SpaceTally new spaceForInstancesOf: Form depth: 0. --- Same as #spaceForInstancesOf: SpaceTally new spaceForInstancesOf: Form depth: 1. --- Includes memory footprint for bits etc. - SpaceTally new spaceForInstancesOf: Form depth: 2. --- Also includes LargePositiveIntegers in bitmaps ;-) " | instances total | instances := aClass allInstances. instances isEmpty ifTrue: [^#(0 0)]. total := 0. instances do: [:each | total := total + (self spaceForInstance: each depth: anInteger seen: seenObjects)]. ^{ total. instances size }! From commits at source.squeak.org Thu Dec 17 17:27:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 17 Dec 2020 17:27:09 0000 Subject: [squeak-dev] The Trunk: System-mt.1200.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1200.mcz ==================== Summary ==================== Name: System-mt.1200 Author: mt Time: 17 December 2020, 6:27:01.501895 pm UUID: 0ff20c8c-9b07-c546-a2fe-c8310bc4c019 Ancestors: System-mt.1199 One more tweak for SpaceTally: It does not make sense to reuse the set of seen objects when enumerating the classes. Only reuse a set when enumerating each class' instances. Now the order of classes provided for #spaceTally: does not matter anymore. =============== Diff against System-mt.1199 =============== Item was changed: ----- Method: SpaceTally>>computeSpaceUsage (in category 'class analysis') ----- computeSpaceUsage - | seenObjects | - seenObjects := self depth > 0 ifTrue: [IdentitySet new]. results do: [ :entry | | class instanceSpaceAndCount | class := self class environment at: entry analyzedClassName. Smalltalk garbageCollectMost. + instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth. - instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth seen: seenObjects. entry codeSize: class spaceUsed; instanceCount: instanceSpaceAndCount second; spaceForInstances: instanceSpaceAndCount first; depthOfSpace: self depth ] displayingProgress: 'Taking statistics...'! From lecteur at zogotounga.net Thu Dec 17 18:54:20 2020 From: lecteur at zogotounga.net (=?UTF-8?Q?St=c3=a9phane_Rollandin?=) Date: Thu, 17 Dec 2020 19:54:20 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: <60b1b238-af3d-69b8-7d20-5a44f91d8a23@zogotounga.net> > > Let's wait until Stef chimes in, I'm sure he has solved that for muO > already. :) Well, indeed, the sound for the first example from Tim is fine in a muO image - I could not explain why off the top of my head, actually, I kind of forgot a lot of what I did. Stef From ma.chris.m at gmail.com Thu Dec 17 18:58:36 2020 From: ma.chris.m at gmail.com (Chris Muller) Date: Thu, 17 Dec 2020 12:58:36 -0600 Subject: [squeak-dev] "Move to" is somehow broken in SqueakSource's Web Interface In-Reply-To: References: Message-ID: On Thu, Dec 17, 2020 at 1:33 AM Marcel Taeumel wrote: > > Yes, I can't believe "Move" isn't working, let's pay attention to see > if it happens again. > > Ah, sorry. I meant, that the "delete/cut" part of the "move" operation is > not working properly in the long term. Versions keep on re-appearing in the > Inbox after a while. Not sure, why. It somewhat impairs manual inbox > processing. ^__^ > "After a while" may be a clue pointing to the recovery process. It assumes everything in the project directory (e.g., /inbox) needs to be restored. If Treating is only "marking" them somehow, but leaving them in there, that could be the cause.. That's definitely counterproductive for them to reappear after they were moved / deleted. I'll try to look soon. - Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From lecteur at zogotounga.net Thu Dec 17 19:00:45 2020 From: lecteur at zogotounga.net (=?UTF-8?Q?St=c3=a9phane_Rollandin?=) Date: Thu, 17 Dec 2020 20:00:45 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: > "no effect from adjustVol..." > |snd | > snd := FMSound organ1. > snd > duration: 5; > play. > 1 second wait. > snd adjustVolumeTo: 1.0 overMSecs: 500. > 1 second wait. > FMSound brass1 > play. > > 1 second wait. > snd stopGracefully. There is no effect because amplitude change is supposed to be driven by an AmplitudeEnvelope (these are the ones that send #adjustVolumeTo:overMSecs:). Unfortunately, there is already one such envelope active in FMSound organ1, which uses amplitude modulation, so a second one would be ignored anyway. What we need is a way to combine several layers of amplitude control; we could start by supporting several AmplitudeEnvelopes in a single AbstractSound. Stef From herbertkoenig at gmx.net Thu Dec 17 21:10:54 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 17 Dec 2020 22:10:54 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: <033e52f7-f72a-f68c-8555-7710d75e7047@gmx.net> I'd think if nobody clips early we can just add all simultaneous sounds (each one after using their own envelope), do that all in Float32 and then add a limiter like I described. It just must be put at the end of the audio chain. Either a clever one with lookahed and no clipping at all or (for live recording and playback with little latency) a conventional one which changes the gain with a certain attack rate and has some clipping until the attack is over. Music industry lived with the latter for decades. No idea if Squeak's sound architecture is suitable for that, it seems the conversion to Integer happens too early. But it was done with 16 Bit DSPs so some search or thinking should uncover that. So first question: Where is the place, where the audio samples are handed to the OS? Second question: Are there more places than the diverse mixSampleCount:into:startingAt:leftVol:rightVol: which are responsible for clipping. Cheers, Herbert Am 17.12.2020 um 20:00 schrieb Stéphane Rollandin: >> "no effect from adjustVol..." >> |snd | >> snd := FMSound organ1. >> snd >>     duration: 5; >>     play. >> 1 second wait. >> snd adjustVolumeTo: 1.0 overMSecs: 500. >> 1 second wait. >> FMSound brass1 >>     play. >> >> 1 second wait. >> snd stopGracefully. > > There is no effect because amplitude change is supposed to be driven > by an AmplitudeEnvelope (these are the ones that send > #adjustVolumeTo:overMSecs:). > > Unfortunately, there is already one such envelope active in FMSound > organ1, which uses amplitude modulation, so a second one would be > ignored anyway. > > What we need is a way to combine several layers of amplitude control; > we could start by supporting several AmplitudeEnvelopes in a single > AbstractSound. > > Stef > From tim at rowledge.org Thu Dec 17 23:53:00 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 17 Dec 2020 15:53:00 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: Thanks for chiming in (see what I did there?). > On 2020-12-17, at 11:00 AM, Stéphane Rollandin wrote: > >> "no effect from adjustVol..." >> |snd | >> snd := FMSound organ1. >> snd >> duration: 5; >> play. >> 1 second wait. >> snd adjustVolumeTo: 1.0 overMSecs: 500. >> 1 second wait. >> FMSound brass1 >> play. >> >> 1 second wait. >> snd stopGracefully. > > There is no effect because amplitude change is supposed to be driven by an AmplitudeEnvelope (these are the ones that send #adjustVolumeTo:overMSecs:). That's extra-puzzling because it is the mechanism used in the original Scratch code to control volume and I'd swear it used to work. The other mechanism #loudness: is rather more brutal and makes glitchy noises if used whilst playing. > Unfortunately, there is already one such envelope active in FMSound organ1, which uses amplitude modulation, so a second one would be ignored anyway. > > What we need is a way to combine several layers of amplitude control; we could start by supporting several AmplitudeEnvelopes in a single AbstractSound. I'm not very familiar with the workings of the sound system and happy to keep it that way if possible. There is the futzing with the 'scaledVol' value built in to the assorted mix prims & methods, so surely that ought to work? What would be the 'proper' way to merge multiple sounds with varying volumes? Do you scale all of them? Wouldn't that mean that starting a new sound would make the others go quieter in an odd sounding manner? Do you just clip the final total for every sample? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "How many Slavers does it take to change a lightbulb?” "Dunno. How susceptible are lightbulbs to telepathy?" From lecteur at zogotounga.net Fri Dec 18 01:12:27 2020 From: lecteur at zogotounga.net (=?UTF-8?Q?St=c3=a9phane_Rollandin?=) Date: Fri, 18 Dec 2020 02:12:27 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> > There is the futzing with the 'scaledVol' value built in to the assorted mix prims & methods, so surely that ought to work? Yes, but that scaledVol value is already set to change cyclicly (is that a word?) in FMSound organ1 in order to modulate the base sine wave and give it some timbre. If we attempt to use that same value to control the overall loudness, we will lose the timbre. In fact we would need to multiply the timbral volume envelope with the loudness one, but this is not trivial because the first one uses a loop. > What would be the 'proper' way to merge multiple sounds with varying volumes? Do you scale all of them? Yes, and whether or not their volumes are varying, the sounds must have been scaled beforehand to ensure there is enough headroom for their superposition. This again is not trivial, because of the way interference works: adding two sounds can potentially double the height of their amplitude peaks, where they interfere constructively, but can also, where they interfere destructively, lead to a lower volume (for an extreme example, if you mix a signal with its exact mirror you will get a plain silence). Stef From tim at rowledge.org Fri Dec 18 01:52:53 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 17 Dec 2020 17:52:53 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> Message-ID: <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> Well... > On 2020-12-17, at 5:12 PM, Stéphane Rollandin wrote: > > >> There is the futzing with the 'scaledVol' value built in to the assorted mix prims & methods, so surely that ought to work? > > Yes, but that scaledVol value is already set to change cyclicly (is that a word?) in FMSound organ1 in order to modulate the base sine wave and give it some timbre. If we attempt to use that same value to control the overall loudness, we will lose the timbre. In fact we would need to multiply the timbral volume envelope with the loudness one, but this is not trivial because the first one uses a loop. I *think* that the FMSound>>#primitiveMixFMSound code handles this; at least it looks like it pays attention to the waveTable etc. I've just taken a quick look and the code that changes the scaleVol if the scaledVolIncr value is non-0 is there in the prim too, so there hasn't been a major regression in the code. Probably. > > >> What would be the 'proper' way to merge multiple sounds with varying volumes? Do you scale all of them? > > Yes, and whether or not their volumes are varying, the sounds must have been scaled beforehand to ensure there is enough headroom for their superposition. Yikes. That smacks of needing a lot of advance information. How on earth do we handle sometihng like a true ten-finger keyboard? Make each sound only allow volume 0.1 ? > This again is not trivial, because of the way interference works: adding two sounds can potentially double the height of their amplitude peaks, where they interfere constructively, but can also, where they interfere destructively, lead to a lower volume (for an extreme example, if you mix a signal with its exact mirror you will get a plain silence). Oh yes. Wave interference maths is great fun. I was just reading a couple of nights ago about using the positive Grassmanian and Kodama-Williams equations to model soliton waves. I hope we don't need to worry about that to solve this tiny problem! tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim If at first you don't succeed, destroy all evidence that you tried. From commits at source.squeak.org Fri Dec 18 02:48:46 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 02:48:46 0000 Subject: [squeak-dev] The Trunk: System-dtl.1201.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1201.mcz ==================== Summary ==================== Name: System-dtl.1201 Author: dtl Time: 17 December 2020, 9:48:42.965817 pm UUID: 02a92044-45ac-40d7-b274-a29ead5778bb Ancestors: System-mt.1200 Make DoItFirst safer on Windows and other platforms without access to stdo streams. If stdio not available, redirect output to transcript. Do not allow the image to quit if output was redirected to transcript, because otherwise command line results cannot be seen. Also move reevalute methods to category 'system startup' to clarify their use. These are only sent from other classes in the startup list. =============== Diff against System-mt.1200 =============== Item was changed: + ----- Method: DoItFirst class>>reevaluateCwd (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateCwd (in category 'reevaluate options') ----- reevaluateCwd "If a -cwd option was specified on the command line, reevaluate it now. May be called from FileDirectory class>>startUp: to reevaluate the command line option to ensure that the default directory is ultimately set as specified by the -cwd image command line option." ^ self current evaluateArg: #cwd.! Item was changed: + ----- Method: DoItFirst class>>reevaluateDebug (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateDebug (in category 'reevaluate options') ----- reevaluateDebug "The -debug option cannot be evaluated at DoInNow startUp time, but may be called later in the startUp processing. If -debug was not specified as a command option this method does nothing. May be called from Delay>>startup to invoke a debugger at the earliest possible time." ^ self current evaluateArg: #debug.! Item was changed: ----- Method: DoItFirst>>cwd: (in category 'actions') ----- cwd: path + "Evaluate arg and print the result on stdout, or error message on stderr." - "Evaluate arg and print the result on stdout, or error message on stderr. - Exit immediately without saving the image." (FileDirectory on: path) exists ifTrue: [ FileDirectory setDefaultDirectory: path ] + ifFalse: [ (self printError: path, ': directory does not exist') + ifTrue: [ Smalltalk quitPrimitive ]].! - ifFalse: [ FileStream stderr nextPutAll: path, ': directory does not exist'; lf; flush. - Smalltalk quitPrimitive ] - ! Item was changed: ----- Method: DoItFirst>>doIt: (in category 'actions') ----- doIt: arguments "Evaluate arguments and print the result on stdout, or error message on stderr. Exit the image after any error." arguments do: [ :arg | + [ self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | self printError: ex asString ]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>evaluateFileContents: (in category 'actions') ----- evaluateFileContents: fileName "Evaluate the contents of a file and print the result on stdout, or error message on stderr. Exit immediately without saving the image." | fs arg | + [fs := FileStream oldFileNamed: fileName. + [arg := fs contentsOfEntireFile. + ^ self evaluateOption: arg] + ensure: [fs close]] + on: Exception + do: [:ex | (self printError: ex asString) + ifTrue: [Smalltalk quitPrimitive]].! - [ [ fs := FileStream oldFileNamed: fileName. ] - on: FileDoesNotExistException - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]. - arg := fs contentsOfEntireFile. - ^ self evaluateOption: arg. - ] ensure: [ fs close ]. - ! Item was changed: ----- Method: DoItFirst>>evaluateOption: (in category 'actions') ----- evaluateOption: arg "Evaluate option and print the result on stdout, or error message on stderr. Exit immediately without saving the image." + | safeToQuit | + [ safeToQuit := self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | safeToQuit := self printError: ex asString ]. + safeToQuit ifTrue: [ Smalltalk quitPrimitive ].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush ]. - Smalltalk quitPrimitive! Item was changed: ----- Method: DoItFirst>>fileIn: (in category 'actions') ----- fileIn: fileNames "File in each named file. On error, print a message to stderr and exit the image." fileNames do: [ :arg | [ | fs | fs := FileStream oldFileNamed: arg. + self printOut: 'file in ', fs name. - FileStream stdout nextPutAll: 'file in ', fs name; lf; flush. fs fileIn ] on: Error + do: [ :ex | (self printError: ex asString) + ifTrue: [ Smalltalk quitPrimitive ]]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>help (in category 'actions') ----- help + self printOut: self class name, ' image arguments:'. - FileStream stdout nextPutAll: self class name, ' image arguments:'; lf. { '--doit argumentlist "evaluate each argument as a doIt expression"' . '--evaluate arg "evaluate arg, print result then exit"' . '--file filename "evaluate contents of filename, print result then exit"' . '--filein filelist "file in each file named in fileList"' . '--cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options"' . '--debug "enter a debugger as soon as possible in the startUp processing"'. '--help "print this message"' + } do: [ :e | self printOut: String tab, e ]. + self printOut: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'. + (self printOut: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help') + ifTrue: [ Smalltalk quitPrimitive ]. "do not quit if output went to the transcript"! - } do: [ :e | FileStream stdout tab; nextPutAll: e; lf ]. - FileStream stdout - nextPutAll: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'; lf; - nextPutAll: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help'; lf; - flush. - Smalltalk quitPrimitive. - - ! Item was added: + ----- Method: DoItFirst>>print:to: (in category 'private') ----- + print: aString to: stream + [ stream nextPutAll: aString; lf; flush ] + on: Error + do: [ Transcript cr; show: self class name , ' output: ', aString; flush. + ^false ]. + ^true. + ! Item was added: + ----- Method: DoItFirst>>printError: (in category 'private') ----- + printError: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stderr. + ! Item was added: + ----- Method: DoItFirst>>printOut: (in category 'private') ----- + printOut: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stdout. + ! From lewis at mail.msen.com Fri Dec 18 03:46:21 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Thu, 17 Dec 2020 22:46:21 -0500 Subject: [squeak-dev] The Inbox: System-dtl.1197.mcz In-Reply-To: <20201213171801.GA93230@shell.msen.com> References: <20201213171801.GA93230@shell.msen.com> Message-ID: <20201218034621.GA68229@shell.msen.com> I would like to merge this into trunk, but here is my concern. With these changes applied, on Unix I can do this to run an image with a start document: $ squeak squeak.image startDocument Or I can do this to prevent the last argument from being treated as a start document: $ squeak squeak.image -- somethingThatIsNotAStartDocument However, on Windows I do not know if there is a similar way to handle somethingThatIsNotAStartDocument. Is this a problem? Thanks, Dave On Sun, Dec 13, 2020 at 12:18:01PM -0500, David T. Lewis wrote: > This update addresses a couple of annoyances in our current startup argument processing. > > Annoyance #1: If someone starts the image like this: > > $ squeak squeak.image -e '3 + 4' > > Then is it clear that the '-e' parameter should not be interpreted as a start document. > > Annoyance #2: Having a preference for #readDocumentAtStartup makes the startup > logic more complicated than it needs to be. It's just one more thing to keep > track of, and if my command line does not work as expected I have to remember > to go check the setting. > > So if we can get rid of a preference and make the system a little bit simpler, > that would be a good thing. > > I cannot think of any use case on a unix-like system for which these changes > would cause a problem, but it is possible that I am overlooking an issue > that would affect Windows or other platforms. > > If someone with Windows experience could have a look at this update, I would > appreciate any feedback. > > Thanks, > Dave > > > On Sun, Dec 13, 2020 at 04:53:27AM +0000, commits at source.squeak.org wrote: > > A new version of System was added to project The Inbox: > > http://source.squeak.org/inbox/System-dtl.1197.mcz > > > > ==================== Summary ==================== > > > > Name: System-dtl.1197 > > Author: dtl > > Time: 12 December 2020, 11:39:02.946469 pm > > UUID: 98a9eb0b-d360-473f-a718-f1f7ae883ac7 > > Ancestors: System-mt.1196 > > > > Enable removal of preference for 'Read document at startup'. > > > > Simplify code such that #readDocumentAtStartup is assumed always true and document specifiers begining with '-' are not treated as start documents. The actual preference setting is no longer referenced. > > > > Assumptions: if the start document resource name starts with '-' then it is unlikely to be a document. For the case of the first argument appearing to be a document but the user wishing to use it otherwise, the '--' token (or any other argument beginning with '-') may be used in the command line to protect the argument from evaluation. This allows the traditional start document processing to work normally in the general case, and allows start document processing to be bypassed from the command line if desired. No preference setting is required. > > > > The #readDocumentAtStartup may be removed in a future update. > > > > =============== Diff against System-mt.1196 =============== > > > > Item was changed: > > ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') ----- > > startUpAfterLogin > > | scriptName loader isUrl | > > self setupFlaps. > > + Smalltalk firstArgMightBeDocument > > + ifTrue: [scriptName := Smalltalk documentPath. > > - Preferences readDocumentAtStartup > > - ifTrue: [scriptName := Smalltalk documentPath > > - ifNil: ['']. > > scriptName := scriptName convertFromSystemString. > > scriptName isEmpty > > ifFalse: ["figure out if script name is a URL by itself" > > isUrl := (scriptName asLowercase beginsWith: 'http://') > > or: [(scriptName asLowercase beginsWith: 'file://') > > or: [scriptName asLowercase beginsWith: 'ftp://']]. > > isUrl > > ifFalse: [| encodedPath pathTokens | > > "Allow for ../dir/scriptName arguments" > > pathTokens := scriptName splitBy: FileDirectory slash. > > pathTokens := pathTokens > > collect: [:s | s encodeForHTTP]. > > encodedPath := pathTokens > > reduce: [:acc :each | acc , FileDirectory slash , each]. > > scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]] > > ifFalse: [scriptName := '']. > > scriptName isEmptyOrNil > > ifTrue: [^ Preferences eToyFriendly > > ifTrue: [self currentWorld addGlobalFlaps]]. > > loader := CodeLoader new. > > loader > > loadSourceFiles: (Array with: scriptName). > > (scriptName asLowercase endsWith: '.pr') > > ifTrue: [self installProjectFrom: loader] > > ifFalse: [loader installSourceFiles]! > > > > Item was changed: > > ----- Method: SmalltalkImage>>arguments (in category 'command line') ----- > > arguments > > "Answer an array with all the command line arguments. > > + This does not include imagePath, documentPath nor any option. > > + The '--' token on the command line indicates that remaining arguments should > > + be passed to the image without interpretation, and should not be treated as e.g. > > + specification of a start script." > > + > > - This does not include imagePath, documentPath nor any option." > > - > > "Smalltalk commandLine arguments" > > > > + | args | > > - | args strm | > > args := self rawArguments. > > + (args includes: '--' ) > > + ifTrue: [ ^ args copyAfter: '--' ] > > + ifFalse: [ | rs | rs := args readStream. > > + rs next. "skip image name" > > + self firstArgMightBeDocument > > + ifTrue: [rs next "skip startup document name"]. > > + ^ rs upToEnd ]. > > - (args includes: '--') > > - ifTrue: [ ^args copyAfter: self imageArgumentsMarker ]. > > - strm := args readStream. > > - strm atEnd ifFalse: [ strm next. "skip image name" > > - (Preferences readDocumentAtStartup and: [ strm atEnd not ]) > > - ifTrue: [ strm next "skip startup document name" ]]. > > - ^ strm upToEnd. > > ! > > > > Item was changed: > > ----- Method: SmalltalkImage>>documentPath (in category 'command line') ----- > > documentPath > > "Answer the absolute path of the document passed to the VM or nil if none." > > "Smalltalk commandLine documentPath" > > + ^ (self getSystemAttribute: 2) ifNil: [ '' ] > > - ^ (self getSystemAttribute: 2) > > - ifNotNil: [ :arg | arg = self imageArgumentsMarker > > - ifTrue: [nil] ifFalse: [arg]]. > > - > > ! > > > > Item was added: > > + ----- Method: SmalltalkImage>>firstArgMightBeDocument (in category 'private') ----- > > + firstArgMightBeDocument > > + "If the first argument begins with '-' then it is unlikely to be a document specification" > > + ^ (self documentPath beginsWith: '-') not > > + ! > > > > Item was removed: > > - ----- Method: SmalltalkImage>>imageArgumentsMarker (in category 'command line') ----- > > - imageArgumentsMarker > > - "The '--' token on the command line indicates that remaining arguments should > > - be passed to the image without interpretation, and should not be treated as e.g. > > - specification of a start script." > > - > > - ^ '--'! > > > > > From herbertkoenig at gmx.net Fri Dec 18 06:45:30 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Fri, 18 Dec 2020 07:45:30 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> Message-ID: Am 18.12.2020 um 02:52 schrieb tim Rowledge: > Yikes. That smacks of needing a lot of advance information. How on earth do we handle sometihng like a true ten-finger keyboard? Make each sound only allow volume 0.1 ? > >> This again is not trivial, because of the way interference works: adding two sounds can potentially double the height of their amplitude peaks, where they interfere constructively, but can also, where they interfere destructively, lead to a lower volume (for an extreme example, if you mix a signal with its exact mirror you will get a plain silence). That is just very unlikely, all tones you press on your keyboard must start with that exact delay that they reach their maxima at the same time. So the higher tone must start later than the lower one because it reaches its max quicker when both start from zero.  But yes, if you look at the waveform of some classical music you see a lot of headroom for the few peaks. Just not a factor 10. Different story for current popular music. Or music to be listened to while driving. Cheers, Herbert -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ekgmdkncghgabolc.png Type: image/png Size: 20715 bytes Desc: not available URL: From vanessa at codefrau.net Fri Dec 18 07:10:06 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Thu, 17 Dec 2020 23:10:06 -0800 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM Message-ID: > > In commemoration of the 40th anniversary of the release of Smalltalk-80, > the Computer History Museum is proud to announce a collaboration with Dan > Ingalls to preserve and host the “Smalltalk Zoo.” Dan has been working on this for a good while now. I helped with the SqueakJS part. Today the Computer History Museum announced it: https://computerhistory.org/blog/introducing-the-smalltalk-zoo-48-years-of-smalltalk-history-at-chm/ Not everything is working perfectly yet. If you want to help out, I can put you in touch with Dan. Cheers! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank-lesser at lesser-software.com Fri Dec 18 07:46:09 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Fri, 18 Dec 2020 08:46:09 +0100 Subject: [squeak-dev] [offtopic] Smalltalk puzzles Message-ID: Hi all, I have started yesterday on my twitter @LesserFrank to publish little smalltalk "puzzles" everyone is welcome to post solutions. the yesterdays puzzle crashes or hang some Smalltalks but can be debugged. Frank From marcel.taeumel at hpi.de Fri Dec 18 08:51:53 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Fri, 18 Dec 2020 09:51:53 +0100 Subject: [squeak-dev] The Inbox: System-dtl.1197.mcz In-Reply-To: <20201218034621.GA68229@shell.msen.com> References: <20201213171801.GA93230@shell.msen.com> <20201218034621.GA68229@shell.msen.com> Message-ID: Hi Dave. > However, on Windows I do not know if there is a similar way to handle somethingThatIsNotAStartDocument. In a recent VM, I tried this in the PowerShell (after loading System-dtl.1197): ./Squeak.exe squeak.image run.st ./Squeak.exe -- run.st Both process the run.st document. The second one makes the user choose the .image file manually. ./SqueakConsole.exe -- --evaluate '3+4' ./SqueakConsole.exe squeak.image --evaluate '3+4' Works as expected. That "no content to install" bug is gone. Thanks! Best, Marcel Am 18.12.2020 04:46:31 schrieb David T. Lewis : I would like to merge this into trunk, but here is my concern. With these changes applied, on Unix I can do this to run an image with a start document: $ squeak squeak.image startDocument Or I can do this to prevent the last argument from being treated as a start document: $ squeak squeak.image -- somethingThatIsNotAStartDocument However, on Windows I do not know if there is a similar way to handle somethingThatIsNotAStartDocument. Is this a problem? Thanks, Dave On Sun, Dec 13, 2020 at 12:18:01PM -0500, David T. Lewis wrote: > This update addresses a couple of annoyances in our current startup argument processing. > > Annoyance #1: If someone starts the image like this: > > $ squeak squeak.image -e '3 + 4' > > Then is it clear that the '-e' parameter should not be interpreted as a start document. > > Annoyance #2: Having a preference for #readDocumentAtStartup makes the startup > logic more complicated than it needs to be. It's just one more thing to keep > track of, and if my command line does not work as expected I have to remember > to go check the setting. > > So if we can get rid of a preference and make the system a little bit simpler, > that would be a good thing. > > I cannot think of any use case on a unix-like system for which these changes > would cause a problem, but it is possible that I am overlooking an issue > that would affect Windows or other platforms. > > If someone with Windows experience could have a look at this update, I would > appreciate any feedback. > > Thanks, > Dave > > > On Sun, Dec 13, 2020 at 04:53:27AM +0000, commits at source.squeak.org wrote: > > A new version of System was added to project The Inbox: > > http://source.squeak.org/inbox/System-dtl.1197.mcz > > > > ==================== Summary ==================== > > > > Name: System-dtl.1197 > > Author: dtl > > Time: 12 December 2020, 11:39:02.946469 pm > > UUID: 98a9eb0b-d360-473f-a718-f1f7ae883ac7 > > Ancestors: System-mt.1196 > > > > Enable removal of preference for 'Read document at startup'. > > > > Simplify code such that #readDocumentAtStartup is assumed always true and document specifiers begining with '-' are not treated as start documents. The actual preference setting is no longer referenced. > > > > Assumptions: if the start document resource name starts with '-' then it is unlikely to be a document. For the case of the first argument appearing to be a document but the user wishing to use it otherwise, the '--' token (or any other argument beginning with '-') may be used in the command line to protect the argument from evaluation. This allows the traditional start document processing to work normally in the general case, and allows start document processing to be bypassed from the command line if desired. No preference setting is required. > > > > The #readDocumentAtStartup may be removed in a future update. > > > > =============== Diff against System-mt.1196 =============== > > > > Item was changed: > > ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') ----- > > startUpAfterLogin > > | scriptName loader isUrl | > > self setupFlaps. > > + Smalltalk firstArgMightBeDocument > > + ifTrue: [scriptName := Smalltalk documentPath. > > - Preferences readDocumentAtStartup > > - ifTrue: [scriptName := Smalltalk documentPath > > - ifNil: ['']. > > scriptName := scriptName convertFromSystemString. > > scriptName isEmpty > > ifFalse: ["figure out if script name is a URL by itself" > > isUrl := (scriptName asLowercase beginsWith: 'http://') > > or: [(scriptName asLowercase beginsWith: 'file://') > > or: [scriptName asLowercase beginsWith: 'ftp://']]. > > isUrl > > ifFalse: [| encodedPath pathTokens | > > "Allow for ../dir/scriptName arguments" > > pathTokens := scriptName splitBy: FileDirectory slash. > > pathTokens := pathTokens > > collect: [:s | s encodeForHTTP]. > > encodedPath := pathTokens > > reduce: [:acc :each | acc , FileDirectory slash , each]. > > scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]] > > ifFalse: [scriptName := '']. > > scriptName isEmptyOrNil > > ifTrue: [^ Preferences eToyFriendly > > ifTrue: [self currentWorld addGlobalFlaps]]. > > loader := CodeLoader new. > > loader > > loadSourceFiles: (Array with: scriptName). > > (scriptName asLowercase endsWith: '.pr') > > ifTrue: [self installProjectFrom: loader] > > ifFalse: [loader installSourceFiles]! > > > > Item was changed: > > ----- Method: SmalltalkImage>>arguments (in category 'command line') ----- > > arguments > > "Answer an array with all the command line arguments. > > + This does not include imagePath, documentPath nor any option. > > + The '--' token on the command line indicates that remaining arguments should > > + be passed to the image without interpretation, and should not be treated as e.g. > > + specification of a start script." > > + > > - This does not include imagePath, documentPath nor any option." > > - > > "Smalltalk commandLine arguments" > > > > + | args | > > - | args strm | > > args := self rawArguments. > > + (args includes: '--' ) > > + ifTrue: [ ^ args copyAfter: '--' ] > > + ifFalse: [ | rs | rs := args readStream. > > + rs next. "skip image name" > > + self firstArgMightBeDocument > > + ifTrue: [rs next "skip startup document name"]. > > + ^ rs upToEnd ]. > > - (args includes: '--') > > - ifTrue: [ ^args copyAfter: self imageArgumentsMarker ]. > > - strm := args readStream. > > - strm atEnd ifFalse: [ strm next. "skip image name" > > - (Preferences readDocumentAtStartup and: [ strm atEnd not ]) > > - ifTrue: [ strm next "skip startup document name" ]]. > > - ^ strm upToEnd. > > ! > > > > Item was changed: > > ----- Method: SmalltalkImage>>documentPath (in category 'command line') ----- > > documentPath > > "Answer the absolute path of the document passed to the VM or nil if none." > > "Smalltalk commandLine documentPath" > > + ^ (self getSystemAttribute: 2) ifNil: [ '' ] > > - ^ (self getSystemAttribute: 2) > > - ifNotNil: [ :arg | arg = self imageArgumentsMarker > > - ifTrue: [nil] ifFalse: [arg]]. > > - > > ! > > > > Item was added: > > + ----- Method: SmalltalkImage>>firstArgMightBeDocument (in category 'private') ----- > > + firstArgMightBeDocument > > + "If the first argument begins with '-' then it is unlikely to be a document specification" > > + ^ (self documentPath beginsWith: '-') not > > + ! > > > > Item was removed: > > - ----- Method: SmalltalkImage>>imageArgumentsMarker (in category 'command line') ----- > > - imageArgumentsMarker > > - "The '--' token on the command line indicates that remaining arguments should > > - be passed to the image without interpretation, and should not be treated as e.g. > > - specification of a start script." > > - > > - ^ '--'! > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Fri Dec 18 09:01:11 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Fri, 18 Dec 2020 10:01:11 +0100 Subject: [squeak-dev] The Trunk: System-dtl.1201.mcz In-Reply-To: References: Message-ID: Hi Dave! Not yet working. ^^' It fails the moment one calls "FileStram stderr" and similar :-) Best, Marcel Am 18.12.2020 03:48:58 schrieb commits at source.squeak.org : David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1201.mcz ==================== Summary ==================== Name: System-dtl.1201 Author: dtl Time: 17 December 2020, 9:48:42.965817 pm UUID: 02a92044-45ac-40d7-b274-a29ead5778bb Ancestors: System-mt.1200 Make DoItFirst safer on Windows and other platforms without access to stdo streams. If stdio not available, redirect output to transcript. Do not allow the image to quit if output was redirected to transcript, because otherwise command line results cannot be seen. Also move reevalute methods to category 'system startup' to clarify their use. These are only sent from other classes in the startup list. =============== Diff against System-mt.1200 =============== Item was changed: + ----- Method: DoItFirst class>>reevaluateCwd (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateCwd (in category 'reevaluate options') ----- reevaluateCwd "If a -cwd option was specified on the command line, reevaluate it now. May be called from FileDirectory class>>startUp: to reevaluate the command line option to ensure that the default directory is ultimately set as specified by the -cwd image command line option." ^ self current evaluateArg: #cwd.! Item was changed: + ----- Method: DoItFirst class>>reevaluateDebug (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateDebug (in category 'reevaluate options') ----- reevaluateDebug "The -debug option cannot be evaluated at DoInNow startUp time, but may be called later in the startUp processing. If -debug was not specified as a command option this method does nothing. May be called from Delay>>startup to invoke a debugger at the earliest possible time." ^ self current evaluateArg: #debug.! Item was changed: ----- Method: DoItFirst>>cwd: (in category 'actions') ----- cwd: path + "Evaluate arg and print the result on stdout, or error message on stderr." - "Evaluate arg and print the result on stdout, or error message on stderr. - Exit immediately without saving the image." (FileDirectory on: path) exists ifTrue: [ FileDirectory setDefaultDirectory: path ] + ifFalse: [ (self printError: path, ': directory does not exist') + ifTrue: [ Smalltalk quitPrimitive ]].! - ifFalse: [ FileStream stderr nextPutAll: path, ': directory does not exist'; lf; flush. - Smalltalk quitPrimitive ] - ! Item was changed: ----- Method: DoItFirst>>doIt: (in category 'actions') ----- doIt: arguments "Evaluate arguments and print the result on stdout, or error message on stderr. Exit the image after any error." arguments do: [ :arg | + [ self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | self printError: ex asString ]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>evaluateFileContents: (in category 'actions') ----- evaluateFileContents: fileName "Evaluate the contents of a file and print the result on stdout, or error message on stderr. Exit immediately without saving the image." | fs arg | + [fs := FileStream oldFileNamed: fileName. + [arg := fs contentsOfEntireFile. + ^ self evaluateOption: arg] + ensure: [fs close]] + on: Exception + do: [:ex | (self printError: ex asString) + ifTrue: [Smalltalk quitPrimitive]].! - [ [ fs := FileStream oldFileNamed: fileName. ] - on: FileDoesNotExistException - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]. - arg := fs contentsOfEntireFile. - ^ self evaluateOption: arg. - ] ensure: [ fs close ]. - ! Item was changed: ----- Method: DoItFirst>>evaluateOption: (in category 'actions') ----- evaluateOption: arg "Evaluate option and print the result on stdout, or error message on stderr. Exit immediately without saving the image." + | safeToQuit | + [ safeToQuit := self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | safeToQuit := self printError: ex asString ]. + safeToQuit ifTrue: [ Smalltalk quitPrimitive ].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush ]. - Smalltalk quitPrimitive! Item was changed: ----- Method: DoItFirst>>fileIn: (in category 'actions') ----- fileIn: fileNames "File in each named file. On error, print a message to stderr and exit the image." fileNames do: [ :arg | [ | fs | fs := FileStream oldFileNamed: arg. + self printOut: 'file in ', fs name. - FileStream stdout nextPutAll: 'file in ', fs name; lf; flush. fs fileIn ] on: Error + do: [ :ex | (self printError: ex asString) + ifTrue: [ Smalltalk quitPrimitive ]]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>help (in category 'actions') ----- help + self printOut: self class name, ' image arguments:'. - FileStream stdout nextPutAll: self class name, ' image arguments:'; lf. { '--doit argumentlist "evaluate each argument as a doIt expression"' . '--evaluate arg "evaluate arg, print result then exit"' . '--file filename "evaluate contents of filename, print result then exit"' . '--filein filelist "file in each file named in fileList"' . '--cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options"' . '--debug "enter a debugger as soon as possible in the startUp processing"'. '--help "print this message"' + } do: [ :e | self printOut: String tab, e ]. + self printOut: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'. + (self printOut: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help') + ifTrue: [ Smalltalk quitPrimitive ]. "do not quit if output went to the transcript"! - } do: [ :e | FileStream stdout tab; nextPutAll: e; lf ]. - FileStream stdout - nextPutAll: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'; lf; - nextPutAll: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help'; lf; - flush. - Smalltalk quitPrimitive. - - ! Item was added: + ----- Method: DoItFirst>>print:to: (in category 'private') ----- + print: aString to: stream + [ stream nextPutAll: aString; lf; flush ] + on: Error + do: [ Transcript cr; show: self class name , ' output: ', aString; flush. + ^false ]. + ^true. + ! Item was added: + ----- Method: DoItFirst>>printError: (in category 'private') ----- + printError: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stderr. + ! Item was added: + ----- Method: DoItFirst>>printOut: (in category 'private') ----- + printOut: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stdout. + ! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 37187 bytes Desc: not available URL: From commits at source.squeak.org Fri Dec 18 09:11:53 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 09:11:53 0000 Subject: [squeak-dev] The Trunk: System-mt.1202.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1202.mcz ==================== Summary ==================== Name: System-mt.1202 Author: mt Time: 18 December 2020, 10:11:47.76906 am UUID: 29ceed8f-1bbf-fa4f-89ee-8e8aaabe25ba Ancestors: System-dtl.1201 Fixes logging output of DoItFirst for cases where stdio streams are unavailable such as on Windows via Squeak.exe (instead of SqueakConsole.exe). =============== Diff against System-dtl.1201 =============== Item was removed: - ----- Method: DoItFirst>>print:to: (in category 'private') ----- - print: aString to: stream - [ stream nextPutAll: aString; lf; flush ] - on: Error - do: [ Transcript cr; show: self class name , ' output: ', aString; flush. - ^false ]. - ^true. - ! Item was changed: ----- Method: DoItFirst>>printError: (in category 'private') ----- printError: aString "Print to stdout if available, otherwise to the transcript. Answer true if the stdio stream was used, false if output was redirected to transcript." + [ FileStream stderr nextPutAll: aString; lf; flush ] + on: Error + do: [ TranscriptStream forceUpdate: false. "Graphics not yet fully initialized." + Transcript cr; show: self class name , ' error: ', aString; flush. + ^false ]. + ^true. - ^self print: aString to: FileStream stderr. ! Item was changed: ----- Method: DoItFirst>>printOut: (in category 'private') ----- printOut: aString "Print to stdout if available, otherwise to the transcript. Answer true if the stdio stream was used, false if output was redirected to transcript." + [ FileStream stdout nextPutAll: aString; lf; flush ] + on: Error + do: [ TranscriptStream forceUpdate: false. "Graphics not yet fully initialized." + Transcript cr; show: self class name , ' output: ', aString; flush. + ^false ]. + ^true. - ^self print: aString to: FileStream stdout. ! From marcel.taeumel at hpi.de Fri Dec 18 09:12:40 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Fri, 18 Dec 2020 10:12:40 +0100 Subject: [squeak-dev] The Trunk: System-dtl.1201.mcz In-Reply-To: References: Message-ID: Hi Dave! Fixed in System-mt.1202. No only your changes for document loading, which are waiting in the inbox, are missing. :-) Best, Marcel Am 18.12.2020 10:01:11 schrieb Marcel Taeumel : Hi Dave! Not yet working. ^^' It fails the moment one calls "FileStram stderr" and similar :-) Best, Marcel Am 18.12.2020 03:48:58 schrieb commits at source.squeak.org : David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1201.mcz ==================== Summary ==================== Name: System-dtl.1201 Author: dtl Time: 17 December 2020, 9:48:42.965817 pm UUID: 02a92044-45ac-40d7-b274-a29ead5778bb Ancestors: System-mt.1200 Make DoItFirst safer on Windows and other platforms without access to stdo streams. If stdio not available, redirect output to transcript. Do not allow the image to quit if output was redirected to transcript, because otherwise command line results cannot be seen. Also move reevalute methods to category 'system startup' to clarify their use. These are only sent from other classes in the startup list. =============== Diff against System-mt.1200 =============== Item was changed: + ----- Method: DoItFirst class>>reevaluateCwd (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateCwd (in category 'reevaluate options') ----- reevaluateCwd "If a -cwd option was specified on the command line, reevaluate it now. May be called from FileDirectory class>>startUp: to reevaluate the command line option to ensure that the default directory is ultimately set as specified by the -cwd image command line option." ^ self current evaluateArg: #cwd.! Item was changed: + ----- Method: DoItFirst class>>reevaluateDebug (in category 'system startup') ----- - ----- Method: DoItFirst class>>reevaluateDebug (in category 'reevaluate options') ----- reevaluateDebug "The -debug option cannot be evaluated at DoInNow startUp time, but may be called later in the startUp processing. If -debug was not specified as a command option this method does nothing. May be called from Delay>>startup to invoke a debugger at the earliest possible time." ^ self current evaluateArg: #debug.! Item was changed: ----- Method: DoItFirst>>cwd: (in category 'actions') ----- cwd: path + "Evaluate arg and print the result on stdout, or error message on stderr." - "Evaluate arg and print the result on stdout, or error message on stderr. - Exit immediately without saving the image." (FileDirectory on: path) exists ifTrue: [ FileDirectory setDefaultDirectory: path ] + ifFalse: [ (self printError: path, ': directory does not exist') + ifTrue: [ Smalltalk quitPrimitive ]].! - ifFalse: [ FileStream stderr nextPutAll: path, ': directory does not exist'; lf; flush. - Smalltalk quitPrimitive ] - ! Item was changed: ----- Method: DoItFirst>>doIt: (in category 'actions') ----- doIt: arguments "Evaluate arguments and print the result on stdout, or error message on stderr. Exit the image after any error." arguments do: [ :arg | + [ self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | self printError: ex asString ]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>evaluateFileContents: (in category 'actions') ----- evaluateFileContents: fileName "Evaluate the contents of a file and print the result on stdout, or error message on stderr. Exit immediately without saving the image." | fs arg | + [fs := FileStream oldFileNamed: fileName. + [arg := fs contentsOfEntireFile. + ^ self evaluateOption: arg] + ensure: [fs close]] + on: Exception + do: [:ex | (self printError: ex asString) + ifTrue: [Smalltalk quitPrimitive]].! - [ [ fs := FileStream oldFileNamed: fileName. ] - on: FileDoesNotExistException - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]. - arg := fs contentsOfEntireFile. - ^ self evaluateOption: arg. - ] ensure: [ fs close ]. - ! Item was changed: ----- Method: DoItFirst>>evaluateOption: (in category 'actions') ----- evaluateOption: arg "Evaluate option and print the result on stdout, or error message on stderr. Exit immediately without saving the image." + | safeToQuit | + [ safeToQuit := self printOut: (Compiler evaluate: arg) asString ] - [FileStream stdout nextPutAll: (Compiler evaluate: arg) asString; lf; flush] on: Error + do: [ :ex | safeToQuit := self printError: ex asString ]. + safeToQuit ifTrue: [ Smalltalk quitPrimitive ].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush ]. - Smalltalk quitPrimitive! Item was changed: ----- Method: DoItFirst>>fileIn: (in category 'actions') ----- fileIn: fileNames "File in each named file. On error, print a message to stderr and exit the image." fileNames do: [ :arg | [ | fs | fs := FileStream oldFileNamed: arg. + self printOut: 'file in ', fs name. - FileStream stdout nextPutAll: 'file in ', fs name; lf; flush. fs fileIn ] on: Error + do: [ :ex | (self printError: ex asString) + ifTrue: [ Smalltalk quitPrimitive ]]].! - do: [ :ex | FileStream stderr nextPutAll: ex asString; lf; flush. - Smalltalk quitPrimitive ]]! Item was changed: ----- Method: DoItFirst>>help (in category 'actions') ----- help + self printOut: self class name, ' image arguments:'. - FileStream stdout nextPutAll: self class name, ' image arguments:'; lf. { '--doit argumentlist "evaluate each argument as a doIt expression"' . '--evaluate arg "evaluate arg, print result then exit"' . '--file filename "evaluate contents of filename, print result then exit"' . '--filein filelist "file in each file named in fileList"' . '--cwd path "set FileDirectory defaultDirectory to path prior to evaluating other options"' . '--debug "enter a debugger as soon as possible in the startUp processing"'. '--help "print this message"' + } do: [ :e | self printOut: String tab, e ]. + self printOut: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'. + (self printOut: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help') + ifTrue: [ Smalltalk quitPrimitive ]. "do not quit if output went to the transcript"! - } do: [ :e | FileStream stdout tab; nextPutAll: e; lf ]. - FileStream stdout - nextPutAll: 'some arguments have single character synonyms, -f is a synonym for --file, -d for --doit'; lf; - nextPutAll: 'single ''-'' may be used instead of ''--'', -help is interpreted as --help'; lf; - flush. - Smalltalk quitPrimitive. - - ! Item was added: + ----- Method: DoItFirst>>print:to: (in category 'private') ----- + print: aString to: stream + [ stream nextPutAll: aString; lf; flush ] + on: Error + do: [ Transcript cr; show: self class name , ' output: ', aString; flush. + ^false ]. + ^true. + ! Item was added: + ----- Method: DoItFirst>>printError: (in category 'private') ----- + printError: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stderr. + ! Item was added: + ----- Method: DoItFirst>>printOut: (in category 'private') ----- + printOut: aString + "Print to stdout if available, otherwise to the transcript. Answer true if + the stdio stream was used, false if output was redirected to transcript." + ^self print: aString to: FileStream stdout. + ! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 37187 bytes Desc: not available URL: From lecteur at zogotounga.net Fri Dec 18 10:52:03 2020 From: lecteur at zogotounga.net (=?UTF-8?Q?St=c3=a9phane_Rollandin?=) Date: Fri, 18 Dec 2020 11:52:03 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> Message-ID: <77e8a843-1293-3ee2-7f8e-aa4b5fd12afb@zogotounga.net> >> Yes, but that scaledVol value is already set to change cyclicly (is that a word?) in FMSound organ1 in order to modulate the base sine wave and give it some timbre. If we attempt to use that same value to control the overall loudness, we will lose the timbre. In fact we would need to multiply the timbral volume envelope with the loudness one, but this is not trivial because the first one uses a loop. > > I *think* that the FMSound>>#primitiveMixFMSound code handles this; at least it looks like it pays attention to the waveTable etc. I've just taken a quick look and the code that changes the scaleVol if the scaledVolIncr value is non-0 is there in the prim too, so there hasn't been a major regression in the code. Probably. That's what I am talking about. Because there is only one scaledVol instance, its evolution in time can be (and actually *is*) described by a *single* envelope. Now see the code in FMSound>>#organ1 There, that envelope is defined in snd addEnvelope: (VolumeEnvelope points: p loopStart: 2 loopEnd: 4). So that is what drives the time evolution of scaledVol. It is a short envelope constantly looping over break points 2 to 4. If you now want to control the overall loudness of the sound, let's say for a crescendo, you have to surimpose to this scaledVol evolution a gradual increase of its max value - this cannot anymore be defined by a looping envelope. Stef From lecteur at zogotounga.net Fri Dec 18 11:06:45 2020 From: lecteur at zogotounga.net (=?UTF-8?Q?St=c3=a9phane_Rollandin?=) Date: Fri, 18 Dec 2020 12:06:45 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> <6e578196-5c02-ed95-e1dc-1f4ac386c220@zogotounga.net> <8A4BDB5E-922F-45DD-BB58-27D20491E1CD@rowledge.org> Message-ID: <51b4eb6f-745b-4c05-6f6c-e7057ef599c6@zogotounga.net> By the way, it is possible in muO to have that kind of waveform display, along with the spectrogram. Try for example (AbstractSound bachFugueVoice1On: PluckedSound default) viewSamples This will yield a zoommable-field morph representing the waveform, where click-dragging smoothly scrolls the display, a shift+click-drag smoothly scales it (images attached). The right-click menu gives access to the FFT settings. Best, Stef -------------- next part -------------- A non-text attachment was scrubbed... Name: waveform1.png Type: image/png Size: 9378 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveform2.png Type: image/png Size: 24806 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveform3.png Type: image/png Size: 18524 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveform4.png Type: image/png Size: 184120 bytes Desc: not available URL: From commits at source.squeak.org Fri Dec 18 12:00:39 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 12:00:39 0000 Subject: [squeak-dev] The Trunk: System-mt.1203.mcz Message-ID: Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1203.mcz ==================== Summary ==================== Name: System-mt.1203 Author: mt Time: 18 December 2020, 1:00:34.958366 pm UUID: 1aa9ec9e-b39a-934f-9f81-1503c06477e5 Ancestors: System-mt.1202 SpaceTally again. Don't forget to count the space that is reachable from pools. But only do that after analysing class instances. And don't count things via pools that have already been counted via instance variables. =============== Diff against System-mt.1202 =============== Item was changed: ----- Method: SpaceTally>>computeSpaceUsage (in category 'class analysis') ----- computeSpaceUsage results do: [ :entry | + | class instanceSpaceAndCount seenObjects poolSpace | - | class instanceSpaceAndCount | class := self class environment at: entry analyzedClassName. Smalltalk garbageCollectMost. + seenObjects := self depth > 0 ifTrue: [IdentitySet new]. + instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth seen: seenObjects. + poolSpace := self spaceForPoolsOf: class depth: self depth seen: seenObjects. - instanceSpaceAndCount := self spaceForInstancesOf: class depth: self depth. entry codeSize: class spaceUsed; instanceCount: instanceSpaceAndCount second; spaceForInstances: instanceSpaceAndCount first; + spaceForPools: poolSpace first; depthOfSpace: self depth ] displayingProgress: 'Taking statistics...'! Item was added: + ----- Method: SpaceTally>>spaceForPoolsOf: (in category 'class analysis') ----- + spaceForPoolsOf: aClass + + ^ self spaceForPoolsOf: aClass depth: self depth! Item was added: + ----- Method: SpaceTally>>spaceForPoolsOf:depth: (in category 'class analysis') ----- + spaceForPoolsOf: aClass depth: anInteger + + ^ self spaceForPoolsOf: aClass depth: anInteger seen: (anInteger > 0 ifTrue: [IdentitySet new])! Item was added: + ----- Method: SpaceTally>>spaceForPoolsOf:depth:seen: (in category 'class analysis') ----- + spaceForPoolsOf: aClass depth: anInteger seen: seenObjects + + | pools objects total | + pools := {aClass classPool}, aClass sharedPools. + objects := pools gather: [:pool | pool values]. + objects isEmpty ifTrue: [^#(0 0)]. + total := 0. + objects do: [:each | total := total + (self spaceForInstance: each depth: anInteger seen: seenObjects)]. + ^{ total. objects size }! Item was changed: Object subclass: #SpaceTallyItem + instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances spaceForPools depthOfSpace' - instanceVariableNames: 'analyzedClassName codeSize instanceCount spaceForInstances depthOfSpace' classVariableNames: '' poolDictionaries: '' category: 'System-Tools'! !SpaceTallyItem commentStamp: 'sd 6/20/2003 22:02' prior: 0! I'm represent an entry in the spaceTally.! Item was changed: ----- Method: SpaceTallyItem>>printOn: (in category 'printing') ----- printOn: aStream analyzedClassName ifNotNil: [ aStream nextPutAll: analyzedClassName asString]. aStream nextPutAll: ' ('. codeSize ifNotNil: [ aStream nextPutAll: 'code size: ' ; nextPutAll: codeSize asString]. instanceCount ifNotNil: [ aStream nextPutAll: ' instance count: ' ; nextPutAll: instanceCount asString]. spaceForInstances ifNotNil: [ aStream nextPutAll: ' space for instances: ' ; nextPutAll: spaceForInstances asBytesDescription]. + spaceForPools + ifNotNil: [ aStream nextPutAll: ' extra for pools: ' ; nextPutAll: spaceForPools asBytesDescription]. depthOfSpace ifNotNil: [ aStream nextPutAll: ' depth of space: ' ; nextPutAll: depthOfSpace asString]. aStream nextPut: $). ! Item was added: + ----- Method: SpaceTallyItem>>spaceForPools (in category 'accessing') ----- + spaceForPools + + ^ spaceForPools! Item was added: + ----- Method: SpaceTallyItem>>spaceForPools: (in category 'accessing') ----- + spaceForPools: aNumber + + spaceForPools := aNumber! From herbertkoenig at gmx.net Fri Dec 18 12:46:07 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Fri, 18 Dec 2020 13:46:07 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <31149895-E36E-40F5-B22D-2112CDCB6039@rowledge.org> Message-ID: Hi all, just noticed SoundBuffer is 16 bits so my suggestions are not practicable. Cheers, Herbert Am 17.12.2020 um 14:14 schrieb Herbert König: > Hi Tim, > > tl,dr Let's build a limiter. > > I stopped using Squeak for Audio with 3.8 :-) With that in mind: > > I believe that all sound goes out through SoundPlayer playing > SoundBuffers. The samples get created via mixSsampleCountInto.... which > seems to be implemented by many classes and there they all seem to do > clipping. > > After running some of your examples I found several SoundBuffers > containing samples 32767 and -32768 which indicates clipping.  I didn't > find enough consecutive clipped samples (you shouldn't hear a single > one) but that's because I only found a few SoundBuffers. > BTW running your example labelled "OK because.." also clipped when run > several times. > > I didn't find the place where float values are changed to Integers for > output. > > I did not find any limiter. --> baaad! > > So if the above is true and the problem is really the clipping (I had > the impression I also heard some wrapping where 32768 uses the top bit > as a sign) I suggest: > -No clipping during the mixing > -Find the place where the SoundBuffers go to the hardware > -Implement a limiter there > > Basically you need a controlled gain. You look ahead in your SoundBuffer > for min and max. In case of overflow you calculate the necessary gain > and gradually reduce your actual gain in the time you have until that > sample really gets output. (attack phase). If no over/underflow is found > you (more) gradually raise your gain back to 1 (release phase). Maybe > introduce some delay before raising your gain again (hold phase). > > For live real time audio you may not have the luxury to look ahead. You > still reduce your gain gradually (let's say in 10 ms) and clip until you > reached your final gain. Human's ears tend to tolerate this. > > There's tons of compromises to evaluate with a limiter we should go with > a bit over TSTTCPW to save CPU. Maybe have another preference to choose > the system wide limiter. SCNR :-))) > > I can help with rough implementations and audiowise discussions but have > no idea where to hook it in and cannot convert it to a primitive or > optimize it. > > Let's wait until Stef chimes in, I'm sure he has solved that for muO > already. > > Best regards, > > Herbert > > > Am 16.12.2020 um 23:52 schrieb tim Rowledge: >> I've discovered that playing two or more sounds simultaneously can >> make truly appalling noises. I'm hoping somebody has a good solution. >> >> The problem started with playing a sound and using the >> pianokeyboardmorph at the same time. Ouch! Also, swizzling the mouse >> across the keyboard causes occasional quite audible 'scratchy-clicks' >> somehow. There can also be a quite noticeable sound between notes, >> not easily describable but sort of a 'dull thump'. >> >> I thought it was some issue with how the sound was played, maybe the >> note-end process as each piano key was released and the next pressed, >> timing issues.. but none of that had very much effect. >> >> The AbstractSound>>#stopGracefully method does seem to have a small >> bug, in that the decayInMs value surely ought not be the sum of the >> attack & decay times from the envelope? But carefully fudging the >> note shutdown to be faster didn't help a lot. >> >> After too much messing around I discovered that at least some of the >> problem is the mixing of sounds. >> >> Now, I know we did a small change to MixedSound>>#add:pan:volume: >> since 5.3, and that we made a small change to the >> SampledSound>>#mixSampleCount:into:startingAt:leftVol:rightVol: >> primitive. However, I'm running on a VM that has the prim change, and >> I've ported across the add:pan... change, with no real difference. >> This is, of course, on a Pi, but the same issue is audible on my iMac >> as well. >> >> Eventually I cottoned on to the fact that I was mixing two sounds >> with volumes set to 100%. Changing to 50% for both actually results >> in a perfectly fine end result - Yay! This doesn't seem like a robust >> solution though. What if I have four sounds playing each set to 40%? >> Why does it seem to work perfectly well for >> AbstractSound>>#stereoBachFugue play, which uses four? >> >> To make life even more fun, it doesn't seem like there is any volume >> control once a sound is playing. The >> AbstractSound>>#adjustVolumeTo:overMSecs: method appears to be the >> one to use but it has no audible effect. There is also #loudness: >> which does work, but produces pretty much exactly the glitch I hear >> from glissandoing(?) the keyboard. >> >> So - some workspace code to illustrate >> >> "awful noise when mixing" >> |snd| >> snd := FMSound organ1. >> snd setPitch: 440 dur: 10 loudness: 0.9; >>     play. >> 1 second wait. >> >> FMSound brass1 setPitch: 470 dur:2 loudness: 0.9; >>     play. >> 1 second wait. >> snd stopGracefully >> >> "OK, because both  sound defualt to quieter" >> |snd | >> snd := FMSound organ1. >> snd >>     duration: 5; >>     play. >> 1 second wait. >> >> FMSound brass1 >>     play. >> >> 1 second wait. >> snd stopGracefully. >> >> "nasty glitch using #loudness: plus mixing graunch" >> |snd | >> snd := FMSound organ1. >> snd duration: 5; >>     play. >> 1 second wait. >> snd loudness: 1.0 . >> >> 1 second wait. >> FMSound brass1 >>     play. >> >> 1 second wait. >> snd stopGracefully. >> >> >> "no effect from adjustVol..." >> |snd | >> snd := FMSound organ1. >> snd >>     duration: 5; >>     play. >> 1 second wait. >> snd adjustVolumeTo: 1.0 overMSecs: 500. >> 1 second wait. >> FMSound brass1 >>     play. >> >> 1 second wait. >> snd stopGracefully. >> >> Aargh! >> >> tim >> -- >> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim >> A computer program does what you tell it to do, not what you want it >> to do. >> >> >> > > From commits at source.squeak.org Fri Dec 18 14:57:59 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 14:57:59 0000 Subject: [squeak-dev] The Trunk: System-dtl.1204.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1204.mcz ==================== Summary ==================== Name: System-dtl.1204 Author: dtl Time: 18 December 2020, 9:57:54.912942 am UUID: 47e43f60-e3fa-4174-ada2-b0b5eb6795d0 Ancestors: System-mt.1203 Enable removal of preference for 'Read document at startup'. Simplify code such that #readDocumentAtStartup is assumed always true and document specifiers begining with '-' are not treated as start documents. The actual preference setting is no longer referenced. Assumptions: if the start document resource name starts with '-' then it is unlikely to be a document. For the case of the first argument appearing to be a document but the user wishing to use it otherwise, the '--' token (or any other argument beginning with '-') may be used in the command line to protect the argument from evaluation. This allows the traditional start document processing to work normally in the general case, and allows start document processing to be bypassed from the command line if desired. No preference setting is required. The #readDocumentAtStartup may be removed in a future update. =============== Diff against System-mt.1203 =============== Item was changed: ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') ----- startUpAfterLogin | scriptName loader isUrl | self setupFlaps. + Smalltalk firstArgMightBeDocument + ifTrue: [scriptName := Smalltalk documentPath. - Preferences readDocumentAtStartup - ifTrue: [scriptName := Smalltalk documentPath - ifNil: ['']. scriptName := scriptName convertFromSystemString. scriptName isEmpty ifFalse: ["figure out if script name is a URL by itself" isUrl := (scriptName asLowercase beginsWith: 'http://') or: [(scriptName asLowercase beginsWith: 'file://') or: [scriptName asLowercase beginsWith: 'ftp://']]. isUrl ifFalse: [| encodedPath pathTokens | "Allow for ../dir/scriptName arguments" pathTokens := scriptName splitBy: FileDirectory slash. pathTokens := pathTokens collect: [:s | s encodeForHTTP]. encodedPath := pathTokens reduce: [:acc :each | acc , FileDirectory slash , each]. scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]] ifFalse: [scriptName := '']. scriptName isEmptyOrNil ifTrue: [^ Preferences eToyFriendly ifTrue: [self currentWorld addGlobalFlaps]]. loader := CodeLoader new. loader loadSourceFiles: (Array with: scriptName). (scriptName asLowercase endsWith: '.pr') ifTrue: [self installProjectFrom: loader] ifFalse: [loader installSourceFiles]! Item was changed: ----- Method: SmalltalkImage>>arguments (in category 'command line') ----- arguments "Answer an array with all the command line arguments. + This does not include imagePath, documentPath nor any option. + The '--' token on the command line indicates that remaining arguments should + be passed to the image without interpretation, and should not be treated as e.g. + specification of a start script." + - This does not include imagePath, documentPath nor any option." - "Smalltalk commandLine arguments" + | args | - | args strm | args := self rawArguments. + (args includes: '--' ) + ifTrue: [ ^ args copyAfter: '--' ] + ifFalse: [ | rs | rs := args readStream. + rs next. "skip image name" + self firstArgMightBeDocument + ifTrue: [rs next "skip startup document name"]. + ^ rs upToEnd ]. - (args includes: '--') - ifTrue: [ ^args copyAfter: self imageArgumentsMarker ]. - strm := args readStream. - strm atEnd ifFalse: [ strm next. "skip image name" - (Preferences readDocumentAtStartup and: [ strm atEnd not ]) - ifTrue: [ strm next "skip startup document name" ]]. - ^ strm upToEnd. ! Item was changed: ----- Method: SmalltalkImage>>documentPath (in category 'command line') ----- documentPath "Answer the absolute path of the document passed to the VM or nil if none." "Smalltalk commandLine documentPath" + ^ (self getSystemAttribute: 2) ifNil: [ '' ] - ^ (self getSystemAttribute: 2) - ifNotNil: [ :arg | arg = self imageArgumentsMarker - ifTrue: [nil] ifFalse: [arg]]. - ! Item was added: + ----- Method: SmalltalkImage>>firstArgMightBeDocument (in category 'private') ----- + firstArgMightBeDocument + "If the first argument begins with '-' then it is unlikely to be a document specification" + ^ (self documentPath beginsWith: '-') not + ! Item was removed: - ----- Method: SmalltalkImage>>imageArgumentsMarker (in category 'command line') ----- - imageArgumentsMarker - "The '--' token on the command line indicates that remaining arguments should - be passed to the image without interpretation, and should not be treated as e.g. - specification of a start script." - - ^ '--'! From lewis at mail.msen.com Fri Dec 18 15:01:35 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 18 Dec 2020 10:01:35 -0500 Subject: [squeak-dev] The Trunk: System-dtl.1204.mcz In-Reply-To: References: Message-ID: <20201218150135.GA88285@shell.msen.com> On Fri, Dec 18, 2020 at 02:57:59PM +0000, commits at source.squeak.org wrote: > David T. Lewis uploaded a new version of System to project The Trunk: > http://source.squeak.org/trunk/System-dtl.1204.mcz > > ==================== Summary ==================== > > Name: System-dtl.1204 > Author: dtl > Time: 18 December 2020, 9:57:54.912942 am > UUID: 47e43f60-e3fa-4174-ada2-b0b5eb6795d0 > Ancestors: System-mt.1203 > > Enable removal of preference for 'Read document at startup'. > This replaces System-dtl.1197, which I have moved to the treated inbox. Dave From lewis at mail.msen.com Fri Dec 18 15:04:56 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 18 Dec 2020 10:04:56 -0500 Subject: [squeak-dev] The Trunk: System-dtl.1201.mcz In-Reply-To: References: Message-ID: <20201218150456.GB88285@shell.msen.com> On Fri, Dec 18, 2020 at 10:12:40AM +0100, Marcel Taeumel wrote: > Hi Dave! > > Fixed in??System-mt.1202. No only your changes for document loading, which are waiting in the inbox, are missing. :-) > > Best, > Marcel > Thank you Marcel! The inbox changes are added now too. Dave From commits at source.squeak.org Fri Dec 18 15:45:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:45:21 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-mt.133.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-mt.133.mcz ==================== Summary ==================== Name: HelpSystem-Core-mt.133 Author: mt Time: 18 December 2020, 4:45:20.673078 pm UUID: d4ffb843-a333-1e46-a58f-4aeed3e95f49 Ancestors: HelpSystem-Core-mt.121, HelpSystem-Core-ct.117, HelpSystem-Core-ct.118, HelpSystem-Core-ct.122, HelpSystem-Core-ct.132, HelpSystem-Core-ct.125, HelpSystem-Core-ct.126, HelpSystem-Core-ct.127 Merges various contributions from Christoph (ct) for Squeak's Help Browser: - menu for tree to inspect/explore/browse help topics - more robust help-topic authoring - adds #bookBlurbKey to use an existing page as blurb - adds pragma to denote generated pages for ClassBasedHelpTopic, which is important to not mess up formatting, which is stand off (i.e. that ]style[) Also fixes the bug where the window title (path) gets lost after editing a topic. Thanks Christoph! :-) =============== Diff against HelpSystem-Core-mt.121 =============== Item was changed: ----- Method: AbstractHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic + "If this topic is editable, this will be the callback to update its contents." + ^ false! - "If this topic is editable, this will be the callback to update its contents."! Item was added: + ----- Method: AbstractHelpTopic>>browseTopicFromParent: (in category 'tools') ----- + browseTopicFromParent: parentTopic + + self canBrowseTopic + ifTrue: [^ self browseTopic]. + parentTopic canBrowseSubtopic + ifTrue: [^ parentTopic browseSubtopic: self]. + ! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopicFromParent: (in category 'testing') ----- + canBrowseTopicFromParent: parentTopic + + ^ self canBrowseTopic or: [ + parentTopic notNil and: [parentTopic canBrowseSubtopic]]! Item was added: + ----- Method: AbstractHelpTopic>>subtopicAt: (in category 'accessing') ----- + subtopicAt: key + "Answer the subtopic that has the given key or nil if no such topic can be found. Always answer nil for the 'nil' key because a topic's key 'nil' means 'unspecified'." + + ^ key ifNotNil: [self subtopics detect: [:topic | topic key = key] ifNone: []]! Item was added: + ----- Method: AbstractHelpTopic>>topicMenu:parentTopic: (in category 'menus') ----- + topicMenu: aMenu parentTopic: parentTopic + + (self canBrowseTopicFromParent: parentTopic) + ifTrue: [ + aMenu + add: 'browse (b)' translated + target: self + selector: #browseTopicFromParent: + argumentList: {parentTopic}; + addLine ]. + aMenu + add: 'inspect (i)' translated target: self action: #inspect; + add: 'explore (I)' translated target: self action: #explore. + + ^ aMenu! Item was added: + ----- Method: AbstractHelpTopic>>topicMenuKey:fromParent: (in category 'menus') ----- + topicMenuKey: aChar fromParent: parentTopic + + aChar + caseOf: { + [$b] -> [(self canBrowseTopicFromParent: parentTopic) + ifTrue: [ self browseTopicFromParent: parentTopic ]]. + [$i] -> [self inspect]. + [$I] -> [self explore] } + otherwise: [^ false]. + ^ true! Item was added: + ----- Method: ClassAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass theMetaClass browse! Item was added: + ----- Method: ClassAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: ClassAPIHelpTopic>>key (in category 'accessing') ----- + key + + ^ self theClass name! Item was changed: ----- Method: ClassBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic "Supports indirect content storage in classes other than helpClass." | topicClass topicMethodSelector code indirect | + (subtopic respondsTo: #contentsAsIs) + ifFalse: [^ self inform: 'Cannot store into this topic' translated]. + (indirect := subtopic contentsAsIs isMessageSend) ifFalse: [ topicClass := self helpClass. topicMethodSelector := subtopic key asLegalSelector asSymbol] ifTrue: [ topicClass := subtopic contentsAsIs receiver. topicMethodSelector := subtopic contentsAsIs selector]. + (topicClass class includesSelector: topicMethodSelector) ==> [self okToWriteSelector: topicMethodSelector] + ifFalse: [^ false]. + code := String streamContents:[:s| s nextPutAll: topicMethodSelector. s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'. s crtab; nextPutAll: '"', self helpClass name,' edit: ', subtopic key storeString,'"'. indirect ifTrue: [s crtab; nextPutAll: '^ ('] ifFalse: [ + s crtab; nextPutAll: ''. s crtab; nextPutAll: '^(HelpTopic'. s crtab: 2; nextPutAll: 'title: ', subtopic title storeString. s crtab: 2; nextPutAll: 'contents: ']. s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: newContents]) storeString. s nextPutAll:' readStream nextChunkText)'. indirect ifFalse: [ subtopic key ifNotNil: [s crtab: 3; nextPutAll: 'key: ', subtopic key storeString; nextPutAll: ';']. subtopic shouldStyle ifNotNil: [s crtab: 3; nextPutAll: 'shouldStyle: ', subtopic shouldStyle storeString; nextPutAll: ';']. s crtab: 3; nextPutAll: 'yourself'] ]. topicClass class compile: code + classified: ((topicClass class organization categoryOfElement: topicMethodSelector) ifNil:['pages']). + ^ true! - classified: ((topicClass class organization categoryOfElement: topicMethodSelector) ifNil:['pages']).! Item was added: + ----- Method: ClassBasedHelpTopic>>browseSubtopic: (in category 'tools') ----- + browseSubtopic: aTopic + + ^ ToolSet browse: self helpClass theMetaClass selector: aTopic key! Item was added: + ----- Method: ClassBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self helpClass theMetaClass browse! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ true! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was changed: ----- Method: ClassBasedHelpTopic>>contents (in category 'accessing') ----- contents + ^ self helpClass bookBlurb ifEmpty: [ + (self subtopicAt: self helpClass bookBlurbKey) + ifNil: [''] ifNotNil: [:topic | topic contents]]! - ^ helpClass bookBlurb! Item was added: + ----- Method: ClassBasedHelpTopic>>key (in category 'accessing') ----- + key + + ^ self helpClass name! Item was added: + ----- Method: ClassBasedHelpTopic>>okToWriteSelector: (in category 'editing') ----- + okToWriteSelector: aSelector + + | method | + method := self helpClass theMetaClass compiledMethodAt: aSelector ifAbsent: [^ true]. + (method hasPragma: #generated) ifTrue: [^ true]. + ^ (Project uiManager + chooseFrom: (#('Override it' 'Don''t override, but browse it' 'Cancel') collect: #translated) + values: { [true]. [method browse. false]. [false] } + title: ('This will override the existing method\{1}!!\Proceed anyway?' withCRs translated asText + format: {method reference asText + addAttribute: (TextLink new classAndMethod: method reference); + yourself })) value == true! Item was changed: ----- Method: CustomHelp class>>bookBlurb (in category 'accessing') ----- bookBlurb + "Returns a short summary of the custom help book. Overrides #bookBlurbKey" - "Returns a short summary of the custom help book" ^ self organization classComment! Item was added: + ----- Method: CustomHelp class>>bookBlurbKey (in category 'accessing') ----- + bookBlurbKey + "Key of the page to show as contents if (1) #bookBlurb is empty and (2) no subtopic is selected in the help browser." + ^ nil! Item was changed: ----- Method: DirectoryBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic FileStream forceNewFileNamed: subtopic fileEntry fullName do: [:strm | strm nextChunkPutWithStyle: newContents]. + ^ true ! Item was added: + ----- Method: DirectoryBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self directoryEntry asFileDirectory! Item was added: + ----- Method: DirectoryBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: DirectoryBasedHelpTopic>>key (in category 'accessing') ----- + key + + ^ self directoryEntry fullName! Item was changed: ----- Method: FileBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic FileStream forceNewFileNamed: self fileEntry fullName do: [:strm | strm nextChunkPutWithStyle: newContents]. + ^ true - ! Item was added: + ----- Method: FileBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self fileEntry containingDirectory! Item was added: + ----- Method: FileBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: HelpBrowser class>>on: (in category 'instance creation') ----- + on: aHelpTopic + + ^ self defaultHelpBrowser new + rootTopic: aHelpTopic; + yourself! Item was changed: ----- Method: HelpBrowser class>>openOn: (in category 'instance creation') ----- openOn: aHelpTopic + "Open the receiver on the given help topic or any other object that can be transformed into + a help topic by sending #asHelpTopic." + + ^ (self on: aHelpTopic) open! - "Open the receiver on the given help topic or any other object that can be transformed into - a help topic by sending #asHelpTopic." - - ^(self defaultHelpBrowser new) - rootTopic: aHelpTopic; - open! Item was changed: ----- Method: HelpBrowser>>accept: (in category 'actions') ----- accept: text "Accept edited text. Compile it into a HelpTopic" | parent currentKey normalizedText colorsToRemove | ((self currentParentTopic isNil or: [self currentParentTopic isEditable not]) or: [self currentTopic isEditable not]) + ifTrue: [^ self inform: 'This help topic cannot be edited.' translated]. - ifTrue: [^ self inform: 'This help topic cannot be edited.']. - self changed: #clearUserEdits. - "Remove default colors for the sake of UI themes." normalizedText := text. colorsToRemove := {Color black. Color white}. normalizedText runs: (normalizedText runs collect: [:attributes | attributes reject: [:attribute | (((attribute respondsTo: #color) and: [colorsToRemove includes: attribute color]) or: [attribute respondsTo: #font])]]). parent := self currentParentTopic. currentKey := self currentTopic key. + [isUpdating := true. + (parent accept: normalizedText for: self currentTopic) == true + ifFalse: [^ false]. + self changed: #clearUserEdits. - isUpdating := true. - - parent accept: normalizedText for: self currentTopic. parent refresh. + parent == self rootTopic ifTrue: [self rootTopic: parent]] + ensure: [isUpdating := false]. - parent == self rootTopic ifTrue: [self rootTopic: parent]. + self showTopicNamed: currentKey. + ^ true! - isUpdating := false. - - self currentTopic: (parent subtopics detect: [:t | t key = currentKey]).! Item was changed: ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- buildTreeWith: builder ^ builder pluggableTreeSpec new model: self; nodeClass: HelpTopicListItemWrapper; roots: #toplevelTopics; + menu: #treeMenu:; + keyPress: #treeKey:from:event:; getSelected: #currentTopic; setSelected: #currentTopic:; getSelectedPath: #currentTopicPath; setSelectedPath: #noteTopicPath:; setSelectedParent: #currentParentTopic:; autoDeselect: false; frame: (LayoutFrame fractions: (0 at 0 corner: 0.3 at 1) offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0 at 0)); yourself! Item was added: + ----- Method: HelpBrowser>>treeKey:from:event: (in category 'menus') ----- + treeKey: aChar from: aView event: anEvent + + anEvent anyModifierKeyPressed ifFalse: [^ false]. + ^ (self currentTopic topicMenuKey: aChar fromParent: self currentParentTopic)! Item was added: + ----- Method: HelpBrowser>>treeListMenu: (in category 'menus') ----- + treeListMenu: aMenu + + + ^ self currentTopic + ifNil: [aMenu] + ifNotNil: [:topic | topic + topicMenu: aMenu + parentTopic: self currentParentTopic]! Item was added: + ----- Method: HelpBrowser>>treeMenu: (in category 'menus') ----- + treeMenu: aMenu + + ^ self menu: aMenu for: #(treeListMenu)! Item was changed: ----- Method: HelpHowToHelpTopicsFromCode class>>step7 (in category 'pages') ----- step7 + "This method was automatically generated. Edit it using:" "HelpHowToHelpTopicsFromCode edit: #step7" + ^(HelpTopic - ^HelpTopic title: 'Step 7 - Tips and Tricks' + contents: + 'STEP 7 - TIPS AND TRICKS - contents: - 'STEP 7 - TIPS AND TRICKS Tip1: If you implement the #pages method you can also use the name of a custom help class that should be integrated between the specific pages: + pages + ^#(firstPage MyAppTutorial secondPage) - #pages - ^(firstPage MyAppTutorial secondPage) Tip2: You can easily edit the help contents of a page by using the #edit: message. For our example just evaluate: MyAppHelp edit: #firstPage This will open a workspace with the help contents and when you accept it it will be saved back to the help method defining the topic. + !!' readStream nextChunkText) + key: #step7; + shouldStyle: false; + yourself! - ' - ! Item was added: + ----- Method: MethodListHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass browse! Item was added: + ----- Method: MethodListHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: MethodListHelpTopic>>key (in category 'accessing') ----- + key + + ^ self theClass name! Item was added: + ----- Method: PackageAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ (PackageInfo named: packageName) browse! Item was added: + ----- Method: PackageAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: PackageAPIHelpTopic>>key (in category 'accessing') ----- + key + + ^ self packageName! From commits at source.squeak.org Fri Dec 18 15:46:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:46:21 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.132.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.132.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.132 Author: ct Time: 20 March 2020, 6:38:30.916237 pm UUID: 4ced0d2a-f4ef-7444-8a05-bdfbb1142b2b Ancestors: HelpSystem-Core-ct.123 Refactors "ifNil: [false]" construct. Depends indeed on HelpSystem-Core-ct.123. But I would still like to talk about #notNilAnd: :) =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: AbstractHelpTopic>>browseTopicFromParent: (in category 'tools') ----- + browseTopicFromParent: parentTopic + + self canBrowseTopic + ifTrue: [^ self browseTopic]. + parentTopic canBrowseSubtopic + ifTrue: [^ parentTopic browseSubtopic: self]. + ! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopicFromParent: (in category 'testing') ----- + canBrowseTopicFromParent: parentTopic + + ^ self canBrowseTopic or: [ + parentTopic notNil and: [parentTopic canBrowseSubtopic]]! Item was added: + ----- Method: AbstractHelpTopic>>topicMenu:parentTopic: (in category 'menus') ----- + topicMenu: aMenu parentTopic: parentTopic + + aMenu + add: 'Inspect (i)' translated target: self action: #inspect; + add: 'Explore (I)' translated target: self action: #explore. + (self canBrowseTopicFromParent: parentTopic) + ifTrue: [ + aMenu add: 'Browse (b)' translated + target: self + selector: #browseTopicFromParent: + argumentList: {parentTopic} ]. + + ^ aMenu! Item was added: + ----- Method: AbstractHelpTopic>>topicMenuKey:fromParent: (in category 'menus') ----- + topicMenuKey: aChar fromParent: parentTopic + + aChar + caseOf: { + [$b] -> [(self canBrowseTopicFromParent: parentTopic) + ifTrue: [ self browseTopicFromParent: parentTopic ]]. + [$i] -> [self inspect]. + [$I] -> [self explore] } + otherwise: [^ false]. + ^ true! Item was added: + ----- Method: ClassAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass theMetaClass browse! Item was added: + ----- Method: ClassAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: ClassBasedHelpTopic>>browseSubtopic: (in category 'tools') ----- + browseSubtopic: aTopic + + ^ ToolSet browse: self helpClass theMetaClass selector: aTopic key! Item was added: + ----- Method: ClassBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self helpClass theMetaClass browse! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ true! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: DirectoryBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self directoryEntry asFileDirectory! Item was added: + ----- Method: DirectoryBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: FileBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self fileEntry containingDirectory! Item was added: + ----- Method: FileBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was changed: ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- buildTreeWith: builder ^ builder pluggableTreeSpec new model: self; nodeClass: HelpTopicListItemWrapper; roots: #toplevelTopics; + menu: #treeMenu:; + keyPress: #treeKey:from:event:; getSelected: #currentTopic; setSelected: #currentTopic:; getSelectedPath: #currentTopicPath; setSelectedParent: #currentParentTopic:; autoDeselect: false; frame: (LayoutFrame fractions: (0 at 0 corner: 0.3 at 1) offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0 at 0)); yourself! Item was added: + ----- Method: HelpBrowser>>treeKey:from:event: (in category 'menus') ----- + treeKey: aChar from: aView event: anEvent + + anEvent anyModifierKeyPressed ifFalse: [^ false]. + ^ (self currentTopic topicMenuKey: aChar fromParent: self currentParentTopic)! Item was added: + ----- Method: HelpBrowser>>treeListMenu: (in category 'menus') ----- + treeListMenu: aMenu + + + ^ self currentTopic + ifNil: [aMenu] + ifNotNil: [:topic | topic + topicMenu: aMenu + parentTopic: self currentParentTopic]! Item was added: + ----- Method: HelpBrowser>>treeMenu: (in category 'menus') ----- + treeMenu: aMenu + + ^ self menu: aMenu for: #(treeListMenu)! Item was added: + ----- Method: MethodListHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass browse! Item was added: + ----- Method: MethodListHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: PackageAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ (PackageInfo named: packageName) browse! Item was added: + ----- Method: PackageAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! From commits at source.squeak.org Fri Dec 18 15:46:34 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:46:34 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.127.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.127.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.127 Author: ct Time: 14 December 2019, 12:40:38.430841 am UUID: b862e17a-aac7-434c-a028-0e4c364feeb5 Ancestors: HelpSystem-Core-mt.118 Fix a small syntax error in the Help on Help cpde examples =============== Diff against HelpSystem-Core-mt.118 =============== Item was changed: ----- Method: HelpHowToHelpTopicsFromCode class>>step7 (in category 'pages') ----- step7 + "This method was automatically generated. Edit it using:" "HelpHowToHelpTopicsFromCode edit: #step7" + ^(HelpTopic - ^HelpTopic title: 'Step 7 - Tips and Tricks' + contents: + 'STEP 7 - TIPS AND TRICKS - contents: - 'STEP 7 - TIPS AND TRICKS Tip1: If you implement the #pages method you can also use the name of a custom help class that should be integrated between the specific pages: + pages + ^#(firstPage MyAppTutorial secondPage) - #pages - ^(firstPage MyAppTutorial secondPage) Tip2: You can easily edit the help contents of a page by using the #edit: message. For our example just evaluate: MyAppHelp edit: #firstPage This will open a workspace with the help contents and when you accept it it will be saved back to the help method defining the topic. + !!' readStream nextChunkText) + key: #step7; + shouldStyle: false; + yourself! - ' - ! From commits at source.squeak.org Fri Dec 18 15:46:41 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:46:41 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.126.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.126.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.126 Author: ct Time: 14 October 2019, 12:37:56.074932 am UUID: a74dcf56-b7cb-4440-b558-8237b0c0723f Ancestors: HelpSystem-Core-mt.116 Implement #key on further help topic classes =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: ClassAPIHelpTopic>>key (in category 'accessing') ----- + key + + ^ self theClass name! Item was added: + ----- Method: ClassBasedHelpTopic>>key (in category 'accessing') ----- + key + + ^ self helpClass name! Item was added: + ----- Method: DirectoryBasedHelpTopic>>key (in category 'accessing') ----- + key + + ^ self directoryEntry fullName! Item was added: + ----- Method: MethodListHelpTopic>>key (in category 'accessing') ----- + key + + ^ self theClass name! Item was added: + ----- Method: PackageAPIHelpTopic>>key (in category 'accessing') ----- + key + + ^ self packageName! From commits at source.squeak.org Fri Dec 18 15:46:46 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:46:46 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.125.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.125.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.125 Author: ct Time: 14 October 2019, 12:33:57.997932 am UUID: bdc17b48-7f21-844e-ad05-f3ba9876fd3f Ancestors: HelpSystem-Core-mt.116 Adds CustomHelp>>#defaultPageKey to show the contents of a specified subtopic if a ClassBasedHelpTopic is selected =============== Diff against HelpSystem-Core-mt.116 =============== Item was changed: ----- Method: ClassBasedHelpTopic>>contents (in category 'accessing') ----- contents "A book has no contents. Only its pages do." + ^ self defaultSubtopic ifNil: [''] ifNotNil: #contents! - ^ ''! Item was added: + ----- Method: ClassBasedHelpTopic>>defaultSubtopic (in category 'accessing') ----- + defaultSubtopic + + ^ self helpClass defaultPageKey + ifNotNil: [:key | + self subtopics + detect: [:topic | topic key = key] + ifNone: [nil]] + ifNil: [nil]! Item was added: + ----- Method: ClassBasedHelpTopic>>key (in category 'accessing') ----- + key + + ^ self helpClass! Item was added: + ----- Method: CustomHelp class>>defaultPageKey (in category 'accessing') ----- + defaultPageKey + "Key of the page to show if no subtopic is selected, or nil" + ^ nil! From commits at source.squeak.org Fri Dec 18 15:46:54 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:46:54 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.123.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.123.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.123 Author: ct Time: 13 October 2019, 9:04:08.373932 pm UUID: dec7ceca-320f-d945-8d2a-c2f6a5e49a52 Ancestors: HelpSystem-Core-ct.120 Refactors HelpBrowser menu: Move menu stuff from HelpBrowser into HelpTopic hierarchy in favor of a better object design Thanks again, Marcel :-) =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: AbstractHelpTopic>>browseTopicFromParent: (in category 'tools') ----- + browseTopicFromParent: parentTopic + + self canBrowseTopic + ifTrue: [^ self browseTopic]. + parentTopic canBrowseSubtopic + ifTrue: [^ parentTopic browseSubtopic: self]. + ! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ false! Item was added: + ----- Method: AbstractHelpTopic>>canBrowseTopicFromParent: (in category 'testing') ----- + canBrowseTopicFromParent: parentTopic + + ^ self canBrowseTopic or: [ + parentTopic ifNotNil: #canBrowseSubtopic ifNil: [false]]! Item was added: + ----- Method: AbstractHelpTopic>>topicMenu:parentTopic: (in category 'menus') ----- + topicMenu: aMenu parentTopic: parentTopic + + aMenu + add: 'Inspect (i)' translated target: self action: #inspect; + add: 'Explore (I)' translated target: self action: #explore. + (self canBrowseTopicFromParent: parentTopic) + ifTrue: [ + aMenu add: 'Browse (b)' translated + target: self + selector: #browseTopicFromParent: + argumentList: {parentTopic} ]. + + ^ aMenu! Item was added: + ----- Method: AbstractHelpTopic>>topicMenuKey:fromParent: (in category 'menus') ----- + topicMenuKey: aChar fromParent: parentTopic + + aChar + caseOf: { + [$b] -> [(self canBrowseTopicFromParent: parentTopic) + ifTrue: [ self browseTopicFromParent: parentTopic ]]. + [$i] -> [self inspect]. + [$I] -> [self explore] } + otherwise: [^ false]. + ^ true! Item was added: + ----- Method: ClassAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass theMetaClass browse! Item was added: + ----- Method: ClassAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: ClassBasedHelpTopic>>browseSubtopic: (in category 'tools') ----- + browseSubtopic: aTopic + + ^ ToolSet browse: self helpClass theMetaClass selector: aTopic key! Item was added: + ----- Method: ClassBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self helpClass theMetaClass browse! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseSubtopic (in category 'testing') ----- + canBrowseSubtopic + + ^ true! Item was added: + ----- Method: ClassBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: DirectoryBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self directoryEntry asFileDirectory! Item was added: + ----- Method: DirectoryBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: FileBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self fileEntry containingDirectory! Item was added: + ----- Method: FileBasedHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was changed: ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- buildTreeWith: builder ^ builder pluggableTreeSpec new model: self; nodeClass: HelpTopicListItemWrapper; roots: #toplevelTopics; + menu: #treeMenu:; + keyPress: #treeKey:from:event:; getSelected: #currentTopic; setSelected: #currentTopic:; getSelectedPath: #currentTopicPath; setSelectedParent: #currentParentTopic:; autoDeselect: false; frame: (LayoutFrame fractions: (0 at 0 corner: 0.3 at 1) offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0 at 0)); yourself! Item was added: + ----- Method: HelpBrowser>>treeKey:from:event: (in category 'menus') ----- + treeKey: aChar from: aView event: anEvent + + anEvent anyModifierKeyPressed ifFalse: [^ false]. + ^ (self currentTopic topicMenuKey: aChar fromParent: self currentParentTopic)! Item was added: + ----- Method: HelpBrowser>>treeListMenu: (in category 'menus') ----- + treeListMenu: aMenu + + + ^ self currentTopic + ifNil: [aMenu] + ifNotNil: [:topic | topic + topicMenu: aMenu + parentTopic: self currentParentTopic]! Item was added: + ----- Method: HelpBrowser>>treeMenu: (in category 'menus') ----- + treeMenu: aMenu + + ^ self menu: aMenu for: #(treeListMenu)! Item was added: + ----- Method: MethodListHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass browse! Item was added: + ----- Method: MethodListHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! Item was added: + ----- Method: PackageAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ (PackageInfo named: packageName) browse! Item was added: + ----- Method: PackageAPIHelpTopic>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ true! From commits at source.squeak.org Fri Dec 18 15:47:01 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:47:01 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.122.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.122.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.122 Author: ct Time: 3 October 2019, 2:20:52.152682 am UUID: 71c0495c-bf43-b440-aa1b-1cf195eb6a54 Ancestors: HelpSystem-Core-mt.116 Refines accepting text in HelpBrowser - Revise use of #clearUserEdits and isUpdating - Use the right #accept: return pattern (Boolean or False) - Catch an edge case when you try to write something into a nested ClassBasedHelpTopic - Mark saved methods with a #generated pragma; ask user before overwriting non-auto-generated methods to avoid discarding manual code (such as in SqueakToolsDebuggerHelp>>#usingTheDebugger) Depends on Tools-ct.894. =============== Diff against HelpSystem-Core-mt.116 =============== Item was changed: ----- Method: AbstractHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic + "If this topic is editable, this will be the callback to update its contents." + ^ false! - "If this topic is editable, this will be the callback to update its contents."! Item was changed: ----- Method: ClassBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic "Supports indirect content storage in classes other than helpClass." | topicClass topicMethodSelector code indirect | + (subtopic respondsTo: #contentsAsIs) + ifFalse: [^ self inform: 'Cannot store into this topic' translated]. + (indirect := subtopic contentsAsIs isMessageSend) ifFalse: [ topicClass := self helpClass. topicMethodSelector := subtopic key asLegalSelector asSymbol] ifTrue: [ topicClass := subtopic contentsAsIs receiver. topicMethodSelector := subtopic contentsAsIs selector]. + (topicClass class includesSelector: topicMethodSelector) ==> [self okToWriteSelector: topicMethodSelector] + ifFalse: [^ false]. + code := String streamContents:[:s| s nextPutAll: topicMethodSelector. s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'. s crtab; nextPutAll: '"', self helpClass name,' edit: ', subtopic key storeString,'"'. indirect ifTrue: [s crtab; nextPutAll: '^ ('] ifFalse: [ + s crtab; nextPutAll: ''. s crtab; nextPutAll: '^(HelpTopic'. s crtab: 2; nextPutAll: 'title: ', subtopic title storeString. s crtab: 2; nextPutAll: 'contents: ']. s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: newContents]) storeString. s nextPutAll:' readStream nextChunkText)'. indirect ifFalse: [ subtopic key ifNotNil: [s crtab: 3; nextPutAll: 'key: ', subtopic key storeString; nextPutAll: ';']. subtopic shouldStyle ifNotNil: [s crtab: 3; nextPutAll: 'shouldStyle: ', subtopic shouldStyle storeString; nextPutAll: ';']. s crtab: 3; nextPutAll: 'yourself'] ]. topicClass class compile: code + classified: ((topicClass class organization categoryOfElement: topicMethodSelector) ifNil:['pages']). + ^ true! - classified: ((topicClass class organization categoryOfElement: topicMethodSelector) ifNil:['pages']).! Item was added: + ----- Method: ClassBasedHelpTopic>>okToWriteSelector: (in category 'editing') ----- + okToWriteSelector: aSelector + + | method | + method := self helpClass theMetaClass compiledMethodAt: aSelector ifAbsent: [^ true]. + (method hasPragma: #generated) ifTrue: [^ true]. + ^ (UIManager default + chooseFrom: (#('Override it' 'Don''t override, but browse it' 'Cancel') collect: #translated) + values: { [true]. [method browse. false]. [false] } + title: ('This will override the existing method\{1}!!\Proceed anyway?' withCRs translated asText + format: {method reference asText + addAttribute: (TextLink new classAndMethod: method reference); + yourself })) value! Item was changed: ----- Method: DirectoryBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic FileStream forceNewFileNamed: subtopic fileEntry fullName do: [:strm | strm nextChunkPutWithStyle: newContents]. + ^ true ! Item was changed: ----- Method: FileBasedHelpTopic>>accept:for: (in category 'editing') ----- accept: newContents for: subtopic FileStream forceNewFileNamed: self fileEntry fullName do: [:strm | strm nextChunkPutWithStyle: newContents]. + ^ true - ! Item was changed: ----- Method: HelpBrowser>>accept: (in category 'actions') ----- accept: text "Accept edited text. Compile it into a HelpTopic" | parent currentKey normalizedText colorsToRemove | ((self currentParentTopic isNil or: [self currentParentTopic isEditable not]) or: [self currentTopic isEditable not]) + ifTrue: [^ self inform: 'This help topic cannot be edited.' translated]. - ifTrue: [^ self inform: 'This help topic cannot be edited.']. - self changed: #clearUserEdits. - "Remove default colors for the sake of UI themes." normalizedText := text. colorsToRemove := {Color black. Color white}. normalizedText runs: (normalizedText runs collect: [:attributes | attributes reject: [:attribute | (((attribute respondsTo: #color) and: [colorsToRemove includes: attribute color]) or: [attribute respondsTo: #font])]]). parent := self currentParentTopic. currentKey := self currentTopic key. + [isUpdating := true. + (parent accept: normalizedText for: self currentTopic) == true + ifFalse: [^ false]. + self changed: #clearUserEdits. - isUpdating := true. - - parent accept: normalizedText for: self currentTopic. parent refresh. + parent == self rootTopic ifTrue: [self rootTopic: parent]] + ensure: [isUpdating := false]. - parent == self rootTopic ifTrue: [self rootTopic: parent]. + self currentTopic: (parent subtopics detect: [:t | t key = currentKey]). + ^ true! - isUpdating := false. - - self currentTopic: (parent subtopics detect: [:t | t key = currentKey]).! From commits at source.squeak.org Fri Dec 18 15:47:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:47:09 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.120.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.120.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.120 Author: ct Time: 3 October 2019, 1:39:46.913682 am UUID: c9b2afad-2786-1f47-a2f5-8ee6258fe75c Ancestors: HelpSystem-Core-ct.119 Adds browse entry into the HelpBrowser menu =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: ClassAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass theMetaClass browse! Item was added: + ----- Method: ClassBasedHelpTopic>>browseSubtopic: (in category 'tools') ----- + browseSubtopic: aTopic + + ^ ToolSet browse: self helpClass theMetaClass selector: aTopic key! Item was added: + ----- Method: ClassBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self helpClass theMetaClass browse! Item was added: + ----- Method: DirectoryBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self directoryEntry asFileDirectory! Item was added: + ----- Method: FileBasedHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ FileList openOn: self fileEntry containingDirectory! Item was added: + ----- Method: HelpBrowser>>browseTopic (in category 'actions') ----- + browseTopic + + ^ (self currentTopic respondsTo: #browseTopic) + ifTrue: [self currentTopic browseTopic] + ifFalse: [self currentParentTopic browseSubtopic: self currentTopic]! Item was changed: ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- buildTreeWith: builder ^ builder pluggableTreeSpec new model: self; nodeClass: HelpTopicListItemWrapper; roots: #toplevelTopics; + menu: #treeMenu:; + keyPress: #treeKey:from:event:; getSelected: #currentTopic; setSelected: #currentTopic:; getSelectedPath: #currentTopicPath; setSelectedParent: #currentParentTopic:; autoDeselect: false; frame: (LayoutFrame fractions: (0 at 0 corner: 0.3 at 1) offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0 at 0)); yourself! Item was added: + ----- Method: HelpBrowser>>canBrowseTopic (in category 'testing') ----- + canBrowseTopic + + ^ (self currentTopic respondsTo: #browseTopic) + or: [self currentParentTopic respondsTo: #browseSubtopic:]! Item was added: + ----- Method: HelpBrowser>>exploreTopic (in category 'actions') ----- + exploreTopic + + ^ self currentTopic explore! Item was added: + ----- Method: HelpBrowser>>inspectTopic (in category 'actions') ----- + inspectTopic + + ^ self currentTopic inspect! Item was added: + ----- Method: HelpBrowser>>treeKey:from:event: (in category 'menus') ----- + treeKey: aChar from: aView event: anEvent + + anEvent anyModifierKeyPressed ifFalse: [^ false]. + aChar + caseOf: { + [$b] -> [self browseTopic]. + [$i] -> [self inspectTopic]. + [$I] -> [self exploreTopic]. } + otherwise: [^ false]. + ^ true! Item was added: + ----- Method: HelpBrowser>>treeListMenu: (in category 'menus') ----- + treeListMenu: aMenu + + + self currentTopic ifNil: [^ aMenu]. + + aMenu + add: 'Inspect (i)' action: #inspectTopic; + add: 'Explore (I)' action: #exploreTopic. + + self canBrowseTopic ifTrue: [ + aMenu + addLine; + add: 'Browse (b)' action: #browseTopic]. + + ^ aMenu! Item was added: + ----- Method: HelpBrowser>>treeMenu: (in category 'menus') ----- + treeMenu: aMenu + + ^ self menu: aMenu for: #(treeListMenu)! Item was added: + ----- Method: MethodListHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ self theClass browse! Item was added: + ----- Method: PackageAPIHelpTopic>>browseTopic (in category 'tools') ----- + browseTopic + + ^ (PackageInfo named: packageName) browse! From commits at source.squeak.org Fri Dec 18 15:47:16 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:47:16 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.119.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.119.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.119 Author: ct Time: 3 October 2019, 1:27:53.283682 am UUID: 937fe85d-8a7a-be48-bbdf-27efb2ae0dda Ancestors: HelpSystem-Core-mt.116 Adds a simple menu to HelpBrowser (inspect + explore topic) =============== Diff against HelpSystem-Core-mt.116 =============== Item was changed: ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- buildTreeWith: builder ^ builder pluggableTreeSpec new model: self; nodeClass: HelpTopicListItemWrapper; roots: #toplevelTopics; + menu: #treeMenu:; + keyPress: #treeKey:from:event:; getSelected: #currentTopic; setSelected: #currentTopic:; getSelectedPath: #currentTopicPath; setSelectedParent: #currentParentTopic:; autoDeselect: false; frame: (LayoutFrame fractions: (0 at 0 corner: 0.3 at 1) offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0 at 0)); yourself! Item was added: + ----- Method: HelpBrowser>>exploreTopic (in category 'actions') ----- + exploreTopic + + ^ self currentTopic explore! Item was added: + ----- Method: HelpBrowser>>inspectTopic (in category 'actions') ----- + inspectTopic + + ^ self currentTopic inspect! Item was added: + ----- Method: HelpBrowser>>treeKey:from:event: (in category 'menus') ----- + treeKey: aChar from: aView event: anEvent + + anEvent anyModifierKeyPressed ifFalse: [^ false]. + aChar + caseOf: { + [$i] -> [self inspectTopic]. + [$I] -> [self exploreTopic]. } + otherwise: [^ false]. + ^ true! Item was added: + ----- Method: HelpBrowser>>treeListMenu: (in category 'menus') ----- + treeListMenu: aMenu + + + self currentTopic ifNil: [^ aMenu]. + + aMenu + add: 'Inspect (i)' action: #inspectTopic; + add: 'Explore (I)' action: #exploreTopic. + + ^ aMenu! Item was added: + ----- Method: HelpBrowser>>treeMenu: (in category 'menus') ----- + treeMenu: aMenu + + ^ self menu: aMenu for: #(treeListMenu)! From commits at source.squeak.org Fri Dec 18 15:47:25 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:47:25 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.118.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.118.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.118 Author: ct Time: 20 September 2019, 7:57:28.579726 pm UUID: 25ce7919-9959-4c4f-a69d-bd267af4d4fe Ancestors: HelpSystem-Core-mt.116 HelpBrowser: Add + refactor instance creation methods =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: HelpBrowser class>>on: (in category 'instance creation') ----- + on: aHelpTopic + + ^ self defaultHelpBrowser new + rootTopic: aHelpTopic; + yourself! Item was changed: ----- Method: HelpBrowser class>>openForCodeOn: (in category 'instance creation') ----- openForCodeOn: aHelpTopic + ^ ToolBuilder open: ((self on: aHelpTopic) + buildForCodeWith: ToolBuilder default)! - | browser window | - browser := (self defaultHelpBrowser new) - rootTopic: aHelpTopic; - yourself. - window := ToolBuilder open: (browser buildForCodeWith: ToolBuilder default). - - ^ window! Item was changed: ----- Method: HelpBrowser class>>openOn: (in category 'instance creation') ----- openOn: aHelpTopic + "Open the receiver on the given help topic or any other object that can be transformed into + a help topic by sending #asHelpTopic." + + ^ (self on: aHelpTopic) + open! - "Open the receiver on the given help topic or any other object that can be transformed into - a help topic by sending #asHelpTopic." - - ^(self defaultHelpBrowser new) - rootTopic: aHelpTopic; - open! From commits at source.squeak.org Fri Dec 18 15:47:31 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 18 Dec 2020 15:47:31 0000 Subject: [squeak-dev] The Trunk: HelpSystem-Core-ct.117.mcz Message-ID: Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk: http://source.squeak.org/trunk/HelpSystem-Core-ct.117.mcz ==================== Summary ==================== Name: HelpSystem-Core-ct.117 Author: ct Time: 20 September 2019, 7:53:36.226726 pm UUID: 7f73f090-17d8-8843-bbff-03e67c26e396 Ancestors: HelpSystem-Core-mt.116 Convenience method for subtopic lookup =============== Diff against HelpSystem-Core-mt.116 =============== Item was added: + ----- Method: AbstractHelpTopic>>subtopicAt: (in category 'accessing') ----- + subtopicAt: key + + ^ self subtopics detect: [:topic | topic key = key]! Item was changed: ----- Method: HelpBrowser>>accept: (in category 'actions') ----- accept: text "Accept edited text. Compile it into a HelpTopic" | parent currentKey normalizedText colorsToRemove | ((self currentParentTopic isNil or: [self currentParentTopic isEditable not]) or: [self currentTopic isEditable not]) ifTrue: [^ self inform: 'This help topic cannot be edited.']. self changed: #clearUserEdits. "Remove default colors for the sake of UI themes." normalizedText := text. colorsToRemove := {Color black. Color white}. normalizedText runs: (normalizedText runs collect: [:attributes | attributes reject: [:attribute | (((attribute respondsTo: #color) and: [colorsToRemove includes: attribute color]) or: [attribute respondsTo: #font])]]). parent := self currentParentTopic. currentKey := self currentTopic key. isUpdating := true. parent accept: normalizedText for: self currentTopic. parent refresh. parent == self rootTopic ifTrue: [self rootTopic: parent]. isUpdating := false. + self currentTopic: (parent subtopicAt: currentKey).! - self currentTopic: (parent subtopics detect: [:t | t key = currentKey]).! From eliot.miranda at gmail.com Fri Dec 18 16:54:47 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 18 Dec 2020 08:54:47 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: Message-ID: Hi Herbert, _,,,^..^,,,_ (phone) > On Dec 18, 2020, at 4:46 AM, Herbert König wrote: > > Hi all, > > just noticed SoundBuffer is 16 bits so my suggestions are not practicable. But adding a signed 32-bit, or even a signed 64-bit collection for mixing would be straight forward, except for ensuring it mixes down to 16 bits. A signed 32-bit collection would allow 32k 16-bit sources to be additively mixed without clipping, right? So an underlying 64-bit collection is unnecessary. So a MixedSound that adds into an underlying 32-bit signed sequence, and updates a count of added sounds, and does interpolation when adding sounds of different sample rates, and outputs 16-bit samples derived by dividing the 32-bit sums by the count of added sounds would be a solution right? > > Cheers, > > Herbert > >> Am 17.12.2020 um 14:14 schrieb Herbert König: >> Hi Tim, >> >> tl,dr Let's build a limiter. >> >> I stopped using Squeak for Audio with 3.8 :-) With that in mind: >> >> I believe that all sound goes out through SoundPlayer playing >> SoundBuffers. The samples get created via mixSsampleCountInto.... which >> seems to be implemented by many classes and there they all seem to do >> clipping. >> >> After running some of your examples I found several SoundBuffers >> containing samples 32767 and -32768 which indicates clipping. I didn't >> find enough consecutive clipped samples (you shouldn't hear a single >> one) but that's because I only found a few SoundBuffers. >> BTW running your example labelled "OK because.." also clipped when run >> several times. >> >> I didn't find the place where float values are changed to Integers for >> output. >> >> I did not find any limiter. --> baaad! >> >> So if the above is true and the problem is really the clipping (I had >> the impression I also heard some wrapping where 32768 uses the top bit >> as a sign) I suggest: >> -No clipping during the mixing >> -Find the place where the SoundBuffers go to the hardware >> -Implement a limiter there >> >> Basically you need a controlled gain. You look ahead in your SoundBuffer >> for min and max. In case of overflow you calculate the necessary gain >> and gradually reduce your actual gain in the time you have until that >> sample really gets output. (attack phase). If no over/underflow is found >> you (more) gradually raise your gain back to 1 (release phase). Maybe >> introduce some delay before raising your gain again (hold phase). >> >> For live real time audio you may not have the luxury to look ahead. You >> still reduce your gain gradually (let's say in 10 ms) and clip until you >> reached your final gain. Human's ears tend to tolerate this. >> >> There's tons of compromises to evaluate with a limiter we should go with >> a bit over TSTTCPW to save CPU. Maybe have another preference to choose >> the system wide limiter. SCNR :-))) >> >> I can help with rough implementations and audiowise discussions but have >> no idea where to hook it in and cannot convert it to a primitive or >> optimize it. >> >> Let's wait until Stef chimes in, I'm sure he has solved that for muO >> already. >> >> Best regards, >> >> Herbert >> >> >>> Am 16.12.2020 um 23:52 schrieb tim Rowledge: >>> I've discovered that playing two or more sounds simultaneously can >>> make truly appalling noises. I'm hoping somebody has a good solution. >>> >>> The problem started with playing a sound and using the >>> pianokeyboardmorph at the same time. Ouch! Also, swizzling the mouse >>> across the keyboard causes occasional quite audible 'scratchy-clicks' >>> somehow. There can also be a quite noticeable sound between notes, >>> not easily describable but sort of a 'dull thump'. >>> >>> I thought it was some issue with how the sound was played, maybe the >>> note-end process as each piano key was released and the next pressed, >>> timing issues.. but none of that had very much effect. >>> >>> The AbstractSound>>#stopGracefully method does seem to have a small >>> bug, in that the decayInMs value surely ought not be the sum of the >>> attack & decay times from the envelope? But carefully fudging the >>> note shutdown to be faster didn't help a lot. >>> >>> After too much messing around I discovered that at least some of the >>> problem is the mixing of sounds. >>> >>> Now, I know we did a small change to MixedSound>>#add:pan:volume: >>> since 5.3, and that we made a small change to the >>> SampledSound>>#mixSampleCount:into:startingAt:leftVol:rightVol: >>> primitive. However, I'm running on a VM that has the prim change, and >>> I've ported across the add:pan... change, with no real difference. >>> This is, of course, on a Pi, but the same issue is audible on my iMac >>> as well. >>> >>> Eventually I cottoned on to the fact that I was mixing two sounds >>> with volumes set to 100%. Changing to 50% for both actually results >>> in a perfectly fine end result - Yay! This doesn't seem like a robust >>> solution though. What if I have four sounds playing each set to 40%? >>> Why does it seem to work perfectly well for >>> AbstractSound>>#stereoBachFugue play, which uses four? >>> >>> To make life even more fun, it doesn't seem like there is any volume >>> control once a sound is playing. The >>> AbstractSound>>#adjustVolumeTo:overMSecs: method appears to be the >>> one to use but it has no audible effect. There is also #loudness: >>> which does work, but produces pretty much exactly the glitch I hear >>> from glissandoing(?) the keyboard. >>> >>> So - some workspace code to illustrate >>> >>> "awful noise when mixing" >>> |snd| >>> snd := FMSound organ1. >>> snd setPitch: 440 dur: 10 loudness: 0.9; >>> play. >>> 1 second wait. >>> >>> FMSound brass1 setPitch: 470 dur:2 loudness: 0.9; >>> play. >>> 1 second wait. >>> snd stopGracefully >>> >>> "OK, because both sound defualt to quieter" >>> |snd | >>> snd := FMSound organ1. >>> snd >>> duration: 5; >>> play. >>> 1 second wait. >>> >>> FMSound brass1 >>> play. >>> >>> 1 second wait. >>> snd stopGracefully. >>> >>> "nasty glitch using #loudness: plus mixing graunch" >>> |snd | >>> snd := FMSound organ1. >>> snd duration: 5; >>> play. >>> 1 second wait. >>> snd loudness: 1.0 . >>> >>> 1 second wait. >>> FMSound brass1 >>> play. >>> >>> 1 second wait. >>> snd stopGracefully. >>> >>> >>> "no effect from adjustVol..." >>> |snd | >>> snd := FMSound organ1. >>> snd >>> duration: 5; >>> play. >>> 1 second wait. >>> snd adjustVolumeTo: 1.0 overMSecs: 500. >>> 1 second wait. >>> FMSound brass1 >>> play. >>> >>> 1 second wait. >>> snd stopGracefully. >>> >>> Aargh! >>> >>> tim >>> -- >>> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim >>> A computer program does what you tell it to do, not what you want it >>> to do. >>> >>> >>> >> >> > > From Patrick.Rein at hpi.de Fri Dec 18 16:57:38 2020 From: Patrick.Rein at hpi.de (Rein, Patrick) Date: Fri, 18 Dec 2020 16:57:38 +0000 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) Message-ID: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Hi everyone, I am happy to announce the release of the new 5.3 edition of Squeak by Example! The new edition includes: * All code examples are updated to the classes and protocols available in Squeak 5.3 * All figures rendered with the current version of tools * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort Functions) * Minor corrections all over the place You can get the new book here: https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf The new edition has been made possible by the help from numerous people from the Software Architecture Group. Thanks goes to all of them! Best wishes and relaxed holidays to all of you, Patrick P.S.: If you would like to contribute (text, code, issues), the repository of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english From tim at rowledge.org Fri Dec 18 17:46:37 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 18 Dec 2020 09:46:37 -0800 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: <7D48DD96-1DD7-45DB-A988-C02F6434FBC3@rowledge.org> > On 2020-12-18, at 8:57 AM, Rein, Patrick wrote: > > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/ Thank you very much to everyone that has contributed to this. I've been pointing people to the prior version (with warnings about it being a bit outdated) for ages, so having a new shiny version is very exciting. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim <-------- The information went data way --------> From gettimothy at zoho.com Fri Dec 18 18:59:57 2020 From: gettimothy at zoho.com (gettimothy) Date: Fri, 18 Dec 2020 13:59:57 -0500 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: <176773911f4.fedf3dfa33453.5971009898205913596@zoho.com> Thank you for your work! ---- On Fri, 18 Dec 2020 11:57:38 -0500 Patrick.Rein at hpi.de wrote ---- Hi everyone, I am happy to announce the release of the new 5.3 edition of Squeak by Example! The new edition includes: * All code examples are updated to the classes and protocols available in Squeak 5.3 * All figures rendered with the current version of tools * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort Functions) * Minor corrections all over the place You can get the new book here: https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf The new edition has been made possible by the help from numerous people from the Software Architecture Group. Thanks goes to all of them! Best wishes and relaxed holidays to all of you, Patrick P.S.: If you would like to contribute (text, code, issues), the repository of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Fri Dec 18 20:44:32 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 18 Dec 2020 15:44:32 -0500 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: References: Message-ID: <20201218204432.GB25019@shell.msen.com> This is wonderful! Thanks for the pointer to the Computer History Museum article. Dave On Thu, Dec 17, 2020 at 11:10:06PM -0800, Vanessa Freudenberg wrote: > > > > In commemoration of the 40th anniversary of the release of Smalltalk-80, > > the Computer History Museum is proud to announce a collaboration with Dan > > Ingalls to preserve and host the ???Smalltalk Zoo.??? > > > Dan has been working on this for a good while now. I helped with the > SqueakJS part. Today the Computer History Museum announced it: > > https://computerhistory.org/blog/introducing-the-smalltalk-zoo-48-years-of-smalltalk-history-at-chm/ > > Not everything is working perfectly yet. If you want to help out, I can put > you in touch with Dan. > > Cheers! > Vanessa > From sumi at seagreen.ocn.ne.jp Fri Dec 18 23:13:04 2020 From: sumi at seagreen.ocn.ne.jp (sumi masato) Date: Sat, 19 Dec 2020 08:13:04 +0900 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: References: Message-ID: Vanessa-san Thank you for providing us with so many great implementations. Smalltalk-72 doesn't seem to be accepting mouse clicks, but I think this issue can be fixed easily by increasing the mem's array size a bit. // this.mem = new Uint16Array(this.bkupMem.length); this.mem = new Uint16Array(0o177777); Please give my regards to Dan. -- sumim 2020年12月18日(金) 16:10 Vanessa Freudenberg : >> >> In commemoration of the 40th anniversary of the release of Smalltalk-80, the Computer History Museum is proud to announce a collaboration with Dan Ingalls to preserve and host the “Smalltalk Zoo.” > > > Dan has been working on this for a good while now. I helped with the SqueakJS part. Today the Computer History Museum announced it: > > https://computerhistory.org/blog/introducing-the-smalltalk-zoo-48-years-of-smalltalk-history-at-chm/ > > Not everything is working perfectly yet. If you want to help out, I can put you in touch with Dan. > > Cheers! > Vanessa > From frank-lesser at lesser-software.com Fri Dec 18 23:30:37 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Sat, 19 Dec 2020 00:30:37 +0100 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: <20201218204432.GB25019@shell.msen.com> References: <20201218204432.GB25019@shell.msen.com> Message-ID: Smalltalk - 48 years - can't find the origin of the name - duckduckgo-ing it. IMO know it well  - but didn't find the explanation why it was named Smalltalk I was asking on my twitter - no response yet ! From tim at rowledge.org Fri Dec 18 23:33:54 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 18 Dec 2020 15:33:54 -0800 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: References: <20201218204432.GB25019@shell.msen.com> Message-ID: > On 2020-12-18, at 3:30 PM, Frank Lesser wrote: > > Smalltalk - 48 years - can't find the origin of the name - duckduckgo-ing it. > > IMO know it well - but didn't find the explanation why it was named Smalltalk The story I've always heard is that it was a reaction to the grandiose naming of projects that massively over-promisesd and under-delivered. Jove! GargantuaMegaVictory! GigaProfitDB! etc... Smalltalk, the light chit-chat at parties seemed nicely innocuous and unthreatening. Plus I'd imagine that the 'talk' nicely includes the essence of message sending and thus had a nice rigng to it. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange Opcodes: FART: Fill Accumulator from Result if True From frank-lesser at lesser-software.com Fri Dec 18 23:58:02 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Sat, 19 Dec 2020 00:58:02 +0100 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: References: <20201218204432.GB25019@shell.msen.com> Message-ID: <23e17e23-3147-5e8c-8460-2b04c08a85a3@lesser-software.com> Tim, the main thing I remember was "a small talk to a machine" James Foster pointed me to http://wiki.squeak.org/squeak/50 Frank On 12/19/2020 00:33, tim Rowledge wrote: > >> On 2020-12-18, at 3:30 PM, Frank Lesser wrote: >> >> Smalltalk - 48 years - can't find the origin of the name - duckduckgo-ing it. >> >> IMO know it well - but didn't find the explanation why it was named Smalltalk > The story I've always heard is that it was a reaction to the grandiose naming of projects that massively over-promisesd and under-delivered. Jove! GargantuaMegaVictory! GigaProfitDB! etc... Smalltalk, the light chit-chat at parties seemed nicely innocuous and unthreatening. > > Plus I'd imagine that the 'talk' nicely includes the essence of message sending and thus had a nice rigng to it. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange Opcodes: FART: Fill Accumulator from Result if True > > > > From tim at rowledge.org Sat Dec 19 04:36:49 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 18 Dec 2020 20:36:49 -0800 Subject: [squeak-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM In-Reply-To: References: Message-ID: <9CBCB420-BC11-4BC3-911F-25B6EF55791D@rowledge.org> This is very cool and I hope it gets expanded to show of much more Smalltalk stuff and history. An amusing sidenote related to my sound problem - running Scratch under SqueakJS and using the note selector mini-keyboard has *exactly* the strange thumpy noise between notes. It's especailly funny given that this is all working through web browsers/emulators/virtual-networking and multiple OSs. What a world we live in. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Useful random insult:- Calling her stupid would be an insult to stupid people. From commits at source.squeak.org Sun Dec 20 00:57:11 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 20 Dec 2020 00:57:11 0000 Subject: [squeak-dev] The Trunk: Chronology-Core-dtl.65.mcz Message-ID: David T. Lewis uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-dtl.65.mcz ==================== Summary ==================== Name: Chronology-Core-dtl.65 Author: dtl Time: 19 December 2020, 7:57:10.809501 pm UUID: 7365f73a-d84f-4c6b-b8b6-16b6fb91194a Ancestors: Chronology-Core-dtl.64 Ensure integral nanoseconds when printing DateAndTime to prevent error in e.g. (DateAndTime fromSeconds: 3124074224.123456789s) printString =============== Diff against Chronology-Core-dtl.64 =============== Item was changed: ----- Method: DateAndTime>>printOn:withLeadingSpace: (in category 'squeak protocol') ----- printOn: aStream withLeadingSpace: printLeadingSpaceToo "Print as per ISO 8601 sections 5.3.3 and 5.4.1. If printLeadingSpaceToo is false, prints either: 'YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years) If printLeadingSpaceToo is true, prints either: ' YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years) " | nanos offsetSeconds | self printYMDOn: aStream withLeadingSpace: printLeadingSpaceToo. aStream nextPut: $T. self printHMSOn: aStream. (nanos := utcMicroseconds \\ 1000000 * 1000) = 0 ifFalse: [ | length | aStream nextPut: $.. length := 9. [ nanos \\ 10 = 0 ] whileTrue: [ nanos := nanos // 10. length := length - 1 ]. + nanos asInteger printOn: aStream base: 10 length: length padded: true ]. - nanos printOn: aStream base: 10 length: length padded: true ]. "Print offset" aStream nextPut: (localOffsetSeconds >= 0 ifTrue: [ $+ ] ifFalse: [ $- ]). offsetSeconds := localOffsetSeconds abs. offsetSeconds // 3600 printOn: aStream base: 10 length: 2 padded: true. aStream nextPut: $:. offsetSeconds \\ 3600 // 60 printOn: aStream base: 10 length: 2 padded: true. (offsetSeconds := offsetSeconds \\ 60) = 0 ifFalse: [ aStream nextPut: $:; print: offsetSeconds ]! From squeaklist at gmail.com Sun Dec 20 15:35:52 2020 From: squeaklist at gmail.com (Kjell Godo) Date: Sun, 20 Dec 2020 07:35:52 -0800 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <176773911f4.fedf3dfa33453.5971009898205913596@zoho.com> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> <176773911f4.fedf3dfa33453.5971009898205913596@zoho.com> Message-ID: thanks On Fri, Dec 18, 2020 at 11:00 gettimothy via Squeak-dev < squeak-dev at lists.squeakfoundation.org> wrote: > Thank you for your work! > > > ---- On Fri, 18 Dec 2020 11:57:38 -0500 * Patrick.Rein at hpi.de > * wrote ---- > > > Hi everyone, > > I am happy to announce the release of the new 5.3 edition of Squeak by > Example! > > The new edition includes: > * All code examples are updated to the classes and protocols available in > Squeak 5.3 > * All figures rendered with the current version of tools > * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort > Functions) > * Minor corrections all over the place > > You can get the new book here: > > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf > > The new edition has been made possible by the help from numerous people > from the Software Architecture Group. Thanks goes to all of them! > > Best wishes and relaxed holidays to all of you, > Patrick > > P.S.: If you would like to contribute (text, code, issues), the repository > of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrmaffeo at gmail.com Sun Dec 20 17:41:11 2020 From: jrmaffeo at gmail.com (John-Reed Maffeo) Date: Sun, 20 Dec 2020 10:41:11 -0700 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: Thank You Patrick and the SAG people who made this possible. I look forward to diving into it; I am sure I will come out more knowledgeable about Squeak On Fri, Dec 18, 2020 at 9:57 AM Rein, Patrick wrote: > Hi everyone, > > I am happy to announce the release of the new 5.3 edition of Squeak by > Example! > > The new edition includes: > * All code examples are updated to the classes and protocols available in > Squeak 5.3 > * All figures rendered with the current version of tools > * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort > Functions) > * Minor corrections all over the place > > You can get the new book here: > > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf > > The new edition has been made possible by the help from numerous people > from the Software Architecture Group. Thanks goes to all of them! > > Best wishes and relaxed holidays to all of you, > Patrick > > P.S.: If you would like to contribute (text, code, issues), the repository > of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english > > -- John-Reed Maffeo -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Sun Dec 20 21:26:35 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Sun, 20 Dec 2020 22:26:35 +0100 Subject: [squeak-dev] FullBlockClosures and ignoreOuterContext? In-Reply-To: References: Message-ID: Hi Eliot, On Tue, Dec 15, 2020 at 3:06 AM Eliot Miranda wrote: > > Hi Fabio, > > On Mon, Dec 14, 2020 at 1:33 PM Fabio Niephaus wrote: >> >> Hi all, >> >> While digging through the implementation of FullBlockClosure with >> Hernan, we were wondering about full closures that ignore their >> outerContext. We noticed that the following method has two senders: >> EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext: >> >> One of them seems to be the only one in use, and it's passing in false >> as defaults for both receiverOnstack and ignoreOuterContext. The other >> sender (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:), >> in turn, doesn't seem to have any further senders. >> >> Unless we missed something, it looks like the outerContext will never >> be ignored at the moment. Similarly, the receiver is never on the >> stack. Is this something only Scorch can do or is this just "not yet >> implemented"? >> >> When can the outerContext be ignored? > > > When the Sista optimizer determines that it isn't needed. i.e. this option is nover used in vanilla code but exists for an optimizing compiler to avoid the overhead in cases where it wants to avoid inlining but knows there is no real suspension point during some evaluation. Now, whether we'll ever use this facility I can't say, but it was certainly in Clément's mind to do so at some point. >> Ok, thanks for the info! >> When does it make sense to pop the receiver from the stack? > > > The point isn't really to pop the receiver from the stack. The point is to be able to take the closures receiver form the stack rather than it being implicitly the receiver of the current method. If closure creation gets inlined by the optimizer then there will be potentially a mismatch between the current method's receiver and an inlined closure's receiver, which necessitates having the facility to specify a distinct receiver. > Makes sense, thanks! > >> >> And where can we find the latest version >> of Scorch. Is it still the one at [1]? > > > http://smalltalkhub.com/mc/ClementBera/Scorch/main Oh, isn't smalltalkhub read-only these days? > > If you're interested in looking at Scorch I'm very interested in collaborating. And there ius one significant modification to perform first which will make development much easier, and that is to restructure the interface between the optimizer and the image via mirrors, allowing the optimizer to be mated with an image being simulated, rather than having to be a full peer of the image it is optimizing. Since we turned on full closures and Sista in Squeak, I could no longer use trunk images on top of TruffleSqueak. I finally decided to bite the bullet and worked on support for both in the last two weeks. It's not that I don't want to collaborate and help evolve Scorch (it's a fascinating project!). It's just that I don't have the time to work on any significant contributions in that direction. Nonetheless, I'd love to see someone working on it again. Fabio >> >> Cheers, >> Fabio >> >> [1] https://github.com/clementbera/Scorch > > > _,,,^..^,,,_ > best, Eliot > From tim at rowledge.org Sun Dec 20 23:21:07 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 20 Dec 2020 15:21:07 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: Message-ID: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> I've made a tiny bit of progress on fighting this and I've discovered some points that might help with understanding why a VolumeEnvelope stops the volume adjustment working. So first, using a simple FMSound with the base volume set to 40% solves a lot of problems in practice when it comes to the note-chooser in Scratch - simply keeping the volume lower avoids any clamping. The simple FMSound has not volume envelope and so the volume control actually works. Looking at how the volume envelope works it seems like it shouldn't cause any issues; after all the operation of the envelope uses the #adjustVolume... method. I think that we're looking at the attempt to set the volume with it is clashing with the VolumeEnvelope>>#updateTargetAt: stomping on the related variables. That happens every time the #doControl method runs, which is nominally 100Hz. Somewhere there is a way to composite the two and get the desired result. I just don't see it right now because I'm trying too many things at once. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "How many Motie Warriors does it take to change a lightbulb?” "None. One of the dead ones will do it." From kksubbu.ml at gmail.com Mon Dec 21 05:19:21 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Mon, 21 Dec 2020 10:49:21 +0530 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: <493a790c-9016-c213-8214-89db637c2e1b@gmail.com> Patrick, Thank you and your team for this nice holiday season gift. I have updated Swiki page for "Squeak by example" at http://wiki.squeak.org/squeak/6546 to refer to this book. HTH .. Subbu On 18/12/20 10:27 pm, Rein, Patrick wrote: > Hi everyone, > > I am happy to announce the release of the new 5.3 edition of Squeak by Example! > > The new edition includes: > * All code examples are updated to the classes and protocols available in Squeak 5.3 > * All figures rendered with the current version of tools > * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort Functions) > * Minor corrections all over the place > > You can get the new book here: > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf > > The new edition has been made possible by the help from numerous people from the Software Architecture Group. Thanks goes to all of them! > > Best wishes and relaxed holidays to all of you, > Patrick > > P.S.: If you would like to contribute (text, code, issues), the repository of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english > From commits at source.squeak.org Mon Dec 21 06:24:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 21 Dec 2020 06:24:21 0000 Subject: [squeak-dev] The Trunk: System-codefrau.1205.mcz Message-ID: Vanessa Freudenberg uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-codefrau.1205.mcz ==================== Summary ==================== Name: System-codefrau.1205 Author: codefrau Time: 20 December 2020, 10:23:10.790782 pm UUID: f94486f3-3743-4300-a495-c2a89089e122 Ancestors: System-dtl.1204 Update platformName for SqueakJS 1.0 =============== Diff against System-dtl.1204 =============== Item was changed: ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- isLowerPerformance "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" + or: [self platformName = 'JS'] "SqueakJS"! - or: [self platformName = 'Web'] "SqueakJS"! From vanessa at codefrau.net Tue Dec 22 00:19:23 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Mon, 21 Dec 2020 16:19:23 -0800 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: On Fri, Dec 18, 2020 at 8:57 AM Rein, Patrick wrote: > Hi everyone, > > I am happy to announce the release of the new 5.3 edition of Squeak by > Example! > > The new edition includes: > * All code examples are updated to the classes and protocols available in > Squeak 5.3 > * All figures rendered with the current version of tools > * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort > Functions) > * Minor corrections all over the place > > You can get the new book here: > > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf > > The new edition has been made possible by the help from numerous people > from the Software Architecture Group. Thanks goes to all of them! > > Best wishes and relaxed holidays to all of you, > Patrick > > P.S.: If you would like to contribute (text, code, issues), the repository > of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english Wow, awesome! Thank you! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 22 02:54:31 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 21 Dec 2020 18:54:31 -0800 Subject: [squeak-dev] [ANN] Squeak by Example (Edition 5.3) out now :) In-Reply-To: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> References: <24e57a5cfe5845d98aa1d1599e74abca@hpi.de> Message-ID: On Fri, Dec 18, 2020 at 8:57 AM Rein, Patrick wrote: > Hi everyone, > > I am happy to announce the release of the new 5.3 edition of Squeak by > Example! > > The new edition includes: > * All code examples are updated to the classes and protocols available in > Squeak 5.3 > * All figures rendered with the current version of tools > * New sections and paragraphs (e.g. Exceptions, Advanced Tools, Sort > Functions) > * Minor corrections all over the place > > You can get the new book here: > > https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3/SqueakByExample_5_3.pdf > > The new edition has been made possible by the help from numerous people > from the Software Architecture Group. Thanks goes to all of them! > > Best wishes and relaxed holidays to all of you, > Patrick > Wow! Thanks Patrick and the SOftware Architecture Group! This is really exciting!! Seeing a guide to the Smalltalk system that I recognise, that is bang up to the minute is so cool. I honestly think this is the first ever up-to-date guide I've ever used. Super cool. > P.S.: If you would like to contribute (text, code, issues), the repository > of the book is at: https://github.com/hpi-swa-lab/SqueakByExample-english > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Dec 22 04:34:13 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 22 Dec 2020 04:34:13 0000 Subject: [squeak-dev] The Trunk: System-dtl.1206.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-dtl.1206.mcz ==================== Summary ==================== Name: System-dtl.1206 Author: dtl Time: 21 December 2020, 11:34:09.218726 pm UUID: f308632b-9f71-4f8d-8092-0b2a5a5ddf43 Ancestors: System-codefrau.1205 DoItFirst>>parse: fix a shadowed variable and provide better method comment =============== Diff against System-codefrau.1205 =============== Item was changed: ----- Method: DoItFirst>>parse: (in category 'evaluating') ----- parse: argumentList + "Iterate over the argument list, creating actions blocks. Register each action + block in the actions dictionary, and collect a list of the actions blocks to be + evaluated now. If any action blocks will require files or directory initialization, + send the appropriate startUp messages. Answer the list of action blocks to + be evaluated." - "Iterate over the argument list, adding action blocks to the actions dictionary. - If any action blocks require files or directory initialization send the appropriate - startUp message to do it now. Answer a list of option selectors that should be - evaluated." + | args listOfBlocks needsFiles needsDirectory | - | args actions needsFiles needsDirectory | needsFiles := needsDirectory := false. args := argumentList readStream. + listOfBlocks := OrderedCollection new. - actions := OrderedCollection new. [ args atEnd ] whileFalse: [ | key | (key := self keyFor: args next) caseOf: { + [ #help ] -> [ self addFirst: [ self help ] to: listOfBlocks at: key. needsFiles := true] . - [ #help ] -> [ self addFirst: [ self help ] to: actions at: key. needsFiles := true] . [ #debug ] -> [ self addWithoutEvaluation: [ self debug ] at: key] . + [ #doit ] -> [ | list | list := self nextTokensFrom: args. self add:[ self doIt: list ] to: listOfBlocks at: key. needsFiles := true] . + [ #evaluate ] -> [ | arg | arg := args next. self add:[ self evaluateOption: arg ] to: listOfBlocks at: key. needsFiles := true] . + [ #file ] -> [ | arg | arg := args next. self add:[ self evaluateFileContents: arg ] to: listOfBlocks at: key. needsFiles := true] . + [ #filein ] -> [ | list | list := self nextTokensFrom: args. self add:[ self fileIn: list ] to: listOfBlocks at: key. needsFiles := needsDirectory := true] . + [ #cwd ] -> [ | arg | arg := args next. self addFirst:[ self cwd: arg ] to: listOfBlocks at: key. needsFiles := needsDirectory := true] . - [ #doit ] -> [ | list | list := self nextTokensFrom: args. self add:[ self doIt: list ] to: actions at: key. needsFiles := true] . - [ #evaluate ] -> [ | arg | arg := args next. self add:[ self evaluateOption: arg ] to: actions at: key. needsFiles := true] . - [ #file ] -> [ | arg | arg := args next. self add:[ self evaluateFileContents: arg ] to: actions at: key. needsFiles := true] . - [ #filein ] -> [ | list | list := self nextTokensFrom: args. self add:[ self fileIn: list ] to: actions at: key. needsFiles := needsDirectory := true] . - [ #cwd ] -> [ | arg | arg := args next. self addFirst:[ self cwd: arg ] to: actions at: key. needsFiles := needsDirectory := true] . } otherwise: [] ]. needsFiles ifTrue: [ FileStream startUp: true. "initialize stdout and stderr" ]. needsDirectory ifTrue: [ FileDirectory startUp "set default directory" ]. + ^ listOfBlocks. - ^ actions. ! From eliot.miranda at gmail.com Tue Dec 22 08:35:07 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 00:35:07 -0800 Subject: [squeak-dev] FullBlockClosures and ignoreOuterContext? In-Reply-To: References: Message-ID: <7025C3AB-804F-4065-B50E-04AFA77AAFA4@gmail.com> Hi Fabio, > On Dec 20, 2020, at 1:27 PM, Fabio Niephaus wrote: > > Hi Eliot, > >> On Tue, Dec 15, 2020 at 3:06 AM Eliot Miranda wrote: >> >> Hi Fabio, >> >>> On Mon, Dec 14, 2020 at 1:33 PM Fabio Niephaus wrote: >>> >>> Hi all, >>> >>> While digging through the implementation of FullBlockClosure with >>> Hernan, we were wondering about full closures that ignore their >>> outerContext. We noticed that the following method has two senders: >>> EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext: >>> >>> One of them seems to be the only one in use, and it's passing in false >>> as defaults for both receiverOnstack and ignoreOuterContext. The other >>> sender (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:), >>> in turn, doesn't seem to have any further senders. >>> >>> Unless we missed something, it looks like the outerContext will never >>> be ignored at the moment. Similarly, the receiver is never on the >>> stack. Is this something only Scorch can do or is this just "not yet >>> implemented"? >>> >>> When can the outerContext be ignored? >> >> >> When the Sista optimizer determines that it isn't needed. i.e. this option is nover used in vanilla code but exists for an optimizing compiler to avoid the overhead in cases where it wants to avoid inlining but knows there is no real suspension point during some evaluation. Now, whether we'll ever use this facility I can't say, but it was certainly in Clément's mind to do so at some point. >>> > > Ok, thanks for the info! > >>> When does it make sense to pop the receiver from the stack? >> >> >> The point isn't really to pop the receiver from the stack. The point is to be able to take the closures receiver form the stack rather than it being implicitly the receiver of the current method. If closure creation gets inlined by the optimizer then there will be potentially a mismatch between the current method's receiver and an inlined closure's receiver, which necessitates having the facility to specify a distinct receiver. >> > > Makes sense, thanks! > >> >>> >>> And where can we find the latest version >>> of Scorch. Is it still the one at [1]? >> >> >> http://smalltalkhub.com/mc/ClementBera/Scorch/main > > Oh, isn't smalltalkhub read-only these days? If it is then things need to move once time is found to work on the code again. > >> >> If you're interested in looking at Scorch I'm very interested in collaborating. And there ius one significant modification to perform first which will make development much easier, and that is to restructure the interface between the optimizer and the image via mirrors, allowing the optimizer to be mated with an image being simulated, rather than having to be a full peer of the image it is optimizing. > > Since we turned on full closures and Sista in Squeak, I could no > longer use trunk images on top of TruffleSqueak. I finally decided to > bite the bullet and worked on support for both in the last two weeks. > It's not that I don't want to collaborate and help evolve Scorch (it's > a fascinating project!). It's just that I don't have the time to work > on any significant contributions in that direction. Nonetheless, I'd > love to see someone working on it again. Ah ok, makes sense. Now you’ve implemented the Sista set I’m curious how you evaluate the design. Eliot _,,,^..^,,,_ (phone) > > Fabio > >>> >>> Cheers, >>> Fabio >>> >>> [1] https://github.com/clementbera/Scorch >> >> >> _,,,^..^,,,_ >> best, Eliot >> > From eliot.miranda at gmail.com Tue Dec 22 09:08:28 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 01:08:28 -0800 Subject: [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: Message-ID: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Hi Vanessa, Hi Fabio, Hi David, Hi All, > On Dec 20, 2020, at 10:24 PM, commits at source.squeak.org wrote: > > Vanessa Freudenberg uploaded a new version of System to project The Trunk: > http://source.squeak.org/trunk/System-codefrau.1205.mcz > > ==================== Summary ==================== > > Name: System-codefrau.1205 > Author: codefrau > Time: 20 December 2020, 10:23:10.790782 pm > UUID: f94486f3-3743-4300-a495-c2a89089e122 > Ancestors: System-dtl.1204 > > Update platformName for SqueakJS 1.0 > > =============== Diff against System-dtl.1204 =============== > > Item was changed: > ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- > isLowerPerformance > "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" > ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" > + or: [self platformName = 'JS'] "SqueakJS"! > - or: [self platformName = 'Web'] "SqueakJS"! this is interesting. The method is do crude, but potentially we have a much more rational basis upon which to derive its result. I would expect the effective performance to be the product of processor speed (mips), core execution engine architecture and object representation. Mips varies hugely across the range from eg Raspberry Pi 2,3,4 to various Intel (i5,I7,i9 etc) and Apple Silicon. The range here is about one order of magnitude. Execution architecture varies from pure context interpreter (the BTTF VM), Stack Interpreter, Squeak JS interpreter, Squeak JS generation one JIT, Squeak JS subsequent generation JITs (temps in JS vars, sends mapped to JS calls), Cog JIT, Sista JIT. Very crudely Spur = 2 x v3 (actually about 1.7 and varies according to workflow). Of the execution architectures Sista JIT is for practical purposes not yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS JITs I think that the send mapping isn’t implemented (am I right?). But is the temp var mapping implemented? If so what difference does it make? Context to Stack is about 1.5. Stack to Cog is about 6. So the notion is that if we can come up with crude numbers that rank the execution architectures and a measure of mips we can compute a meaningful numeric estimate of likely Smalltalk execution speed and answer isLowerPerformance if this number falls below a specific threshold. What we have now based on platformName is simply wrong. eg a Raspberry Pi 4 is way faster than a Pi 3. One thing I did for visual works is estimate processor mips by timing the first invocation of the allInstances primitive and dividing by the number of objects. Basically the heuristic is that mips is roughly (inversely) proportional to how much time per object the first allInstances invocation spends. There is (almost) always an allInstances invocation at startup in VisualWorks (to clear font handles IIRC), and there may be in a Squeak image. Alternatives are measuring how long it takes to load and/or swizzle the image on load divided by the heap size. Basically we have the opportunity to introspection at startup cheaply measuring the time some costly primitive takes to run and this result can be cached, accessed via a primitive or vmParameter and perhaps updated as execution proceeds. Does this sound like overkill? If not, what should we choose as our mips measurer? We want something that all VMs have to do somewhat similarly fairly early on system startup and we can correlate with stopwatches and macro benchmarks like the time taken for the Compiler package to recompile itself, etc. Eliot _,,,^..^,,,_ (phone) From lewis at mail.msen.com Tue Dec 22 17:55:32 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 22 Dec 2020 12:55:32 -0500 Subject: [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: <20201222175532.GB58144@shell.msen.com> On Tue, Dec 22, 2020 at 01:08:28AM -0800, Eliot Miranda wrote: > Hi Vanessa, Hi Fabio, Hi David, Hi All, > > > On Dec 20, 2020, at 10:24 PM, commits at source.squeak.org wrote: > > > > ???Vanessa Freudenberg uploaded a new version of System to project The Trunk: > > http://source.squeak.org/trunk/System-codefrau.1205.mcz > > > > ==================== Summary ==================== > > > > Name: System-codefrau.1205 > > Author: codefrau > > Time: 20 December 2020, 10:23:10.790782 pm > > UUID: f94486f3-3743-4300-a495-c2a89089e122 > > Ancestors: System-dtl.1204 > > > > Update platformName for SqueakJS 1.0 > > > > =============== Diff against System-dtl.1204 =============== > > > > Item was changed: > > ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- > > isLowerPerformance > > "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" > > ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" > > + or: [self platformName = 'JS'] "SqueakJS"! > > - or: [self platformName = 'Web'] "SqueakJS"! > > this is interesting. The method is do crude, but potentially we have a much more rational basis upon which to derive its result. I would expect the effective performance to be the product of processor speed (mips), core execution engine architecture and object representation. > > Mips varies hugely across the range from eg Raspberry Pi 2,3,4 to various Intel (i5,I7,i9 etc) and Apple Silicon. The range here is about one order of magnitude. > > Execution architecture varies from pure context interpreter (the BTTF VM), Stack Interpreter, Squeak JS interpreter, Squeak JS generation one JIT, Squeak JS subsequent generation JITs (temps in JS vars, sends mapped to JS calls), Cog JIT, Sista JIT. > > Very crudely Spur = 2 x v3 (actually about 1.7 and varies according to workflow). > > Of the execution architectures Sista JIT is for practical purposes not yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS JITs I think that the send mapping isn???t implemented (am I right?). But is the temp var mapping implemented? If so what difference does it make? Context to Stack is about 1.5. Stack to Cog is about 6. > > So the notion is that if we can come up with crude numbers that rank the execution architectures and a measure of mips we can compute a meaningful numeric estimate of likely Smalltalk execution speed and answer isLowerPerformance if this number falls below a specific threshold. What we have now based on platformName is simply wrong. eg a Raspberry Pi 4 is way faster than a Pi 3. > > One thing I did for visual works is estimate processor mips by timing the first invocation of the allInstances primitive and dividing by the number of objects. Basically the heuristic is that mips is roughly (inversely) proportional to how much time per object the first allInstances invocation spends. There is (almost) always an allInstances invocation at startup in VisualWorks (to clear font handles IIRC), and there may be in a Squeak image. Alternatives are measuring how long it takes to load and/or swizzle the image on load divided by the heap size. Basically we have the opportunity to introspection at startup cheaply measuring the time some costly primitive takes to run and this result can be cached, accessed via a primitive or vmParameter and perhaps updated as execution proceeds. > > Does this sound like overkill? If not, what should we choose as our mips measurer? We want something that all VMs have to do somewhat similarly fairly early on system startup and we can correlate with stopwatches and macro benchmarks like the time taken for the Compiler package to recompile itself, etc. > Not overkill at all, I think it's a good idea. There are currently only two use cases for isLowerPerformance, and in both cases it looks like something that could be computed on demand when first referenced after image startup. Dave From commits at source.squeak.org Tue Dec 22 21:14:47 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 22 Dec 2020 21:14:47 0000 Subject: [squeak-dev] The Inbox: System-dtl.1207.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Inbox: http://source.squeak.org/inbox/System-dtl.1207.mcz ==================== Summary ==================== Name: System-dtl.1207 Author: dtl Time: 22 December 2020, 4:14:44.828557 pm UUID: 55d26f8d-673a-4927-8718-a6680425562d Ancestors: System-dtl.1206 Check #isLowerPerformance on first reference and compute it based on simple benchmarks. Replaces previous policy based on platform identifiers. =============== Diff against System-dtl.1206 =============== Item was changed: Object subclass: #SmalltalkImage instanceVariableNames: 'globals' + classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SlowPlatform SourceFileVersionString StartUpList StartupStamp WordSize' - classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SourceFileVersionString StartUpList StartupStamp WordSize' poolDictionaries: '' category: 'System-Support'! !SmalltalkImage commentStamp: 'dtl 3/6/2010 14:00' prior: 0! I represent the current image and runtime environment, including system organization, the virtual machine, object memory, plugins and source files. My instance variable #globals is a reference to the system dictionary of global variables and class names. My singleton instance is called Smalltalk.! Item was changed: ----- Method: SmalltalkImage class>>startUp: (in category 'class initialization') ----- startUp: resuming resuming ifTrue: [LastStats := nil. + SlowPlatform := nil. + SystemChangeNotifier uniqueInstance notify: Smalltalk ofAllSystemChangesUsing: #event:]! - SystemChangeNotifier uniqueInstance notify: Smalltalk ofAllSystemChangesUsing: #event:]! Item was changed: ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- isLowerPerformance + "Some operations - TestCases for example - need an idea of the typical performance + of the system on which they are being performed." + ^ SlowPlatform + ifNil: [ SlowPlatform := (Time millisecondsToRun:[ 25 benchFib ]) > 200 + or: [ (Time millisecondsToRun: [ 64 benchmark ]) > 200 ]]! - "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" - ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" - or: [self platformName = 'JS'] "SqueakJS"! From lewis at mail.msen.com Tue Dec 22 21:18:46 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 22 Dec 2020 16:18:46 -0500 Subject: [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: <20201222175532.GB58144@shell.msen.com> References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> <20201222175532.GB58144@shell.msen.com> Message-ID: <20201222211846.GA87919@shell.msen.com> On Tue, Dec 22, 2020 at 12:55:32PM -0500, David T. Lewis wrote: > On Tue, Dec 22, 2020 at 01:08:28AM -0800, Eliot Miranda wrote: > > Hi Vanessa, Hi Fabio, Hi David, Hi All, > > > > > On Dec 20, 2020, at 10:24 PM, commits at source.squeak.org wrote: > > > > > > ???Vanessa Freudenberg uploaded a new version of System to project The Trunk: > > > http://source.squeak.org/trunk/System-codefrau.1205.mcz > > > > > > ==================== Summary ==================== > > > > > > Name: System-codefrau.1205 > > > Author: codefrau > > > Time: 20 December 2020, 10:23:10.790782 pm > > > UUID: f94486f3-3743-4300-a495-c2a89089e122 > > > Ancestors: System-dtl.1204 > > > > > > Update platformName for SqueakJS 1.0 > > > > > > =============== Diff against System-dtl.1204 =============== > > > > > > Item was changed: > > > ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- > > > isLowerPerformance > > > "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" > > > ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" > > > + or: [self platformName = 'JS'] "SqueakJS"! > > > - or: [self platformName = 'Web'] "SqueakJS"! > > > > this is interesting. The method is do crude, but potentially we have a much more rational basis upon which to derive its result. I would expect the effective performance to be the product of processor speed (mips), core execution engine architecture and object representation. > > > > Mips varies hugely across the range from eg Raspberry Pi 2,3,4 to various Intel (i5,I7,i9 etc) and Apple Silicon. The range here is about one order of magnitude. > > > > Execution architecture varies from pure context interpreter (the BTTF VM), Stack Interpreter, Squeak JS interpreter, Squeak JS generation one JIT, Squeak JS subsequent generation JITs (temps in JS vars, sends mapped to JS calls), Cog JIT, Sista JIT. > > > > Very crudely Spur = 2 x v3 (actually about 1.7 and varies according to workflow). > > > > Of the execution architectures Sista JIT is for practical purposes not yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS JITs I think that the send mapping isn???t implemented (am I right?). But is the temp var mapping implemented? If so what difference does it make? Context to Stack is about 1.5. Stack to Cog is about 6. > > > > So the notion is that if we can come up with crude numbers that rank the execution architectures and a measure of mips we can compute a meaningful numeric estimate of likely Smalltalk execution speed and answer isLowerPerformance if this number falls below a specific threshold. What we have now based on platformName is simply wrong. eg a Raspberry Pi 4 is way faster than a Pi 3. > > > > One thing I did for visual works is estimate processor mips by timing the first invocation of the allInstances primitive and dividing by the number of objects. Basically the heuristic is that mips is roughly (inversely) proportional to how much time per object the first allInstances invocation spends. There is (almost) always an allInstances invocation at startup in VisualWorks (to clear font handles IIRC), and there may be in a Squeak image. Alternatives are measuring how long it takes to load and/or swizzle the image on load divided by the heap size. Basically we have the opportunity to introspection at startup cheaply measuring the time some costly primitive takes to run and this result can be cached, accessed via a primitive or vmParameter and perhaps updated as execution proceeds. > > > > Does this sound like overkill? If not, what should we choose as our mips measurer? We want something that all VMs have to do somewhat similarly fairly early on system startup and we can correlate with stopwatches and macro benchmarks like the time taken for the Compiler package to recompile itself, etc. > > > > Not overkill at all, I think it's a good idea. There are currently only two > use cases for isLowerPerformance, and in both cases it looks like something > that could be computed on demand when first referenced after image startup. > I put System-dtl.1207 in the inbox as a possible solution. Treat it as a bikeshed in need of a good coat of paint. Dave From vanessa at codefrau.net Tue Dec 22 21:44:10 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Tue, 22 Dec 2020 13:44:10 -0800 Subject: [squeak-dev] [Vm-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: On Tue, Dec 22, 2020 at 1:08 AM Eliot Miranda wrote: > > Of the execution architectures Sista JIT is for practical purposes not yet > implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS > JITs I think that the send mapping isn’t implemented (am I right?). But is > the temp var mapping implemented? If so what difference does it make? > Context to Stack is about 1.5. Stack to Cog is about 6. > None of that has been implemented in SqueakJS. The current JIT only gets rid of the generic bytecode decoding, plus it inlines small-int arithmetic. However, that still gives an 8x increase in bytecode speed, which causes the send speed as measured by tinyBenchmarks to go up by 3.5x too. It also *feels* significantly faster with the JIT enabled. See the comment on top of https://github.com/codefrau/SqueakJS/blob/main/jit.js > > Does this sound like overkill? If not, what should we choose as our mips > measurer? We want something that all VMs have to do somewhat similarly > fairly early on system startup and we can correlate with stopwatches and > macro benchmarks like the time taken for the Compiler package to recompile > itself, etc. > I like measuring all-over performance, and not adding any extra work. Like, DateAndTime is pretty early in the startup list. It could remember the time its startup was invoked. Another class that comes later could set a LowPerformance flag if it took longer than x ms since DateAndTime was initialized. I just tried that with ProcessorScheduler (see attachment). On Safari and a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I get 5 ms. So maybe if that takes longer than say 50 ms it could be considered low performance? Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: startup-codefrau.1.cs Type: text/x-csharp Size: 3055 bytes Desc: not available URL: From eliot.miranda at gmail.com Tue Dec 22 21:57:33 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 13:57:33 -0800 Subject: [squeak-dev] [Vm-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: On Tue, Dec 22, 2020 at 1:44 PM Vanessa Freudenberg wrote: > On Tue, Dec 22, 2020 at 1:08 AM Eliot Miranda > wrote: > >> >> Of the execution architectures Sista JIT is for practical purposes not >> yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak >> JS JITs I think that the send mapping isn’t implemented (am I right?). But >> is the temp var mapping implemented? If so what difference does it make? >> Context to Stack is about 1.5. Stack to Cog is about 6. >> > > None of that has been implemented in SqueakJS. The current JIT only gets > rid of the generic bytecode decoding, plus it inlines small-int arithmetic. > > However, that still gives an 8x increase in bytecode speed, which causes > the send speed as measured by tinyBenchmarks to go up by 3.5x too. It also > *feels* significantly faster with the JIT enabled. > > See the comment on top of > https://github.com/codefrau/SqueakJS/blob/main/jit.js > >> >> Does this sound like overkill? If not, what should we choose as our mips >> measurer? We want something that all VMs have to do somewhat similarly >> fairly early on system startup and we can correlate with stopwatches and >> macro benchmarks like the time taken for the Compiler package to recompile >> itself, etc. >> > > I like measuring all-over performance, and not adding any extra work. > > Like, DateAndTime is pretty early in the startup list. It could remember > the time its startup was invoked. Another class that comes later could set > a LowPerformance flag if it took longer than x ms since DateAndTime was > initialized. > > I just tried that with ProcessorScheduler (see attachment). On Safari and > a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I > get 5 ms. So maybe if that takes longer than say 50 ms it could be > considered low performance? > Works for me. I would record and provide an accessor for ImageStartUsecs (a class variable in SmalltalkImage, using microseconds :-) ). Then one can either use isLowerPerformance or the actual time for a more "nuanced" view. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanessa at codefrau.net Tue Dec 22 22:07:30 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Tue, 22 Dec 2020 14:07:30 -0800 Subject: [squeak-dev] [Vm-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: (dropping vm-dev) On Tue, Dec 22, 2020 at 1:57 PM Eliot Miranda wrote: > > On Tue, Dec 22, 2020 at 1:44 PM Vanessa Freudenberg > wrote: > >> >> I like measuring all-over performance, and not adding any extra work. >> >> Like, DateAndTime is pretty early in the startup list. It could remember >> the time its startup was invoked. Another class that comes later could set >> a LowPerformance flag if it took longer than x ms since DateAndTime was >> initialized. >> >> I just tried that with ProcessorScheduler (see attachment). On Safari and >> a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I >> get 5 ms. So maybe if that takes longer than say 50 ms it could be >> considered low performance? >> > > Works for me. I would record and provide an accessor for ImageStartUsecs > (a class variable in SmalltalkImage, using microseconds :-) ). Then one > can either use isLowerPerformance or the actual time for a more "nuanced" > view. > Good idea. It also should use class vars not globals, etc. I didn't mean to use this as is, just to do a quick proof of concept. And I didn't see Dave's take come through yet ... or are announcements from squeaksource broken? Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 23 02:25:39 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 23 Dec 2020 02:25:39 0000 Subject: [squeak-dev] The Trunk: System-eem.1207.mcz Message-ID: Eliot Miranda uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-eem.1207.mcz ==================== Summary ==================== Name: System-eem.1207 Author: eem Time: 22 December 2020, 6:25:35.535409 pm UUID: 307e584e-0a0c-422b-8f92-2acd43a29ff7 Ancestors: System-dtl.1206 Update vmParameterAt: doc with the event trace mask. Fix ResourceManager>>#convertMapNameForBackwardcompatibilityFrom: for the 10.x => 11.x MacOS version name issue. =============== Diff against System-dtl.1206 =============== Item was changed: ----- Method: ResourceManager>>convertMapNameForBackwardcompatibilityFrom: (in category 'backward-compatibility') ----- convertMapNameForBackwardcompatibilityFrom: aString (Smalltalk platformName = 'Mac OS' + and: [(Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc"]) + ifTrue: [^aString convertFromWithConverter: ShiftJISTextConverter new]. - and: ['10*' match: Smalltalk osVersion]) - ifTrue: [^aString convertFromWithConverter: ShiftJISTextConverter new]. ^aString convertFromSystemString! Item was changed: ----- Method: SmalltalkImage>>vmParameterAt: (in category 'vm parameters') ----- vmParameterAt: parameterIndex "parameterIndex is a positive integer corresponding to one of the VM's internal parameter/metric registers. Answer with the current value of that register. Fail if parameterIndex has no corresponding register. VM parameters are numbered as follows: 1 byte size of old-space (read-only) 2 byte size of young-space (read-only) 3 byte size of object memory (read-only) 4 allocationCount (read-only; nil in Cog VMs) 5 allocations between GCs (read-write; nil in Cog VMs) 6 survivor count tenuring threshold (read-write) 7 full GCs since startup (read-only) 8 total milliseconds in full GCs since startup (read-only) 9 incremental GCs since startup (read-only; scavenging GCs on Spur) 10 total milliseconds in incremental/scavenging GCs since startup (read-only) + 11 tenures of surving objects since startup/last write (read-write) + 12 event trace mask; if 1 << eventType is set in the mask then event received by primGetNextEvent: will be printed to stderr. + 13-15 specific to the (o0bsolete) translating VM - 11 tenures of surving objects since startup (read-only) - 12-15 specific to the translating VM 16 total microseconds in idle since startup 17 proportion of code zone available for use (Sista VMs only; read-write) 18 total milliseconds in full GC compaction since startup (a portion of parameter 8) 19 scavenge threshold; the effective size of eden 20 utc microseconds at VM start-up (actually at time initialization, which precedes image load) (newer Cog VMs only). 21 root (remembered) table size (read-only) 22 root (remembered) table overflows since startup (read-only) 23 bytes of extra memory to reserve for VM buffers, plugins, etc. 24 memory threshold above which to shrink object memory (read-write) 25 ammount to grow by when growing object memory (read-write) 26 interruptChecksEveryNms - force an ioProcessEvents every N milliseconds (read-write) 27 number of times mark loop iterated for current IGC/FGC (read-only) includes ALL marking 28 number of times sweep loop iterated for current IGC/FGC (read-only) 29 number of times make forward loop iterated for current IGC/FGC (read-only) 30 number of times compact move loop iterated for current IGC/FGC (read-only) 31 number of grow memory requests (read-only) 32 number of shrink memory requests (read-only) 33 number of root table entries used for current IGC/FGC (read-only) 34 bytes allocated in total since start-up or reset (read-write) 35 number of survivor objects after current IGC/FGC (read-only) 36 millisecond clock when current IGC/FGC completed (read-only) 37 number of marked objects for Roots of the world, not including Root Table entries for current IGC/FGC (read-only) 38 milliseconds taken by current IGC (read-only) 39 Number of finalization signals for Weak Objects pending when current IGC/FGC completed (read-only) 40 BytesPerWord for this image 41 imageFormatVersion for the VM 42 number of stack pages in use (Cog Stack VM only, otherwise nil) 43 desired number of stack pages (stored in image file header, max 65535; Cog VMs only, otherwise nil) 44 size of eden, in bytes (Cog VMs only, otherwise nil) 45 desired size of eden, in bytes (stored in image file header; Cog VMs only, otherwise nil) 46 size of machine code zone, in bytes (stored in image file header; Cog JIT VM only, otherwise nil) 47 desired size of machine code zone, in bytes (applies at startup only, stored in image file header; Cog JIT VM only) 48 various properties stored in the image header (that instruct the VM) as an integer encoding an array of bit flags. Bit 0: tells the VM that the image's Process class has threadId as its 5th inst var (after nextLink, suspendedContext, priority & myList) Bit 1: on Cog JIT VMs asks the VM to set the flag bit in interpreted methods Bit 2: if set, preempting a process puts it to the head of its run queue, not the back, i.e. preempting a process by a higher priority one will not cause the preempted process to yield to others at the same priority. Bit 3: in a muilt-threaded VM, if set, the Window system will only be accessed from the first VM thread Bit 4: in a Spur vm, if set, causes weaklings and ephemerons to be queued individually for finalization Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) 49 the size of the external semaphore table (read-write; Cog VMs only) 50-51 reserved for VM parameters that persist in the image (such as eden above) 52 root (remembered) table maximum size (read-only) 53 the number of oldSpace segments (Spur only, otherwise nil) 54 total size of free old space (Spur only, otherwise nil) 55 ratio of growth and image size at or above which a GC will be performed post scavenge (Spur only, otherwise nil) 56 number of process switches since startup (read-only) 57 number of ioProcessEvents calls since startup (read-only) 58 number of forceInterruptCheck (Cog VMs) or quickCheckInterruptCalls (non-Cog VMs) calls since startup (read-only) 59 number of check event calls since startup (read-only) 60 number of stack page overflows since startup (read-only; Cog VMs only) 61 number of stack page divorces since startup (read-only; Cog VMs only) 62 number of machine code zone compactions since startup (read-only; Cog VMs only) 63 milliseconds taken by machine code zone compactions since startup (read-only; Cog VMs only) 64 current number of machine code methods (read-only; Cog VMs only) 65 In newer Cog VMs a set of flags describing VM features, if non-zero bit 0 implies multiple bytecode set support; if non-zero bit 1 implies read-only object support; if non-zero bit 2 implies the VM suffers from using an ITIMER heartbeat (if 0 it has a thread that provides the heartbeat) (read-only; Cog VMs only; nil in older Cog VMs, a boolean answering multiple bytecode support in not so old Cog VMs) 66 the byte size of a stack page in the stack zone (read-only; Cog VMs only) 67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur VMs only). 68 the average number of live stack pages when scanned by GC (at scavenge/gc/become et al) 69 the maximum number of live stack pages when scanned by GC (at scavenge/gc/become et al) 70 the value of VM_PROXY_MAJOR (the interpreterProxy major version number) 71 the value of VM_PROXY_MINOR (the interpreterProxy minor version number) 72 total milliseconds in full GCs Mark phase since startup (read-only) 73 total milliseconds in full GCs Sweep phase since startup (read-only, can be 0 depending on compactors) + 74 maximum pause time due to segment allocation + 75 whether arithmetic primitives will do mixed type arithmetic; if false they fail for different receiver and argument types" - 74 maximum pause time due to segment allocation" self primitiveFailed! Item was changed: ----- Method: SmalltalkImage>>vmParameterAt:put: (in category 'vm parameters') ----- vmParameterAt: parameterIndex put: newValue "parameterIndex is a positive integer corresponding to one of the VM's internal parameter/metric registers. Store newValue (a positive integer) into that register and answer with the previous value that was stored there. Fail if newValue is out of range, if parameterIndex has no corresponding register, or if the corresponding register is read-only. + As of late 2020 the parameters which can be set are - As of mid 2017 the parameters which can be set are 5 allocations between GCs (read-write; nil in Cog VMs) 6 survivor count tenuring threshold (read-write) + 11 tenures of surving objects since startup/last write (read-write) + 12 event trace mask; if 1 << eventType is set in the mask then event received by primGetNextEvent: will be printed to stderr. 17 proportion of code zone available for use (Sista VMs only) 23 bytes of extra memory to reserve for VM buffers, plugins, etc. 24 memory threshold above whichto shrink object memory (read-write) 25 memory headroom when growing object memory (read-write) 26 interruptChecksEveryNms - force an ioProcessEvents every N milliseconds (read-write) 34 bytes allocated in total since start-up or reset (read-write) 43 desired number of stack pages (stored in image file header, max 65535; Cog VMs only, otherwise nil) 45 desired size of eden, in bytes (stored in image file header; Cog VMs only, otherwise nil) 47 desired size of machine code zone, in bytes (applies at startup only, stored in image file header; Cog JIT VM only) 48 various properties of the Cog VM as an integer encoding an array of bit flags. Bit 0: tells the VM that the image's Process class has threadId as its 5th inst var (after nextLink, suspendedContext, priority & myList) Bit 1: on Cog JIT VMs asks the VM to set the flag bit in interpreted methods Bit 2: if set, preempting a process puts it to the head of its run queue, not the back, i.e. preempting a process by a higher priority one will not cause the preempted process to yield to others at the same priority. Bit 3: in a muilt-threaded VM, if set, the Window system will only be accessed from the first VM thread Bit 4: in a Spur vm, if set, causes weaklings and ephemerons to be queued individually for finalization 49 the size of the external semaphore table (read-write; Cog VMs only) 55 ratio of growth and image size at or above which a GC will be performed post scavenge (Spur only, otherwise nil) + 67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur only). + 68 the average number of live stack pages when scanned by GC (at scavenge/gc/become et al) + 69 the maximum number of live stack pages when scanned by GC (at scavenge/gc/become et al) + 74 maximum pause time due to segment allocation + 75 whether arithmetic primitives will do mixed type arithmetic; if false they fail for different receiver and argument types" - 67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur only)." + self primitiveFailed! From frank-lesser at lesser-software.com Wed Dec 23 12:29:56 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Wed, 23 Dec 2020 13:29:56 +0100 Subject: [squeak-dev] [offtopic] Smalltalk puzzles In-Reply-To: References: Message-ID: <5bc85424-6cbb-bfaa-f23d-e7396f0e17b3@lesser-software.com> Hi all - my today's puzzle on my twitter @LesserFrank is connected with Smalltalk's history. From vanessa at codefrau.net Wed Dec 23 19:20:44 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Wed, 23 Dec 2020 11:20:44 -0800 Subject: [squeak-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: Oops - I don't think this made it to squeak-dev? Sending again. ---------- Forwarded message --------- From: Vanessa Freudenberg Date: Mon, Dec 21, 2020 at 9:32 PM Subject: [ANN] SqueakJS 1.0 To: , Open Smalltalk Virtual Machine Development Discussion , < esug-list at lists.esug.org> Hi All, yesterday I released version 1.0 of SqueakJS, exactly 7 years after my first public announcement on December 20, 2013. https://squeak.js.org/ Arguably I should have done this back in 2016 when it could run Spur images. What got it over the last hump was Fabio's interpreter for Sista bytecodes and Erik's refactoring for Node.js. SqueakJS is now the most compatible Squeak VM: it can run pre-release images from 1996 as well as the latest Squeak 6.0 trunk image. For production, you should still use non-Sista images, because no JIT has been implemented yet. A big Thank You to all the contributors over the years, and to Dan Ingalls for the inspiration, and funding the initial development. There are still many things to work on: - a simple JIT for Sista bytecode to bring its speed at least up to par with its pre-Sista speed - a "real" JIT with context mapping (keeping temps in JS vars rather than on the stack) and send optimizations (mapping sends to JS function invocations) - 64 bit support for pre-Spur images - big-endian support for 64 bit images Help is very welcome at https://github.com/codefrau/SqueakJS Happy Holidays to Everyone! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From rssnow1 at gmail.com Wed Dec 23 20:02:02 2020 From: rssnow1 at gmail.com (Richard Snow) Date: Wed, 23 Dec 2020 14:02:02 -0600 Subject: [squeak-dev] welcome Message-ID: I'm back Ian piumarta -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Thu Dec 24 03:32:47 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 23 Dec 2020 19:32:47 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> Message-ID: <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> Well nothing to do with sound ever seems as simple as one would like. Remember, the waggling keyboard thing makes horrific scratchy noises BUT it doesn't do that on a Mac running exactly the same Smalltalk code, so I got suspicious. I now have three Pi setups that make completely different sounds. 1) an old Pi-top CEED with a Pi 3 and a May 2017 OS, a)with the as-provided NuScratch. This makes perfectly ok sounds under the piano-waggle regime, event though the volume is 100%. b) same Pi-top but using a newer (but still 2017 vintage) Squeak system, where the sound seems fine. Both cases are using the old release of alsa. 2) my main daily use Pi4 with the last non-pulse version of OS. a) using the supplied NuScratch it makes barely audible noises that are terrible when actually audible. Even the cat meow is terrible! b) using an early-this-year Squeak VM there is just no sound at all 3) a fresh Pi4 with the release candidate OS Simon pointed me to. a) in as-supplied NuScratch with a pulse audio sound lib added the sound is bad unless the internal volume is turned way down, when there are still nasty scratchy-glitches b) in a new system the sound is still bad but much nearer to ok with the internal volume reduced. As mentioned, the Mac runs the exact same Smalltalk image just fine. I don't have Windows so I can't opine on that option. Other than "Eww, Windows?" The obvious thing to dig into now is what changes have been made to the lowest-level unix sound stuff since 2016. Anybody got ideas? Could it even be changes to the unix libraries in the pulse/alsa world? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: MET: Misread and Eat Tape From herbertkoenig at gmx.net Thu Dec 24 10:35:26 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 24 Dec 2020 11:35:26 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> Message-ID: <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> There's always a chance that the OS meddles with it too. Notably on Windows if you simultaneously play and record it looses buffers sometimes. And often it is the combination of application and OS. I didn't find the place where Squeak audio goes out to the OS but writing this to a (preferably .wav) file would give a chance to analyse what happens inside Squeak. If anybody can post the necessary changes I can do that and check. I will set up a Pi and record the audio (hardware) output with another computer to see the sum of the effects. Are the snippets in your original post those which produce the problem on a Pi? Would be more comparable then waggling the keyboard. Cheers, Herbert Am 24.12.2020 um 04:32 schrieb tim Rowledge: > Well nothing to do with sound ever seems as simple as one would like. > > Remember, the waggling keyboard thing makes horrific scratchy noises BUT it doesn't do that on a Mac running exactly the same Smalltalk code, so I got suspicious. > > I now have three Pi setups that make completely different sounds. > > 1) an old Pi-top CEED with a Pi 3 and a May 2017 OS, > a)with the as-provided NuScratch. This makes perfectly ok sounds under the piano-waggle regime, event though the volume is 100%. > b) same Pi-top but using a newer (but still 2017 vintage) Squeak system, where the sound seems fine. > Both cases are using the old release of alsa. > > 2) my main daily use Pi4 with the last non-pulse version of OS. > a) using the supplied NuScratch it makes barely audible noises that are terrible when actually audible. Even the cat meow is terrible! > b) using an early-this-year Squeak VM there is just no sound at all > > 3) a fresh Pi4 with the release candidate OS Simon pointed me to. > a) in as-supplied NuScratch with a pulse audio sound lib added the sound is bad unless the internal volume is turned way down, when there are still nasty scratchy-glitches > b) in a new system the sound is still bad but much nearer to ok with the internal volume reduced. > > As mentioned, the Mac runs the exact same Smalltalk image just fine. I don't have Windows so I can't opine on that option. Other than "Eww, Windows?" > > The obvious thing to dig into now is what changes have been made to the lowest-level unix sound stuff since 2016. Anybody got ideas? Could it even be changes to the unix libraries in the pulse/alsa world? > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: MET: Misread and Eat Tape > > > From commits at source.squeak.org Thu Dec 24 18:36:16 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 24 Dec 2020 18:36:16 0000 Subject: [squeak-dev] The Inbox: System-dtl.1208.mcz Message-ID: A new version of System was added to project The Inbox: http://source.squeak.org/inbox/System-dtl.1208.mcz ==================== Summary ==================== Name: System-dtl.1208 Author: dtl Time: 24 December 2020, 1:34:26.591143 pm UUID: 2d7b8483-72c8-4f51-ab7d-83e5aeaad51e Ancestors: System-eem.1207 Provide vmParameterAt:default: to handle primitive failure on reading VM parameters. Fix sendMouseWheelEvents, should test bit 5 not bit 6. Supply default parameter values to mock possibly missing elements in the parameters array. Remove two unnecessary isRunningCog checks and an ifNotNil: Remove inappropriate halt in sendMouseWheelEvents: Let supportsMultipleBytecodeSets and supportsReadOnlyObjects work on any VM. =============== Diff against System-eem.1207 =============== Item was changed: ----- Method: SmalltalkImage>>isRunningCog (in category 'system attributes') ----- isRunningCog "Answers if we're running on a Cog VM (JIT or StackInterpreter)" + ^(self vmParameterAt: 42 default: nil) - ^(self vmParameterAt: 42) ifNil: [false] ifNotNil: [:numStackPages| numStackPages > 0]! Item was changed: ----- Method: SmalltalkImage>>isRunningCogit (in category 'system attributes') ----- isRunningCogit "Answers if we're running on the Cog JIT" + ^(self vmParameterAt: 46 default: nil) - ^(self vmParameterAt: 46) ifNil: [false] ifNotNil: [:machineCodeZoneSize| machineCodeZoneSize > 0]! Item was changed: ----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') ----- lowSpaceThreshold "Answer the low space threshold. When the amount of free memory (after garbage collection) falls below this limit, the system is in serious danger of completely exhausting memory and crashing. This limit should be made high enough to allow the user open a debugger to diagnose a problem or to save the image. In a stack-based VM such as Cog contexts for activations in the stack zone will have to be created as the debugger opens, requiring additional headroom." | slotsForDebugger slotsForContextsOnStackPages | slotsForDebugger := 65536. "Arbitrary guess" slotsForContextsOnStackPages := + (self vmParameterAt: 42 default: nil) - (self vmParameterAt: 42) ifNil: [0] ifNotNil: [:numStackPages| | headerSize numActivationsPerPage maxContextSize | numActivationsPerPage := 40. "Design goal of the Cog & Stack VMs" headerSize := 8 / self wordSize. "64-bits for Spur" maxContextSize := thisContext class instSize + CompiledMethod fullFrameSize + headerSize. numStackPages * numActivationsPerPage * maxContextSize]. ^slotsForDebugger + slotsForContextsOnStackPages * self wordSize! Item was changed: ----- Method: SmalltalkImage>>maxExternalSemaphores (in category 'vm parameters') ----- maxExternalSemaphores + "The size of table where external semaphores are registered. Only in Cog, + other VMs are expected to answer nil if present in the parameters array." + ^self vmParameterAt: 49 default: nil! - "The size of table where external semaphores are registered. Only in Cog" - self isRunningCog ifFalse: [^nil]. - ^self vmParameterAt: 49! Item was changed: ----- Method: SmalltalkImage>>maxExternalSemaphores: (in category 'vm parameters') ----- maxExternalSemaphores: aSize "Changes the size of table where external semaphores are registered. The size can only grow, and will always be the next power of two larger than the parameter. Setting this at any time other than start-up can potentially lose requests. i.e. during the realloc new storage is allocated, the old contents are copied and then pointers are switched. Requests occurring during copying won't be seen if they occur to indices already copied. The intended use is to set the table to some adequate maximum at start-up" - self isRunningCog ifFalse: [^0]. "The vm-header field is a short, maximum 64k entries. Well, on most platforms anyways " (aSize < 0 or: [aSize > 16rFFFF]) ifTrue: [^self error: 'maxExternalSemaphores: is limited to 16rFFFF']. + ^[self vmParameterAt: 49 put: aSize] on: Error do: [0].! - ^self vmParameterAt: 49 put: aSize! Item was changed: ----- Method: SmalltalkImage>>processPreemptionYields (in category 'system attributes') ----- processPreemptionYields "Answer whether the VM causes a process to yield on process preemption, i.e. to put a preempted process at the back of its run queue. If the parameter is unavailable (non-Cog VMs) or bit 2 (4) is 0 then preemption yields." + ^((self vmParameterAt: 48 default: [^true]) allMask: 4) not + ! - ^(([self vmParameterAt: 48] - on: Error - do: [:ex| ^true]) allMask: 4) not! Item was changed: ----- Method: SmalltalkImage>>sendMouseWheelEvents (in category 'system attributes') ----- sendMouseWheelEvents "The Cog VM can be instructed to deliver mouse wheel events as mouse wheel events. By default mouse wheel events are mapped to arrow events. This flag persists across snapshots, stored in the image header." + ^(self vmParameterAt: 48 default: 0) allMask: 16 "bit 5" + + ! - ^(self vmParameterAt: 48) anyMask: 32! Item was changed: ----- Method: SmalltalkImage>>supportsMultipleBytecodeSets (in category 'system attributes') ----- supportsMultipleBytecodeSets "Answer whether the VM supports multiple bytecodeSets." "SmalltalkImage current supportsMultipleBytecodeSets" + ^(self vmParameterAt: 65 default: nil) - ^(self vmParameterAt: 65) ifNil: [false] ifNotNil: [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" param isInteger "In newer VMs it is a set of integer flags, bit 0 of which is the vm-internal MULTIPLE_BYTECODE_SETS define" ifTrue: [param anyMask: 1] ifFalse: [param]]! Item was changed: ----- Method: SmalltalkImage>>supportsQueueingFinalization (in category 'system attributes') ----- supportsQueueingFinalization "Answer whether the VM queues individual weak arrays for finalization, instead of signalling the finalization semaphore once for all arrays and having the WeakRegistry mechanism finalize all weak arrays, whether they need to or not." "SmalltalkImage current supportsQueueingFinalization" + ^(self vmParameterAt: 48 default: 0) anyMask: 16! - ^(self vmParameterAt: 48) anyMask: 16! Item was changed: ----- Method: SmalltalkImage>>supportsReadOnlyObjects (in category 'system attributes') ----- supportsReadOnlyObjects "Answer whether the VM observes the per-object read-only flag and consequently aborts writes to inst vars of, and fails primitives that attempt to modify, read-only objects." "SmalltalkImage current supportsReadOnlyObjects" + ^(self vmParameterAt: 65 default: nil) - ^(self vmParameterAt: 65) ifNil: [false] ifNotNil: [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" param isInteger "In newer VMs it is a set of integer flags, bit 1 of which is the vm-internal IMMUTABILITY define" ifTrue: [param anyMask: 2] ifFalse: [false]]! Item was added: + ----- Method: SmalltalkImage>>vmParameterAt:default: (in category 'vm parameters') ----- + vmParameterAt: parameterIndex default: defaultValueOrBlock + "Answer a VM parameter or defaultValueOrBlock value if out of range." + + ^defaultValueOrBlock value! Item was changed: ----- Method: SmalltalkImage>>wordSize (in category 'image') ----- wordSize "Answer the size in bytes of an object pointer or word in the object memory. The value does not change for a given image, but may be modified by a SystemTracer when converting the image to another format. The value is cached in WordSize to avoid the performance overhead of repeatedly consulting the VM." "Smalltalk wordSize" + ^ WordSize ifNil: [WordSize := self vmParameterAt: 40 default: 4]! - ^ WordSize ifNil: [WordSize := [self vmParameterAt: 40] on: Error do: [4]]! From lewis at mail.msen.com Thu Dec 24 18:43:11 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Thu, 24 Dec 2020 13:43:11 -0500 Subject: [squeak-dev] The Inbox: System-dtl.1208.mcz In-Reply-To: References: Message-ID: <20201224184311.GA55865@shell.msen.com> This tidies up the code a bit and provides a no-overhead way to supply default vmParameter values for parameters that may be out of range on some VMs. The change to sendMouseWheelEvents fixes an existing bug. Dave On Thu, Dec 24, 2020 at 06:36:16PM +0000, commits at source.squeak.org wrote: > A new version of System was added to project The Inbox: > http://source.squeak.org/inbox/System-dtl.1208.mcz > > ==================== Summary ==================== > > Name: System-dtl.1208 > Author: dtl > Time: 24 December 2020, 1:34:26.591143 pm > UUID: 2d7b8483-72c8-4f51-ab7d-83e5aeaad51e > Ancestors: System-eem.1207 > > Provide vmParameterAt:default: to handle primitive failure on reading VM parameters. > Fix sendMouseWheelEvents, should test bit 5 not bit 6. > Supply default parameter values to mock possibly missing elements in the parameters array. > Remove two unnecessary isRunningCog checks and an ifNotNil: > Remove inappropriate halt in sendMouseWheelEvents: > Let supportsMultipleBytecodeSets and supportsReadOnlyObjects work on any VM. > > =============== Diff against System-eem.1207 =============== > > Item was changed: > ----- Method: SmalltalkImage>>isRunningCog (in category 'system attributes') ----- > isRunningCog > "Answers if we're running on a Cog VM (JIT or StackInterpreter)" > > + ^(self vmParameterAt: 42 default: nil) > - ^(self vmParameterAt: 42) > ifNil: [false] > ifNotNil: [:numStackPages| numStackPages > 0]! > > Item was changed: > ----- Method: SmalltalkImage>>isRunningCogit (in category 'system attributes') ----- > isRunningCogit > "Answers if we're running on the Cog JIT" > > + ^(self vmParameterAt: 46 default: nil) > - ^(self vmParameterAt: 46) > ifNil: [false] > ifNotNil: [:machineCodeZoneSize| machineCodeZoneSize > 0]! > > Item was changed: > ----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') ----- > lowSpaceThreshold > "Answer the low space threshold. When the amount of free memory (after garbage collection) > falls below this limit, the system is in serious danger of completely exhausting memory and > crashing. This limit should be made high enough to allow the user open a debugger to diagnose > a problem or to save the image. In a stack-based VM such as Cog contexts for activations in > the stack zone will have to be created as the debugger opens, requiring additional headroom." > > | slotsForDebugger slotsForContextsOnStackPages | > slotsForDebugger := 65536. "Arbitrary guess" > slotsForContextsOnStackPages := > + (self vmParameterAt: 42 default: nil) > - (self vmParameterAt: 42) > ifNil: [0] > ifNotNil: > [:numStackPages| | headerSize numActivationsPerPage maxContextSize | > numActivationsPerPage := 40. "Design goal of the Cog & Stack VMs" > headerSize := 8 / self wordSize. "64-bits for Spur" > maxContextSize := thisContext class instSize + CompiledMethod fullFrameSize + headerSize. > numStackPages * numActivationsPerPage * maxContextSize]. > ^slotsForDebugger + slotsForContextsOnStackPages * self wordSize! > > Item was changed: > ----- Method: SmalltalkImage>>maxExternalSemaphores (in category 'vm parameters') ----- > maxExternalSemaphores > + "The size of table where external semaphores are registered. Only in Cog, > + other VMs are expected to answer nil if present in the parameters array." > + ^self vmParameterAt: 49 default: nil! > - "The size of table where external semaphores are registered. Only in Cog" > - self isRunningCog ifFalse: [^nil]. > - ^self vmParameterAt: 49! > > Item was changed: > ----- Method: SmalltalkImage>>maxExternalSemaphores: (in category 'vm parameters') ----- > maxExternalSemaphores: aSize > "Changes the size of table where external semaphores are registered. > The size can only grow, and will always be the next power of two larger than the parameter. > > Setting this at any time other than start-up can potentially lose requests. > i.e. during the realloc new storage is allocated, > the old contents are copied and then pointers are switched. > Requests occurring during copying won't be seen if they occur to indices already copied. > The intended use is to set the table to some adequate maximum at start-up" > > - self isRunningCog ifFalse: [^0]. > "The vm-header field is a short, maximum 64k entries. Well, on most platforms anyways " > (aSize < 0 or: [aSize > 16rFFFF]) ifTrue: [^self error: 'maxExternalSemaphores: is limited to 16rFFFF']. > + ^[self vmParameterAt: 49 put: aSize] on: Error do: [0].! > - ^self vmParameterAt: 49 put: aSize! > > Item was changed: > ----- Method: SmalltalkImage>>processPreemptionYields (in category 'system attributes') ----- > processPreemptionYields > "Answer whether the VM causes a process to yield on process preemption, > i.e. to put a preempted process at the back of its run queue. If the parameter > is unavailable (non-Cog VMs) or bit 2 (4) is 0 then preemption yields." > > + ^((self vmParameterAt: 48 default: [^true]) allMask: 4) not > + ! > - ^(([self vmParameterAt: 48] > - on: Error > - do: [:ex| ^true]) allMask: 4) not! > > Item was changed: > ----- Method: SmalltalkImage>>sendMouseWheelEvents (in category 'system attributes') ----- > sendMouseWheelEvents > "The Cog VM can be instructed to deliver mouse wheel events as mouse wheel events. > By default mouse wheel events are mapped to arrow events. > This flag persists across snapshots, stored in the image header." > > + ^(self vmParameterAt: 48 default: 0) allMask: 16 "bit 5" > + > + ! > - ^(self vmParameterAt: 48) anyMask: 32! > > Item was changed: > ----- Method: SmalltalkImage>>supportsMultipleBytecodeSets (in category 'system attributes') ----- > supportsMultipleBytecodeSets > "Answer whether the VM supports multiple bytecodeSets." > "SmalltalkImage current supportsMultipleBytecodeSets" > > + ^(self vmParameterAt: 65 default: nil) > - ^(self vmParameterAt: 65) > ifNil: [false] > ifNotNil: > [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" > param isInteger "In newer VMs it is a set of integer flags, bit 0 of which is the vm-internal MULTIPLE_BYTECODE_SETS define" > ifTrue: [param anyMask: 1] > ifFalse: [param]]! > > Item was changed: > ----- Method: SmalltalkImage>>supportsQueueingFinalization (in category 'system attributes') ----- > supportsQueueingFinalization > "Answer whether the VM queues individual weak arrays for finalization, instead > of signalling the finalization semaphore once for all arrays and having the > WeakRegistry mechanism finalize all weak arrays, whether they need to or not." > "SmalltalkImage current supportsQueueingFinalization" > > + ^(self vmParameterAt: 48 default: 0) anyMask: 16! > - ^(self vmParameterAt: 48) anyMask: 16! > > Item was changed: > ----- Method: SmalltalkImage>>supportsReadOnlyObjects (in category 'system attributes') ----- > supportsReadOnlyObjects > "Answer whether the VM observes the per-object read-only flag and consequently aborts > writes to inst vars of, and fails primitives that attempt to modify, read-only objects." > "SmalltalkImage current supportsReadOnlyObjects" > > + ^(self vmParameterAt: 65 default: nil) > - ^(self vmParameterAt: 65) > ifNil: [false] > ifNotNil: > [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" > param isInteger "In newer VMs it is a set of integer flags, bit 1 of which is the vm-internal IMMUTABILITY define" > ifTrue: [param anyMask: 2] > ifFalse: [false]]! > > Item was added: > + ----- Method: SmalltalkImage>>vmParameterAt:default: (in category 'vm parameters') ----- > + vmParameterAt: parameterIndex default: defaultValueOrBlock > + "Answer a VM parameter or defaultValueOrBlock value if out of range." > + > + ^defaultValueOrBlock value! > > Item was changed: > ----- Method: SmalltalkImage>>wordSize (in category 'image') ----- > wordSize > "Answer the size in bytes of an object pointer or word in the object memory. > The value does not change for a given image, but may be modified by a SystemTracer > when converting the image to another format. The value is cached in WordSize to > avoid the performance overhead of repeatedly consulting the VM." > > "Smalltalk wordSize" > > + ^ WordSize ifNil: [WordSize := self vmParameterAt: 40 default: 4]! > - ^ WordSize ifNil: [WordSize := [self vmParameterAt: 40] on: Error do: [4]]! > > From frank-lesser at lesser-software.com Thu Dec 24 19:31:01 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Thu, 24 Dec 2020 20:31:01 +0100 Subject: [squeak-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: Hi Vanessa, congrats - know the feeling how fast time passes if you seriously work on a great project - hope to find the time to have a deeper look at your work soon s possible - merry Christmas, Frank On 12/23/2020 20:20, Vanessa Freudenberg wrote: > Oops - I don't think this made it to squeak-dev? Sending again. > > ---------- Forwarded message --------- > From: *Vanessa Freudenberg* > > Date: Mon, Dec 21, 2020 at 9:32 PM > Subject: [ANN] SqueakJS 1.0 > To: >, Open Smalltalk Virtual Machine > Development Discussion >, > > > > Hi All, > > yesterday I released version 1.0 of SqueakJS, exactly 7 years after my > first public announcement on December 20, 2013. > > https://squeak.js.org/ > > Arguably I should have done this back in 2016 when it could run Spur > images. What got it over the last hump was Fabio's interpreter for > Sista bytecodes and Erik's refactoring for Node.js. > > SqueakJS is now the most compatible Squeak VM: it can run pre-release > images from 1996 as well as the latest Squeak 6.0 trunk image. > > For production, you should still use non-Sista images, because no JIT > has been implemented yet. > > A big Thank You to all the contributors over the years, and to Dan > Ingalls for the inspiration, and funding the initial development. > > There are still many things to work on: > > - a simple JIT for Sista bytecode to bring its speed at least up to > par with its pre-Sista speed > - a "real" JIT with context mapping (keeping temps in JS vars rather > than on the stack) and send optimizations (mapping sends to JS > function invocations) > - 64 bit support for pre-Spur images > - big-endian support for 64 bit images > > Help is very welcome at https://github.com/codefrau/SqueakJS > > > Happy Holidays to Everyone! > Vanessa > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Thu Dec 24 19:58:44 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 24 Dec 2020 11:58:44 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> Message-ID: <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> > On 2020-12-24, at 2:35 AM, Herbert König wrote: > > There's always a chance that the OS meddles with it too. Notably on > Windows if you simultaneously play and record it looses buffers > sometimes. And often it is the combination of application and OS. Yah. It certainly isn't impossible that changes to the underlying libraries are causing issues; after, my original work on this was done six years ago and the basic sound related stuff may be 20 years old. > > I didn't find the place where Squeak audio goes out to the OS but > writing this to a (preferably .wav) file would give a chance to analyse > what happens inside Squeak. If anybody can post the necessary changes I > can do that and check. I can see three plausible places where it might be smart to record things a) copy the sound buffer samples as sent to the prim in the #playLoop method b) copy the samples actually sent to the OS by the VM c) copy the sound output by the OS I suspect that somebody can point to an application to record the final output cleanly. > > I will set up a Pi and record the audio (hardware) output with another > computer to see the sum of the effects. I was almost at the point of just aiming my iPhone at the screen. > > Are the snippets in your original post those which produce the problem > on a Pi? Would be more comparable then waggling the keyboard. Yes and no; that code shows off how the volume level can drive things into a screeching mess. Here is another snippet that seems to illustrate things a bit better - |snd volume | volume:= 40. 10 timesRepeat: [ snd := FMSound new. "250 milliSeconds wait." snd setPitch: (AbstractSound pitchForMIDIKey: 60) dur: 1000 loudness: ((volume / 100.0) min: 1.0 max: 0.0). snd play. 50 milliSeconds wait. snd stopGracefully. "250 milliSeconds wait." snd := FMSound new. snd setPitch: (AbstractSound pitchForMIDIKey: 58) dur: 1000 loudness: ((volume / 100.0) min: 1.0 max: 0.0). snd play. 50 milliSeconds wait. snd stopGracefully] You might experiment with - the volume setting - the variety of FMSound (organ1 includes an envelope or two to mix things up a bit) - the commented out between-sound delay, which I used to try to avoid two sounds overlapping in order to test the hypothesis that mixing was messing up And depending on the update level of your image, the "X milliSeconds wait" might need to be changed back to "(Delay forMIlliSeconds: X) wait" etc. I get a strangely interesting effect that is probably suggesting something important (and that I'm not yet getting) with the between-sound delay used and set to 150 mS. It's as if there is some mangling of buffers going on. At 100mS it goes berserk; at 200 it sounds perfectly regular. I'm going to indulge in some code scanning to try to spot changes made that might affect this. I'll be interested how you see, or rather hear, things. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "Bother!" said Pooh, as Piglet pressed on the Microwave... From herbertkoenig at gmx.net Thu Dec 24 20:18:59 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 24 Dec 2020 21:18:59 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> Message-ID: <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> Hi Tim, ATM I get no sound from Squeak or Scratch on my Raspi3. I updated the OS but it still doesn't say "Raspberry Pi OS" With some googling I got Audio working from Audacity (simple Audio Editor I use on Raspi, Linux and Windows). I use Squeak5.3-19439. Recording with a phone will show some glitches but the bandwidth of phone (and monitor speakers) mellows down (err filters) the waveform. Surely only second choice. I would not mind downloading and using the proper Squeak to get sound going. Any quick help? Cheers, Herbert Am 24.12.2020 um 20:58 schrieb tim Rowledge: > >> On 2020-12-24, at 2:35 AM, Herbert König wrote: >> >> There's always a chance that the OS meddles with it too. Notably on >> Windows if you simultaneously play and record it looses buffers >> sometimes. And often it is the combination of application and OS. > Yah. It certainly isn't impossible that changes to the underlying libraries are causing issues; after, my original work on this was done six years ago and the basic sound related stuff may be 20 years old. > >> I didn't find the place where Squeak audio goes out to the OS but >> writing this to a (preferably .wav) file would give a chance to analyse >> what happens inside Squeak. If anybody can post the necessary changes I >> can do that and check. > I can see three plausible places where it might be smart to record things > a) copy the sound buffer samples as sent to the prim in the #playLoop method > b) copy the samples actually sent to the OS by the VM > c) copy the sound output by the OS > > I suspect that somebody can point to an application to record the final output cleanly. > >> I will set up a Pi and record the audio (hardware) output with another >> computer to see the sum of the effects. > I was almost at the point of just aiming my iPhone at the screen. > >> Are the snippets in your original post those which produce the problem >> on a Pi? Would be more comparable then waggling the keyboard. > Yes and no; that code shows off how the volume level can drive things into a screeching mess. > > Here is another snippet that seems to illustrate things a bit better - > > |snd volume | > volume:= 40. > 10 timesRepeat: [ > snd := FMSound new. > "250 milliSeconds wait." > snd > setPitch: (AbstractSound pitchForMIDIKey: 60) > dur: 1000 > loudness: ((volume / 100.0) min: 1.0 max: 0.0). > snd play. > 50 milliSeconds wait. > snd stopGracefully. > "250 milliSeconds wait." > snd := FMSound new. > snd > setPitch: (AbstractSound pitchForMIDIKey: 58) > dur: 1000 > loudness: ((volume / 100.0) min: 1.0 max: 0.0). > snd play. > 50 milliSeconds wait. > snd stopGracefully] > > You might experiment with > - the volume setting > - the variety of FMSound (organ1 includes an envelope or two to mix things up a bit) > - the commented out between-sound delay, which I used to try to avoid two sounds overlapping in order to test the hypothesis that mixing was messing up > > And depending on the update level of your image, the "X milliSeconds wait" might need to be changed back to "(Delay forMIlliSeconds: X) wait" etc. > > I get a strangely interesting effect that is probably suggesting something important (and that I'm not yet getting) with the between-sound delay used and set to 150 mS. It's as if there is some mangling of buffers going on. At 100mS it goes berserk; at 200 it sounds perfectly regular. > > I'm going to indulge in some code scanning to try to spot changes made that might affect this. I'll be interested how you see, or rather hear, things. > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > "Bother!" said Pooh, as Piglet pressed on the Microwave... > > > From tim at rowledge.org Thu Dec 24 20:36:41 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 24 Dec 2020 12:36:41 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> Message-ID: <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> > On 2020-12-24, at 12:18 PM, Herbert König wrote: > > Hi Tim, > > ATM I get no sound from Squeak or Scratch on my Raspi3. I updated the OS > but it still doesn't say "Raspberry Pi OS" Hmm, updating a Pi can be confusing at times. If you do `uname -a` in a terminal, what do you see? On my still-alsa machine I get Linux Goldskin 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux On my test-pulse I get Linux Pi-4-1-pulse 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux Remember that you need to include the vm sound flag when you start up squeak! I keep forgetting that. Though.. if you're start scratch with the standard menu entry, that should do it. Let's see - there is also the possibility you are not directing sound to the right output. The Pi sound-volume control widget on the menubar can set where the sound goes - right-click on it and you should see a menu with at least Analogue HDMI entries. I use the analogue and headphones since none of my Pi have a direct HDMI display attached but go via VNC. If you have an HDMI monitor attached it may not have speakers or you might not have them turned on! DAMHIKT. > > With some googling I got Audio working from Audacity (simple Audio > Editor I use on Raspi, Linux and Windows). I use Squeak5.3-19439. > > Recording with a phone will show some glitches but the bandwidth of > phone (and monitor speakers) mellows down (err filters) the waveform. > Surely only second choice. > > I would not mind downloading and using the proper Squeak to get sound going. The 5.3 armlinux package from squeak.org ought to do ok for this. Remembering of course to include that '-vm-sound-alsa' (or pulse) in your commandline tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: PRM: PRint Money From herbertkoenig at gmx.net Thu Dec 24 21:05:41 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 24 Dec 2020 22:05:41 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> Message-ID: <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> Am 24.12.2020 um 21:36 schrieb tim Rowledge: > >> On 2020-12-24, at 12:18 PM, Herbert König wrote: >> >> Hi Tim, >> >> ATM I get no sound from Squeak or Scratch on my Raspi3. I updated the OS >> but it still doesn't say "Raspberry Pi OS" > Hmm, updating a Pi can be confusing at times. > > If you do > `uname -a` in a terminal, what do you see? > > On my still-alsa machine I get > Linux Goldskin 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux Linux herpi2 5.4.79-V7+ .. Rest same as yours above. > > On my test-pulse I get > Linux Pi-4-1-pulse 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux > > Remember that you need to include the vm sound flag when you start up squeak! I keep forgetting that. Though.. if you're start scratch with the standard menu entry, that should do it. Let's see - there is also the possibility you are not directing sound to the right output. The Pi sound-volume control widget on the menubar can set where the sound goes - right-click on it and you should see a menu with at least > Analogue > HDMI > entries. I use the analogue and headphones since none of my Pi have a direct HDMI display attached but go via VNC. If you have an HDMI monitor attached it may not have speakers or you might not have them turned on! DAMHIKT. I use the 3.5mm headphone output and verified that via Audacity and VLC. I have a cheap active speaker connected. Just checked: Scratch 2 plays sound Scratch1 started via the menu doesn't. Now downloading a fresh Squeak. I tried the -vmsound alsa and pulse but I'm not sure If I used the right place in the script. I tried editing the last line to: exec "${VM}" "-vm-sound-alsa" "${IMAGE}"  (and pulse and w/o the "" but my Linux fu is not enough to know if that's ok. Cheers, Herbert > > > >> With some googling I got Audio working from Audacity (simple Audio >> Editor I use on Raspi, Linux and Windows). I use Squeak5.3-19439. >> >> Recording with a phone will show some glitches but the bandwidth of >> phone (and monitor speakers) mellows down (err filters) the waveform. >> Surely only second choice. >> >> I would not mind downloading and using the proper Squeak to get sound going. > The 5.3 armlinux package from squeak.org ought to do ok for this. Remembering of course to include that '-vm-sound-alsa' (or pulse) in your commandline > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: PRM: PRint Money > > > From herbertkoenig at gmx.net Thu Dec 24 21:21:27 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Thu, 24 Dec 2020 22:21:27 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> Message-ID: <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Ha, ran the script in a terminal and on each piano keypress I get: sound_Start(default) soundStart: snd_add_pcm_handler: Function not implemented. ... Handling two mouses and two keyboards is quite confusing ... Have to run to pick up my wife Hoping for some enlightenment tomorrow :-) Cheers, Herbert Am 24.12.2020 um 22:05 schrieb Herbert König: > > > Am 24.12.2020 um 21:36 schrieb tim Rowledge: >> >>> On 2020-12-24, at 12:18 PM, Herbert König >>> wrote: >>> >>> Hi Tim, >>> >>> ATM I get no sound from Squeak or Scratch on my Raspi3. I updated >>> the OS >>> but it still doesn't say "Raspberry Pi OS" >> Hmm, updating a Pi can be confusing at times. >> >> If you do >> `uname -a` in a terminal, what do you see? >> >> On my still-alsa machine I get >> Linux Goldskin 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 >> armv7l GNU/Linux > Linux herpi2 5.4.79-V7+ .. Rest same as yours above. >> >> On my test-pulse I get >> Linux Pi-4-1-pulse 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 >> armv7l GNU/Linux >> >> Remember that you need to include the vm sound flag when you start up >> squeak! I keep forgetting that. Though.. if you're start scratch with >> the standard menu entry, that should do it. Let's see - there is also >> the possibility you are not directing sound to the right output. The >> Pi sound-volume control widget on the menubar can set where the sound >> goes - right-click on it and you should see a menu with at least >>    Analogue >>    HDMI >> entries. I use the analogue and headphones since none of my Pi have a >> direct HDMI display attached but go via VNC. If you have an HDMI >> monitor attached it may not have speakers or you might not have them >> turned on! DAMHIKT. > I use the 3.5mm headphone output and verified that via Audacity and VLC. > I have a cheap active speaker connected. Just checked: Scratch 2 plays > sound Scratch1 started via the menu doesn't. Now downloading a fresh > Squeak. > > I tried the -vmsound alsa and pulse but I'm not sure If I used the right > place in the script. I tried editing the last line to: > exec "${VM}" "-vm-sound-alsa" "${IMAGE}"  (and pulse and w/o the "" but > my Linux fu is not enough to know if that's ok. > > Cheers, > > Herbert > >> >> >> >>> With some googling I got Audio working from Audacity (simple Audio >>> Editor I use on Raspi, Linux and Windows). I use Squeak5.3-19439. >>> >>> Recording with a phone will show some glitches but the bandwidth of >>> phone (and monitor speakers) mellows down (err filters) the waveform. >>> Surely only second choice. >>> >>> I would not mind downloading and using the proper Squeak to get >>> sound going. >> The 5.3 armlinux package from squeak.org ought to do ok for this. >> Remembering of course to include that '-vm-sound-alsa' (or pulse) in >> your commandline >> >> >> tim >> -- >> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim >> Strange OpCodes: PRM: PRint Money >> >> >> > > From tim at rowledge.org Fri Dec 25 04:41:57 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 24 Dec 2020 20:41:57 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Message-ID: > On 2020-12-24, at 1:21 PM, Herbert König wrote: > > Ha, ran the script in a terminal and on each piano keypress I get: > sound_Start(default) > soundStart: snd_add_pcm_handler: Function not implemented. That's an error to do with some asynchronous handler stuff in alsa. I have no idea why it would fail. All in all this sound stuff is getting very, very, frustrating tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: NOP: Randomize the PSW and then branch From kksubbu.ml at gmail.com Fri Dec 25 12:02:30 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Fri, 25 Dec 2020 17:32:30 +0530 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> Message-ID: <393f5a2b-7e91-501e-cbce-d75d45cb3403@gmail.com> On 25/12/20 2:35 am, Herbert König wrote: > I tried the -vmsound alsa and pulse but I'm not sure If I used the right > place in the script. I tried editing the last line to: > exec "${VM}" "-vm-sound-alsa" "${IMAGE}"  (and pulse and w/o the "" but > my Linux fu is not enough to know if that's ok. ALSA is a bit long in the tooth. Pulse is the preferred audio server these days. You could try running Squeak with padsp which mixes the OSS API calls from squeak vm through Pulse audio service: exec padsp "${VM}" ... The GUI mixer panel is pavucontrol (from pavucontrol package). HTH .. Subbu From bruce.oneel at pckswarms.ch Fri Dec 25 12:55:55 2020 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Fri, 25 Dec 2020 13:55:55 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Message-ID: <1608900955-a8e254641e67b9ccf42cac1ed5048d0b@pckswarms.ch> So another data point. Linux Mint 20 (so basically Ubuntu) on x86-64.  Happens to be a MacBook Air but I don't think that's important. My normal install only build vm-sound-OSS.  And with that there is no sound and a complaint in the terminal about /dev/dsp not existing.  Which is true, /dev/dsp does not exist. But if install libpluse-dev before I build the VM then I also get vm-sound-pluse. tmp/opensmalltalk-vm/build.linux64x64/[squeak.cog.spur/build/squeak](http://squeak.cog.spur/build/squeak) -vm-sound-pulse myimage Good news - I get sound! Bad news - Well it seems a bit drunk in that it pauses about every second to two.  It acts like a buffering issue.  It is slightly worse without doing the RT priority limits.conf file. I'll also poke at this a bit. cheers bruce > > On 2020-12-24, at 1:21 PM, Herbert König wrote: > > > > Ha, ran the script in a terminal and on each piano keypress I get: > > sound_Start(default) > > soundStart: snd_add_pcm_handler: Function not implemented. > > That's an error to do with some asynchronous handler stuff in alsa. I have no idea why it would fail. > > All in all this sound stuff is getting very, very, frustrating > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: NOP: Randomize the PSW and then branch -------------- next part -------------- An HTML attachment was scrubbed... URL: From herbertkoenig at gmx.net Fri Dec 25 13:19:05 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Fri, 25 Dec 2020 14:19:05 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Message-ID: Am 25.12.2020 um 05:41 schrieb tim Rowledge: > >> On 2020-12-24, at 1:21 PM, Herbert König wrote: >> >> Ha, ran the script in a terminal and on each piano keypress I get: >> sound_Start(default) >> soundStart: snd_add_pcm_handler: Function not implemented. > That's an error to do with some asynchronous handler stuff in alsa. I have no idea why it would fail. > > All in all this sound stuff is getting very, very, frustrating > > Same on my RPi4. Audio is working except Squeak and Scratch1, same error. So I tried my Pi2 which I haven't updated in times but mounted on a RPi touch display -->no sound at all and no Volume control in the taskbar. Since the RPI2 I use them for Audio recording and playing and audio measurements. They all saw an IQaudio DAC + and Digiamp so maybe that's part of the problem. Everything always worked out of the box, just I never used Squeak. Maybe it has to do with the recent switch from Alsa to Pulse Audio (just names for me) but the Pi2 should not have seen this. Anyway I got some time so I will check the messages from Subbu and Bruce and then just do the reverse. Use Squeak audio on Windows (Just checked, 5.3 has the nasty effects) and record with my soundcard on a Pi. It would be cool if someone can implement Your suggestion on how to write Squeak's audio output buffers to a file because then I could discern if the whole mess gets created by Squeak or if the OS plays a role too. Cheers, Herbert From kksubbu.ml at gmail.com Fri Dec 25 13:54:50 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Fri, 25 Dec 2020 19:24:50 +0530 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Message-ID: <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> On 25/12/20 6:49 pm, Herbert König wrote: > It would be cool if someone can implement Your suggestion on how to > write Squeak's audio output buffers to a file because then I could > discern if the whole mess gets created by Squeak or if the OS plays a > role too. You may use parec (sound capture to file) and paplay (file to sound output) to test the audio subsystem of the OS to rule out any audio driver or mixer configuration problems [1]. The corresponding ALSA utilities are arecord and aplay. The mixer is alsamixer. padsp acts as a relay between the older /dev/dsp (audio device under OSS) and the newer /dev/snd/* (audio i/o devices). [1] https://manpages.debian.org/testing/pulseaudio-utils/pacat.1.en.html HTH .. Subbu From herbertkoenig at gmx.net Fri Dec 25 14:01:28 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Fri, 25 Dec 2020 15:01:28 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <393f5a2b-7e91-501e-cbce-d75d45cb3403@gmail.com> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <393f5a2b-7e91-501e-cbce-d75d45cb3403@gmail.com> Message-ID: <9555e80f-1efa-06f0-0dd4-32271989494d@gmx.net> Hi Subbu, thanks, that did it. Squeak playing Audio with the problems described, Scratch one through the menu still w/o audio (as expected) but both showing up in the pavucontrol. Except that now I have a crackling noise when using the volume control (Crossfade still being a secret to some audio implementors, really :-) So on to electrical recording and then try to implement Tim's suggestion on recording the buffers from Squeak. Cheers, Herbert Am 25.12.2020 um 13:02 schrieb K K Subbu: > On 25/12/20 2:35 am, Herbert König wrote: >> I tried the -vmsound alsa and pulse but I'm not sure If I used the right >> place in the script. I tried editing the last line to: >> exec "${VM}" "-vm-sound-alsa" "${IMAGE}"  (and pulse and w/o the "" but >> my Linux fu is not enough to know if that's ok. > ALSA is a bit long in the tooth. Pulse is the preferred audio server > these days. > > You could try running Squeak with padsp which mixes the OSS API calls > from squeak vm through Pulse audio service: > >  exec padsp "${VM}" ... > > The GUI mixer panel is pavucontrol (from pavucontrol package). > > HTH .. Subbu > From herbertkoenig at gmx.net Fri Dec 25 14:03:59 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Fri, 25 Dec 2020 15:03:59 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> Message-ID: Hey you seem to know Linux's audio stuff. Thanks! Herbert Am 25.12.2020 um 14:54 schrieb K K Subbu: > On 25/12/20 6:49 pm, Herbert König wrote: >> It would be cool if someone can implement Your suggestion on how to >> write Squeak's audio output buffers to a file because then I could >> discern if the whole mess gets created by Squeak or if the OS plays a >> role too. > > You may use parec (sound capture to file) and paplay (file to sound > output) to test the audio subsystem of the OS to rule out any audio > driver or mixer configuration problems [1]. The corresponding ALSA > utilities are arecord and aplay. The mixer is alsamixer. > > padsp acts as a relay between the older /dev/dsp (audio device under > OSS) and the newer /dev/snd/* (audio i/o devices). > > [1] https://manpages.debian.org/testing/pulseaudio-utils/pacat.1.en.html > > HTH .. Subbu > From herbertkoenig at gmx.net Fri Dec 25 14:45:24 2020 From: herbertkoenig at gmx.net (Herbert) Date: Fri, 25 Dec 2020 15:45:24 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <1608900955-a8e254641e67b9ccf42cac1ed5048d0b@pckswarms.ch> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1608900955-a8e254641e67b9ccf42cac1ed5048d0b@pckswarms.ch> Message-ID: <02e1f833-7962-b84c-430f-da8c0d8b533f@gmx.net> I just downloaded Squeak on my up to date Linux Mint computer (a Core I 3 from 2009) and right at the start (before the message you report) I get the message copied below. No sound with vm-sound-alsa but sound with vm-sound-pulse and always the same message. But it sounds like high latency and not as bad as on the Pi (with the keyboard). When waggling the keyboard Squeak goes from 5% to 56% CPU. That seems a lot to me. Cheers, Herbert "Using /home/herbert/Schreibtisch/Squeak5.3alpha-19256-64bit-201911012148-Linux/bin/squeak... pthread_setschedparam failed: Operation not permitted This VM uses a separate heartbeat thread to update its internal clock and handle events.  For best operation, this thread should run at a higher priority, however the VM was unable to change the priority.  The effect is that heavily loaded systems may experience some latency issues.  If this occurs, please create the appropriate configuration file in /etc/security/limits.d/ as shown below: cat < > So another data point. > > Linux Mint 20 (so basically Ubuntu) on x86-64.  Happens to be a > MacBook Air but I don't think that's important. > > My normal install only build vm-sound-OSS.  And with that there is no > sound and a complaint in the terminal about /dev/dsp not existing. >  Which is true, /dev/dsp does not exist. > > But if install libpluse-dev before I build the VM then I also get > vm-sound-pluse. > > tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build/squeak > -vm-sound-pulse myimage > > > Good news - I get sound! > > Bad news - Well it seems a bit drunk in that it pauses about every > second to two.  It acts like a buffering issue.  It is slightly worse > without doing the RT priority limits.conf file. > > I'll also poke at this a bit. > > > cheers > > bruce > > > > /25 December 2020 05:41 tim Rowledge wrote:/ > > > > > On 2020-12-24, at 1:21 PM, Herbert König wrote: > > > > Ha, ran the script in a terminal and on each piano keypress I get: > > sound_Start(default) > > soundStart: snd_add_pcm_handler: Function not implemented. > > That's an error to do with some asynchronous handler stuff in > alsa. I have no idea why it would fail. > > All in all this sound stuff is getting very, very, frustrating > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: NOP: Randomize the PSW and then branch > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gettimothy at zoho.com Fri Dec 25 17:28:59 2020 From: gettimothy at zoho.com (gettimothy) Date: Fri, 25 Dec 2020 12:28:59 -0500 Subject: [squeak-dev] given String 'Foo Bar Baz' yield String 'Foo Baz' Message-ID: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> Hi folks, I did not see anything obvious to do the above, and I am writing some really ugly code to get the task done. Is anybody aware of a simple message send like... 'Foo Bar Baz' removeAllBetween:'' and: ''. thx in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier_diaz_r at mac.com Fri Dec 25 19:14:10 2020 From: javier_diaz_r at mac.com (Javier Diaz-Reinoso) Date: Fri, 25 Dec 2020 14:14:10 -0500 Subject: [squeak-dev] given String 'Foo Bar Baz' yield String 'Foo Baz' In-Reply-To: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> References: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> Message-ID: <0144E314-4C4B-4C51-8A20-9F07C1149362@mac.com> > On 25 Dec 2020, at 12:28, gettimothy via Squeak-dev wrote: > > 'Foo Bar Baz' removeAllBetween:'' and: ''. a := 'Foo Bar Baz'. s:= Scanner new. toks := s typedScanTokens: a. sel := ''. level := 0. toks do: [:t| t caseOf: { [#<] -> [level:=1]. [# [level:=2]. [#>] -> [level =2 ifTrue:[sel:=sel, ' '. level:=0]]. } otherwise: [ level = 0 ifTrue:[sel := sel, t] ]. ]. sel -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Fri Dec 25 19:15:01 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 25 Dec 2020 11:15:01 -0800 Subject: [squeak-dev] given String 'Foo Bar Baz' yield String 'Foo Baz' In-Reply-To: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> References: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> Message-ID: <21674DE2-68D4-4285-86FD-AC0479505A42@rowledge.org> Depends on your needs - > On 2020-12-25, at 9:28 AM, gettimothy via Squeak-dev wrote: > > > 'Foo Bar Baz' removeAllBetween:'' and: ''. > thx in advance. For a one-off case, maybe some of the #findTokenXXX methods? Maybe #parseTokens: would help - it's part of the HTML handling stuff. For bigger duty, probably time to look into the regexp methods; there's a bunch of likely suspects in the messagenamebrowser. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BPB: Branch on Program Bug From tim at rowledge.org Fri Dec 25 19:32:52 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 25 Dec 2020 11:32:52 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> Message-ID: <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> I'm glad a few people around here do - there seems to be a bewildering mix of things out there. Looking at the assorted C code for soundplugin, sqUnixSound, sqUnixSoundALSA & SsqUnixSoundPulseAudio I see a bunch of places where pointer types don't agree and just maybe there are some problems there. The worst potential for pointer issues is avoided in practice because we never actually pass any value for startIndex other than 0 (the '1' used in all the Smalltalk is pre-decremented in SoundPlugin>primitiveSoundPlaySamples) Both the ALSA & pulseaudio files appear to connect to the semaphore in a reasonable manner. Ther pulseaudio code is clearly long untouched and in need of a lot of tidying up and the addition of a number of new routines like sound_GetDefaultSoundPlayer - try using that prim and it just dumps you VM with extreme prejudice! I think one of the really puzzling things right now is how does my older Pi setup *not* make such terrible noises? The scratch image & vm involved are *identical* to the ones on the newer-but-still-alsa Pi. > On 2020-12-25, at 6:03 AM, Herbert König wrote: > > Hey you seem to know Linux's audio stuff. > > Thanks! > > Herbert > > Am 25.12.2020 um 14:54 schrieb K K Subbu: >> On 25/12/20 6:49 pm, Herbert König wrote: >>> It would be cool if someone can implement Your suggestion on how to >>> write Squeak's audio output buffers to a file because then I could >>> discern if the whole mess gets created by Squeak or if the OS plays a >>> role too. >> >> You may use parec (sound capture to file) and paplay (file to sound >> output) to test the audio subsystem of the OS to rule out any audio >> driver or mixer configuration problems [1]. The corresponding ALSA >> utilities are arecord and aplay. The mixer is alsamixer. >> >> padsp acts as a relay between the older /dev/dsp (audio device under >> OSS) and the newer /dev/snd/* (audio i/o devices). >> >> [1] https://manpages.debian.org/testing/pulseaudio-utils/pacat.1.en.html >> >> HTH .. Subbu >> > > > tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim When flying inverted, remember that down is up and up is expensive From eliot.miranda at gmail.com Fri Dec 25 19:46:25 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 25 Dec 2020 11:46:25 -0800 Subject: [squeak-dev] given String 'Foo Bar Baz' yield String 'Foo Baz' In-Reply-To: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> References: <1769af24d69.103e32cd62332.4806620061353538794@zoho.com> Message-ID: Hi Tim, On Fri, Dec 25, 2020 at 9:29 AM gettimothy via Squeak-dev < squeak-dev at lists.squeakfoundation.org> wrote: > Hi folks, > > I did not see anything obvious to do the above, and I am writing some > really ugly code to get the task done. > > Is anybody aware of a simple message send like... > > 'Foo Bar Baz' removeAllBetween:'' and: > ''. > > thx in advance. > You can rely on your own parsing, but if you're at all likely to expand into a broader HTML space then explore the HTML Framework. For example, this doesn't do what you want but it gets you close and is generally powerful enough for any and all HTML parsing tasks. (HTMLParser parse: 'Foo Bar Baz') contents last textualContents => 'Foo Bar Baz' _,,,^..^,,,_ Happy Holidays, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Fri Dec 25 22:39:37 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 25 Dec 2020 14:39:37 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: I've managed to record some samples with parecord on the pulseaudio Pi. As usual, the man page for parecord etc was about as helpful as a chocolate teapot in a sauna, but some flailing around on google eventually found a page with something that worked. parecord --channels=1 -d alsa_output.platform-bcm2835_audio.analog-mono.2.monitor testsound.wav records the output of the headphone socket channel until you ctrl-C. I also tried with the HDMI output in case this is all down to some bug in the headphpone output - which has happened in the past. When playing the two samples I couldn't hear any difference, so I think that saves one level of nightmare. I'm loathe to dump a meg-and-a-half of horrible noise file in list mail, or indeed on the swiki - so you ought to be able to download from https://mega.nz/folder/iN1wWajL#SkljQIWhHP8c6McE9HDwDg Currently there are two files, the Pi4-pulse-1.wav is the noise made by my code snippet plus some waggling of mouse over the normal pianokeyboardmorph, and -2 is waggling the mouse over the scratch note chooser keyboard morph. I'd add files for the alsa Pi but I can't make arecord work at all. As usual, making sense of a man page is ridiculous. I've tried a variety - arecord -d 5 -f cd -D -t wav output Pi4-alsa-1.wav ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM -t arecord: main:828: audio open error: No such file or directory arecord -d 5 -f cd -D output -t wav Pi4-alsa-1.wav arecord: main:828: audio open error: No such file or directory arecord -d 5 -f cd -t wav Pi4-alsa-1.wav ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input arecord: main:828: audio open error: No such file or directory arecord -d 5 -f cd -t wav foo ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input arecord: main:828: audio open error: No such file or directory arecord -d 5 -D output -t wav Pi4-alsa-1.wav arecord: main:828: audio open error: No such file or directory arecord -d 5 -D output -t wav ./Pi4-alsa-1.wav arecord: main:828: audio open error: No such file or directory arecord -d 5 foo.wav ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input arecord: main:828: audio open error: No such file or directory I even found the arecord.c sources and looked for the error message - of course, there is no reasonable way to work out what file is not there... Advice on a suitable command most welcome. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BBL: Branch on Burned out Light From kksubbu.ml at gmail.com Sat Dec 26 06:28:41 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Sat, 26 Dec 2020 11:58:41 +0530 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: <0a4d70f0-b2ee-c05a-4b16-cb857b3dc590@gmail.com> On 26/12/20 4:09 am, tim Rowledge wrote: > I'd add files for the alsa Pi but I can't make arecord work at all. As usual, making sense of a man page is ridiculous. ;-). A man(ual) page is detailed spec. Reading all options can be quite intimidating. I just skip to the examples section in the beginning. I only use options to override defaults. > arecord -d 5 -f cd -D -t wav output Pi4-alsa-1.wav > ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM -t > arecord: main:828: audio open error: No such file or directory -D requires an argument. $ arecord -d 5 -f cd Pi4-alsa-1.wav will sample mic at 44khz (16-bit little endian) for 5 seconds and store it in wav format file (-t wav is the default anyway). > arecord -d 5 -f cd -D output -t wav Pi4-alsa-1.wav > arecord: main:828: audio open error: No such file or directory The "output" argument to -D is not a valid audio input device. What valid audio input devices does "arecord -l" show? You could also use alsamixer TUI to see all valid input/output devices, check their gain/vol settings and test recording and playback. > arecord -d 5 -f cd -t wav Pi4-alsa-1.wav > ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input > arecord: main:828: audio open error: No such file or directory > > arecord -d 5 -f cd -t wav foo > ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input > arecord: main:828: audio open error: No such file or directory > > arecord -d 5 -D output -t wav Pi4-alsa-1.wav > arecord: main:828: audio open error: No such file or directory > > arecord -d 5 -D output -t wav ./Pi4-alsa-1.wav > arecord: main:828: audio open error: No such file or directory > > arecord -d 5 foo.wav > ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM input > arecord: main:828: audio open error: No such file or directory The default device is not available (bad driver?) or misconfigured. Try listing audio devices with arecord -l and then pick the appropriate name to use with -D. HTH .. Subbu From kksubbu.ml at gmail.com Sat Dec 26 06:35:50 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Sat, 26 Dec 2020 12:05:50 +0530 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: On 26/12/20 1:02 am, tim Rowledge wrote: > I think one of the really puzzling things right now is how does my > older Pi setup*not* make such terrible noises? The scratch image & > vm involved are*identical* to the ones on the newer-but-still-alsa > Pi. Audio drivers and servers can make a difference between distro versions. Didn't Raspbian switch to pulse audio server to pulse in their recent release [1]? [1] https://www.raspberrypi.org/blog/new-raspberry-pi-os-release-december-2020/ Regards .. Subbu From herbertkoenig at gmx.net Sat Dec 26 12:57:29 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Sat, 26 Dec 2020 13:57:29 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: Tim, thanks for the recording. No idea if that happens inside Squeak but basically clipping is not working. In the image instead of going from positive full-scale to negative full-scale the signal should just stay at the resp. full-scale. Instead of clipping 32767 + 1 to 32767  the code uses 32768 as being - full-scale (wraparound).  See pulse1PosWrap.png. For negative full-scale the symmetric thing happens. The signal should stay at full-scale there. mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol  seems to do the right thing:         leftVol > 0 ifTrue: [             i := (2 * outIndex) - 1.             s := (aSoundBuffer at: i) + ((sample * leftVol) // ScaleFactor).             s >  32767 ifTrue: [s :=  32767].  "clipping!"             s < -32767 ifTrue: [s := -32767].  "clipping!"             aSoundBuffer at: i put: s]. except we can go to 32767 and -32768 IIRC but that's no problem. If you look at Pi4-pulse-1.wav second 5.2352 it seems there's multiple wraparounds going on. See pulse1MultipleWrap. For this I have no explanation because the signal if it were unclipped looks like going to about 1.5 * full-scale. pulse2ClipAndWrap shows that somewhere (red mark) the normal clipping is going on (sounds bad if this strong, that's why I suggested a limiter) and close to this the wrapping is going on. Maybe there are places where the clipping is taking something >32767 as max. Or (a wild idea): SoundBuffer stores 16 bit unsigned quantities. So if a signal is first put into a sound buffer w/o clipping and only the mixing does the clipping and that happens in several places (several sounds generated independently) that could explain the wrapping. That's why I gave up when I saw that SoundBuffer only uses 16 bits. Here Eliot's suggestion from Dec 18: "But adding a signed 32-bit, or even a signed 64-bit collection for mixing would be straight forward, except for ensuring it mixes down to 16 bits. A signed 32-bit collection would allow 32k 16-bit sources to be additively mixed without clipping, right? So an underlying 64-bit collection is unnecessary. So a MixedSound that adds into an underlying 32-bit signed sequence, and updates a count of added sounds, and does interpolation when adding sounds of different sample rates, and outputs 16-bit samples derived by dividing the 32-bit sums by the count of added sounds would be a solution right? " could make sense. I'd suggest using 32 Bit Float. Seeing loudness being 0.0 to 1.0 and scale in Envelope having Float values > 1 (I see even 25) I hope that this already happens. But looking at e.g. FMSound's class var SineTable I see it is a SoundBuffer, on which we operate with float operations and then we must go back to 16 Bit unsigned to store the result. Lots of room for human error in this. All audio precessing (incl. mixing) should be done in Float (usually normalized to +-1.0) and then use a limiter and then go to 16 bit sound buffers. Or better use 32 bit Float for output to the OS too. Usually AD and DA conversion is done with 24 bit by moderately cheap audio cards so I guess most OSses use 32 bit float. But that's just a guess. Cheers, Herbert Am 25.12.2020 um 23:39 schrieb tim Rowledge: > I've managed to record some samples with parecord on the pulseaudio Pi. As usual, the man page for parecord etc was about as helpful as a chocolate teapot in a sauna, but some flailing around on google eventually found a page with something that worked. > ...... -------------- next part -------------- A non-text attachment was scrubbed... Name: pulse1PosWrap.png Type: image/png Size: 2464 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pulse1MultipleWrap.png Type: image/png Size: 2735 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pulse2ClipAndWrap.png Type: image/png Size: 13553 bytes Desc: not available URL: From bruce.oneel at pckswarms.ch Sat Dec 26 13:11:49 2020 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Sat, 26 Dec 2020 14:11:49 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <1608900955-a8e254641e67b9ccf42cac1ed5048d0b@pckswarms.ch> References: <1608900955-a8e254641e67b9ccf42cac1ed5048d0b@pckswarms.ch> <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> Message-ID: <1608988309-613d6b0e82c463b0806a2f34ac69f006@pckswarms.ch> Hi, Just for reference  padsp squeak image -vm-sound-OSS produces for me the same pauses every second or two. cheers bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.oneel at pckswarms.ch Sat Dec 26 13:13:31 2020 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Sat, 26 Dec 2020 14:13:31 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: <1608988411-28d2404ba961151c8db7e8ea8a54fbd8@pckswarms.ch> Thanks for the pointer to Raspbian switching to Pulse Audio. I thought the opening paragraph was a nice bit of understatement. First, a bit of background. Audio on Linux is really quite complicated. There are multiple different standards for handling audio input and output, and it does sometimes seem that what has happened, historically, is that whenever anyone wanted to use audio in Linux, they looked at the existing libraries and programs and went “Hmmm… I don’t like that, I’ll write something new and better.” This has resulted in a confused mass of competing and conflicting software, none of which *quite* works the way anyone wants it to! -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sat Dec 26 19:48:00 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 26 Dec 2020 14:48:00 -0500 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> References: <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: <20201226194800.GA41041@shell.msen.com> On Fri, Dec 25, 2020 at 11:32:52AM -0800, tim Rowledge wrote: > >> On 2020-12-25, at 6:03 AM, Herbert K??nig wrote: >> >> Am 25.12.2020 um 14:54 schrieb K K Subbu: >> >>> On 25/12/20 6:49 pm, Herbert K??nig wrote: >>>> >>>> It would be cool if someone can implement Your suggestion on how to >>>> write Squeak's audio output buffers to a file because then I could >>>> discern if the whole mess gets created by Squeak or if the OS plays a >>>> role too. >>> >>> You may use parec (sound capture to file) and paplay (file to sound >>> output) to test the audio subsystem of the OS to rule out any audio >>> driver or mixer configuration problems [1]. The corresponding ALSA >>> utilities are arecord and aplay. The mixer is alsamixer. >>> >>> padsp acts as a relay between the older /dev/dsp (audio device under >>> OSS) and the newer /dev/snd/* (audio i/o devices). >>> >>> [1] https://manpages.debian.org/testing/pulseaudio-utils/pacat.1.en.html >>> >>> HTH .. Subbu >>> >> >> Hey you seem to know Linux's audio stuff. >> >> Thanks! >> >> Herbert >> > I'm glad a few people around here do - there seems to be a bewildering > mix of things out there. > > Looking at the assorted C code for soundplugin, sqUnixSound, sqUnixSoundALSA > & SsqUnixSoundPulseAudio I see a bunch of places where pointer types > don't agree and just maybe there are some problems there. The worst potential > for pointer issues is avoided in practice because we never actually pass any > value for startIndex other than 0 (the '1' used in all the Smalltalk is > pre-decremented in SoundPlugin>primitiveSoundPlaySamples) > > Both the ALSA & pulseaudio files appear to connect to the semaphore in a > reasonable manner. Ther pulseaudio code is clearly long untouched and in > need of a lot of tidying up and the addition of a number of new routines > like sound_GetDefaultSoundPlayer - try using that prim and it just dumps > you VM with extreme prejudice! > > I think one of the really puzzling things right now is how does my older > Pi setup *not* make such terrible noises? The scratch image & vm involved > are *identical* to the ones on the newer-but-still-alsa Pi. > Tim, I adapted your earlier code example as follows: volume := 0.30. { 55 . 60 . 64 } collect: [ :e | FMSound new setPitch: (AbstractSound pitchForMIDIKey: e) dur: 5 loudness: volume] thenDo: [:s | s play. (Delay forSeconds: 1) wait ]. This plays a major triad, which makes it very easy to hear the clipping distortion. On my Linux PC with pulse audio, I get audible clipping distortion when volume in the snippet above is set to anything higher than 0.30. Results are very similar regardless of the VM and the image version. I tried Squeak 3.8, Squeak trunk, interpreter VM, Spur64 VM, and SqueakJS on Chrome. Maybe you can compare this on Raspbery Pi and see if you get the same result. Dave From tim at rowledge.org Sat Dec 26 20:23:30 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 26 Dec 2020 12:23:30 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <0a4d70f0-b2ee-c05a-4b16-cb857b3dc590@gmail.com> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <0a4d70f0-b2ee-c05a-4b16-cb857b3dc590@gmail.com> Message-ID: <14EE84F6-CCD8-4D4C-B1B6-5DA912473ED2@rowledge.org> > On 2020-12-25, at 10:28 PM, K K Subbu wrote: > > On 26/12/20 4:09 am, tim Rowledge wrote: >> I'd add files for the alsa Pi but I can't make arecord work at all. As usual, making sense of a man page is ridiculous. > > ;-). A man(ual) page is detailed spec. Reading all options can be quite intimidating. I just skip to the examples section in the beginning. I only use options to override defaults. Me too - except it always seems that the examples section has been deleted when things are really confusing. I claim that this is all part of a Vast Global Conspiracy To Confuse Us. It's working. > > $ arecord -d 5 -f cd Pi4-alsa-1.wav > > will sample mic at 44khz (16-bit little endian) for 5 seconds and store it in wav format file (-t wav is the default anyway). Yeah, I saw that example somewhere but it returns the same old "arecord: main:828: audio open error: No such file or directory" error as the others. All the other cases I posted were as recommended on assorted pages, which is terribly frustrating. I think maybe my alsa-Pi has got some wider alsa setup issue - which is strange since I haven't ever deliberately done any sound stuff on this particular unit and so it should be completely default. None of the examples to test the sound seem to work - 'sudo aplay /usr/share/sounds/alsa/Front_Center.wav' makes no sound at all. And yet Squeak does make faint and feeble (scratchy) noises ... totally nuts. I guess I can try a totally fresh load-up on yet another Pi to compare. > > The "output" argument to -D is not a valid audio input device. What valid audio input devices does "arecord -l" show? Well, 'arecord -l' shows no devices, which isn't surprising on a bare Pi. But this is supposed to be recording what gets sent to the headphone output, so all the examples I've seen have referred to things like 'output' and 'default' and 'hw:1,0' etc etc. The parecord on the pulse-Pi had no problem. OK, I'll put this email aside for a moment while I fire up the 'very old alsa Pi' to see if it can do better. Later - the old alsa-Pi system (that 2017 version OS) plays sound from Scratch perfectly well, and even when playing a looped sample guitar I can thrash up and down the pianokeyboard without glitches. I can bang on the 'normal' pianokeyboardmorph without scratchy-glitches. My code snippet plays fine even with volume set to 100% with either a plan FMSound or an organ1 sound (that adds the envelope stuff to the mix). The test samples stuff ' aplay /usr/share/sounds/alsa/Front_Center.wav' works fine and clear. However, I can't record the headphone output with arecord which makes it difficult to share. I bet there's some magic incantation to make the headphone out channel appear as an input. So - 4 y.o. Pi system makes nice sounds. iMac makes nice sounds. Newer alsa Pi makes nasty sounds but may be borked in other ways. New pulse-Pi makes nasty sounds. Herbert has shown convincing evidence of bad clipping occurring. Dave's chord example makes graunchy noises on all machines *except iMac*, which is interesting, and if the volume is increased even the mac makes graunch. I guess this implies we need to check the clipping code at the very least. And I've already mentioned that the pulse sound driver needs a bunch of additional code for new stuff. Such fun! tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim The downside of being better than everyone else is that people tend to assume you're pretentious From tim at rowledge.org Sun Dec 27 00:57:15 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 26 Dec 2020 16:57:15 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> Message-ID: <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> > On 2020-12-26, at 4:57 AM, Herbert König wrote: > > Tim, thanks for the recording. > > No idea if that happens inside Squeak but basically clipping is not > working. In the image instead of going from positive full-scale to > negative full-scale the signal should just stay at the resp. full-scale. > Instead of clipping 32767 + 1 to 32767 the code uses 32768 as being - > full-scale (wraparound). See pulse1PosWrap.png. Staring at the generated C code it looks possibly suspicious that we have short int *aSoundBuffer; sqInt s; if (leftVol > 0) { i = (2 * sliceIndex) - 1; s = (aSoundBuffer[i]) + ((sample * leftVol) / ScaleFactor); if (s > 0x7FFF) { s = 0x7FFF; } if (s < -32767) { s = -32767; } aSoundBuffer[i] = s; } But surely no C compiler screws that up these days? I added printfs to show when over/underflow happened and indeed it happens - duh. I've compared latest and ancient (as in ~2016 vintage) copies of SoundPlugin.c, SoundGenerationPlugin.c and sqUnixSoundALSA.c and found nothing that looks anything other than trivial changes - dates, some macros, etc. There doesn't seem to be any place other than primitiveMixFMSound() that is involved in clipping sample values. None of the lowest level send-to-OS code looks to do any sort of casting or limiting. I've even just for grins tried limiting the 's' value with a s & 0x3FFF just to see what happens. It sounds a bit strange but also seems to remove the clicks, so maybe there is something in it. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BYEBYE: Store in Write-Only Storage From commits at source.squeak.org Sun Dec 27 03:30:53 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 03:30:53 0000 Subject: [squeak-dev] The Trunk: Compiler-eem.453.mcz Message-ID: Eliot Miranda uploaded a new version of Compiler to project The Trunk: http://source.squeak.org/trunk/Compiler-eem.453.mcz ==================== Summary ==================== Name: Compiler-eem.453 Author: eem Time: 26 December 2020, 7:30:51.52735 pm UUID: 1a90195c-0773-4f16-bc29-08b718ad4d66 Ancestors: Compiler-eem.452 Fix a spelling error, preceed => precede, etc =============== Diff against Compiler-eem.452 =============== Item was changed: ----- Method: BytecodeEncoder class>>extensionsFor:in:into: (in category 'instruction stream support') ----- extensionsFor: pc in: aCompiledMethod into: trinaryBlock + "If the bytecode at pc is an extension, or if the bytecode at pc is preceded by extensions, - "If the bytecode at pc is an extension, or if the bytecode at pc is preceeded by extensions, then evaluate aTrinaryBlock with the values of extA and extB and number of extension *bytes*. If the bytecode at pc is neither an extension or extended then evaluate with 0, 0, 0." | prevPC | "If there is what appears to be an extension bytecode before this bytecode then scan for the previous pc to confirm." (pc - 2 >= aCompiledMethod initialPC and: [self isExtension: (aCompiledMethod at: pc - 2)]) ifTrue: [prevPC := aCompiledMethod pcPreviousTo: pc. (self nonExtensionPcAt: prevPC in: aCompiledMethod) = pc ifTrue: [^self extensionsAt: prevPC in: aCompiledMethod into: trinaryBlock]]. ^self extensionsAt: pc in: aCompiledMethod into: trinaryBlock! Item was changed: ----- Method: BytecodeEncoder class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') ----- nonExtensionBytecodeAt: pc in: method + "Answer the actual bytecode at pc in method, skipping past any preceding extensions." - "Answer the actual bytecode at pc in method, skipping past any preceeding extensions." self subclassResponsibility! Item was changed: ----- Method: BytecodeEncoder class>>nonExtensionPcAt:in: (in category 'instruction stream support') ----- nonExtensionPcAt: pc in: method + "Answer the pc of the actual bytecode at pc in method, skipping past any preceding extensions." - "Answer the pc of the actual bytecode at pc in method, skipping past any preceeding extensions." | thePC bytecode | thePC := pc. [self isExtension: (bytecode := method at: thePC)] whileTrue: [thePC := thePC + (self bytecodeSize: bytecode)]. ^thePC! Item was changed: ----- Method: EncoderForSistaV1 class>>blockMethodOrNilFor:in:at: (in category 'instruction stream support') ----- blockMethodOrNilFor: anInstructionStream in: method at: pc "If anInstructionStream is at a block creation bytecode then answer the block's CompiledBlock, otherwise answer nil. The complication is that for convenience we allow the pc to point to the + raw send bytecode after its extension(s), or at the extension(s) preceding it. - raw send bytecode after its extension(s), or at the extension(s) preceeding it. 249 11111001 xxxxxxxx siyyyyyy push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1" | byte | byte := method at: pc. byte = 249 ifTrue: ["it could be extended..." ^self extensionsFor: pc in: method into: [:extA :extB :nExtBytes| method literalAt: (method at: pc + nExtBytes + 1) + (extA bitShift: 8) + 1]]. ^byte = 16rE0 ifTrue: [self extensionsAt: pc in: method into: [:extA :extB :nExtBytes| (method at: pc + nExtBytes) = 249 ifTrue: [method literalAt: (method at: pc + nExtBytes + 1) + (extA bitShift: 8) + 1]]]! Item was changed: ----- Method: EncoderForSistaV1 class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') ----- nonExtensionBytecodeAt: pc in: method + "Answer the actual bytecode at pc in method, skipping past any preceding extensions." - "Answer the actual bytecode at pc in method, skipping past any preceeding extensions." | thePC bytecode | thePC := pc. [self isExtension: (bytecode := method at: thePC)] whileTrue: [thePC := thePC + (self bytecodeSize: bytecode)]. ^bytecode! Item was changed: ----- Method: EncoderForSistaV1 class>>selectorToSendOrItselfFor:in:at: (in category 'instruction stream support') ----- selectorToSendOrItselfFor: anInstructionStream in: method at: pc "If anInstructionStream is at a send bytecode then answer the send's selector, otherwise answer anInstructionStream itself. The rationale for answering anInstructionStream instead of, say, nil, is that potentially any existing object can be used as a selector, but since anInstructionStream postdates the method, it can't be one of them. The complication is that for convenience we allow the pc to point to the + raw send bytecode after its extension(s), or at the extension(s) preceding it. - raw send bytecode after its extension(s), or at the extension(s) preceeding it. 96-111 0110 iiii Send Arithmetic Message #iiii (+ - < > <= >= = ~= * / \\ @ bitShift: // bitAnd: bitOr:) 112-119 01110 iii Send Special Message #iii + 0 (at: at:put: size next nextPut: atEnd == class) 120-127 01111 iii Send Special Message #iii + 8 (~~ value value: do: new new: x y) 128-143 1000 iiii Send Literal Selector #iiii With 0 Argument 144-159 1001 iiii Send Literal Selector #iiii With 1 Arguments 160-175 1010 iiii Send Literal Selector #iiii With 2 Arguments * 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A) * 225 11100001 bbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B) ** 234 11101010 iiiiijjj Send Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments ** 235 11101011 iiiiijjj ExtendB < 64 ifTrue: [Send To Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments] + ifFalse: [Send To Superclass of Stacked Class Literal Selector #iiiii (+ Extend A * 32) with jjj (+ (Extend B bitAnd: 63) * 8) Arguments" - ifFalse: [Send To Superclass of Stacked Class Literal Selector #iiiii (+ Extend A * 32) with jjj (+ (Extend B " | byte | byte := method at: pc. byte < 96 ifTrue: [^anInstructionStream]. byte <= 175 ifTrue: ["special byte or short send" ^byte >= 128 ifTrue: [method literalAt: (byte bitAnd: 15) + 1] ifFalse: [Smalltalk specialSelectorAt: byte - 95]]. + byte < 234 ifTrue: "need to check for either extension cuz order of extensions is not restricted. so extB could precede extA" - byte < 234 ifTrue: "need to check for either extension cuz order of extensions is not restricted. so extB could preceed extA" [(byte >= 224 and: [byte <= 225]) ifTrue: [^self extensionsAt: pc in: method into: [:extA :extB :nExtBytes| | byteAfter index | byteAfter := method at: pc + nExtBytes. (byteAfter >= 234 and: [byteAfter <= 235]) ifTrue: [index := ((method at: pc + nExtBytes + 1) bitShift: -3) + (extA bitShift: 5). method literalAt: index + 1] ifFalse: [anInstructionStream]]]. ^anInstructionStream]. byte > 235 ifTrue: [^anInstructionStream]. "they could be extended..." ^self extensionsFor: pc in: method into: [:extA :extB :nExtBytes| | index | index := ((method at: pc + 1) bitShift: -3) + (extA bitShift: 5). method literalAt: index + 1]! Item was changed: ----- Method: EncoderForV3 class>>extensionsFor:in:into: (in category 'instruction stream support') ----- extensionsFor: pc in: aCompiledMethod into: trinaryBlock + "If the bytecode at pc is an extension, or if the bytecode at pc is preceded by extensions, - "If the bytecode at pc is an extension, or if the bytecode at pc is preceeded by extensions, then evaluate aTrinaryBlock with the values of extA and extB and number of extension *bytes*. If the bytecode at pc is neither an extension or extended then evaluate with 0, 0, 0. There are no extensions in the SqueakV3/Smalltalk-80 bytecode set, so..." ^trinaryBlock value: 0 value: 0 value: 0! Item was changed: ----- Method: EncoderForV3 class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') ----- nonExtensionBytecodeAt: pc in: method + "Answer the actual bytecode at pc in method, skipping past any preceding extensions." - "Answer the actual bytecode at pc in method, skipping past any preceeding extensions." ^method at: pc! Item was changed: ----- Method: MethodNode>>preenableNodes (in category 'converting-private') ----- preenableNodes "Answer a Dictionary from node or sequence of nodes to preen method selector for nodes in the tree that require post-processing after either a format or a decompile. Such issues are the variable for an ifNotNil: which is local to the ifNotNil: block but, due to the inlining of ifNotNil: appears to be declared at the outer level, and, similarly, a temporary variable that conflicts with one of the same name in a block when, were the variable declared local to some inlined block it would no longer conflict. The resulting dictionary is used to perform the value with the key (node or array) as argument to preen the tree." | preenableNodes priorBlocks priorVariables | preenableNodes := Dictionary new. priorBlocks := OrderedCollection new. priorVariables := Set new. self nodesWithPrecedingStatementsDo: + [:node :precedingStatementOrNil| | variable temps | - [:node :preceedingStatementOrNil| | variable temps | (node isMessageNode and: [node macroPrinter == #printIfNilNotNil:indent: and: [node receiver isMessageNode and: [node receiver selector key == #== and: [node receiver receiver isAssignmentNode and: [(variable := node receiver receiver variable) isTemp and: [variable isRemote not and: [variable isOnlySubnodeOf: node in: self]]]]]]]) ifTrue: [preenableNodes at: node put: #preenIfNotNilNode:. priorVariables add: variable]. node isBlockNode ifTrue: [temps := OrderedCollection new. node temporaries do: [:temp| priorBlocks do: [:aBlock| aBlock temporaries do: [:priorTemp| (priorVariables includes: priorTemp) ifFalse: [priorTemp key = temp key ifTrue: [temps addLast: priorTemp]]]]]. temps isEmpty ifFalse: [preenableNodes at: temps put: #preenTempsConflictingWithBlockNode:]. priorBlocks addLast: node]. (node == NodeNil + and: [precedingStatementOrNil notNil + and: [precedingStatementOrNil isMessageNode + and: [precedingStatementOrNil isNilIf]]]) ifTrue: + [preenableNodes at: precedingStatementOrNil put: #preenNilNodeFollowingNilIfNode:]]. - and: [preceedingStatementOrNil notNil - and: [preceedingStatementOrNil isMessageNode - and: [preceedingStatementOrNil isNilIf]]]) ifTrue: - [preenableNodes at: preceedingStatementOrNil put: #preenNilNodeFollowingNilIfNode:]]. ^preenableNodes! From commits at source.squeak.org Sun Dec 27 18:06:32 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 18:06:32 0000 Subject: [squeak-dev] The Inbox: GraphicsTests-nice.56.mcz Message-ID: A new version of GraphicsTests was added to project The Inbox: http://source.squeak.org/inbox/GraphicsTests-nice.56.mcz ==================== Summary ==================== Name: GraphicsTests-nice.56 Author: nice Time: 27 December 2020, 7:06:27.996411 pm UUID: cbf0b08f-d0a6-45fa-bb06-dc59278ecbcd Ancestors: GraphicsTests-pre.55 Add tests for new alpha compositing rules. See https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 Those tests require a newer VM (or at least a newer BitBlt plugin - post VMMaker.oscog-nice.2909). =============== Diff against GraphicsTests-pre.55 =============== Item was added: + ----- Method: BitBltTest>>testAlphaCompositingUnscaled (in category 'tests') ----- + testAlphaCompositingUnscaled + "self run: #testAlphaCompositingUnscaled" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:srcA | + 0 to: 255 do:[:dstA | + | sColor dColor bb result a r b | + sColor := Color blue alpha: srcA / 255.0. + dColor := Color red alpha: dstA / 255.0. + fSrc colorAt: 0 at 0 put: sColor. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. + bb combinationRule: Form blendAlphaUnscaled. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := 1 - (srcA/255) * dstA + srcA / 255.0. + a = 0 + ifFalse: + [r := 1 - (srcA/255) * dColor red + (srcA/255 * sColor red) / a. + b := 1 - (srcA/255) * dColor blue + (srcA/255 * sColor blue) / a. + self assert: (result red - r) abs < eps. + self assert: (result green = 0). + self assert: (result blue - b) abs < eps]. + self assert: (result alpha - a) abs < eps]]! Item was added: + ----- Method: BitBltTest>>testAlphaCompositingUnscaled2 (in category 'tests') ----- + testAlphaCompositingUnscaled2 + "self run: #testAlphaCompositingUnscaled2" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:srcA | + 0 to: 255 do:[:dstA | + | sColor dColor bb result a r g b | + sColor := (Color r: 0.75 g: 0.5 b: 0) alpha: srcA / 255.0. + dColor := (Color r: 0.0 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fSrc colorAt: 0 at 0 put: sColor. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. + bb combinationRule: Form blendAlphaUnscaled. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := 1 - (srcA/255) * dstA + srcA / 255.0. + a = 0 + ifFalse: + [r := 1 - (srcA/255) * dColor red + (srcA/255 * sColor red) / a. + g := 1 - (srcA/255) * dColor green + (srcA/255 * sColor green) / a. + b := 1 - (srcA/255) * dColor blue + (srcA/255 * sColor blue) / a. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps]. + self assert: (result alpha - a) abs < eps]]! Item was added: + ----- Method: BitBltTest>>testAlphaScale (in category 'tests') ----- + testAlphaScale + "self run: #testAlphaScale" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:dstA | + | dColor bb result a r g b | + dColor := (Color r: 0.25 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. "source is ignored" + bb combinationRule: Form alphaScale. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := dColor alpha. + r := dColor alpha * dColor red. + g := dColor alpha * dColor green. + b := dColor alpha * dColor blue. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps. + self assert: (result alpha - a) abs < eps]! Item was added: + ----- Method: BitBltTest>>testAlphaUnscale (in category 'tests') ----- + testAlphaUnscale + "self run: #testAlphaUnscale" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 1 to: 255 do:[:dstA | + | dColor bb result a r g b | + dColor := (Color r: 0.25 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. "source is ignored" + bb combinationRule: Form alphaUncale. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := dColor alpha. + r := dColor red / dColor alpha min: 1.0. + g := dColor green / dColor alpha min: 1.0. + b := dColor blue / dColor alpha min: 1.0. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps. + self assert: (result alpha - a) abs < eps]! From commits at source.squeak.org Sun Dec 27 18:10:57 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 18:10:57 0000 Subject: [squeak-dev] The Inbox: Graphics-nice.442.mcz Message-ID: A new version of Graphics was added to project The Inbox: http://source.squeak.org/inbox/Graphics-nice.442.mcz ==================== Summary ==================== Name: Graphics-nice.442 Author: nice Time: 27 December 2020, 7:10:51.749858 pm UUID: 969b2f75-ff78-444b-a4ff-ec3fd6cd931b Ancestors: Graphics-mt.441 Provide comment and named accessors for new alpha BitBlt compositing combination rules. Those new rules are described here: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 They require a new VM, or at least a new BitBlt plugin posterior to VMMaker.oscog-nice.2909 =============== Diff against Graphics-mt.441 =============== Item was changed: Object subclass: #BitBlt instanceVariableNames: 'destForm sourceForm halftoneForm combinationRule destX destY width height sourceX sourceY clipX clipY clipWidth clipHeight colorMap' classVariableNames: 'CachedFontColorMaps ColorConvertingMaps SubPixelRenderColorFonts SubPixelRenderFonts' poolDictionaries: '' category: 'Graphics-Primitives'! + !BitBlt commentStamp: 'nice 12/27/2020 16:53' prior: 0! - !BitBlt commentStamp: 'tpr 9/17/2013 15:42' prior: 0! WARNING: BitBlt's shape cannot be modified since WarpBlt relies on the exact layout. Important primitives will break if you fail to heed this warning. I represent a block transfer (BLT) of pixels from one Form ( the sourceForm) into a rectangle (destX, destY, width, height) of the destinationForm, as modified by a combination rule, a possible halftoneForm and a possible color map. The source of pixels may be a similar rectangle (at sourceX, sourceY) in the sourceForm, or the halftoneForm, or both. If both are specified, their pixel values are combined by a logical AND function prior to any further combination rule processing. The halftoneForm may be an actual Form or a simple WordArray of 32 bit values usually intended to represent Color values. In either case the 'top' of the form is effectively aligned with the top of the destinationForm and for each scanline the destination y modulo the size of the halftoneForm gives the index of the word to use. This makes it easy to make horizontal stripes, for example. In any case, the pixels from the source (AND'd with the halftone, remember) are combined with those of the destination by as specified by the combinationRules below- name rule result 0 always 0 and 1 src AND dst 2 src AND not(dst) over 3 src only erase 4 not(src) AND& dst 5 dst only reverse 6 src XOR dst under 7 src OR dst 8 not(src) AND not(dst) 9 not(src) XOR dst 10 not(dst) 11 src OR not(dst) 12 not(src) 13 not(src) OR dst 14 not(src) OR not(dst) 15 always 1 (You can find an interesting explanation of how this comes to be in http://dev-docs.atariforge.org/files/BLiTTER_1-25-1990.pdf - which interestingly fails to mention any connection to Smalltalk and PARC.) Forms may be of different depths, see the comment in class Form. In addition to the original 16 combination rules invented for monochrome Forms, this BitBlt supports 16 fails (to simulate paint bits) 17 fails (to simulate erase bits) 18 sourceWord + destinationWord 19 sourceWord - destinationWord 20 rgbAdd: sourceWord with: destinationWord. Sum of color components 21 rgbSub: sourceWord with: destinationWord. Difference of color components 22 OLDrgbDiff: sourceWord with: destinationWord. Sum of abs of differences in components 23 OLDtallyIntoMap: destinationWord. Tallies pixValues into a colorMap these old versions don't do bitwise dest clipping. Use 32 and 33 now. blend 24 alphaBlend: sourceWord with: destinationWord. 32-bit source and dest only. Blend sourceWord with destinationWord, assuming both are 32-bit pixels. The source is assumed to have 255*alpha in the high 8 bits of each pixel, while the high 8 bits of the destinationWord will be ignored. The blend produced is alpha*source + (1-alpha)*dest, with the computation being performed independently on each color component. The high byte of the result will be 0. paint 25 pixPaint: sourceWord with: destinationWord. Wherever the sourceForm is non-zero, it replaces the destination. Can be used with a 1-bit source color mapped to (0, FFFFFFFF), and a fillColor to fill the dest with that color wherever the source is 1. erase1BitShape 26 pixMask: sourceWord with: destinationWord. Like pixPaint, but fills with 0. 27 rgbMax: sourceWord with: destinationWord. Max of each color component. 28 rgbMin: sourceWord with: destinationWord. Min of each color component. 29 rgbMin: sourceWord bitInvert32 with: destinationWord. Min with (max-source) blendAlpha 30 alphaBlendConst: sourceWord with: destinationWord. alpha is an arg. works in 16 bits. Blend sourceWord with destinationWord using a constant alpha. Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. The blend produced is alpha*source + (1.0-alpha)*dest, with the computation being performed independently on each color component. paintAlpha 31 alphaPaintConst: sourceWord with: destinationWord. alpha is an arg. works in 16 bits. 32 rgbDiff: sourceWord with: destinationWord. Sum of abs of differences in components 33 tallyIntoMap: destinationWord. Tallies pixValues into a colorMap - Those tallied are exactly those in the destination rectangle. Note that the source should be specified == destination, in order for the proper color map checks be performed at setup. blendAlphaScaled 34 alphaBlendScaled: srcWord with: dstWord. Alpha blend of scaled srcWord and destWord. In contrast to alphaBlend:with: the color produced is srcColor + (1-srcAlpha) * dstColor 35 & 36 not used rgbMul 37 rgbMul: srcWord with: dstWord. 38 pixSwap: srcWord with: dstWord. 39 pixClear: srcWord with: dstWord. Clear all pixels in destinationWord for which the pixels of sourceWord have the same values. Used to clear areas of some constant color to zero. 40 fixAlpha: srcWord with: dstWord. For any non-zero pixel value in destinationWord with zero alpha channel take the alpha from sourceWord and fill it in. Intended for fixing alpha channels left at zero during 16->32 bpp conversions. 41 rgbComponentAlpha: srcWord with: dstWord. + 42 alphaScale: srcWord with: dstWord. Pre-scale the destWord (i.e. multiply rgb components by alpha channel) + 43 alphaUncale: srcWord with: dstWord. Un-scale the destWord (i.e. divide rgb components by alpha channel) + 44 alphaBlendUnscaled: srcWord with: dstWord. Alpha blend of unscaled srcWord and destWord. + In contrast to alphaBlendScaled:with: the color produced is (srcAlpha*srcColor + (1-srcAlpha) * dstColor)/resultAlpha + where resultAlpha is srcAlpha + destAlpha*(1-srcAlpha) + This is equivalent to operations 42 + 34 + 43 (aphaScale, alphaBlendScaled, alphaUnscale) Any transfer specified is further clipped by the specified clipping rectangle (clipX, clipY, clipWidth, clipHeight), and also by the bounds of the source and destination forms. To make a small Form repeat and fill a big form, use an InfiniteForm as the source. Pixels copied from a source to a destination whose pixels have a different depth are converted based on the optional colorMap. If colorMap is nil, then conversion to more bits is done by filling the new high-order bits with zero, and conversion to fewer bits is done by truncating the lost high-order bits. The colorMap, if specified, must be a either word array (ie Bitmap) with 2^n elements, where n is the pixel depth of the source, or a fully specified ColorMap which may contain a lookup table (ie Bitmap) and/or four separate masks and shifts which are applied to the pixels. For every source pixel, BitBlt will first perform masking and shifting and then index the lookup table, and select the corresponding pixelValue and mask it to the destination pixel size before storing. When blitting from a 32 or 16 bit deep Form to one 8 bits or less, the default is truncation. This will produce very strange colors, since truncation of the high bits does not produce the nearest encoded color. Supply a 512 long colorMap, and red, green, and blue will be shifted down to 3 bits each, and mapped. The message copybits...stdColors will use the best map to the standard colors for destinations of depths 8, 4, 2 and 1. Two other sized of colorMaps are allowed, 4096 (4 bits per color) and 32786 (five bits per color). Normal blits between 16 and 32 bit forms truncates or pads the colors automatically to provide the best preservation of colors. Colors can be remapped at the same depth. Sometimes a Form is in terms of colors that are not the standard colors for this depth, for example in a GIF file. Convert the Form to a MaskedForm and send colorMap: the list of colors that the picture is in terms of. (Note also that a Form can be copied to itself, and transformed in the process, if a non-nil colorMap is supplied.)! Item was added: + ----- Method: Form class>>alphaScale (in category 'mode constants') ----- + alphaScale + "Answer the integer denoting BitBlt's pre-multiply rgb components by alpha (alphaScale) rule." + + ^ 42! Item was added: + ----- Method: Form class>>alphaUnscale (in category 'mode constants') ----- + alphaUnscale + "Answer the integer denoting BitBlt's post-multiply rgb components by alpha (alphaUnscale) rule." + + ^ 43! Item was added: + ----- Method: Form class>>blendAlphaUnscaled (in category 'mode constants') ----- + blendAlphaUnscaled + "Answer the integer denoting BitBlt's blend-with-alpha-unscaled rule." + + ^ 44! From commits at source.squeak.org Sun Dec 27 18:13:24 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 18:13:24 0000 Subject: [squeak-dev] The Inbox: GraphicsTests-nice.57.mcz Message-ID: A new version of GraphicsTests was added to project The Inbox: http://source.squeak.org/inbox/GraphicsTests-nice.57.mcz ==================== Summary ==================== Name: GraphicsTests-nice.57 Author: nice Time: 27 December 2020, 7:13:22.58338 pm UUID: 72c4e0a0-c603-4537-81e6-7c9812d95062 Ancestors: GraphicsTests-pre.55 Add tests for new alpha compositing rules. See https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 Those tests require a newer VM (or at least a newer BitBlt plugin - post VMMaker.oscog-nice.2909). This is the 2nd attempt with typo corrected: Uncaled => Unscaled Hence, GraphicsTests-nice.56 can be thrown away. =============== Diff against GraphicsTests-pre.55 =============== Item was added: + ----- Method: BitBltTest>>testAlphaCompositingUnscaled (in category 'tests') ----- + testAlphaCompositingUnscaled + "self run: #testAlphaCompositingUnscaled" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:srcA | + 0 to: 255 do:[:dstA | + | sColor dColor bb result a r b | + sColor := Color blue alpha: srcA / 255.0. + dColor := Color red alpha: dstA / 255.0. + fSrc colorAt: 0 at 0 put: sColor. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. + bb combinationRule: Form blendAlphaUnscaled. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := 1 - (srcA/255) * dstA + srcA / 255.0. + a = 0 + ifFalse: + [r := 1 - (srcA/255) * dColor red + (srcA/255 * sColor red) / a. + b := 1 - (srcA/255) * dColor blue + (srcA/255 * sColor blue) / a. + self assert: (result red - r) abs < eps. + self assert: (result green = 0). + self assert: (result blue - b) abs < eps]. + self assert: (result alpha - a) abs < eps]]! Item was added: + ----- Method: BitBltTest>>testAlphaCompositingUnscaled2 (in category 'tests') ----- + testAlphaCompositingUnscaled2 + "self run: #testAlphaCompositingUnscaled2" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:srcA | + 0 to: 255 do:[:dstA | + | sColor dColor bb result a r g b | + sColor := (Color r: 0.75 g: 0.5 b: 0) alpha: srcA / 255.0. + dColor := (Color r: 0.0 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fSrc colorAt: 0 at 0 put: sColor. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. + bb combinationRule: Form blendAlphaUnscaled. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := 1 - (srcA/255) * dstA + srcA / 255.0. + a = 0 + ifFalse: + [r := 1 - (srcA/255) * dColor red + (srcA/255 * sColor red) / a. + g := 1 - (srcA/255) * dColor green + (srcA/255 * sColor green) / a. + b := 1 - (srcA/255) * dColor blue + (srcA/255 * sColor blue) / a. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps]. + self assert: (result alpha - a) abs < eps]]! Item was added: + ----- Method: BitBltTest>>testAlphaScale (in category 'tests') ----- + testAlphaScale + "self run: #testAlphaScale" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 0 to: 255 do:[:dstA | + | dColor bb result a r g b | + dColor := (Color r: 0.25 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. "source is ignored" + bb combinationRule: Form alphaScale. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := dColor alpha. + r := dColor alpha * dColor red. + g := dColor alpha * dColor green. + b := dColor alpha * dColor blue. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps. + self assert: (result alpha - a) abs < eps]! Item was added: + ----- Method: BitBltTest>>testAlphaUnscale (in category 'tests') ----- + testAlphaUnscale + "self run: #testAlphaUnscale" + + | fSrc fDst eps | + fSrc := Form extent: 1 at 1 depth: 32. + fDst := Form extent: 1 at 1 depth: 32. + eps := 0.5 / 255. + 1 to: 255 do:[:dstA | + | dColor bb result a r g b | + dColor := (Color r: 0.25 g: 0.75 b: 0.5) alpha: dstA / 255.0. + fDst colorAt: 0 at 0 put: dColor. + bb := BitBlt toForm: fDst. + bb sourceForm: fSrc. "source is ignored" + bb combinationRule: Form alphaUnscale. + bb copyBits. + result := fDst colorAt: 0 at 0. + a := dColor alpha. + r := dColor red / dColor alpha min: 1.0. + g := dColor green / dColor alpha min: 1.0. + b := dColor blue / dColor alpha min: 1.0. + self assert: (result red - r) abs < eps. + self assert: (result green - g) abs < eps. + self assert: (result blue - b) abs < eps. + self assert: (result alpha - a) abs < eps]! From nicolas.cellier.aka.nice at gmail.com Sun Dec 27 18:24:59 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 19:24:59 +0100 Subject: [squeak-dev] source.squeak.org access is difficult Message-ID: Hi all, I wanted to clean my own garbage in inbox, but web interface is not really responsive from here... I've checked with https://downforeveryoneorjustme.com/source.squeak.org, and uh oh, as they say: Source.squeak.org Status Is source.squeak.org down right now? * Uh oh! Something went wrong on our side. It's not you, it's us. Feel free to contact us if this persists. * -------------- next part -------------- An HTML attachment was scrubbed... URL: From herbertkoenig at gmx.net Sun Dec 27 18:49:11 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Sun, 27 Dec 2020 19:49:11 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> Message-ID: I searched all method sources for 3276 and only found one suspicious place in : adjustVolumeTo: vol overMSecs: mSecs     "Adjust the volume of this sound to the given volume, a number in the range [0.0..1.0], over the given number of milliseconds. The volume will be changed a little bit on each sample until the desired volume is reached."     | newScaledVol |     self flag: #bob.        "I removed the upper limit to allow making sounds louder. hmm..."     newScaledVol := (32768.0 * vol) truncated. "<------------------------------- might exceed 32767 if vol = 1.0 -> wrap not clip"     newScaledVol = scaledVol ifTrue: [^ self]. but changing that to 32767 didn't help. Also I didn't find the version where Bob had not yet removed the limit (my oldest image being 3.6) so that is most probably not the culprit. Also I looked at a lot of in image code but didn't find anything. Next step is to try to record the output before it goes to the OS and see if the image or some primitive creates the problem. Cheers, Herbert Am 27.12.2020 um 01:57 schrieb tim Rowledge: > >> On 2020-12-26, at 4:57 AM, Herbert König wrote: >> >> Tim, thanks for the recording. >> >> No idea if that happens inside Squeak but basically clipping is not >> working. In the image instead of going from positive full-scale to >> negative full-scale the signal should just stay at the resp. full-scale. >> Instead of clipping 32767 + 1 to 32767 the code uses 32768 as being - >> full-scale (wraparound). See pulse1PosWrap.png. > Staring at the generated C code it looks possibly suspicious that we have > > short int *aSoundBuffer; > sqInt s; > if (leftVol > 0) { > i = (2 * sliceIndex) - 1; > s = (aSoundBuffer[i]) + ((sample * leftVol) / ScaleFactor); > if (s > 0x7FFF) { > s = 0x7FFF; > } > if (s < -32767) { > s = -32767; > } > aSoundBuffer[i] = s; > } > But surely no C compiler screws that up these days? > > I added printfs to show when over/underflow happened and indeed it happens - duh. > > I've compared latest and ancient (as in ~2016 vintage) copies of SoundPlugin.c, SoundGenerationPlugin.c and sqUnixSoundALSA.c and found nothing that looks anything other than trivial changes - dates, some macros, etc. > > There doesn't seem to be any place other than primitiveMixFMSound() that is involved in clipping sample values. None of the lowest level send-to-OS code looks to do any sort of casting or limiting. > > I've even just for grins tried limiting the 's' value with a s & 0x3FFF just to see what happens. It sounds a bit strange but also seems to remove the clicks, so maybe there is something in it. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: BYEBYE: Store in Write-Only Storage > > > From commits at source.squeak.org Sun Dec 27 20:58:39 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 20:58:39 0000 Subject: [squeak-dev] The Trunk: GraphicsTests-ct.56.mcz Message-ID: Nicolas Cellier uploaded a new version of GraphicsTests to project The Trunk: http://source.squeak.org/trunk/GraphicsTests-ct.56.mcz ==================== Summary ==================== Name: GraphicsTests-ct.56 Author: ct Time: 17 September 2020, 1:06:30.897813 pm UUID: 31ca4fe7-71ba-2d4e-9578-06cb5b8f3a8a Ancestors: GraphicsTests-pre.55 Adds regression test for Graphics-ct.439 (Color >> #negated). =============== Diff against GraphicsTests-pre.55 =============== Item was added: + ----- Method: ColorTest>>testNegated (in category 'tests') ----- + testNegated + + self assert: Color blue equals: Color yellow negated. + self assert: (Color blue alpha: 0.4) equals: (Color yellow alpha: 0.4) negated.! From commits at source.squeak.org Sun Dec 27 21:00:41 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 21:00:41 0000 Subject: [squeak-dev] The Trunk: Graphics-ct.439.mcz Message-ID: Nicolas Cellier uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-ct.439.mcz ==================== Summary ==================== Name: Graphics-ct.439 Author: ct Time: 17 September 2020, 1:05:42.958813 pm UUID: 523992a5-7677-d14c-a4b1-e2a676e92c6b Ancestors: Graphics-tonyg.438 Fixes transparency handling in Color >> #negated. Negating a color should not remove its alpha channel. =============== Diff against Graphics-tonyg.438 =============== Item was changed: ----- Method: Color>>negated (in category 'transformations') ----- negated "Return an RGB inverted color" ^Color r: 1.0 - self red g: 1.0 - self green + b: 1.0 - self blue + alpha: self alpha! - b: 1.0 - self blue! From commits at source.squeak.org Sun Dec 27 21:12:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 21:12:03 0000 Subject: [squeak-dev] The Trunk: Graphics-ct.430.mcz Message-ID: Nicolas Cellier uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-ct.430.mcz ==================== Summary ==================== Name: Graphics-ct.430 Author: ct Time: 21 March 2020, 8:03:59.93556 pm UUID: d78a37e5-e52b-e14c-9949-8738184bf42d Ancestors: Graphics-nice.429 Miscellaneous minor refactoring - Use #ifError: and correct deprecated [:argWithoutBar] block syntax (see Compiler-ct.417) - Fix a documetation typo - Simplify some conditions =============== Diff against Graphics-nice.429 =============== Item was changed: ----- Method: BMPReadWriter class>>readAllFrom: (in category 'testing') ----- readAllFrom: fd "MessageTally spyOn:[BMPReadWriter readAllFrom: FileDirectory default]" fd fileNames do:[:fName| (fName endsWith: '.bmp') ifTrue:[ + [Form fromBinaryStream: (fd readOnlyFileNamed: fName)] ifError: []. - [Form fromBinaryStream: (fd readOnlyFileNamed: fName)] on: Error do:[:nix]. ]. ]. fd directoryNames do:[:fdName| self readAllFrom: (fd directoryNamed: fdName) ].! Item was changed: StrikeFont subclass: #FormSetFont instanceVariableNames: 'tintable combinationRule' classVariableNames: '' poolDictionaries: '' category: 'Graphics-Fonts'! + !FormSetFont commentStamp: 'ct 2/14/2020 16:49' prior: 0! + FormSetFonts are designed to capture individual images as character forms for imbedding in normal text. While most often used to insert an isolated glyph in some text, the code is actually designed to support an entire user-defined font. The TextAttribute subclass TextFontReference is specifically designed for such in-line insertion of exceptional fonts in normal text.! - !FormSetFont commentStamp: '' prior: 0! - FormSetFonts are designed to capture individual images as character forms for imbedding in normal text. While most often used to insert an isolated glyph in some text, the code is actually desinged to support an entire user-defined font. The TextAttribute subclass TextFontReference is specifically designed for such in-line insertion of exceptional fonts in normal text.! Item was changed: ----- Method: StrikeFont>>hasGlyphForCode: (in category 'multibyte character methods') ----- hasGlyphForCode: aCharacterCode + (aCharacterCode between: self minAscii and: self maxAscii) + ifFalse: [^ false]. + (xTable at: aCharacterCode + 1) positive + ifFalse: [^ false]. - ((aCharacterCode between: self minAscii and: self maxAscii) not) ifTrue: [ - ^ false. - ]. - (xTable at: aCharacterCode + 1) < 0 ifTrue: [ - ^ false. - ]. ^ true. ! From commits at source.squeak.org Sun Dec 27 21:13:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 21:13:21 0000 Subject: [squeak-dev] The Trunk: Graphics-ct.425.mcz Message-ID: Nicolas Cellier uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-ct.425.mcz ==================== Summary ==================== Name: Graphics-ct.425 Author: ct Time: 31 December 2019, 2:12:48.956022 am UUID: cc03f86d-d37e-9b41-8c06-2effc3756ff9 Ancestors: Graphics-pre.424 [very minor] Use already defined magic number instead of hard-coded duplication =============== Diff against Graphics-pre.424 =============== Item was changed: ----- Method: FixedFaceFont>>passwordFont (in category 'initialize-release') ----- passwordFont displaySelector := #displayPasswordOn:length:at:kern:baselineY:. + substitutionCharacter := self passwordCharacter! - substitutionCharacter := $*! From lewis at mail.msen.com Sun Dec 27 21:19:38 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 27 Dec 2020 16:19:38 -0500 Subject: [squeak-dev] source.squeak.org access is difficult In-Reply-To: References: Message-ID: <20201227211938.GA94403@shell.msen.com> On Sun, Dec 27, 2020 at 07:24:59PM +0100, Nicolas Cellier wrote: > Hi all, > I wanted to clean my own garbage in inbox, but web interface is not really > responsive from here... > I've checked with https://downforeveryoneorjustme.com/source.squeak.org, > and uh oh, as they say: > > Source.squeak.org Status Is source.squeak.org down right now? > It seems fine to me. Coincidentally, I was cleaning up some of my own inbox garbage today :-) > * Uh oh! Something went wrong on our side. It's not you, it's us. Feel free > to contact us if this > persists. * I get this: Source.squeak.org Status Is source.squeak.org down right now? It's just you. source.squeak.org is up. I am on the east coast of USA, so maybe there was some network routing issue? Dave From tim at rowledge.org Sun Dec 27 21:28:13 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 27 Dec 2020 13:28:13 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> Message-ID: > On 2020-12-27, at 10:49 AM, Herbert König wrote: > > I searched all method sources for 3276 and only found one suspicious > place in : > adjustVolumeTo: vol overMSecs: mSecs I even tried not using the adjustVol... at all in case that was a cause - no change whatsoever. Next stop, using GDB. I hate using GDB. I suppose one option is also faking a nice clean sound buffer and finding a way to feed it as directly as possible to various stages. Maybe it's even a problem in the audio libraries! Not like we haven't discovered similar issues in the past. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Hipatitis (n): Terminal coolness From commits at source.squeak.org Sun Dec 27 21:35:12 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 21:35:12 0000 Subject: [squeak-dev] The Trunk: Graphics-nice.443.mcz Message-ID: Nicolas Cellier uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-nice.443.mcz ==================== Summary ==================== Name: Graphics-nice.443 Author: nice Time: 27 December 2020, 10:35:06.879989 pm UUID: f712ead7-a4fb-467d-bef1-a0962208c170 Ancestors: Graphics-mt.441, Graphics-ct.439, Graphics-ct.430, Graphics-ct.425, Graphics-ct.418 Merge Graphics-mt.441, Graphics-ct.439, Graphics-ct.430, Graphics-ct.425, Graphics-ct.418 Graphics-mt.441: Some clean up around DisplayTransform. Thanks to Stephan Lutz (stlu)! Graphics-ct.439: Fixes transparency handling in Color >> #negated. Negating a color should not remove its alpha channel. Graphics-ct.430: Miscellaneous minor refactoring - Use #ifError: and correct deprecated [:argWithoutBar] block syntax (see Compiler-ct.417) - Fix a documetation typo - Simplify some conditions Graphics-ct.425: [very minor] Use already defined magic number instead of hard-coded duplication Graphics-ct.418: Add Color>>#veryMuchDarker We also have #veryMuchLighter, so balance this out :) =============== Diff against Graphics-mt.441 =============== Item was changed: ----- Method: BMPReadWriter class>>readAllFrom: (in category 'testing') ----- readAllFrom: fd "MessageTally spyOn:[BMPReadWriter readAllFrom: FileDirectory default]" fd fileNames do:[:fName| (fName endsWith: '.bmp') ifTrue:[ + [Form fromBinaryStream: (fd readOnlyFileNamed: fName)] ifError: []. - [Form fromBinaryStream: (fd readOnlyFileNamed: fName)] on: Error do:[:nix]. ]. ]. fd directoryNames do:[:fdName| self readAllFrom: (fd directoryNamed: fdName) ].! Item was changed: ----- Method: Color>>negated (in category 'transformations') ----- negated "Return an RGB inverted color" ^Color r: 1.0 - self red g: 1.0 - self green + b: 1.0 - self blue + alpha: self alpha! - b: 1.0 - self blue! Item was added: + ----- Method: Color>>veryMuchDarker (in category 'transformations') ----- + veryMuchDarker + + ^ self alphaMixed: 0.25 with: Color black + ! Item was changed: ----- Method: FixedFaceFont>>passwordFont (in category 'initialize-release') ----- passwordFont displaySelector := #displayPasswordOn:length:at:kern:baselineY:. + substitutionCharacter := self passwordCharacter! - substitutionCharacter := $*! Item was changed: StrikeFont subclass: #FormSetFont instanceVariableNames: 'tintable combinationRule' classVariableNames: '' poolDictionaries: '' category: 'Graphics-Fonts'! + !FormSetFont commentStamp: 'ct 2/14/2020 16:49' prior: 0! + FormSetFonts are designed to capture individual images as character forms for imbedding in normal text. While most often used to insert an isolated glyph in some text, the code is actually designed to support an entire user-defined font. The TextAttribute subclass TextFontReference is specifically designed for such in-line insertion of exceptional fonts in normal text.! - !FormSetFont commentStamp: '' prior: 0! - FormSetFonts are designed to capture individual images as character forms for imbedding in normal text. While most often used to insert an isolated glyph in some text, the code is actually desinged to support an entire user-defined font. The TextAttribute subclass TextFontReference is specifically designed for such in-line insertion of exceptional fonts in normal text.! Item was changed: ----- Method: StrikeFont>>hasGlyphForCode: (in category 'multibyte character methods') ----- hasGlyphForCode: aCharacterCode + (aCharacterCode between: self minAscii and: self maxAscii) + ifFalse: [^ false]. + (xTable at: aCharacterCode + 1) positive + ifFalse: [^ false]. - ((aCharacterCode between: self minAscii and: self maxAscii) not) ifTrue: [ - ^ false. - ]. - (xTable at: aCharacterCode + 1) < 0 ifTrue: [ - ^ false. - ]. ^ true. ! From herbertkoenig at gmx.net Sun Dec 27 22:03:09 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Sun, 27 Dec 2020 23:03:09 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> Message-ID: <0af924ae-b7a6-21e1-a2f6-b638aca64592@gmx.net> I changed SoundPlayer class playLoop which I figured is what passes the samples to the OS like attached, writing 1 mega samples to an aiff file. TSTTCPW. I must have made a mistake because I suddenly get lost buffers but frankly I had some wine :-). I used Tim's first snippet: "awful noise when mixing" |snd| snd := FMSound organ1. snd setPitch: 440 dur: 10 loudness: 0.9;     play. 1 second wait. FMSound brass1 setPitch: 470 // 2 dur:2 loudness: 0.9;     play. 1 second wait. snd stopGracefully It's repeatable the sound seems to have the right length but the discontinuity marked red usually happens if the sound system of the OS looses a buffer. I had my laptop run at 4 GHZ, the audio output sounded normally bad and the loss is in the first second, where the audio is still ok. Playing the recorded file reveals the additional distortions. I just want to save another trip through the time zones so I put it out buggy as it is. Maybe I just used the wrong place to do my recording, maybe I recorded mono from a stereo buffer, whatever. Be mild :-) Herbert Am 27.12.2020 um 19:49 schrieb Herbert König: > Next step is to try to record the output before it goes to the OS and > see if the image or some primitive creates the problem. > > Cheers, > > Herbert > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hlgkbmcgckmbaocp.png Type: image/png Size: 10485 bytes Desc: not available URL: -------------- next part -------------- 'From Squeak5.3alpha of 4 October 2019 [latest update: #19044] on 27 December 2020 at 10:36:13 pm'! !SoundPlayer class methodsFor: 'player process' stamp: 'hk 12/27/2020 22:36'! playLoop "The sound player process loop." | bytesPerSlice count willStop mayStop recordBuffer recIndex file| mayStop := self stopSoundWhenDone. bytesPerSlice := Stereo ifTrue: [4] ifFalse: [2]. "Herbert debugging clip and wrap" recordBuffer := SoundBuffer newStereoSampleCount: 1000000. recordBuffer primFill: 0. recIndex := 1. [ [(count := self primSoundAvailableBytes // bytesPerSlice) > 100] whileFalse: [ReadyForBuffer wait]. count := count min: Buffer stereoSampleCount. PlayerSemaphore critical: [ ActiveSounds := ActiveSounds select: [:snd | snd samplesRemaining > 0]. ActiveSounds do: [:snd | snd ~~ SoundJustStarted ifTrue: [ snd playSampleCount: count into: Buffer startingAt: 1]]. ReverbState == nil ifFalse: [ ReverbState applyReverbTo: Buffer startingAt: 1 count: count]. "HK debugging" 1 to: count do: [:i| recordBuffer at: recIndex put: (Buffer at: i). recIndex := recIndex + 1. ]. self primSoundPlaySamples: count from: Buffer startingAt: 1. willStop := mayStop and:[ (ActiveSounds size = 0) and:[ self isAllSilence: Buffer size: count]]. LastBuffer ifNotNil:[ LastBuffer replaceFrom: 1 to: LastBuffer size with: Buffer startingAt: 1. ]. willStop ifTrue:[self shutDown: true. PlayerProcess := nil] ifFalse:[Buffer primFill: 0]. SoundJustStarted := nil]. willStop ifTrue:[ "HK debugging" file := (FileStream fileNamed: '#playedSamples.aiff') binary. recordBuffer saveAsAIFFFileSamplingRate: 44100 on: file. file close. ^self] ] repeat ! ! From commits at source.squeak.org Sun Dec 27 22:14:46 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 22:14:46 0000 Subject: [squeak-dev] The Trunk: Graphics-nice.444.mcz Message-ID: Nicolas Cellier uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-nice.444.mcz ==================== Summary ==================== Name: Graphics-nice.444 Author: nice Time: 27 December 2020, 11:14:18.76654 pm UUID: 7ad44724-768e-449e-b201-507678a23c94 Ancestors: Graphics-nice.443 Isolate alpha channel when printing a named color. This allows it to reuse the color name even for translucent color. Example: (Color red alpha: 0.4) printString Output (new): '(Color red alpha: 0.4)' Output (old): '(TranslucentColor r: 1 g: 0.5 b: 0.0 alpha: 0.4)' Note: the implementation preserves parentheses and Color transparent printString. Thanks to Christoph Thiede (ct) for the original proposal. =============== Diff against Graphics-nice.443 =============== Item was changed: + ----- Method: TranslucentColor>>isOpaque (in category 'testing') ----- - ----- Method: TranslucentColor>>isOpaque (in category 'queries') ----- isOpaque ^alpha = 255! Item was changed: + ----- Method: TranslucentColor>>isTranslucent (in category 'testing') ----- - ----- Method: TranslucentColor>>isTranslucent (in category 'queries') ----- isTranslucent ^ alpha < 255! Item was changed: + ----- Method: TranslucentColor>>isTranslucentColor (in category 'testing') ----- - ----- Method: TranslucentColor>>isTranslucentColor (in category 'queries') ----- isTranslucentColor "This means: self isTranslucent, but isTransparent not" ^ alpha > 0! Item was changed: + ----- Method: TranslucentColor>>isTransparent (in category 'testing') ----- - ----- Method: TranslucentColor>>isTransparent (in category 'queries') ----- isTransparent ^ alpha = 0! Item was added: + ----- Method: TranslucentColor>>printOn: (in category 'printing') ----- + printOn: aStream + | name | + self isTransparent ifTrue: [^ aStream nextPutAll: 'Color transparent']. + (name := self asNontranslucentColor name) ifNil: [^self storeOn: aStream]. + aStream + nextPutAll: '(Color '; + nextPutAll: name; + nextPutAll: ' alpha: '; + print: self alpha maxDecimalPlaces: 3; + nextPut: $) + ! Item was changed: ----- Method: TranslucentColor>>storeOn: (in category 'printing') ----- storeOn: aStream + self isTransparent ifTrue: [^ aStream nextPutAll: 'Color transparent']. - self isTransparent ifTrue: [^ aStream nextPutAll: '(Color transparent)']. super storeOn: aStream. aStream skip: -1; "get rid of trailing )" nextPutAll: ' alpha: '; print: self alpha maxDecimalPlaces: 3; nextPutAll: ')'. ! From herbertkoenig at gmx.net Sun Dec 27 22:44:24 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Sun, 27 Dec 2020 23:44:24 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <0af924ae-b7a6-21e1-a2f6-b638aca64592@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> <0af924ae-b7a6-21e1-a2f6-b638aca64592@gmx.net> Message-ID: <1e845167-d55b-6c8c-4d0e-1c6e0841996d@gmx.net> I tested Tim's snippet (modified to use Delay forSeconds: ) on Squeak 3.6 (Windows) and it has the same problem. But it's only clipping and no wrapping on Windows! Still very ugly. Tomorrow I'll switch to a Pi to see if my recording to file also shows wrapping. Then we'll know if it's the primitive handling audio to the OS in Linux or Rapbian or if it happens inside Squeak's sound architecture. Cheers, Herbert Am 27.12.2020 um 23:03 schrieb Herbert König: > I changed SoundPlayer class playLoop which I figured is what passes > the samples to the OS like attached, writing 1 mega samples to an aiff > file. TSTTCPW. > I must have made a mistake because I suddenly get lost buffers but > frankly I had some wine :-). > > I used Tim's first snippet: > > "awful noise when mixing" > |snd| > snd := FMSound organ1. > snd setPitch: 440 dur: 10 loudness: 0.9; >     play. > 1 second wait. > > FMSound brass1 setPitch: 470 // 2 dur:2 loudness: 0.9; >     play. > 1 second wait. > snd stopGracefully > > It's repeatable the sound seems to have the right length but the > discontinuity marked red usually happens if the sound system of the OS > looses a buffer. I had my laptop run at 4 GHZ, the audio output > sounded normally bad and the loss is in the first second, where the > audio is still ok. Playing the recorded file reveals the additional > distortions. > > I just want to save another trip through the time zones so I put it > out buggy as it is. Maybe I just used the wrong place to do my > recording, maybe I recorded mono from a stereo buffer, whatever. > > Be mild :-) > > Herbert > > > > > Am 27.12.2020 um 19:49 schrieb Herbert König: >> Next step is to try to record the output before it goes to the OS and >> see if the image or some primitive creates the problem. >> >> Cheers, >> >> Herbert >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hlgkbmcgckmbaocp.png Type: image/png Size: 10485 bytes Desc: not available URL: From tim at rowledge.org Sun Dec 27 23:53:34 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 27 Dec 2020 15:53:34 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <1e845167-d55b-6c8c-4d0e-1c6e0841996d@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <992FDF2B-E411-4C83-AC78-5D60CE0A7EA0@rowledge.org> <75704AAB-FDE7-46E9-9D86-239D06F9D9EB@rowledge.org> <0af924ae-b7a6-21e1-a2f6-b638aca64592@gmx.net> <1e845167-d55b-6c8c-4d0e-1c6e0841996d@gmx.net> Message-ID: <53A1B1D8-E9B3-4564-8E96-F7F3A0A0D7F8@rowledge.org> Thanks for banging on this Herbert - I suspect a few drinks might actually help with this one... GDB is such fun, not. So far as I can see the algorithm is doing correct things - the 16bit values get read & written without whacking other values, we get suitably matching left & right channel values, when the value over/under flows the max value is properly written, etc etc. Of course, it's extra fun to mentally deal with the 'short' addressing. I've double checked the 'FMSound new' wavetable values in case they changed across some release but they appear to be the same. Anybody got any more ideas? In particular, a recipe for recording the output with alsa would be interesting so at least I could add the record of the old-alsa-pi getting it right! tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: KFP: Kindle Fire in Printer From commits at source.squeak.org Mon Dec 28 11:48:49 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 28 Dec 2020 11:48:49 0000 Subject: [squeak-dev] The Inbox: Monticello-ct.734.mcz Message-ID: A new version of Monticello was added to project The Inbox: http://source.squeak.org/inbox/Monticello-ct.734.mcz ==================== Summary ==================== Name: Monticello-ct.734 Author: ct Time: 28 December 2020, 12:48:47.150654 pm UUID: 3964a938-941a-4e1a-89e6-d1b33e370e29 Ancestors: Monticello-mt.733 Proposal: Dispatch request notifications via ToolSet before opening an interactive dialog window. This should give us better feedback in non-interactive environments such as CI jobs or production contexts (at the moment, CI only hangs silently). Questions: Is it okay to depend on the System, Tools, and CommandLineTools from Monticello? Are there further exceptions that should be dispatched equally? =============== Diff against Monticello-mt.733 =============== Item was added: + ----- Method: CommandLineToolSet class>>mcHandleChangeSelectionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleChangeSelectionRequest: aNotification + + ^ self handleError: aNotification! Item was added: + ----- Method: CommandLineToolSet class>>mcHandleMergeResolutionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleMergeResolutionRequest: aNotification + + ^ self handleError: aNotification! Item was added: + ----- Method: CommandLineToolSet class>>mcHandleNoChangesNotification: (in category '*Monticello-Versioning-handlers') ----- + mcHandleNoChangesNotification: aNotification + + ^ self handleWarning: aNotification! Item was added: + ----- Method: CommandLineToolSet class>>mcHandleSaveVersionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleSaveVersionRequest: aNotification + + ^ self handleError: aNotification! Item was changed: ----- Method: MCChangeSelectionRequest>>defaultAction (in category 'handling') ----- defaultAction + + ^ ToolSet mcHandleChangeSelectionRequest: self! - ^ (MCChangeSelector forPatch: patch) - label: label ; - showModally! Item was changed: ----- Method: MCMergeResolutionRequest>>defaultAction (in category 'handling') ----- defaultAction + + ^ ToolSet mcHandleMergeResolutionRequest: self! - ^ (MCMergeBrowser new - merger: merger; - label: messageText) showModally! Item was changed: ----- Method: MCNoChangesException>>defaultAction (in category 'handling') ----- defaultAction + + ^ ToolSet mcHandleNoChangesNotification: self! - self inform: 'No changes'! Item was changed: ----- Method: MCVersionNameAndMessageRequest>>defaultAction (in category 'handling') ----- defaultAction + + ^ ToolSet mcHandleSaveVersionRequest: self! - ^ MCSaveVersionDialog new - versionName: suggestion; - logMessage: initialMessage; - patchBlock: patchBlock; - selection: 1; - showModally! Item was added: + ----- Method: StandardToolSet class>>mcHandleChangeSelectionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleChangeSelectionRequest: aNotification + + ^ (MCChangeSelector forPatch: aNotification patch) + label: aNotification label; + showModally! Item was added: + ----- Method: StandardToolSet class>>mcHandleMergeResolutionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleMergeResolutionRequest: aNotification + + ^ (MCMergeBrowser new + merger: aNotification merger; + label: aNotification messageText) showModally! Item was added: + ----- Method: StandardToolSet class>>mcHandleNoChangesNotification: (in category '*Monticello-Versioning-handlers') ----- + mcHandleNoChangesNotification: aNotification + + ^ self inform: 'No changes' translated! Item was added: + ----- Method: StandardToolSet class>>mcHandleSaveVersionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleSaveVersionRequest: aNotification + + ^ MCSaveVersionDialog new + versionName: aNotification suggestedName; + logMessage: aNotification initialMessage; + patchBlock: aNotification patchBlock; + selection: 1; + showModally! Item was added: + ----- Method: ToolSet class>>mcHandleChangeSelectionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleChangeSelectionRequest: aNotification + + ^ self default + ifNil: [self handleError: aNotification] + ifNotNil: [:ts | ts mcHandleChangeSelectionRequest: aNotification]! Item was added: + ----- Method: ToolSet class>>mcHandleMergeResolutionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleMergeResolutionRequest: aNotification + + ^ self default + ifNil: [self handleError: aNotification] + ifNotNil: [:ts | ts mcHandleMergeResolutionRequest: aNotification]! Item was added: + ----- Method: ToolSet class>>mcHandleNoChangesNotification: (in category '*Monticello-Versioning-handlers') ----- + mcHandleNoChangesNotification: aNotification + + ^ self default + ifNil: [self handleWarning: aNotification] + ifNotNil: [:ts | ts mcHandleNoChangesNotification: aNotification]! Item was added: + ----- Method: ToolSet class>>mcHandleSaveVersionRequest: (in category '*Monticello-Versioning-handlers') ----- + mcHandleSaveVersionRequest: aNotification + + ^ self default + ifNil: [self handleError: aNotification] + ifNotNil: [:ts | ts mcHandleSaveVersionRequest: aNotification]! From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:07:11 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:07:11 +0000 Subject: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? In-Reply-To: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> References: <176338b9bcf.cfe5be8a23282.6654357096027688810@zoho.com> Message-ID: Good question. If we had such a test, we should also check it when receiving shortcuts such as cmd + d. If capslock is enabled and I press cmd + d, I still mean "do it" but not "debug it" ... Until this is implemented on the VM site, you could check this yourself using FFI. Example for Windows: https://stackoverflow.com/a/13905385/13994294 Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von gettimothy via Squeak-dev Gesendet: Samstag, 5. Dezember 2020 16:35:56 An: squeak-dev Betreff: [squeak-dev] for the morphic team...is a "caps locks is on" indicator doable? Hi folks. Ignore as appropriate. Fat-finger me hits caps-lock by accident quite a bit and copy-n-paste does not work in morphic when that happens. A not-so-subtle indicator that "caps lock is on" would be helpful. cheers and thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:23:47 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:23:47 +0000 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> Hi Fabio, thanks for the hint! I can reproduce this neither on Win 2004/OSVM 202010232046 nor Ubuntu 18/OSVM 202008211759, each with the latest trunk update. Could you maybe share the entire stack trace/SqueakDebug.log with us? :) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Fabio Niephaus Gesendet: Freitag, 11. Dezember 2020 16:47:32 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:26:32 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:26:32 +0000 Subject: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> References: , <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> Message-ID: Nevermind, I should have read all the new unread 198 mails in my squeak-dev inbox folder before answering any of them ... Thanks for fixing, Eliot! :-) Best, Christoph ________________________________ Von: Thiede, Christoph Gesendet: Montag, 28. Dezember 2020 13:23:47 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: AW: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi Fabio, thanks for the hint! I can reproduce this neither on Win 2004/OSVM 202010232046 nor Ubuntu 18/OSVM 202008211759, each with the latest trunk update. Could you maybe share the entire stack trace/SqueakDebug.log with us? :) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Fabio Niephaus Gesendet: Freitag, 11. Dezember 2020 16:47:32 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:45:16 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:45:16 +0000 Subject: [squeak-dev] [offtopic] Smalltalk puzzles In-Reply-To: References: Message-ID: Hi Frank, great idea! :-) Maybe use a special hashtag for your interesting quiz questions? This might make it easier to get notified of them even if you are not on Twitter on a regular basis (e.g. using an RSS feed) ... :-) Happy Coding, Christoph ________________________________ Von: Squeak-dev im Auftrag von Frank Lesser Gesendet: Freitag, 18. Dezember 2020 08:46:09 An: squeak-dev at lists.squeakfoundation.org Betreff: [squeak-dev] [offtopic] Smalltalk puzzles Hi all, I have started yesterday on my twitter @LesserFrank to publish little smalltalk "puzzles" everyone is welcome to post solutions. the yesterdays puzzle crashes or hang some Smalltalks but can be debugged. Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Dec 28 13:55:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 28 Dec 2020 13:55:03 0000 Subject: [squeak-dev] The Trunk: ST80Tests-nice.7.mcz Message-ID: Nicolas Cellier uploaded a new version of ST80Tests to project The Trunk: http://source.squeak.org/trunk/ST80Tests-nice.7.mcz ==================== Summary ==================== Name: ST80Tests-nice.7 Author: nice Time: 28 December 2020, 2:55:01.970604 pm UUID: 23d32eca-56dc-434a-9498-57a6f421c0f8 Ancestors: ST80Tests-fn.6 ST80 doesn't seem to depend on Monticello anymore. =============== Diff against ST80Tests-fn.6 =============== Item was changed: ----- Method: ST80PackageDependencyTest>>testST80 (in category 'tests') ----- testST80 self testPackage: #ST80 dependsExactlyOn: #( #'Chronology-Core' Collections Compiler Files Graphics Kernel Morphic Multilingual SUnit System #'ToolBuilder-Kernel' Tools - Monticello ).! From commits at source.squeak.org Mon Dec 28 15:50:10 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 28 Dec 2020 15:50:10 0000 Subject: [squeak-dev] The Inbox: System-dtl.1209.mcz Message-ID: David T. Lewis uploaded a new version of System to project The Inbox: http://source.squeak.org/inbox/System-dtl.1209.mcz ==================== Summary ==================== Name: System-dtl.1209 Author: dtl Time: 28 December 2020, 10:50:06.875257 am UUID: 25efba24-561f-4c53-97d9-95438edfce90 Ancestors: System-eem.1207 Provide vmParameterAt:default: to handle primitive failure on reading VM parameters. Supply default parameter values to mock possibly missing elements in the parameters array. Remove two unnecessary isRunningCog checks and an ifNotNil: Remove inappropriate halt in sendMouseWheelEvents: Let supportsMultipleBytecodeSets and supportsReadOnlyObjects work on any VM. =============== Diff against System-eem.1207 =============== Item was changed: ----- Method: SmalltalkImage>>isRunningCog (in category 'system attributes') ----- isRunningCog "Answers if we're running on a Cog VM (JIT or StackInterpreter)" + ^(self vmParameterAt: 42 default: nil) - ^(self vmParameterAt: 42) ifNil: [false] ifNotNil: [:numStackPages| numStackPages > 0]! Item was changed: ----- Method: SmalltalkImage>>isRunningCogit (in category 'system attributes') ----- isRunningCogit "Answers if we're running on the Cog JIT" + ^(self vmParameterAt: 46 default: nil) - ^(self vmParameterAt: 46) ifNil: [false] ifNotNil: [:machineCodeZoneSize| machineCodeZoneSize > 0]! Item was changed: ----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') ----- lowSpaceThreshold "Answer the low space threshold. When the amount of free memory (after garbage collection) falls below this limit, the system is in serious danger of completely exhausting memory and crashing. This limit should be made high enough to allow the user open a debugger to diagnose a problem or to save the image. In a stack-based VM such as Cog contexts for activations in the stack zone will have to be created as the debugger opens, requiring additional headroom." | slotsForDebugger slotsForContextsOnStackPages | slotsForDebugger := 65536. "Arbitrary guess" slotsForContextsOnStackPages := + (self vmParameterAt: 42 default: nil) - (self vmParameterAt: 42) ifNil: [0] ifNotNil: [:numStackPages| | headerSize numActivationsPerPage maxContextSize | numActivationsPerPage := 40. "Design goal of the Cog & Stack VMs" headerSize := 8 / self wordSize. "64-bits for Spur" maxContextSize := thisContext class instSize + CompiledMethod fullFrameSize + headerSize. numStackPages * numActivationsPerPage * maxContextSize]. ^slotsForDebugger + slotsForContextsOnStackPages * self wordSize! Item was changed: ----- Method: SmalltalkImage>>maxExternalSemaphores (in category 'vm parameters') ----- maxExternalSemaphores + "The size of table where external semaphores are registered. Only in Cog, + other VMs are expected to answer nil if present in the parameters array." + ^self vmParameterAt: 49 default: nil! - "The size of table where external semaphores are registered. Only in Cog" - self isRunningCog ifFalse: [^nil]. - ^self vmParameterAt: 49! Item was changed: ----- Method: SmalltalkImage>>maxExternalSemaphores: (in category 'vm parameters') ----- maxExternalSemaphores: aSize "Changes the size of table where external semaphores are registered. The size can only grow, and will always be the next power of two larger than the parameter. Setting this at any time other than start-up can potentially lose requests. i.e. during the realloc new storage is allocated, the old contents are copied and then pointers are switched. Requests occurring during copying won't be seen if they occur to indices already copied. The intended use is to set the table to some adequate maximum at start-up" - self isRunningCog ifFalse: [^0]. "The vm-header field is a short, maximum 64k entries. Well, on most platforms anyways " (aSize < 0 or: [aSize > 16rFFFF]) ifTrue: [^self error: 'maxExternalSemaphores: is limited to 16rFFFF']. + ^[self vmParameterAt: 49 put: aSize] on: Error do: [0].! - ^self vmParameterAt: 49 put: aSize! Item was changed: ----- Method: SmalltalkImage>>processPreemptionYields (in category 'system attributes') ----- processPreemptionYields "Answer whether the VM causes a process to yield on process preemption, i.e. to put a preempted process at the back of its run queue. If the parameter is unavailable (non-Cog VMs) or bit 2 (4) is 0 then preemption yields." + ^((self vmParameterAt: 48 default: [^true]) allMask: 4) not + ! - ^(([self vmParameterAt: 48] - on: Error - do: [:ex| ^true]) allMask: 4) not! Item was changed: ----- Method: SmalltalkImage>>sendMouseWheelEvents (in category 'system attributes') ----- sendMouseWheelEvents "The Cog VM can be instructed to deliver mouse wheel events as mouse wheel events. By default mouse wheel events are mapped to arrow events. This flag persists across snapshots, stored in the image header." + ^(self vmParameterAt: 48 default: 0) anyMask: 32! - ^(self vmParameterAt: 48) anyMask: 32! Item was changed: ----- Method: SmalltalkImage>>supportsMultipleBytecodeSets (in category 'system attributes') ----- supportsMultipleBytecodeSets "Answer whether the VM supports multiple bytecodeSets." "SmalltalkImage current supportsMultipleBytecodeSets" + ^(self vmParameterAt: 65 default: nil) - ^(self vmParameterAt: 65) ifNil: [false] ifNotNil: [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" param isInteger "In newer VMs it is a set of integer flags, bit 0 of which is the vm-internal MULTIPLE_BYTECODE_SETS define" ifTrue: [param anyMask: 1] ifFalse: [param]]! Item was changed: ----- Method: SmalltalkImage>>supportsQueueingFinalization (in category 'system attributes') ----- supportsQueueingFinalization "Answer whether the VM queues individual weak arrays for finalization, instead of signalling the finalization semaphore once for all arrays and having the WeakRegistry mechanism finalize all weak arrays, whether they need to or not." "SmalltalkImage current supportsQueueingFinalization" + ^(self vmParameterAt: 48 default: 0) anyMask: 16! - ^(self vmParameterAt: 48) anyMask: 16! Item was changed: ----- Method: SmalltalkImage>>supportsReadOnlyObjects (in category 'system attributes') ----- supportsReadOnlyObjects "Answer whether the VM observes the per-object read-only flag and consequently aborts writes to inst vars of, and fails primitives that attempt to modify, read-only objects." "SmalltalkImage current supportsReadOnlyObjects" + ^(self vmParameterAt: 65 default: nil) - ^(self vmParameterAt: 65) ifNil: [false] ifNotNil: [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" param isInteger "In newer VMs it is a set of integer flags, bit 1 of which is the vm-internal IMMUTABILITY define" ifTrue: [param anyMask: 2] ifFalse: [false]]! Item was added: + ----- Method: SmalltalkImage>>vmParameterAt:default: (in category 'vm parameters') ----- + vmParameterAt: parameterIndex default: defaultValueOrBlock + "Answer a VM parameter or defaultValueOrBlock value if out of range." + + ^defaultValueOrBlock value! Item was changed: ----- Method: SmalltalkImage>>wordSize (in category 'image') ----- wordSize "Answer the size in bytes of an object pointer or word in the object memory. The value does not change for a given image, but may be modified by a SystemTracer when converting the image to another format. The value is cached in WordSize to avoid the performance overhead of repeatedly consulting the VM." "Smalltalk wordSize" + ^ WordSize ifNil: [WordSize := self vmParameterAt: 40 default: 4]! - ^ WordSize ifNil: [WordSize := [self vmParameterAt: 40] on: Error do: [4]]! From lewis at mail.msen.com Mon Dec 28 15:59:16 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Mon, 28 Dec 2020 10:59:16 -0500 Subject: [squeak-dev] The Inbox: System-dtl.1208.mcz In-Reply-To: <20201224184311.GA55865@shell.msen.com> References: <20201224184311.GA55865@shell.msen.com> Message-ID: <20201228155916.GA72499@shell.msen.com> I moved System-dtl.1208 to treated, and replaced it with a new version in the inbox. My "fix" sendMouseWheelEvents was due to an off-by-one error in my brain. It's right again now in System-dtl.1209 in the inbox. In my defence, I'll note that Integer>>bitAt: is one-based, whereas the documentation of bit fields in vmParameterAt: is zero-based. We should probably pick one convention or the other. Dave On Thu, Dec 24, 2020 at 01:43:11PM -0500, David T. Lewis wrote: > This tidies up the code a bit and provides a no-overhead way to supply > default vmParameter values for parameters that may be out of range on > some VMs. The change to sendMouseWheelEvents fixes an existing bug. > > Dave > > On Thu, Dec 24, 2020 at 06:36:16PM +0000, commits at source.squeak.org wrote: > > A new version of System was added to project The Inbox: > > http://source.squeak.org/inbox/System-dtl.1208.mcz > > > > ==================== Summary ==================== > > > > Name: System-dtl.1208 > > Author: dtl > > Time: 24 December 2020, 1:34:26.591143 pm > > UUID: 2d7b8483-72c8-4f51-ab7d-83e5aeaad51e > > Ancestors: System-eem.1207 > > > > Provide vmParameterAt:default: to handle primitive failure on reading VM parameters. > > Fix sendMouseWheelEvents, should test bit 5 not bit 6. > > Supply default parameter values to mock possibly missing elements in the parameters array. > > Remove two unnecessary isRunningCog checks and an ifNotNil: > > Remove inappropriate halt in sendMouseWheelEvents: > > Let supportsMultipleBytecodeSets and supportsReadOnlyObjects work on any VM. > > > > =============== Diff against System-eem.1207 =============== > > > > Item was changed: > > ----- Method: SmalltalkImage>>isRunningCog (in category 'system attributes') ----- > > isRunningCog > > "Answers if we're running on a Cog VM (JIT or StackInterpreter)" > > > > + ^(self vmParameterAt: 42 default: nil) > > - ^(self vmParameterAt: 42) > > ifNil: [false] > > ifNotNil: [:numStackPages| numStackPages > 0]! > > > > Item was changed: > > ----- Method: SmalltalkImage>>isRunningCogit (in category 'system attributes') ----- > > isRunningCogit > > "Answers if we're running on the Cog JIT" > > > > + ^(self vmParameterAt: 46 default: nil) > > - ^(self vmParameterAt: 46) > > ifNil: [false] > > ifNotNil: [:machineCodeZoneSize| machineCodeZoneSize > 0]! > > > > Item was changed: > > ----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') ----- > > lowSpaceThreshold > > "Answer the low space threshold. When the amount of free memory (after garbage collection) > > falls below this limit, the system is in serious danger of completely exhausting memory and > > crashing. This limit should be made high enough to allow the user open a debugger to diagnose > > a problem or to save the image. In a stack-based VM such as Cog contexts for activations in > > the stack zone will have to be created as the debugger opens, requiring additional headroom." > > > > | slotsForDebugger slotsForContextsOnStackPages | > > slotsForDebugger := 65536. "Arbitrary guess" > > slotsForContextsOnStackPages := > > + (self vmParameterAt: 42 default: nil) > > - (self vmParameterAt: 42) > > ifNil: [0] > > ifNotNil: > > [:numStackPages| | headerSize numActivationsPerPage maxContextSize | > > numActivationsPerPage := 40. "Design goal of the Cog & Stack VMs" > > headerSize := 8 / self wordSize. "64-bits for Spur" > > maxContextSize := thisContext class instSize + CompiledMethod fullFrameSize + headerSize. > > numStackPages * numActivationsPerPage * maxContextSize]. > > ^slotsForDebugger + slotsForContextsOnStackPages * self wordSize! > > > > Item was changed: > > ----- Method: SmalltalkImage>>maxExternalSemaphores (in category 'vm parameters') ----- > > maxExternalSemaphores > > + "The size of table where external semaphores are registered. Only in Cog, > > + other VMs are expected to answer nil if present in the parameters array." > > + ^self vmParameterAt: 49 default: nil! > > - "The size of table where external semaphores are registered. Only in Cog" > > - self isRunningCog ifFalse: [^nil]. > > - ^self vmParameterAt: 49! > > > > Item was changed: > > ----- Method: SmalltalkImage>>maxExternalSemaphores: (in category 'vm parameters') ----- > > maxExternalSemaphores: aSize > > "Changes the size of table where external semaphores are registered. > > The size can only grow, and will always be the next power of two larger than the parameter. > > > > Setting this at any time other than start-up can potentially lose requests. > > i.e. during the realloc new storage is allocated, > > the old contents are copied and then pointers are switched. > > Requests occurring during copying won't be seen if they occur to indices already copied. > > The intended use is to set the table to some adequate maximum at start-up" > > > > - self isRunningCog ifFalse: [^0]. > > "The vm-header field is a short, maximum 64k entries. Well, on most platforms anyways " > > (aSize < 0 or: [aSize > 16rFFFF]) ifTrue: [^self error: 'maxExternalSemaphores: is limited to 16rFFFF']. > > + ^[self vmParameterAt: 49 put: aSize] on: Error do: [0].! > > - ^self vmParameterAt: 49 put: aSize! > > > > Item was changed: > > ----- Method: SmalltalkImage>>processPreemptionYields (in category 'system attributes') ----- > > processPreemptionYields > > "Answer whether the VM causes a process to yield on process preemption, > > i.e. to put a preempted process at the back of its run queue. If the parameter > > is unavailable (non-Cog VMs) or bit 2 (4) is 0 then preemption yields." > > > > + ^((self vmParameterAt: 48 default: [^true]) allMask: 4) not > > + ! > > - ^(([self vmParameterAt: 48] > > - on: Error > > - do: [:ex| ^true]) allMask: 4) not! > > > > Item was changed: > > ----- Method: SmalltalkImage>>sendMouseWheelEvents (in category 'system attributes') ----- > > sendMouseWheelEvents > > "The Cog VM can be instructed to deliver mouse wheel events as mouse wheel events. > > By default mouse wheel events are mapped to arrow events. > > This flag persists across snapshots, stored in the image header." > > > > + ^(self vmParameterAt: 48 default: 0) allMask: 16 "bit 5" > > + > > + ! > > - ^(self vmParameterAt: 48) anyMask: 32! > > > > Item was changed: > > ----- Method: SmalltalkImage>>supportsMultipleBytecodeSets (in category 'system attributes') ----- > > supportsMultipleBytecodeSets > > "Answer whether the VM supports multiple bytecodeSets." > > "SmalltalkImage current supportsMultipleBytecodeSets" > > > > + ^(self vmParameterAt: 65 default: nil) > > - ^(self vmParameterAt: 65) > > ifNil: [false] > > ifNotNil: > > [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" > > param isInteger "In newer VMs it is a set of integer flags, bit 0 of which is the vm-internal MULTIPLE_BYTECODE_SETS define" > > ifTrue: [param anyMask: 1] > > ifFalse: [param]]! > > > > Item was changed: > > ----- Method: SmalltalkImage>>supportsQueueingFinalization (in category 'system attributes') ----- > > supportsQueueingFinalization > > "Answer whether the VM queues individual weak arrays for finalization, instead > > of signalling the finalization semaphore once for all arrays and having the > > WeakRegistry mechanism finalize all weak arrays, whether they need to or not." > > "SmalltalkImage current supportsQueueingFinalization" > > > > + ^(self vmParameterAt: 48 default: 0) anyMask: 16! > > - ^(self vmParameterAt: 48) anyMask: 16! > > > > Item was changed: > > ----- Method: SmalltalkImage>>supportsReadOnlyObjects (in category 'system attributes') ----- > > supportsReadOnlyObjects > > "Answer whether the VM observes the per-object read-only flag and consequently aborts > > writes to inst vars of, and fails primitives that attempt to modify, read-only objects." > > "SmalltalkImage current supportsReadOnlyObjects" > > > > + ^(self vmParameterAt: 65 default: nil) > > - ^(self vmParameterAt: 65) > > ifNil: [false] > > ifNotNil: > > [:param| "In older VMs this is a boolean answering the vm-internal MULTIPLE_BYTECODE_SETS define" > > param isInteger "In newer VMs it is a set of integer flags, bit 1 of which is the vm-internal IMMUTABILITY define" > > ifTrue: [param anyMask: 2] > > ifFalse: [false]]! > > > > Item was added: > > + ----- Method: SmalltalkImage>>vmParameterAt:default: (in category 'vm parameters') ----- > > + vmParameterAt: parameterIndex default: defaultValueOrBlock > > + "Answer a VM parameter or defaultValueOrBlock value if out of range." > > + > > + ^defaultValueOrBlock value! > > > > Item was changed: > > ----- Method: SmalltalkImage>>wordSize (in category 'image') ----- > > wordSize > > "Answer the size in bytes of an object pointer or word in the object memory. > > The value does not change for a given image, but may be modified by a SystemTracer > > when converting the image to another format. The value is cached in WordSize to > > avoid the performance overhead of repeatedly consulting the VM." > > > > "Smalltalk wordSize" > > > > + ^ WordSize ifNil: [WordSize := self vmParameterAt: 40 default: 4]! > > - ^ WordSize ifNil: [WordSize := [self vmParameterAt: 40] on: Error do: [4]]! > > > > > From herbertkoenig at gmx.net Mon Dec 28 18:36:31 2020 From: herbertkoenig at gmx.net (Herbert) Date: Mon, 28 Dec 2020 19:36:31 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> Message-ID: <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> Hi, after a lot of trying I managed to have parec --file-format=wav --device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor test.wav record the audio output of Squeak. Device is found via pactl list sinks and Squeak is started via exec padsp "${VM}" "${IMAGE}" From there on I used my slightly improved but still not working playLoop to record inside Squeak and the above to record outside Squeak. Inside Squeak I saw a lot of clipping as expected, outside I saw wrapping whenever it clipped inside. I saw no buffer loss in the recording outside of Squeak up to the 6 voices I checked. My recording inside playLoop still looses most of the buffers. I used: SoundPlayer startReverb. FMSound organ1 setPitch: 261.6 dur: 10 loudness: 0.3 ; play. FMSound organ1 setPitch: 329.6 dur: 10 loudness: 0.3 ; play. FMSound organ1 setPitch: 392 dur: 10 loudness: 0.3 ; play. FMSound organ1 setPitch: 523.2 dur: 10 loudness: 0.3 ; play. FMSound organ1 setPitch: 659.3 dur: 10 loudness: 0.3 ; play. FMSound organ1 setPitch: 784 dur: 10 loudness: 0.3 ; play. C major chord plus an octave above. With loudness 0.2 nearly no clipping occurred up to 0.3 with constant clipping. As playing even one voice sets the CPU to 100% load on the Pi (as per top). I checked up to 6 voices to see if it was a matter of CPU load which it seems to be not on a Pi3. Conclusion: It seems to happen somewhere between primSoundPlaySamples: count from: Buffer startingAt: 1 (Before that I recorded inside Squeak to a file) and the output to the os. primSoundPlay... is sent in SoundPlayer class playLoop. quoting Tim: Staring at the generated C code it looks possibly suspicious that we have short int *aSoundBuffer; sqInt s; if (leftVol > 0) { i = (2 * sliceIndex) - 1; s = (aSoundBuffer[i]) + ((sample * leftVol) / ScaleFactor); if (s > 0x7FFF) { s = 0x7FFF; } if (s < -32767) { s = -32767; } aSoundBuffer[i] = s; } But surely no C compiler screws that up these days? if that's from the primitive, why do we clip here? Clipping is done inside Squeak. Cheers, Herbert Am 25.12.20 um 14:54 schrieb K K Subbu: > On 25/12/20 6:49 pm, Herbert König wrote: >> It would be cool if someone can implement Your suggestion on how to >> write Squeak's audio output buffers to a file because then I could >> discern if the whole mess gets created by Squeak or if the OS plays a >> role too. > > You may use parec (sound capture to file) and paplay (file to sound > output) to test the audio subsystem of the OS to rule out any audio > driver or mixer configuration problems [1]. The corresponding ALSA > utilities are arecord and aplay. The mixer is alsamixer. > > padsp acts as a relay between the older /dev/dsp (audio device under > OSS) and the newer /dev/snd/* (audio i/o devices). > > [1] https://manpages.debian.org/testing/pulseaudio-utils/pacat.1.en.html > > HTH .. Subbu > From tim at rowledge.org Mon Dec 28 21:48:38 2020 From: tim at rowledge.org (tim Rowledge) Date: Mon, 28 Dec 2020 13:48:38 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> Message-ID: > On 2020-12-28, at 10:36 AM, Herbert wrote: > > Inside Squeak I saw a lot of clipping as expected, outside I saw > wrapping whenever it clipped inside. That would be an interesting thing to prove conclusively. It's not unimagineable that there could be a bug in a unix sound library. Just ofr a moment I got excited looking at the pulse driver code when I spotted it is using audioIn.pa_spec.format = PA_SAMPLE_S16LE; ... because I could have sworn that squeak is generating 16 bit BIG endian samples. But no... Maybe if we make a crafted sound buffer with a clean waveform that we know never gets clipped but does hit the maxval/minval and play it directly with no mixing related calls (because the mixer code does volume scaling etc and internal clipping) we might see what comes out of pulseaudio and indeed alsa. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim MIPS: Meaningless Indicator of Processor Speed. From herbertkoenig at gmx.net Tue Dec 29 11:38:51 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Tue, 29 Dec 2020 12:38:51 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> Message-ID: <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> Am 28.12.2020 um 22:48 schrieb tim Rowledge: >> On 2020-12-28, at 10:36 AM, Herbert wrote: >> >> Inside Squeak I saw a lot of clipping as expected, outside I saw >> wrapping whenever it clipped inside. > That would be an interesting thing to prove conclusively. It's not unimagineable that there could be a bug in a unix sound library. I'd suspect the Squeak primitive that hands the buffers to the OS before looking into OS code. Would it be conclusive to record the outside for a minute or so, read that file and count wrapping (sample(n) = +fullscale and sample(n+1) = -fullscale) or (sample(n) = -fullscale and sample(n+1) = +fullscale) and do the same for all SoundBuffers we get hold of inside Squeak during the recording? (repeatedly checking SoundBuffer allInstances) > Maybe if we make a crafted sound buffer with a clean waveform that we know never gets clipped but does hit the maxval/minval and play it directly with no mixing related calls (because the mixer code does volume scaling etc and internal clipping) we might see what comes out of pulseaudio and indeed alsa. AbstractSound or the like has a class var Sine with that but I feel that's directed at finding a bug in the OS and discards the possibility of Squeak messing it up. And the organ sounds used are predictable enough re clipping but I hope the individual envelopes add some randomness to cover more cases. Cheers, Herbert From herbertkoenig at gmx.net Tue Dec 29 18:52:54 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Tue, 29 Dec 2020 19:52:54 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> Message-ID: <7d413507-ad63-0631-f197-71c43978fd82@gmx.net> I changed playLoop to just copy the current SoundBuffer into a collection. I got some 11 seconds sound (2 below) Each buffer I differentiated and took the abs value. (see attached st) Of those I took the max. In case of wraparound that would be close to 64k. The zeroes in these buffers are the clippings. (3 below) Again I took the max. (4 below). I can't email screenshots from the Pi but I did it on a Pi too. I used Tim's first snippet. I found a lot of clipping inside Squeak and not a single wraparound in several attempts. Same observation id waggling the Keyboard or playing my 6 voiced C major while waggling the keyboard morph. On the Pi3 I still lost buffers (getting 7 seconds worth of buffers from 10+ seconds of Audio). I would not search in the Squeak Smalltalk code for the problem but would suspect the primitive where Squeak hands the output to Raspbian. That said clipping still makes for horrible sound (SCNR :-). Cheers, Herbert Am 29.12.2020 um 12:38 schrieb Herbert König: > > > Am 28.12.2020 um 22:48 schrieb tim Rowledge: >>> On 2020-12-28, at 10:36 AM, Herbert wrote: >>> >>> Inside Squeak I saw a lot of clipping as expected, outside I saw >>> wrapping whenever it clipped inside. >> That would be an interesting thing to prove conclusively. It's not >> unimagineable that there could be a bug in a unix sound library. > I'd suspect the Squeak primitive that hands the buffers to the OS before > looking into OS code. > > Would it be conclusive to record the outside for a minute or so, read > that file and count wrapping > (sample(n) = +fullscale and sample(n+1) = -fullscale) or (sample(n) = > -fullscale and sample(n+1) = +fullscale) > and do the same for all SoundBuffers we get hold of inside Squeak during > the recording? (repeatedly checking SoundBuffer allInstances) > >> Maybe if we make a crafted sound buffer with a clean waveform that we >> know never gets clipped but does hit the maxval/minval and play it >> directly with no mixing related calls (because the mixer code does >> volume scaling etc and internal clipping) we might see what comes out >> of pulseaudio and indeed alsa. > AbstractSound or the like has a class var Sine with that but I feel > that's directed at finding a bug in the OS and discards the possibility > of Squeak messing it up. And the organ sounds used are predictable > enough re clipping but I hope the individual envelopes add some > randomness to cover more cases. > > Cheers, > > Herbert > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hnbcejajmlkkicge.png Type: image/png Size: 234140 bytes Desc: not available URL: -------------- next part -------------- 'From Squeak5.3alpha of 4 October 2019 [latest update: #19044] on 29 December 2020 at 4:32:13 pm'! !SoundBuffer methodsFor: 'utilities' stamp: 'hk 12/29/2020 16:17'! absDifferentiatedLeft "return n Array consisting of the differntiated (n - n+1st samples) hackish unoptimized" | leftSamples absDiff | leftSamples := self splitStereo first. absDiff := Array new: leftSamples size -1. 1 to: leftSamples size - 1 do: [:i | absDiff at: i put: ((leftSamples at: i) - (leftSamples at: i+1)) abs]. ^absDiff! ! -------------- next part -------------- 'From Squeak5.3alpha of 4 October 2019 [latest update: #19044] on 29 December 2020 at 4:01:54 pm'! !SoundPlayer class methodsFor: 'player process' stamp: 'hk 12/29/2020 15:59'! playLoop "The sound player process loop." | bytesPerSlice count willStop mayStop buffers| buffers := OrderedCollection new. mayStop := self stopSoundWhenDone. bytesPerSlice := Stereo ifTrue: [4] ifFalse: [2]. [ [(count := self primSoundAvailableBytes // bytesPerSlice) > 100] whileFalse: [ReadyForBuffer wait]. count := count min: Buffer stereoSampleCount. PlayerSemaphore critical: [ ActiveSounds := ActiveSounds select: [:snd | snd samplesRemaining > 0]. ActiveSounds do: [:snd | snd ~~ SoundJustStarted ifTrue: [ snd playSampleCount: count into: Buffer startingAt: 1]]. ReverbState == nil ifFalse: [ ReverbState applyReverbTo: Buffer startingAt: 1 count: count]. buffers add: Buffer copy. self primSoundPlaySamples: count from: Buffer startingAt: 1. willStop := mayStop and:[ (ActiveSounds size = 0) and:[ self isAllSilence: Buffer size: count]]. LastBuffer ifNotNil:[ LastBuffer replaceFrom: 1 to: LastBuffer size with: Buffer startingAt: 1. ]. willStop ifTrue:[self shutDown: true. PlayerProcess := nil] ifFalse:[Buffer primFill: 0]. SoundJustStarted := nil]. willStop ifTrue:[buffers explore. ^self] ] repeat ! ! From eliot.miranda at gmail.com Tue Dec 29 19:03:28 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 29 Dec 2020 11:03:28 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: <7d413507-ad63-0631-f197-71c43978fd82@gmx.net> References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> <7d413507-ad63-0631-f197-71c43978fd82@gmx.net> Message-ID: Hi Herbert, Hi Tim, I suspect I've made a mistake somewhere. This used to play smoothly and now I can hear some distortion and it's unlilely to do with my speakers, as the same is heard either through my laptop speakers or my apple display speakers: | samples sineTable sound | "1 second of A below middle C (220Hz). 16000 / 220 is 72.72 recurring" sineTable := SoundPlayer sineTable: 73. sineTable doWithIndex: "And let's not deafen anyone..." [:sample :index| sineTable at: index put: sample // 4]. samples := SoundBuffer new: 16000. 1 to: samples size by: sineTable size do: [:i| samples replaceFrom: i to: (i + sineTable size - 1 min: 16000) with: sineTable startingAt: 1]. 1 to: 146 do: [:i| samples at: i put: ((samples at: i) * i / 146) asInteger. samples at: 16001 - i put: ((samples at: 16001 - i) * i / 146) asInteger]. sound := SampledSound samples: samples samplingRate: 16000. sound := MixedSound new add: sound pan: 0.25; add: sound pan: 0.75; yourself. sound play So I'll try and do a regression test soon. On Tue, Dec 29, 2020 at 10:53 AM Herbert König wrote: > I changed playLoop to just copy the current SoundBuffer into a collection. > I got some 11 seconds sound (2 below) > Each buffer I differentiated and took the abs value. (see attached st) > Of those I took the max. In case of wraparound that would be close to > 64k. > The zeroes in these buffers are the clippings. (3 below) Again I took the > max. (4 below). > > I can't email screenshots from the Pi but I did it on a Pi too. I used > Tim's first snippet. I found a lot of clipping inside Squeak and not a > single wraparound in several attempts. > > Same observation id waggling the Keyboard or playing my 6 voiced C major > while waggling the keyboard morph. > > On the Pi3 I still lost buffers (getting 7 seconds worth of buffers from > 10+ seconds of Audio). I would not search in the Squeak Smalltalk code for > the problem but would suspect the primitive where Squeak hands the output > to Raspbian. > > That said clipping still makes for horrible sound (SCNR :-). > > Cheers, > > Herbert > > > Am 29.12.2020 um 12:38 schrieb Herbert König: > > > > Am 28.12.2020 um 22:48 schrieb tim Rowledge: > > On 2020-12-28, at 10:36 AM, Herbert > wrote: > > Inside Squeak I saw a lot of clipping as expected, outside I saw > wrapping whenever it clipped inside. > > That would be an interesting thing to prove conclusively. It's not > unimagineable that there could be a bug in a unix sound library. > > I'd suspect the Squeak primitive that hands the buffers to the OS before > looking into OS code. > > Would it be conclusive to record the outside for a minute or so, read > that file and count wrapping > (sample(n) = +fullscale and sample(n+1) = -fullscale) or (sample(n) = > -fullscale and sample(n+1) = +fullscale) > and do the same for all SoundBuffers we get hold of inside Squeak during > the recording? (repeatedly checking SoundBuffer allInstances) > > Maybe if we make a crafted sound buffer with a clean waveform that we know > never gets clipped but does hit the maxval/minval and play it directly with > no mixing related calls (because the mixer code does volume scaling etc and > internal clipping) we might see what comes out of pulseaudio and indeed > alsa. > > AbstractSound or the like has a class var Sine with that but I feel > that's directed at finding a bug in the OS and discards the possibility > of Squeak messing it up. And the organ sounds used are predictable > enough re clipping but I hope the individual envelopes add some > randomness to cover more cases. > > Cheers, > > Herbert > > > > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hnbcejajmlkkicge.png Type: image/png Size: 234140 bytes Desc: not available URL: From commits at source.squeak.org Tue Dec 29 19:19:35 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 29 Dec 2020 19:19:35 0000 Subject: [squeak-dev] The Trunk: Sound-eem.77.mcz Message-ID: Eliot Miranda uploaded a new version of Sound to project The Trunk: http://source.squeak.org/trunk/Sound-eem.77.mcz ==================== Summary ==================== Name: Sound-eem.77 Author: eem Time: 29 December 2020, 11:19:33.380113 am UUID: 6ba9cee3-631a-4b00-b66f-0aad4608aefd Ancestors: Sound-eem.76 Allow MixedSound to do its thing even if it hasn't been sent reset and had soundDone set-up correctly. =============== Diff against Sound-eem.76 =============== Item was changed: ----- Method: MixedSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') ----- mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol "Play a number of sounds concurrently. The level of each sound can be set independently for the left and right channels." | snd left right | + soundDone + ifNil: + [1 to: sounds size do: + [:i | + snd := sounds at: i. + left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. + right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. + snd samplesRemaining > 0 ifTrue: + [snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right]]] + ifNotNil: + [1 to: sounds size do: + [:i | + (soundDone at: i) ifFalse: + [snd := sounds at: i. + left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. + right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. + snd samplesRemaining > 0 + ifTrue: [snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right] + ifFalse: [soundDone at: i put: true]]]]! - 1 to: sounds size do: [:i | - (soundDone at: i) ifFalse: [ - snd := sounds at: i. - left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. - right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor. - snd samplesRemaining > 0 - ifTrue: [ - snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right] - ifFalse: [soundDone at: i put: true]]]. - ! From tim at rowledge.org Tue Dec 29 19:49:16 2020 From: tim at rowledge.org (tim Rowledge) Date: Tue, 29 Dec 2020 11:49:16 -0800 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> <7d413507-ad63-0631-f197-71c43978fd82@gmx.net> Message-ID: > On 2020-12-29, at 11:03 AM, Eliot Miranda wrote: > > Hi Herbert, Hi Tim, > > I suspect I've made a mistake somewhere. Well, I guess that happens occasionally - but I should note that my experiments are using a 5.3 release image (though I have tried the fairly up to date 6alpha stream as well). and so don't have your change involved. Herbert - the prim to play the sound simply passes pointers around and I can't find any place where values might get changed. Given that both ALSA and pulseaudio allow setting of the sample format in order to handle 8, 16, 32 bt, integer and float, compressed, spindled, folded and mutilated, it is certainly possible there is an issue, though finding it will be 'fun'. One thing I should do is dig out another Pi and set it up with a clean 'last before pulse' copy of the OS and make sure we know what happens in that case. So many things to break, so little time... tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim The world is not magic From herbertkoenig at gmx.net Tue Dec 29 20:09:36 2020 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Tue, 29 Dec 2020 21:09:36 +0100 Subject: [squeak-dev] Sound mixing makes nasty noises In-Reply-To: References: <108F5892-289F-445E-8DC4-579C610CEB74@rowledge.org> <7C8655DA-7CA9-4133-90EE-BDA202681583@rowledge.org> <33a18d48-1644-9324-4bd2-e6a64da94a16@gmx.net> <80778164-F339-4986-BD6C-489757CBD0F1@rowledge.org> <78a26136-ac80-3bd7-3f6d-cbaee7d6fd15@gmx.net> <2A486FD7-778B-47EF-BC2D-48E964529E33@rowledge.org> <363580ae-43cf-36a9-9c6c-3c5649913dac@gmx.net> <5618d556-9ee8-f8dc-26b3-1dc5f613a7b2@gmx.net> <1a8f5722-17aa-06e9-bf95-b3d29336d3c5@gmail.com> <43dc69bf-c8fc-9c38-f898-a2f79c8273e2@gmx.net> <4cfccf9d-aa05-60df-fc70-7ce8b8665516@gmx.net> <7d413507-ad63-0631-f197-71c43978fd82@gmx.net> Message-ID: <53e1d7b6-13c0-999e-7a4e-149d3515bb21@gmx.net> Hi Tim, Hi Eliot, Eliot our problem is on the Pi only, not on Windows10 not on Linux Mint and I think Tim uses Mac Os w/o these problems. 5.3 release Squeak here too. I created a fullscale sine and a 1.01 * fullscale sine in Audacity (cross platform audio editor) on the Pi, saved them as 16 Bit Wav and read them again -> all as expected. But Audacity was a bit unclear if it used Pulse or Alsa. Next I'll create these sines in Python where I hope to have more control over the audio drivers. Cheers, Herbert Am 29.12.2020 um 20:49 schrieb tim Rowledge: > >> On 2020-12-29, at 11:03 AM, Eliot Miranda wrote: >> >> Hi Herbert, Hi Tim, >> >> I suspect I've made a mistake somewhere. > Well, I guess that happens occasionally - but I should note that my experiments are using a 5.3 release image (though I have tried the fairly up to date 6alpha stream as well). and so don't have your change involved. > > Herbert - the prim to play the sound simply passes pointers around and I can't find any place where values might get changed. Given that both ALSA and pulseaudio allow setting of the sample format in order to handle 8, 16, 32 bt, integer and float, compressed, spindled, folded and mutilated, it is certainly possible there is an issue, though finding it will be 'fun'. > > One thing I should do is dig out another Pi and set it up with a clean 'last before pulse' copy of the OS and make sure we know what happens in that case. > > So many things to break, so little time... > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > The world is not magic > > > From commits at source.squeak.org Tue Dec 29 23:42:37 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 29 Dec 2020 23:42:37 0000 Subject: [squeak-dev] The Trunk: CollectionsTests-nice.347.mcz Message-ID: Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk: http://source.squeak.org/trunk/CollectionsTests-nice.347.mcz ==================== Summary ==================== Name: CollectionsTests-nice.347 Author: nice Time: 30 December 2020, 12:42:34.890916 am UUID: 5b26fe17-c4d3-4fd0-a8d3-f53f5818d9dd Ancestors: CollectionsTests-mt.346 Add a test for float array 32<->64 conversions =============== Diff against CollectionsTests-mt.346 =============== Item was added: + ----- Method: FloatArrayTest>>testConversionToFloat64 (in category 'tests') ----- + testConversionToFloat64 + | b32 f32 f64 | + f32 := Float32Array withAll: #(0.1 0.25 1.0 1.5 2.0 3.14). + f64 := f32 asFloat64Array. + self assert: f64 class isBits. + self assert: f64 class isLongs. + self assert: f64 size equals: f32 size. + self assert: (f32 hasEqualElements: f64) description: '32 to 64 bits conversion is lossless'. + b32 := f64 asFloat32Array. + self assert: b32 class equals: f32 class. + self assert: b32 equals: f32.! From commits at source.squeak.org Tue Dec 29 23:46:24 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 29 Dec 2020 23:46:24 0000 Subject: [squeak-dev] The Trunk: Collections-nice.921.mcz Message-ID: Nicolas Cellier uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-nice.921.mcz ==================== Summary ==================== Name: Collections-nice.921 Author: nice Time: 30 December 2020, 12:46:21.328377 am UUID: f66c5960-3b41-4815-ab2c-ce42061fb43e Ancestors: Collections-eem.920 Fix buggish float array 32<->64 conversions... Hell, how could I publish that? Il ne faut pas confondre vitesse et pr�cipitation... =============== Diff against Collections-eem.920 =============== Item was changed: ----- Method: Float32Array class>>fromFloat64Array: (in category 'instance creation') ----- fromFloat64Array: aFloat64Array + ^(self new: aFloat64Array size) copyFromFloat64Array: aFloat64Array! - ^(self new: aFloat64Array) copyFromFloat64Array: aFloat64Array! Item was changed: ----- Method: Float32Array>>copyFromFloat64Array: (in category 'initialize-release') ----- copyFromFloat64Array: aFloat64Array "Destructively replace the elements of self with those of aFloat64Array" + - self isOfSameSizeCheck: aFloat64Array. 1 to: self size do:[:i| self at: i put: (aFloat64Array at: i)].! Item was changed: ----- Method: Float64Array class>>fromFloatArray: (in category 'instance creation') ----- fromFloatArray: aFloatArray + ^(self new: aFloatArray size) copyFromFloatArray: aFloatArray! - ^(self new: aFloatArray) copyFromFloatArray: aFloatArray! From frank-lesser at lesser-software.com Wed Dec 30 06:23:05 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Wed, 30 Dec 2020 07:23:05 +0100 Subject: [squeak-dev] [offtopic] Smalltalk puzzles In-Reply-To: References: Message-ID: Hi all, I have published a next #SmalltalkPuzzle on my twitter @LesserFrank. Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Wed Dec 30 09:11:53 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Wed, 30 Dec 2020 10:11:53 +0100 Subject: [squeak-dev] cannot browse Monticello change from to any of its ancestors Message-ID: Hi MC experts, when spawning history of a dirty package, then selecting the , then trying to view changes from one of the ancestors via pop up menu, the operation ends up with a 'MessageNotUnderstood: UndefinedObject>>snapshot'. The problem is that: MCWorkingHistoryBrowser>>selectedSnapshot ^ self snapshotForInfo: self selectedInfo will use a MCWorkingCopyAncestry as the selectedInfo... But a MCWorkingCopyAncestry lacks essential messages of a regular MCVersionInfo, like versionName etc... This will cause an Error, caught at upper level, and result in nil (no repository holds the 'working copy', there is no point in searching...). I have no idea how to fix it, presumably we should catch early that we're dealing with 'working copy' and use appropriate snapshot for it... I do not know if it was broken recently or if it never worked, but this is a useful feature when there are several ancestors, so help would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hernan.wilkinson at gmail.com Wed Dec 30 13:10:05 2020 From: hernan.wilkinson at gmail.com (Hernan Wilkinson) Date: Wed, 30 Dec 2020 10:10:05 -0300 Subject: [squeak-dev] Problem debugging a test with #should:raise: Message-ID: Hi all, I'm sending this mail to the three lists because it is an error I found in the three Smalltalks (Squeak, Pharo and Cuis) and maybe we could share the effort to solve it and the solution. The problem can be reproduce with this test: test1 self should: [ self error: 'something' ] raise: Error withExceptionDo: [ :anError | self assert: 'something different' equals: anError messageText ] If you run that test, it will fail of course. So if you go with the debugger to the context that signals de error (self error: 'something') and press restart and then over you will find the error. In the case of Squeak and Cuis, a new debugger is opened and you can not do anything with the original one. In the case of Pharo, the debugger stops working (in another try it opened a new debugger also but I could not reproduce it). I think the problem is related to the execution simulation but it is not a simple problem... Any idea what it could be? Cheers! Hernan. -- *Hernán WilkinsonAgile Software Development, Teaching & Coaching* *Phone: +54-011*-4893-2057 *Twitter: @HernanWilkinson* *site: http://www.10Pines.com * Address: Alem 896, Floor 6, Buenos Aires, Argentina -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Wed Dec 30 14:55:33 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Wed, 30 Dec 2020 14:55:33 +0000 Subject: [squeak-dev] Problem debugging a test with #should:raise: In-Reply-To: References: Message-ID: <2b250de3272b4eaea988f57c34ca191e@student.hpi.uni-potsdam.de> Hi Hernan, thanks for the bug report! This is to some extent related to the bugs reported in this thread [1] (debuggers showing up in the wrong process), and I am currently preparing a changeset to fix these issues. Unfortunately, it does not yet resolve your issue. I have not yet investigated it in great detail, but this is probably caused by the #runUntilErrorOrReturnFrom: hack, see also this thread [2]. We still should find a patch or a better alternative to it. Best, Christoph [1] http://forum.world.st/I-broke-the-debugger-td5110752.html#a5124736 [2] http://forum.world.st/BUG-REGRESSION-while-debugging-Generator-gt-gt-nextPut-td5108125.html#a5109109 ________________________________ Von: Squeak-dev im Auftrag von Hernan Wilkinson Gesendet: Mittwoch, 30. Dezember 2020 14:10:05 An: Discussion of Cuis Smalltalk; The general-purpose Squeak developers list; Pharo Development List Betreff: [squeak-dev] Problem debugging a test with #should:raise: Hi all, I'm sending this mail to the three lists because it is an error I found in the three Smalltalks (Squeak, Pharo and Cuis) and maybe we could share the effort to solve it and the solution. The problem can be reproduce with this test: test1 self should: [ self error: 'something' ] raise: Error withExceptionDo: [ :anError | self assert: 'something different' equals: anError messageText ] If you run that test, it will fail of course. So if you go with the debugger to the context that signals de error (self error: 'something') and press restart and then over you will find the error. In the case of Squeak and Cuis, a new debugger is opened and you can not do anything with the original one. In the case of Pharo, the debugger stops working (in another try it opened a new debugger also but I could not reproduce it). I think the problem is related to the execution simulation but it is not a simple problem... Any idea what it could be? Cheers! Hernan. -- Hernán Wilkinson Agile Software Development, Teaching & Coaching Phone: +54-011-4893-2057 Twitter: @HernanWilkinson site: http://www.10Pines.com Address: Alem 896, Floor 6, Buenos Aires, Argentina -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 30 14:57:23 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 30 Dec 2020 14:57:23 0000 Subject: [squeak-dev] The Inbox: Monticello-nice.734.mcz Message-ID: A new version of Monticello was added to project The Inbox: http://source.squeak.org/inbox/Monticello-nice.734.mcz ==================== Summary ==================== Name: Monticello-nice.734 Author: nice Time: 30 December 2020, 3:57:21.60758 pm UUID: 863f642a-7795-4eb6-aa6b-76a5af3a8504 Ancestors: Monticello-mt.733 Workaround version history browser bug when 'working copy' is selected. The snapshot is searched in repositoryGroup, and logically, none is found. Note that the self selectedInfo isKindOf: MCWorkingCopyAncestry, which does not behave as a regular MCVersionInfo, it does not even answer to versionName... This somehow accelerate the failure thru an ifError: [] handling, but at the end, the selectedSnapshot is still nil which makes the 'view changes from...' menu fail. The workaround is not very nice, it use implicit knowledge that 'working copy' will be at top of list (index = 1). If you can think of nicer fix, please raise voice. =============== Diff against Monticello-mt.733 =============== Item was changed: ----- Method: MCVersionHistoryBrowser>>selectedSnapshot (in category 'accessing') ----- selectedSnapshot + index = 1 ifTrue: [^package snapshot]. ^ self snapshotForInfo: self selectedInfo! From Christoph.Thiede at student.hpi.uni-potsdam.de Wed Dec 30 15:12:11 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Wed, 30 Dec 2020 15:12:11 +0000 Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> References: <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> Message-ID: <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> Sorry for the complex title. I'm not yet sure what is the error in my particular configuration. I'm trying to write a Dockerfile to run Squeak on my raspberry pi (4b+, set up with 64 bit). I downloaded this release: `squeak.cog.spur_linux64x64_202003021730` and tried to execute it without any arguments for the beginning: ``` root at cadc927632ce:/# ./sqcogspur64linuxht/squeak not a dynamic executable Error. Could not determine platform's libc path for VM. Try forcing $PLATFORMLIBDIR in ./sqcogspur64linuxht/squeak, based on LIBC_SO. Please report what works to squeak [vm-dev] mail list. LIBC_SO= DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS" NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" VERSION_CODENAME=focal UBUNTU_CODENAME=focal UNAME=Linux cadc927632ce 5.4.79-v8+ #1373 SMP PREEMPT Mon Nov 23 13:32:41 GMT 2020 aarch64 aarch64 aarch64 GNU/Linux System seems to be 64 bit. You may need to (re)install the 32-bit libraries. ``` What does this error message want to tell me? Which libraries should I install? I already gave this \[\] a try, but I only get 404 errors for i386 repository - [it looks as if it is not available for Ubuntu 20.](https://eofla.wordpress.com/2020/04/01/ubuntu-20-04-lts-i386-repository-fade-out/) Can you help me? What libraries and packages do I need to install to get a (headful, planning to use `ssh -X`) running in my container? (PS: Probably a Squeak alternative for http://get.pharo.org/ could be helpful, too. :-)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Wed Dec 30 15:22:50 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Wed, 30 Dec 2020 15:22:50 +0000 Subject: [squeak-dev] [offtopic] Smalltalk puzzles In-Reply-To: References: , Message-ID: Hi all, here is another puzzle from my side (@LinqLover): https://twitter.com/hashtag/SmalltalkPuzzle Discerning list readers will have seen an explanation of this phenomenon some time ago here on squeak-dev. :-) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Frank Lesser Gesendet: Mittwoch, 30. Dezember 2020 07:23:05 An: squeak-dev at lists.squeakfoundation.org Betreff: Re: [squeak-dev] [offtopic] Smalltalk puzzles Hi all, I have published a next #SmalltalkPuzzle on my twitter @LesserFrank. Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Wed Dec 30 16:52:38 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 30 Dec 2020 11:52:38 -0500 Subject: [squeak-dev] The Inbox: Monticello-nice.734.mcz In-Reply-To: References: Message-ID: <20201230165238.GA59395@shell.msen.com> On Wed, Dec 30, 2020 at 02:57:23PM +0000, commits at source.squeak.org wrote: > A new version of Monticello was added to project The Inbox: > http://source.squeak.org/inbox/Monticello-nice.734.mcz > > ==================== Summary ==================== > > Name: Monticello-nice.734 > Author: nice > Time: 30 December 2020, 3:57:21.60758 pm > UUID: 863f642a-7795-4eb6-aa6b-76a5af3a8504 > Ancestors: Monticello-mt.733 > > Workaround version history browser bug when 'working copy' is selected. > > The snapshot is searched in repositoryGroup, and logically, none is found. > Note that the self selectedInfo isKindOf: MCWorkingCopyAncestry, which does not behave as a regular MCVersionInfo, it does not even answer to versionName... > This somehow accelerate the failure thru an ifError: [] handling, but at the end, the selectedSnapshot is still nil which makes the 'view changes from...' menu fail. > > The workaround is not very nice, it use implicit knowledge that 'working copy' will be at top of list (index = 1). > > If you can think of nicer fix, please raise voice. > Attached is another way to do it without relying on the list index. I have not tested very much but it seems to be all right. MCVersionHistoryBrowser>>snapshotForInfo: aVersionInfo "Answer snapshot for aVersionInfo or for the working copy if not found" ^ (self repositoryGroup versionWithInfo: aVersionInfo ifNone: [ package ]) snapshot Apologies for violating MC package standards by including a method comment ;-) Dave -------------- next part -------------- 'From Squeak6.0alpha of 30 December 2020 [latest update: #20138] on 30 December 2020 at 11:42:15 am'!!MCVersionHistoryBrowser methodsFor: 'accessing' stamp: 'dtl 12/30/2020 11:34'!snapshotForInfo: aVersionInfo "Answer snapshot for aVersionInfo or for the working copy if not found" ^ (self repositoryGroup versionWithInfo: aVersionInfo ifNone: [ package ]) snapshot! ! From frank-lesser at lesser-software.com Wed Dec 30 18:08:34 2020 From: frank-lesser at lesser-software.com (Frank Lesser) Date: Wed, 30 Dec 2020 19:08:34 +0100 Subject: [squeak-dev] [offtopic] Smalltalk puzzles In-Reply-To: References: Message-ID: A next puzzle - nd nothing is broken - it is just Smalltalk ... On 12/30/2020 16:22, Thiede, Christoph wrote: > > Hi all, > > > here is another puzzle from my side (@LinqLover): > https://twitter.com/hashtag/SmalltalkPuzzle > > > > Discerning list readers will have seen an explanation of this > phenomenon some time ago here on squeak-dev. :-) > > > Best, > > Christoph > > > ------------------------------------------------------------------------ > *Von:* Squeak-dev im > Auftrag von Frank Lesser > *Gesendet:* Mittwoch, 30. Dezember 2020 07:23:05 > *An:* squeak-dev at lists.squeakfoundation.org > *Betreff:* Re: [squeak-dev] [offtopic] Smalltalk puzzles > > Hi all, I have published a next #SmalltalkPuzzle on my twitter > @LesserFrank. > > Frank > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Wed Dec 30 18:11:16 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Wed, 30 Dec 2020 19:11:16 +0100 Subject: [squeak-dev] The Inbox: Monticello-nice.734.mcz In-Reply-To: <20201230165238.GA59395@shell.msen.com> References: <20201230165238.GA59395@shell.msen.com> Message-ID: Yeah, no comment nowhere and most methods 'as yet unclassified' (we fixed many of those already). I guess that the idea was that with a clear separation of concerns and limitation of responsibilities, comments coud eventually become moot. Even classification of methods could be seen as unhelpful if there are few enough per class... It's been a nice exercise in style. But in corners like this, nothing is that obvious, sorry but we're well beyond the limit of what an average Smalltalker can follow and understand... The alternative you're proposing does work thanks to an ugly ifError: handling... We're sending versionName to a MCWorkingCopyAncestry which is a MNU. We have absolutely no idea why a MCWorkingCopyAncestry would ever be a good candidate for self selectedInfo... We have no idea why a MCVersionInfo has to be a specialization of a MCAncestry. But then, should we subclass MCWorkingCopyAncestry and get a MCWorkingCopyInfo? Inheritance vs composition? We have no idea why we must search a specific version in MCRepositoryGroup default, rather than the more restricted group registered for this package... So we end up scanning all the repositories in the default repositoryGroup for getting a snapshot of working copy, which is quiet a vain idea, the snapshot lies in no repository, it's right there under our mouse, in the image. Clearly not such a good example of crystal clear and straightforward code to my eyes... I'd rather say crooked! I don't know when and how exactly we got there... Is it from inception? Or gradual rot due to quick hacking (we often do the EASIEST thing that could possibly work, rather than the SIMPLEST thing that could possibly sustain)... But at this stage, we need more than comments. We need deeper clean up. Every piece of code requires such lifting in order to sustain the burden of age, even the nicest pieces... Concerning the lack of comments, I have my own opinion: I think it's a great mistake. The mental image of the zoo of classes and concepts is certainly obvious to the authors, or the experts, once sufficiently fluent. But the lack of comment or tutorial or even the lightest introduction to the concepts and key implementation choices, will for sure delay the learning curve of newbies. If you have to deal with such a bug, you're directly thrown into the crooked parts of code, and the austerity of comment is just intimidating. Where to begin the journey in MC? Let's follow my example: why does each and every MCWorkingCopy has a (nil) versionInfo? My guess when reading code is that such info could be (have been?) a proxy for rebuilding the ancestry (a cheaper memory footprint?). But then what? There no setter but nil... Is it a dead code? When the bug I'm after concerns the selectedInfo of the working copy, the lack of comment and clear intentions just let me lost in a desert. My idea would be to (double) dispatch the search of snapshot to the info, but I have no idea what could be a good candidate implementation. End of rant! Le mer. 30 déc. 2020 à 17:52, David T. Lewis a écrit : > On Wed, Dec 30, 2020 at 02:57:23PM +0000, commits at source.squeak.org wrote: > > A new version of Monticello was added to project The Inbox: > > http://source.squeak.org/inbox/Monticello-nice.734.mcz > > > > ==================== Summary ==================== > > > > Name: Monticello-nice.734 > > Author: nice > > Time: 30 December 2020, 3:57:21.60758 pm > > UUID: 863f642a-7795-4eb6-aa6b-76a5af3a8504 > > Ancestors: Monticello-mt.733 > > > > Workaround version history browser bug when 'working copy' is selected. > > > > The snapshot is searched in repositoryGroup, and logically, none is > found. > > Note that the self selectedInfo isKindOf: MCWorkingCopyAncestry, which > does not behave as a regular MCVersionInfo, it does not even answer to > versionName... > > This somehow accelerate the failure thru an ifError: [] handling, but at > the end, the selectedSnapshot is still nil which makes the 'view changes > from...' menu fail. > > > > The workaround is not very nice, it use implicit knowledge that 'working > copy' will be at top of list (index = 1). > > > > If you can think of nicer fix, please raise voice. > > > > Attached is another way to do it without relying on the list index. I have > not tested very much but it seems to be all right. > > MCVersionHistoryBrowser>>snapshotForInfo: aVersionInfo > "Answer snapshot for aVersionInfo or for the working copy if not > found" > ^ (self repositoryGroup > versionWithInfo: aVersionInfo > ifNone: [ package ]) snapshot > > > Apologies for violating MC package standards by including a method comment > ;-) > > Dave > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.oneel at pckswarms.ch Wed Dec 30 18:17:31 2020 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Wed, 30 Dec 2020 19:17:31 +0100 Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> References: <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> Message-ID: <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> Hi, You are trying to run a Linux x86-64 VM.  But that is not the CPU you have.   What you have is an ARMv8 CPU in either 32 or 64 bit mode.  Since it's in 64bit mode then.... You need a 64 bit ARMv8 VM. A recent checkout of the git repostiory git clone [https://github.com/OpenSmalltalk/opensmalltalk-vm.git](https://github.com/OpenSmalltalk/opensmalltalk-vm.git) Should work.  The last I tried was at the beginning of December and that VM works fine on my ArmV8 systems. Check it out with git clone [https://github.com/OpenSmalltalk/opensmalltalk-vm.git](https://github.com/OpenSmalltalk/opensmalltalk-vm.git) Then run ./scripts/updateSCCSVersions cd build.linux64ARMv8/[squeak.cog.spur/build](http://squeak.cog.spur/build) ./mvm and when it gets done in a few minutes you have a squeak binary and all the libraries. When it is done $ file local/squeak/squeak local/squeak/squeak: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=23893b13c1f61cd426946572ca6f5e374f3d647d, with debug_info, not stripped Should show you something similar.  The first bit before the dynamically linked, is the important bit. cheers bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.oneel at pckswarms.ch Wed Dec 30 18:20:59 2020 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Wed, 30 Dec 2020 19:20:59 +0100 Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> References: <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> Message-ID: <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> Oh I forgot. The following apt installs probably are necessary. sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev sudo apt install libevdev-dev I think that is the minimal set necessary.  Depending on your audio setup you might want. sudo apt install libpulse-dev cheers bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Dec 30 18:32:52 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 30 Dec 2020 10:32:52 -0800 Subject: [squeak-dev] The Inbox: Monticello-nice.734.mcz In-Reply-To: References: <20201230165238.GA59395@shell.msen.com> Message-ID: <7B652CC7-0978-49E8-8398-04E182BFEF04@rowledge.org> > On 2020-12-30, at 10:11 AM, Nicolas Cellier wrote: [eloquent rant elided] I refer us, as so often, to Adele's Dictum: "If it isn't documented, it doesn't exist. If it doesn't exist, what exactly did we pay you for?" Of course, part of the problem is that for a lot of things surprisingly important to us *we didn't pay anyone*. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Thesaurus: Ancient reptile with a truly extensive vocabulary From tim at rowledge.org Wed Dec 30 18:42:46 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 30 Dec 2020 10:42:46 -0800 Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> References: <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> Message-ID: <8BABFEC2-81A6-4FB9-B883-FD4ED61B50F4@rowledge.org> > On 2020-12-30, at 10:20 AM, Bruce O'Neel wrote: > > sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev > sudo apt install libevdev-dev > > > I think that is the minimal set necessary. Depending on your audio setup you might want. > > sudo apt install libpulse-dev > That's interesting; I haven't seen libgl1-mesa-dev & libgl1-mesa-glx suggested before. I've been using mesa-common-dev which I can only guess must contain a lot of similar components - though B3DAcceleratorPlugin doesn't always make, possibly connected? Also libasound2-dev might be wanted if you have an ALSA setup rather than pulse (Pi are transitioning, as would be inferred from my recent travails with pulse). I've also been loading autoconf (do I still need it?), netatalk (to make life a little simpler) and libx11-dev since I starte Pi-ing. My current line to connect to my iMac via /etc/fstab looks like - //192.168.1.65/tim /home/pi/DizietFS cifs _netdev,vers=3.0,noserverino,noperm,username=tim,password=XXXXX,uid=1000,gid=pi,iocharset=utf8,x-systemd.automount 0 0 Those parameters seem to change randomly and I have never, ever, found a decent explanation for what goes in there. One might argue that an nfs connection would be better, but after years of using one, it started to cause problems and I abandoned. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Fractured Idiom:- L'ETAT, C'EST MOE - All the world's a stooge From christoph.thiede at student.hpi.uni-potsdam.de Thu Dec 31 00:48:01 2020 From: christoph.thiede at student.hpi.uni-potsdam.de (Christoph Thiede) Date: Wed, 30 Dec 2020 18:48:01 -0600 (CST) Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <8BABFEC2-81A6-4FB9-B883-FD4ED61B50F4@rowledge.org> References: <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> <8BABFEC2-81A6-4FB9-B883-FD4ED61B50F4@rowledge.org> Message-ID: <1609375681885-0.post@n4.nabble.com> Thanks for the instructions, Bruce! I needed to install two more packages, gcc and make, but then the compilation succeeded. I posted my next problem (mprotect error) in the GitHub thread [1] - let's join the split conversation there again :-) [1] https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752803523 ----- Carpe Squeak! -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html From kksubbu.ml at gmail.com Thu Dec 31 06:48:07 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Thu, 31 Dec 2020 12:18:07 +0530 Subject: [squeak-dev] Fwd: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> References: <1609352251-e5fe5cf9bc6eae7a6a88106269547f22@pckswarms.ch> <5b2c27a3e2b64e5dbfcfd3b41b555e1f@student.hpi.uni-potsdam.de> <223637412.155972.1609341080692.JavaMail.administrator@n4.nabble.com> <1609352459-5256fcd7eb69c2aa1bfee8434efb77f3@pckswarms.ch> Message-ID: On 30/12/20 11:50 pm, Bruce O'Neel wrote: > sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev > libgl1-mesa-dev libgl1-mesa-glx libssl-dev > > sudo apt install libevdev-dev > ... I think that is the minimal set necessary. pango-dev requires cairo and mesa-dev requires mesa-glx respectively, so a minimal set of packages would be: $ sudo apt-get install uuid-dev libpango1.0-dev libgl1-mesa-dev libssl-dev libevdev-dev HTH .. Subbu From lewis at mail.msen.com Thu Dec 31 17:47:00 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Thu, 31 Dec 2020 12:47:00 -0500 Subject: [squeak-dev] [Vm-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: <20201231174700.GA6669@shell.msen.com> On Tue, Dec 22, 2020 at 02:07:30PM -0800, Vanessa Freudenberg wrote: > (dropping vm-dev) > > On Tue, Dec 22, 2020 at 1:57 PM Eliot Miranda > wrote: > > > > > On Tue, Dec 22, 2020 at 1:44 PM Vanessa Freudenberg > > wrote: > > > >> > >> I like measuring all-over performance, and not adding any extra work. > >> > >> Like, DateAndTime is pretty early in the startup list. It could remember > >> the time its startup was invoked. Another class that comes later could set > >> a LowPerformance flag if it took longer than x ms since DateAndTime was > >> initialized. > >> > >> I just tried that with ProcessorScheduler (see attachment). On Safari and > >> a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I > >> get 5 ms. So maybe if that takes longer than say 50 ms it could be > >> considered low performance? > >> > > > > Works for me. I would record and provide an accessor for ImageStartUsecs > > (a class variable in SmalltalkImage, using microseconds :-) ). Then one > > can either use isLowerPerformance or the actual time for a more "nuanced" > > view. > > > > Good idea. It also should use class vars not globals, etc. > > I didn't mean to use this as is, just to do a quick proof of concept. And I > didn't see Dave's take come through yet ... or are announcements from > squeaksource broken? > > Vanessa I'm not sure if the inbox announcement came out on email (I did not see it either), but my take on this was in System-dtl.1207.mcz in the inbox. It uses a value computed once per session on first reference, so it should have no effect on startup time. The actual logic to determine a "slow platform" is this: (Time millisecondsToRun:[ 25 benchFib ]) > 200 or: [ (Time millisecondsToRun: [ 64 benchmark ]) > 200 ] Perhaps someone with a Raspberry Pi can check and see if this is reasonable? It does indicate that SqueakJS is "slow" when running in Chrome on my Linux box, and the compiled VMs are "fast". Dave