SlideShare a Scribd company logo
Portability in Seaside
   NYC Smalltalk
 December 10, 2009
Julian Fitzell


Co-creator of Seaside
Independent consultant
Seaside Portability
694 classes
6844 methods
Platforms
Seaside Portability
External Interface Support
                  XML Support enables XML–Smalltalk object
                  mapping, includes a server interface via XML
                  request handlers and reading of remote resources
 B disk           via TCP sockets using HTTP requests
                  OLE Support enables an application to use OLE
                  clients and custom control services.
                  Domino Connection allows an application to
                  retrieve and work with Domino documents as well
                  as access Notes mail system.




                    Download a risk-free trial copy:
                www.instantiations.com/VAST/download




m/VAST
                                                   Build Quality Software

 l other trademarks mentioned are the property of their respective owners.
Portability



Photo: Alexia´s, flickr.com
Goals

Create consistent experience
Minimize platform changes
Isolate platform changes
Ease code updates (in both directions!)
Namespacing:

  WAObject
 #seasideUrl
Syntax



Photo: pipp, sxc.hu
n o
  Underscore
  Assignments

      a_1
      b←2
n o
  Brace Arrays

      { 1. 2. 1 + 2 }
n o
Array Constructors

 #[ ‘string’, 123, Object new ]
n o
  Byte Arrays

      #[ 1 2 3 ]
n o
 Variable Bindings

   {Smalltalk.Object}
n o
 Selection Blocks

   {:i | i.is.permanent}
o k   Pragma

  <javascript: 1.5>
ANSI



       Photo: njd89, sxc.hu
ANSI Protocols
Object, Character, Boolean, nil, etc.
Block
Exception
Numeric
Collection
Date and Time
Stream
Exceptions



Photo: ingythewingy, flickr.com
Exception Protocols

 #signal, #signal:, ...
 #on:do:, #ensure:, #ifCurtailed:
 #defaultAction, #isResumable
 #pass, #outer, #retry, #resume
 Warning, Error, Notification, ZeroDivide, ...
n o
[ ... ]
 on: Error
 do: [ ... ]
y e s
[ ... ]
 on: Error
 do: [ |err| ... ]
n o
 #defaultAction
       +
 non-resumable
   exceptions
“The exact behavior and
  result of this method is
implementation defined.”
Unless the exception is resumable,
“the action taken upon completion
  of the #defaultAction method is
      implementation defined”
n o
MyException signal
Collections




Photo: ijsendoorn,sxc.hu
Collection Protocols

 Array, Set, OrderedCollection, Interval, ...
 #do:, #collect:, #select:, #reject:, #detect:, ...
 #includes:, #isEmpty, anySatisfy:, ...
 #asSet, #asOrderedCollection, ...
 #at:put:, #at:ifAbsent:, #removeKey:, ...
n o
 Collection>>#=
n o
 #withIndexDo:
y e s
 #keysAndValuesDo:
n o
  #pairsDo:
y e s
1
    to: aCollection size
    by: 2 do: [ :i | ... ]
Strings




Photo: Lynne Lancaster, sxc.hu
n o
 Symbol is a String
n o
      #match:
n o
 Object>>#asString
n o
 #displayString
n o
 Non-ASCII Strings
Streams




Photo: Lynne Lancaster, sxc.hu
Stream Protocols

ReadStream, WriteStream,
ReadWriteStream
#close, #isEmpty, #position, #reset, ...
#do:, #next, #peek, #upTo:, ...
#cr, #nextPut:, #nextPutAll:, ...
n o
 #next, at the end
   of a stream
y e s
 Check #atEnd first
n o
  #position
  #position:
Times
                        and
                      Dates




Photo: inya, sxc.hu
y e s
  DateAndTime
       +
    Duration
n o
  TimeStamp
k in d a

           Time
s o r ta

           Date
Cross-Platform Behaviour


        Consistent
        Conflicting
         Missing
Unit
               Slime       Grease
 Tests


Consistent    Conflicting   Missing

  Use it!      Avoid it!   Add it!
 (Test it!)
Unit Tests




Photo: shadowkill, sxc.hu
Done?
Unit Tests



150
                                                   131




                        44            44

          20

  0
      Seaside 2.5   Seaside 2.6   Seaside 2.7   Seaside 2.8   Seaside 3.0
Unit Tests
1,200




                     1,115




1,050
Slime
  Lint Tests
for Seaside




               Photo: A Syed, sxc.hu
Rules to detect
Portability Issues
a _ 1.

b := { a + 2. 3 }.

c pairsDo: [ :a :b | a raisedTo: b ]
a _ 1.

b := { a + 2. 3 }.

c pairsDo: [ :a :b | a raisedTo: b ]
a _ 1.

b := { a + 2. 3 }.

c pairsDo: [ :a :b | a raisedTo: b ]
a _ 1.

b := { a + 2. 3 }.

c pairsDo: [ :a :b | a raisedTo: b ]
Rules to detect
 Seaside Bugs
html div
  with: ‘Hello World’;
  id: ‘message’.

html updater
  id: ‘message’;
  callback: [ :r | html text: ‘Bye’ ]
html div
  with: ‘Hello World’;
  id: ‘message’.

html updater
  id: ‘message’;
  callback: [ :r | html text: ‘Bye’ ]
html div
  with: ‘Hello World’;
  id: ‘message’.

html updater
  id: ‘message’;
  callback: [ :r | html text: ‘Bye’ ]
Grease
   Platform
Compatibility
      Layer




                Photo: DarkSide, sxc.hu
Pragmatic
Minimal
Unit Tested
ANSI++
Grease Features

Consistent object initialization
Consistent exception signalling
Common convenience methods
Platform-dependent behaviour
Unit tests
y e s
GRObject class>>#new
	 ^ self basicNew initialize
y e s
GRError class>>#signal

 “VW implementation”
	 ^ self raiseSignal
y e s
Object>>#greaseString

 “Squeak implementation”
	 ^ self asString
y e s#trimLeft
    #upToLast:
       #ifNil:
   #isCollection
y e s
GRPlatform current
	 base64Decode: 'aGk='.
GRPlatform current
	 addToStartupList: SomeClass.
GRPlatform current
	 openDebuggerOn: anException.
Packaging

                                ↑

                                SUnit




Photo: Tory Byrne, www.sxc.hu
73 Packages
Common

Seaside-Core
Platform-Specific

Seaside-Pharo-Core
Test

   Seaside-Tests-Core
Seaside-Tests-Pharo-Core
BON US!



  Find incorrect layer
     dependencies
Monticello
Monticello

Declarative modeling
Distributed repositories
Optimistic code merging
Vendor round-tripping
Monticello

☹   Slow with large repositories
☹   Inconvenient with many packages
☹   Awkward when renaming and moving
    between packages
Future?
Metacello

Declare and load package configurations
Express dependencies on other projects
Easily upgrade to newest versions
Mason


Automate build process
Run tests for each package + dependencies
Monticello2

Faster
Per-method version history
Better interface for projects with many
packages
Easier to port? (uses Grease)
book.seaside.st
Summary
Write tests!
Avoid extended syntax
Use ANSI where possible
Package out platform-specific code
Slime/Lint for what you can’t use, Grease for
what you can
www.seaside.st
  blog.fitzell.ca
jfitzell@gmail.com

More Related Content

PDF
Loophole: Timing Attacks on Shared Event Loops in Chrome
PPTX
Introduction to Rust language programming
PDF
Rust Intro @ Roma Rust meetup
PDF
stackconf 2020 | Speeding up Linux disk encryption by Ignat Korchagin
PPTX
Combating The Ransomworm
PDF
Dynamo: Not Just For Datastores
PDF
Kernel Recipes 2014 - Quick state of the art of clang
PDF
Locker: distributed consistent locking
Loophole: Timing Attacks on Shared Event Loops in Chrome
Introduction to Rust language programming
Rust Intro @ Roma Rust meetup
stackconf 2020 | Speeding up Linux disk encryption by Ignat Korchagin
Combating The Ransomworm
Dynamo: Not Just For Datastores
Kernel Recipes 2014 - Quick state of the art of clang
Locker: distributed consistent locking

What's hot (18)

PDF
Distributed Consensus A.K.A. "What do we eat for lunch?"
PDF
Automatic Sound Signals Quality Estimation Integration
PDF
An introduction to Rust: the modern programming language to develop safe and ...
PDF
不深不淺,帶你認識 LLVM (Found LLVM in your life)
PPT
securing_syslog_onFreeBSD
PDF
From Zero to Application Delivery with NixOS
PDF
Kubernetes
PDF
Kubernetes Scheduler deep dive
PDF
Embedded Rust – Rust on IoT devices
PDF
Natural Language Toolkit (NLTK), Basics
PDF
[COSCUP 2021] A trip about how I contribute to LLVM
PPTX
Java Hates Linux. Deal With It.
PPSX
Bleeding secrets
PPTX
Programming The Arduino Due in Rust
PDF
Functional Operations (Functional Programming at Comcast Labs Connect)
PDF
Drone CI/CD 自動化測試及部署
KEY
NLTK in 20 minutes
PDF
Intro to Rust from Applicative / NY Meetup
Distributed Consensus A.K.A. "What do we eat for lunch?"
Automatic Sound Signals Quality Estimation Integration
An introduction to Rust: the modern programming language to develop safe and ...
不深不淺,帶你認識 LLVM (Found LLVM in your life)
securing_syslog_onFreeBSD
From Zero to Application Delivery with NixOS
Kubernetes
Kubernetes Scheduler deep dive
Embedded Rust – Rust on IoT devices
Natural Language Toolkit (NLTK), Basics
[COSCUP 2021] A trip about how I contribute to LLVM
Java Hates Linux. Deal With It.
Bleeding secrets
Programming The Arduino Due in Rust
Functional Operations (Functional Programming at Comcast Labs Connect)
Drone CI/CD 自動化測試及部署
NLTK in 20 minutes
Intro to Rust from Applicative / NY Meetup
Ad

Viewers also liked (17)

PDF
Seaside - Why should you care? (Dynamic Stockholm 2010)
PDF
Oração do arcanjo miguel para limpeza espiritual em 21 dias
PDF
ChannelStream: The challenges of continuously delivering
PDF
Real-time Collaborative Development (Jazoon 2011)
DOC
Hunt Iinternational Training & Speaking Catalog --- January 2013
PDF
Ignorance is not Bliss
PDF
At the Extremities of Extreme (SPA 2011)
PDF
Appl Phys Lett 96 211103
PDF
Orações poderosas
PDF
At the Extremities of Extreme (Agile North 2011)
DOC
Hunt International Training & Speaking Overview --- January 2013
PDF
Seaside - Why should you care? (OSDC.fr 2010)
PDF
Permenkumham 28 2014 orta kanwil kemenkumham sorted
PPT
The Literary Works Of Alice Walker
PPT
IEEE LEOS Optical MEMS
PDF
Comsol2009 Paper
PDF
Slide presentasi pmk 249 2011
Seaside - Why should you care? (Dynamic Stockholm 2010)
Oração do arcanjo miguel para limpeza espiritual em 21 dias
ChannelStream: The challenges of continuously delivering
Real-time Collaborative Development (Jazoon 2011)
Hunt Iinternational Training & Speaking Catalog --- January 2013
Ignorance is not Bliss
At the Extremities of Extreme (SPA 2011)
Appl Phys Lett 96 211103
Orações poderosas
At the Extremities of Extreme (Agile North 2011)
Hunt International Training & Speaking Overview --- January 2013
Seaside - Why should you care? (OSDC.fr 2010)
Permenkumham 28 2014 orta kanwil kemenkumham sorted
The Literary Works Of Alice Walker
IEEE LEOS Optical MEMS
Comsol2009 Paper
Slide presentasi pmk 249 2011
Ad

Similar to Seaside Portability (20)

PDF
Agile Seaside
PDF
Seaside — Agile Software Development
PDF
The Rust Programming Language 2nd Edition Steve Klabnik
PDF
The Rust Programming Language 2nd Edition Steve Klabnik
PDF
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
PPTX
Js tacktalk team dev js testing performance
PDF
The Rust Programming Language 2nd Edition Second Converted Steve Klabnik Caro...
PDF
XML-Free Programming : Java Server and Client Development without &lt;>
PDF
IJTC%202009%20JRuby
PDF
IJTC%202009%20JRuby
PDF
The Rust Programming Language Second Edition 2 Converted Steve Klabnik
PDF
Pharo 2.0: An Exciting Milestone
PDF
Lessons learned from a large scale OSGi web app
PDF
ooc - OSDC 2010 - Amos Wenger
PDF
Haxe: What Makes It Cool
PPTX
Integreation
KEY
IronRuby for the .NET Developer
PDF
Introduction to OSGi
KEY
Pharo, an innovative and open-source Smalltalk
KEY
Conole vilnius 3_nov
Agile Seaside
Seaside — Agile Software Development
The Rust Programming Language 2nd Edition Steve Klabnik
The Rust Programming Language 2nd Edition Steve Klabnik
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Js tacktalk team dev js testing performance
The Rust Programming Language 2nd Edition Second Converted Steve Klabnik Caro...
XML-Free Programming : Java Server and Client Development without &lt;>
IJTC%202009%20JRuby
IJTC%202009%20JRuby
The Rust Programming Language Second Edition 2 Converted Steve Klabnik
Pharo 2.0: An Exciting Milestone
Lessons learned from a large scale OSGi web app
ooc - OSDC 2010 - Amos Wenger
Haxe: What Makes It Cool
Integreation
IronRuby for the .NET Developer
Introduction to OSGi
Pharo, an innovative and open-source Smalltalk
Conole vilnius 3_nov

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
TLE Review Electricity (Electricity).pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Mushroom cultivation and it's methods.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
A Presentation on Touch Screen Technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Tartificialntelligence_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Hindi spoken digit analysis for native and non-native speakers
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf
1 - Historical Antecedents, Social Consideration.pdf
1. Introduction to Computer Programming.pptx
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Chapter 5: Probability Theory and Statistics
OMC Textile Division Presentation 2021.pptx
NewMind AI Weekly Chronicles - August'25-Week II
TLE Review Electricity (Electricity).pptx
A comparative analysis of optical character recognition models for extracting...
Mushroom cultivation and it's methods.pdf
A comparative study of natural language inference in Swahili using monolingua...
A Presentation on Touch Screen Technology
Programs and apps: productivity, graphics, security and other tools
Tartificialntelligence_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf

Seaside Portability