I just tried out Nebraska (I think it might be the very first time) and noticed
a) for some reason the default port used is set to (9091 to: 9099) and that breaks the prim. If I fudge it to just us port 9091 I can get both server and client to work
b) it looks like the event x/y values passed are not offset to match any offset of the client morph. If you have the client in the default top-left location all is well.
Has anyone been actually using Nebraska? Is it sometihng to keep alive?
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Useful Latin Phrases:- Sic faciunt omnes. = Everyone is doing it.
Hi Folks
I am looking for an easy way to display the results of an Xtreams PEG parse visually for debugging/development/sanity purposes.
In the Xtreams evaluator callbacks, we can pick and choose what elements we want from an ordered collection via pragmas.
However, sometimes our grammars do not give us what we think they should.
In this case, visuallizing the parse tree (? correct term) in a graph would be helpful.
Graphviz ain't it afaikt, and I do not have the bandwidth to return to the Roassal work to accomplish this.
I did find this: https://ironcreek.net/syntaxtree/
And I am thinking I may get this to work in Seaside
So, given a PEG grammar rule...
PFStringReplaceTwoPipe <- '{{' "#replace:" PFStringReplaceFlow{'|'} PFStringReplaceFlow{'|'} PFStringReplaceFlow+ '}}'
and a test case...
input := '{{#replace:Foo|Foo | Bar}}'.
output := parser parse: 'PFStringReplaceTwoPipe' stream: input reading actor: actor.
self assert: (output = 'Foo').
In the "callback" for the grammar rule...
PFStringReplaceTwoPipe: anOrderedCollection
<action: 'PFStringReplaceTwoPipe' >
anOrderedCollection inspect.
^anOrderedCollection
I get a Collection that (Array in this case) that looks like this...
{{{ . '#replace:' . an OrderedCollection($F $o $o) . an OrderedCollection($F $o $o Character space) . an OrderedCollection(Character space $B $a $r) . }}}
Which I want to express in labelled bracket notation like this ....[S [NP jsSyntaxTree][VP [V creates][NP nice syntax trees ->1]]]... that I can feed to a Seaside app...
Ideas, suggestions much appreciated...I am guessing that there is a tree traversal algorithm that a good programmer would know that would do the job...
heck...I can just feed the Collection to Seaside and have it do the traversal on the output to create that notation that , hopefully, that JS thing can display.
thx in advance.
cordially
t
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1545.mcz
==================== Summary ====================
Name: Kernel-jar.1545
Author: jar
Time: 28 December 2023, 7:35:53.222247 pm
UUID: 467e9c01-0094-c141-9980-1703a639d5a5
Ancestors: Kernel-mt.1544
fix the "stepOver bug" (Cannot #stepOver '^2' in example '[^2] ensure: []')
This is a more conceptual solution and replaces the previous patch in Kernel-jar.1503 which departed from exact mimicking the VM behavior (thanks to Christoph for pointing this out).
Detailed description:
The whole issue emerged probably in 2012 when #aboutToReturn:through: started using the `firstUnwindContext` argument, I guess as an optimization, and forced a starting point to searching for unwind contexts in the resumtion logic (#resumeEvaluating:through:) - which was inconsistent with inserting the ensure guard context **before** this starting point during simulation (by #runUntilErrorOrReturnFrom: called by stepping methods). This resulted in erroneous skipping over the inserted guard ensure context during stepOver simulation and the unexpected behavior.
The idea is for the resumption logic (#resumeEvaluating:through:) to recognize a simulated execution and search for a potential guard (i.e. #ensure:) context inserted during the simulation. I suggest using a `simulationFlag` tempVar in #ensure: which would be set in #return:from:, i.e. if, and only if, the `firstUnwindContext` is supplied in simulaton (i.e. potentially dangerous). When the resumption logic recognizes a simulation supplied `firstUnwindContext` it recomputes the real first unwind context at the moment and proceeds as expected.
=============== Diff against Kernel-mt.1544 ===============
Item was changed:
----- Method: BlockClosure>>ensure: (in category 'exceptions') -----
ensure: aBlock
"Evaluate a termination block after evaluating the receiver, regardless of
whether the receiver's evaluation completes. N.B. This method is *not*
implemented as a primitive. Primitive 198 always fails. The VM uses prim
198 in a context's method as the mark for an ensure:/ifCurtailed: activation."
+ | complete returnValue simulationFlag |
- | complete returnValue |
<primitive: 198>
returnValue := self valueNoContextSwitch.
complete ifNil:[
complete := true.
aBlock value.
].
^ returnValue!
Item was changed:
----- Method: BlockClosure>>ifCurtailed: (in category 'exceptions') -----
ifCurtailed: aBlock
"Evaluate the receiver with an abnormal termination action.
Evaluate aBlock only if execution is unwound during execution
of the receiver. If execution of the receiver finishes normally do
not evaluate aBlock. N.B. This method is *not* implemented as a
primitive. Primitive 198 always fails. The VM uses prim 198 in a
context's method as the mark for an ensure:/ifCurtailed: activation."
+ | complete result simulationFlag |
- | complete result |
<primitive: 198>
result := self valueNoContextSwitch.
complete := true.
^result!
Item was added:
+ ----- Method: Context>>isSimulationFlagSet (in category 'controlling') -----
+ isSimulationFlagSet
+
+ ^self numTemps >= 3 and: [(self tempAt: 3) notNil]!
Item was changed:
----- Method: Context>>resumeEvaluating: (in category 'controlling') -----
resumeEvaluating: aBlock
"Unwind thisContext to self and resume with value as result of last send.
Execute unwind blocks when unwinding.
ASSUMES self is a sender of thisContext"
+ ^self resumeEvaluating: aBlock through: thisContext!
- ^self resumeEvaluating: aBlock through: nil!
Item was changed:
----- Method: Context>>resumeEvaluating:through: (in category 'controlling') -----
+ resumeEvaluating: aBlock through: aContext
- resumeEvaluating: aBlock through: firstUnwindCtxtOrNil
"Unwind thisContext to self and resume with value as result of last send.
Execute unwind blocks when unwinding.
ASSUMES self is a sender of thisContext."
self isDead ifTrue: [self cannotReturn: aBlock value to: self].
+ (aContext isSimulationFlagSet ifTrue: [thisContext] ifFalse: [aContext])
+ unwindTo: self safely: false.
- (firstUnwindCtxtOrNil ifNil: thisContext) unwindTo: self safely: false.
thisContext terminateTo: self.
^aBlock value!
Item was changed:
----- Method: Context>>return:from: (in category 'instruction decoding') -----
return: value from: aSender
"For simulation. Roll back self to aSender and return value from it. Execute any unwind blocks on the way. ASSUMES aSender is a sender of self"
| newTop |
aSender isDead ifTrue:
[^self send: #cannotReturn: to: self with: {value}].
newTop := aSender sender.
(self findNextUnwindContextUpTo: newTop) ifNotNil:
+ [:firstUnwindContext | firstUnwindContext tempAt: 3 put: true. "simulation flag"
+ ^self send: #aboutToReturn:through: to: self with: {value. firstUnwindContext}].
- "Send #aboutToReturn:through: with nil as the second argument to avoid this bug:
- Cannot #stepOver '^2' in example '[^2] ensure: []'.
- See http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-June/220975.html"
- [^self send: #aboutToReturn:through: to: self with: {value. nil}].
self releaseTo: newTop.
newTop ifNotNil: [newTop push: value].
^newTop!
... and it can not only run the very oldest Squeak images, but even update
(!) the latest trunk image.
I started working on it in Nov 2013, and the first public release was on
20th December 2013.
That one could really only run Dan's old "mini" image. We've come a
long way. SqueakJS certainly isn't the fastest Squeak VM. But it is the
most compatible one, and arguably the one easiest to understand and debug.
You can try it yourself at https://squeak.js.org
Either click one of the demos (like Etoys or Scratch), or drag-and-drop
your favorite image into the "launcher" page.
Recently I've been working on resurrecting "old" Croquet from 2005 – which
included creating a proper FFI plugin to relay OpenGL calls, plus
writing an OpenGL emulator mapping those functions to WebGL:
Try it: https://codefrau.github.io/jasmine/
Code: https://github.com/codefrau/jasmine
This is obviously work in progress, a lot of the rendering is not working
yet, and I haven't even started on the networking emulation. But a lot is
also working – like you can right-click in any of the teapot morphs to move
around, and Tweak is alive too.
Contributions to both core SqueakJS and this Croquet project are very
welcome! Or support some other projects based on SqueakJS, like Craig
Latta's https://caffeine.js.org or Erik Stel's https://codeparadise.nl/
(using Pharo).
Happy holidays everyone!
Vanessa
[image: image.png]
Christoph Thiede uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ct.1441.mcz
==================== Summary ====================
Name: System-ct.1441
Author: ct
Time: 28 December 2023, 6:14:35.822302 pm
UUID: 6815f755-34db-064a-a120-bf0266234c98
Ancestors: System-ct.1440
Adds Leon Matthes (LM) to the authors table.
=============== Diff against System-ct.1440 ===============
Item was changed:
----- Method: SystemNavigation class>>privateAuthorsRaw (in category 'class initialization') -----
(excessive size, no diff calculated)
Item was changed:
(PackageInfo named: 'System') postscript: '"In Process, threadId/threadAffinity have been around for a long time."
Smalltalk processHasThreadAffinityInstVar: true.
"Squeak 6.0 and above have #scaleFactor support in image."
+ Smalltalk upscaleDisplayOnHighDPI: false.
+
+ SystemNavigation initializeAuthors. "Adds Leon Matthes (LM)"'!
- Smalltalk upscaleDisplayOnHighDPI: false.'!
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.2151.mcz
==================== Summary ====================
Name: Morphic-ct.2151
Author: ct
Time: 26 December 2023, 6:23:47.620645 pm
UUID: ae3abd13-f180-f842-bce3-f4fee6a33518
Ancestors: Morphic-ct.2150
Fixes data-streaming of hands when the stream does not have an associated project.
=============== Diff against Morphic-ct.2150 ===============
Item was changed:
----- Method: HandMorph>>objectForDataStream: (in category 'objects from disk') -----
objectForDataStream: refStrm
| dp |
"I am about to be written on an object file. Write a path to me in the other system instead."
+ refStrm project ifNotNil: [:project |
+ (project world hands includes: self) ifTrue: [
+ ^ self]. "owned by the project"].
- (refStrm project world hands includes: self) ifTrue: [
- ^ self]. "owned by the project"
dp := DiskProxy global: #World selector: #primaryHand args: #().
refStrm replace: self with: dp.
^ dp
"Note, when this file is loaded in an MVC project, this will return nil. The MenuItemMorph that has this in a field will have that item not work. Maybe warn the user at load time?"!