SlideShare a Scribd company logo
1 of 36
Download to read offline
F-Script: Smalltalk Scripting for Mac OS X




              Philippe Mougin
               pmougin@acm.org




            ESUG 2002 - DOUAI
F-Script in the Mac OS X Architecture




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
F-Script in the Mac OS X Architecture




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!




                      Mac OS X is a UNIX operating
                      system which is implemented
                      (mostly) in C and which offers
                      C-based APIs.
F-Script in the Mac OS X Architecture


                                Apple provides three high-level
                                environments (tools, APIs) for
                                programmers.




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
F-Script in the Mac OS X Architecture
                                              The main goal of Carbon
                                              is to provide toolbox-like
                                              APIs (i.e. old Mac OS
                                              APIs) for porting existing
                                              Mac OS applications, or
                                              creating new ones.




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
F-Script in the Mac OS X Architecture
                                              The Java environment supports
                                              both standards, cross-platform,
                                              Java frameworks and specific
                                              Mac OS X Java APIs. In both
                                              cases, the Java environment
                                              provides advanced integration
                                              with the underlying Mac OS X
                                              layers.




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
F-Script in the Mac OS X Architecture
                                              Cocoa provides a lightweight
                                              object-oriented extension of the C
                                              language, called Objective-C. It
                                              comes with various frameworks
                                              and tools.!
                                              Cocoa is strongly influenced by
                                              Smalltalk although it is based on
                                              the compile-link-run model of C.!




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
F-Script in the Mac OS X Architecture
                                              F-Script adds an interactive
                                              object-oriented environment to
                                              Cocoa. It lets you interactively
                                              manipulate Cocoa-based
                                              objects. It also lets you write
                                              scripts.




                                                                                 F-Script




Quartz, OpenGL, multimedia, printing,
event handling, low-level window
management, etc.


               !
Strings, run loops, collections, processes,
resources, etc.

Multitasking, virtual memory, SMP, file
systems, device drivers, networking,
threading packages, etc.!
Lightweight interactive & scripting layer

 •    F-Script does not replace Mac OS X development tools, frameworks
      and object run-time: developers continue to use existing tools & the
      Objective-C language to develop new classes.

 •    F-Script adds a lightweight interactive and scripting layer to the
      Cocoa stack.

 •    Emphasis is on interactive high-level and user-friendly object
      manipulation rather than class development.
Lightweight interactive & scripting layer
   Emphasis is on interactive high-level and user-friendly object
    manipulation rather than class development.
Lightweight interactive & scripting layer
   Emphasis is on interactive high-level and user-friendly object
    manipulation rather than class development.




   myObject is now registered in the Mac OS X distributed object
   system, under the public name ‘foo’. Other applications can
   connect to it and use it.
Lightweight interactive & scripting layer
   Emphasis is on interactive high-level and user-friendly object
    manipulation rather than class development.




    Block inspector allowing in-place editing of block code.
Lightweight interactive & scripting layer
   Emphasis is on interactive high-level and user-friendly object
    manipulation rather than class development.




    User-friendly access to core Mac OS X technologies (here: drawing a blue circle with Quartz).
High level object manipulation
   Emphasis is on interactive high-level and user-friendly object
    manipulation rather than class development.



   One of the main weakness of object technology: high-level
   manipulation of data.
Weakness of object technology


   Years ago relational supporters argued that object-oriented
    databases were a twenty-year step backward.


   They were right !!!


   Sure, object technology provides a high-level modeling approach.
    But think about how low-level, object technology is compared to
    relational algebra when it comes to manipulating whole sets of
    data.


   This is a big challenge!
Weakness of object technology
  This criticism prompted a major enhancement of object
   technologies: the development of object query languages.


  This development provided a solution to the lack of high-level
   features found in traditional object languages.


  So far, results are mixed.


  Object query languages have not yet made their way into
   mainstream object languages.


  In their most recent incarnations, object query languages adopt
   quite a low profile. They are merely used as an interface to an
   underlying database, and not as a general means of manipulating
   objects (e.g. JDO Query Language, EJB Query Language, Gemstone
   etc.). “The query is executed in the databse, not in the VM”.
High-level object manipulation

  We want something with the power of relational algebra built into
   our programming language!
  Array programming principles (cf. Ken Iverson’s APL) to the rescue.


 Smalltalk extended into an object query language allowing synthetic
 expression of object manipulations.

   A new message send paradigm. The classic Smalltalk message construct
    becomes a special case of a more general messaging system.
   A small kernel of high-level operators for object collection manipulation:
    Compression, Reduction, Join, Transposition, etc. (implemented as
    methods).
   Aim was to minimize extensions needed to include query language level
    capacities in Smalltalk. From a technical point of view, can easily be
    adapted to existing Smalltalk implementations.
“F-Script lets one easily do pretty complex data mining to drill down through samples of
thousands of galaxies distributed throughout a very large parameter space.”           !
                                                                                               !
              Prof. Roberto Abraham - Dept. of Astronomy & Astrophysics - University of Toronto.
F-Script Architecture

            Graphical Environment: shell, object browser, etc.



              Little Smalltalk Interpreter (+ Array Extensions)



                   Object/Array Programming Engine




                              Object Model!
F-Script Object Model & Frameworks

  F-Script is based on Smalltalk syntax and concepts, but instead of
   using Smalltalk’s object model and common Smalltalk frameworks, it
   use the Cocoa object model and frameworks.

  Thanks to the integration with Cocoa, F-Script gains many advanced
   features, which can be directly accessed by the F-Script user, "for
   free":

   •    Sophisticated GUI framework (Windows, Views, Event Model, Text Layout, etc.),
   •    Unicode support,
   •    Access to the Quartz features (Mac OS X graphic subsystem),
   •    Distributed Objects,
   •    Object Persistence,
   •    Integration with Interface Builder,
   •    Networking,
   •    File System interaction,
   •    UNIX abstractions: tasks, pipes, etc,
   •    Collection classes,
   •    Etc.
F-Script/Cocoa Object Model Example

    Derived from the Smalltalk object model.

    Smalltalk’s keyword syntax.

    Class and meta-classes are objects.

    Single inheritance. Support for protocols.

    Fully dynamic. Static typing optional.

    Flexible: the notion of “category” lets you add
     methods to classes you have not produced.
     The “poseAsClass:” method lets you replace a
     class by another one a runtime, etc.

    isKindOfClass:, respondsToSelector:,
     performSelector:, doesNotRecognizeSelector:,
     etc.
F-Script is embeddable

  In addition to a stand-alone application, F-Script comes as an
   embeddable Mac OS X framework.

  This means you can use an F-Script interpreter (or several ones) in
   your own applications.

  F-Script components are accessed through an Objective-C API.
F-Script is embeddable




  Developing with Project Builder and the F-Script framework
Object browser: browsing the workspace
Object browser asks for arguments
Browsing classes and meta-classes
On-Screen selection of widgets
Customizing the object browser
The key-value browser (by Joerg Garbers)
Using Mac OS X frameworks from F-Script




[:title | |window conversionScript form button line|
window := NSWindow alloc initWithContentRect:(125<>513 extent:400<>200)
                   styleMask:NSTitledWindowMask+NSClosableWindowMask+NSMiniaturizableWindowMask+NSResizableWindowMask
                   backing:NSBackingStoreBuffered
                   defer:true.

conversionScript := [(form cellAtIndex:2) setStringValue:(form cellAtIndex:0)
floatValue * (form cellAtIndex:1) floatValue. form selectTextAtIndex:0].

form := (NSForm alloc initWithFrame:(60<>90 extent:320<>85)) autorelease.
form addEntry:@{'Exchange Rate per $1', 'Dollars to Convert', 'Amount in Other Currency'}.
form setAutosizesCells:true; setTarget:conversionScript; setAction:#value.

button := (NSButton alloc initWithFrame:(250<>20 extent:90<>30)) autorelease.
button setBezelStyle:NSRoundedBezelStyle; setTitle:'Convert'; setKeyEquivalent:'r'.
button setTarget:conversionScript; setAction:#value.

line := (NSBox alloc initWithFrame:(15<>70 extent:370<>2)) autorelease.

window contentView addSubview:@{form, button, line}.
window setTitle:title; orderFront:nil.
]
Interface Builder and F-Script
F-Script Anywhere

  F-Script Anywhere, developed by Nicholas Riley, allows you to inject a
   complete F-Script environment into any running Cocoa application -
   even third-party applications!
F-Script Anywhere inside Chess
Download & Resources

    Binaries for Mac OS X
    Source code
    User guide with complete reference documentation
    Articles published by O’Reilly Network
    Paper from APL 2000, documenting the high-level extensions
    Additional tools, including F-Script Anywhere
    Mailing List




                 www.fscript.org
Thanks !
See you at
 ESUG 2003 !

More Related Content

Viewers also liked

Smalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsSmalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsESUG
 
Smartcard-Login into Gemstone
Smartcard-Login into GemstoneSmartcard-Login into Gemstone
Smartcard-Login into GemstoneESUG
 
Visualizing Dynamic Metrics with Profiling Blueprints
Visualizing Dynamic Metrics with Profiling BlueprintsVisualizing Dynamic Metrics with Profiling Blueprints
Visualizing Dynamic Metrics with Profiling BlueprintsESUG
 
Pharo
PharoPharo
PharoESUG
 
Seaside
SeasideSeaside
SeasideESUG
 
Smalltalk in Large-scale Enterprise Architectures
Smalltalk in Large-scale Enterprise ArchitecturesSmalltalk in Large-scale Enterprise Architectures
Smalltalk in Large-scale Enterprise ArchitecturesESUG
 
Building Ruby in Smalltalk
Building Ruby in SmalltalkBuilding Ruby in Smalltalk
Building Ruby in SmalltalkESUG
 
Internet application development using a meta-repository
Internet application development using a meta-repositoryInternet application development using a meta-repository
Internet application development using a meta-repositoryESUG
 

Viewers also liked (8)

Smalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsSmalltalk in Enterprise Applications
Smalltalk in Enterprise Applications
 
Smartcard-Login into Gemstone
Smartcard-Login into GemstoneSmartcard-Login into Gemstone
Smartcard-Login into Gemstone
 
Visualizing Dynamic Metrics with Profiling Blueprints
Visualizing Dynamic Metrics with Profiling BlueprintsVisualizing Dynamic Metrics with Profiling Blueprints
Visualizing Dynamic Metrics with Profiling Blueprints
 
Pharo
PharoPharo
Pharo
 
Seaside
SeasideSeaside
Seaside
 
Smalltalk in Large-scale Enterprise Architectures
Smalltalk in Large-scale Enterprise ArchitecturesSmalltalk in Large-scale Enterprise Architectures
Smalltalk in Large-scale Enterprise Architectures
 
Building Ruby in Smalltalk
Building Ruby in SmalltalkBuilding Ruby in Smalltalk
Building Ruby in Smalltalk
 
Internet application development using a meta-repository
Internet application development using a meta-repositoryInternet application development using a meta-repository
Internet application development using a meta-repository
 

Similar to F-Script

Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In MalaysiaGen Kanai
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaPrageeth Sandakalum
 
Simon Barker CV 20160926
Simon Barker CV 20160926Simon Barker CV 20160926
Simon Barker CV 20160926Simon Barker
 
Simon Barker CV 20151116
Simon Barker CV 20151116Simon Barker CV 20151116
Simon Barker CV 20151116Simon Barker
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016Vaidheswaran CS
 
WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014Minko3D
 
Silverlight
SilverlightSilverlight
Silverlightvishakpb
 
dan_labrecque_web_resume
dan_labrecque_web_resumedan_labrecque_web_resume
dan_labrecque_web_resumeDan Labrecque
 
Apache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkApache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkTomislav Pokrajcic
 
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#Shiraz LUG
 
Introduction to programming world
Introduction to programming worldIntroduction to programming world
Introduction to programming worldJaskaran Singh
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamDataWorks Summit
 
Paris Android LiveCode - Creating cross-platform 3D apps with Minko
Paris Android LiveCode - Creating cross-platform 3D apps with MinkoParis Android LiveCode - Creating cross-platform 3D apps with Minko
Paris Android LiveCode - Creating cross-platform 3D apps with MinkoMinko3D
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
Srinivasan resume updated
Srinivasan resume updatedSrinivasan resume updated
Srinivasan resume updatedSrinivasan V N
 

Similar to F-Script (20)

Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In Malaysia
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
 
Simon Barker CV 20160926
Simon Barker CV 20160926Simon Barker CV 20160926
Simon Barker CV 20160926
 
Simon Barker CV 20151116
Simon Barker CV 20151116Simon Barker CV 20151116
Simon Barker CV 20151116
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016
 
Os Rego
Os RegoOs Rego
Os Rego
 
WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014
 
Silverlight
SilverlightSilverlight
Silverlight
 
dan_labrecque_web_resume
dan_labrecque_web_resumedan_labrecque_web_resume
dan_labrecque_web_resume
 
.net framework
.net framework.net framework
.net framework
 
Apache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI frameworkApache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI framework
 
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#
برنامه نویسی مستقل از پلتفرم با استفاده از .NET Core و C#
 
Introduction to programming world
Introduction to programming worldIntroduction to programming world
Introduction to programming world
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache Beam
 
Paris Android LiveCode - Creating cross-platform 3D apps with Minko
Paris Android LiveCode - Creating cross-platform 3D apps with MinkoParis Android LiveCode - Creating cross-platform 3D apps with Minko
Paris Android LiveCode - Creating cross-platform 3D apps with Minko
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Srinivasan resume updated
Srinivasan resume updatedSrinivasan resume updated
Srinivasan resume updated
 
Smalltalk and Business
Smalltalk and BusinessSmalltalk and Business
Smalltalk and Business
 
Chapter1
Chapter1Chapter1
Chapter1
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

F-Script

  • 1. F-Script: Smalltalk Scripting for Mac OS X Philippe Mougin pmougin@acm.org ESUG 2002 - DOUAI
  • 2. F-Script in the Mac OS X Architecture Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 3. F-Script in the Mac OS X Architecture Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.! Mac OS X is a UNIX operating system which is implemented (mostly) in C and which offers C-based APIs.
  • 4. F-Script in the Mac OS X Architecture Apple provides three high-level environments (tools, APIs) for programmers. Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 5. F-Script in the Mac OS X Architecture The main goal of Carbon is to provide toolbox-like APIs (i.e. old Mac OS APIs) for porting existing Mac OS applications, or creating new ones. Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 6. F-Script in the Mac OS X Architecture The Java environment supports both standards, cross-platform, Java frameworks and specific Mac OS X Java APIs. In both cases, the Java environment provides advanced integration with the underlying Mac OS X layers. Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 7. F-Script in the Mac OS X Architecture Cocoa provides a lightweight object-oriented extension of the C language, called Objective-C. It comes with various frameworks and tools.! Cocoa is strongly influenced by Smalltalk although it is based on the compile-link-run model of C.! Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 8. F-Script in the Mac OS X Architecture F-Script adds an interactive object-oriented environment to Cocoa. It lets you interactively manipulate Cocoa-based objects. It also lets you write scripts. F-Script Quartz, OpenGL, multimedia, printing, event handling, low-level window management, etc. ! Strings, run loops, collections, processes, resources, etc. Multitasking, virtual memory, SMP, file systems, device drivers, networking, threading packages, etc.!
  • 9.
  • 10. Lightweight interactive & scripting layer •  F-Script does not replace Mac OS X development tools, frameworks and object run-time: developers continue to use existing tools & the Objective-C language to develop new classes. •  F-Script adds a lightweight interactive and scripting layer to the Cocoa stack. •  Emphasis is on interactive high-level and user-friendly object manipulation rather than class development.
  • 11. Lightweight interactive & scripting layer   Emphasis is on interactive high-level and user-friendly object manipulation rather than class development.
  • 12. Lightweight interactive & scripting layer   Emphasis is on interactive high-level and user-friendly object manipulation rather than class development. myObject is now registered in the Mac OS X distributed object system, under the public name ‘foo’. Other applications can connect to it and use it.
  • 13. Lightweight interactive & scripting layer   Emphasis is on interactive high-level and user-friendly object manipulation rather than class development. Block inspector allowing in-place editing of block code.
  • 14. Lightweight interactive & scripting layer   Emphasis is on interactive high-level and user-friendly object manipulation rather than class development. User-friendly access to core Mac OS X technologies (here: drawing a blue circle with Quartz).
  • 15. High level object manipulation   Emphasis is on interactive high-level and user-friendly object manipulation rather than class development. One of the main weakness of object technology: high-level manipulation of data.
  • 16. Weakness of object technology   Years ago relational supporters argued that object-oriented databases were a twenty-year step backward.   They were right !!!   Sure, object technology provides a high-level modeling approach. But think about how low-level, object technology is compared to relational algebra when it comes to manipulating whole sets of data.   This is a big challenge!
  • 17. Weakness of object technology   This criticism prompted a major enhancement of object technologies: the development of object query languages.   This development provided a solution to the lack of high-level features found in traditional object languages.   So far, results are mixed.   Object query languages have not yet made their way into mainstream object languages.   In their most recent incarnations, object query languages adopt quite a low profile. They are merely used as an interface to an underlying database, and not as a general means of manipulating objects (e.g. JDO Query Language, EJB Query Language, Gemstone etc.). “The query is executed in the databse, not in the VM”.
  • 18. High-level object manipulation   We want something with the power of relational algebra built into our programming language!   Array programming principles (cf. Ken Iverson’s APL) to the rescue. Smalltalk extended into an object query language allowing synthetic expression of object manipulations.   A new message send paradigm. The classic Smalltalk message construct becomes a special case of a more general messaging system.   A small kernel of high-level operators for object collection manipulation: Compression, Reduction, Join, Transposition, etc. (implemented as methods).   Aim was to minimize extensions needed to include query language level capacities in Smalltalk. From a technical point of view, can easily be adapted to existing Smalltalk implementations.
  • 19. “F-Script lets one easily do pretty complex data mining to drill down through samples of thousands of galaxies distributed throughout a very large parameter space.” ! ! Prof. Roberto Abraham - Dept. of Astronomy & Astrophysics - University of Toronto.
  • 20. F-Script Architecture Graphical Environment: shell, object browser, etc. Little Smalltalk Interpreter (+ Array Extensions) Object/Array Programming Engine Object Model!
  • 21. F-Script Object Model & Frameworks   F-Script is based on Smalltalk syntax and concepts, but instead of using Smalltalk’s object model and common Smalltalk frameworks, it use the Cocoa object model and frameworks.   Thanks to the integration with Cocoa, F-Script gains many advanced features, which can be directly accessed by the F-Script user, "for free": •  Sophisticated GUI framework (Windows, Views, Event Model, Text Layout, etc.), •  Unicode support, •  Access to the Quartz features (Mac OS X graphic subsystem), •  Distributed Objects, •  Object Persistence, •  Integration with Interface Builder, •  Networking, •  File System interaction, •  UNIX abstractions: tasks, pipes, etc, •  Collection classes, •  Etc.
  • 22. F-Script/Cocoa Object Model Example   Derived from the Smalltalk object model.   Smalltalk’s keyword syntax.   Class and meta-classes are objects.   Single inheritance. Support for protocols.   Fully dynamic. Static typing optional.   Flexible: the notion of “category” lets you add methods to classes you have not produced. The “poseAsClass:” method lets you replace a class by another one a runtime, etc.   isKindOfClass:, respondsToSelector:, performSelector:, doesNotRecognizeSelector:, etc.
  • 23. F-Script is embeddable   In addition to a stand-alone application, F-Script comes as an embeddable Mac OS X framework.   This means you can use an F-Script interpreter (or several ones) in your own applications.   F-Script components are accessed through an Objective-C API.
  • 24. F-Script is embeddable Developing with Project Builder and the F-Script framework
  • 25. Object browser: browsing the workspace
  • 26. Object browser asks for arguments
  • 27. Browsing classes and meta-classes
  • 30. The key-value browser (by Joerg Garbers)
  • 31. Using Mac OS X frameworks from F-Script [:title | |window conversionScript form button line| window := NSWindow alloc initWithContentRect:(125<>513 extent:400<>200) styleMask:NSTitledWindowMask+NSClosableWindowMask+NSMiniaturizableWindowMask+NSResizableWindowMask backing:NSBackingStoreBuffered defer:true. conversionScript := [(form cellAtIndex:2) setStringValue:(form cellAtIndex:0) floatValue * (form cellAtIndex:1) floatValue. form selectTextAtIndex:0]. form := (NSForm alloc initWithFrame:(60<>90 extent:320<>85)) autorelease. form addEntry:@{'Exchange Rate per $1', 'Dollars to Convert', 'Amount in Other Currency'}. form setAutosizesCells:true; setTarget:conversionScript; setAction:#value. button := (NSButton alloc initWithFrame:(250<>20 extent:90<>30)) autorelease. button setBezelStyle:NSRoundedBezelStyle; setTitle:'Convert'; setKeyEquivalent:'r'. button setTarget:conversionScript; setAction:#value. line := (NSBox alloc initWithFrame:(15<>70 extent:370<>2)) autorelease. window contentView addSubview:@{form, button, line}. window setTitle:title; orderFront:nil. ]
  • 33. F-Script Anywhere   F-Script Anywhere, developed by Nicholas Riley, allows you to inject a complete F-Script environment into any running Cocoa application - even third-party applications!
  • 35. Download & Resources   Binaries for Mac OS X   Source code   User guide with complete reference documentation   Articles published by O’Reilly Network   Paper from APL 2000, documenting the high-level extensions   Additional tools, including F-Script Anywhere   Mailing List www.fscript.org
  • 36. Thanks ! See you at ESUG 2003 !