Amber Smalltalk
   HOME

TheInfoList



OR:

Amber Smalltalk, formerly named Jtalk, is an implementation of the
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
Smalltalk Smalltalk is an object-oriented, dynamically typed reflective programming language. It was designed and created in part for educational use, specifically for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan ...
-80, that runs on the
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
runtime of a
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used o ...
. It is designed to enable client-side development using Smalltalk.Smalltalk Implementations
(brief comparative summaries describing Smalltalk dialects)
The programming environment in Amber is named Helios.


Key features

Amber includes an
integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...
(IDE) with a class browser, Workspace, transcript, object inspector, and
debugger A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
. Amber is written in itself (is self-hosting), including the
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
, and compiles into JavaScript, mapping one-to-one with the JavaScript equivalent. This one-to-one mapping with JavaScript differentiates Amber from other Smalltalk variants such as
Pharo Pharo is an open source, cross-platform implementation of the classic Smalltalk-80 programming language and runtime. It's based on the OpenSmalltalk virtual machine called Cog (VM), which evaluates a dynamic, reflective, and object-orient ...
, Seaside, and
Squeak Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imagineering, ...
. Developing Amber project requires
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript cod ...
to run the tooling; the deployed project only needs browser to run. Amber doesn't run slowly on a
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
virtual machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
due to its convenient mapping to JavaScript, which makes compiled code run fast.


History

Amber was originally created by Nicolas Petton in 2011. Amber was influenced by an earlier Smalltalk in browser project, named ''Clamato'', created by Avi Bryant. (Clamato Smalltalk project website) Amber and Clamato both use
parsing expression grammar In computer science, a parsing expression grammar (PEG) is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of rules for recognizing strings in the language. The formalism was introduced by Bryan Ford in 200 ...
(PEG)
libraries A library is a collection of Document, materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or electronic media, digital access (soft copies) materials, and may be a ...
to parse Smalltalk
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
. Amber uses the
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
based PEG.js library written by David Majda. Clamato uses PetitParser, a Smalltalk-based library written by Lukas Renggli. Clamato and Amber were both influenced by earlier work by
Dan Ingalls Daniel Henry Holmes Ingalls Jr. (born 1944) is a pioneer of object-oriented computer programming and the principal architect, designer and implementer of five generations of Smalltalk environments. He designed the bytecoded virtual machine tha ...
in developing the
Lively Kernel The Lively Kernel is an open-source web programming environment. It supports desktop-style applications with rich graphics and direct manipulation abilities, but without the installation or upgrade troubles of conventional desktop applications. D ...
implementation of Morphic to run in web browsers via JavaScript. Starting with version 0.12.0, Amber modules compile to
asynchronous module definition Asynchronous module definition (AMD) is a specification for the programming language JavaScript. It defines an application programming interface (API) that defines code modules and their dependencies, and loads them asynchronously if desired. Im ...
(AMD). Starting with version 0.12.6, the development helper
command-line interface A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
(CLI) tool is extracted to dedicated module, which can be installed from npm as @ambers/cli; and setting up the project and its JavaScript ecosystem (npm, grunt) is greatly simplified using this CLI tool by issuing amber init and answering a few questions. Since August 2018, project scaffolding of "amber init" is simplified, not using bower any more and only based on npm and whole project resides under npm organization @ambers. This makes setting Amber Smalltalk easier for people with little JavaScript experience.


Installing

Up-to-date instructions should be at https://lolg.it/amber/amber. To install Amber,
Git Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data in ...
must be installed first, if it is not already. The following commands will install Amber: # for macOS and Linux, needs the following two commands: npm config set prefix=~/npm export PATH="$PATH:$HOME/npm/bin" # add to .bash_profile or .bashrc npm install -g grunt-cli grunt-init @ambers/cli To create a new project, write: # Create the empty project dir mkdir example-project cd example-project # Create and initialize a new Amber project amber init "amber init" step will lead to some questions about the project. For most of them, a default answer can be set. The next step is to start the server:
amber serve
After that, typing http://localhost:4000 in the browser will get to the application. Most browsers will block Helios IDE pop-ups by default, so browser settings may need changing to allow the Helios IDE popup to appear.


Integrating external JavaScript libraries

Npm software can be used to access a vast array of JavaScript libraries. A library can be integrated by following only four steps: # Install the library using npm. # If 'local.amd.json' files doesn't exist for the npm package, create a 'libname.amd.json' file in the project root. # Run 'grunt devel' (or 'grunt deploy' if ready to deploy an application). # Add 'libname' to the application package's #imports: .


Deployment

By running grunt deploy, the Amber project is packaged using RequireJS into just a few files, at the minimum just index.html and the.js, which can be hosted statically as any other static web page.


See also

*
Pharo Pharo is an open source, cross-platform implementation of the classic Smalltalk-80 programming language and runtime. It's based on the OpenSmalltalk virtual machine called Cog (VM), which evaluates a dynamic, reflective, and object-orient ...
* Seaside (software) *
Squeak Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imagineering, ...


References


External links

* * {{Smalltalk programming language Smalltalk programming language family