Amber Smalltalk

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Jerryobject (talk | contribs) at 05:40, 2 September 2018 (→‎External links: WP:NAVBOX add.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Amber Smalltalk
Original author(s)Nicolas Petton
Developer(s)Amber Community
Initial releaseSeptember 13, 2011; 12 years ago (2011-09-13)
Stable release
0.20.0 / November 12, 2017; 6 years ago (2017-11-12)
Repositorylolg.it/amber/amber
Written inSmalltalk, JavaScript
Operating systemCross-platform
PlatformWeb browser
Available inEnglish
TypeObject-oriented programming language, IDE
LicenseMIT
Websitewww.amber-lang.net

Amber Smalltalk, formerly named Jtalk, is an implementation of the Smalltalk-80 language that runs on the JavaScript runtime of a web browser. It is designed to enable client-side development using the Smalltalk programming language.[1] The programming environment in Amber is named Helios.[2]

Key features

Amber includes an integrated development environment (IDE) with a class browser, Workspace, transcript, object inspector, and debugger. Amber is written in itself (is self-hosting), including the compiler, and compiles into JavaScript, mapping one-to-one with the JavaScript equivalent.[3] This one-to-one mapping with JavaScript differentiates Amber from other Smalltalk variants such as Pharo, Seaside, and Squeak.[1] Starting the Amber IDE requires Node.js. Amber doesn't run slowly on a bytecode virtual machine due to its convenient mapping to JavaScript, which makes compiled code run fast.

History

Amber was originally created by Nicolas Petton in 2011.[4] Amber was influenced by an earlier Smalltalk in browser project, named Clamato, created by Avi Bryant.[4][5] Amber and Clamato both use parsing expression grammar (PEG) libraries to parse Smalltalk source code. Amber uses the JavaScript based PEG.js library[6][7] written by David Majda. Clamato uses PetitParser, a Smalltalk-based library written by Lukas Renggli.[4] Clamato and Amber were both influenced by earlier work by Dan Ingalls in developing the Lively Kernel implementation of Morphic to run in web browsers via JavaScript.[4][8]

Starting with version 0.12.0, Amber modules compile to asynchronous module definition (AMD).[9] Starting with version 0.12.6, the development helper command-line interface (CLI) tool is extracted to dedicated module amber-cli, which can be installed from npm; and setting up the project and its JavaScript ecosystem (bower, npm, grunt) is greatly simplified using this CLI tool by issuing amber init and answering a few questions.[10] This makes setting Amber Smalltalk easier for people with little JavaScript experience.[11]

Installing

To install Amber, Git must be installed first, if it is not already. The following commands will install Amber:[2]

# 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 amber-cli grunt-cli grunt-init

To create a new project, write:

# Create the project structure
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 pop-ups by default, so browser settings may need changing to allow the Helios application popup to appear.

Integrating external JavaScript libraries

Bower software can be used to access a vast array of JavaScript libraries. A library can be integrated by following only four steps:[2]

  1. Install the library using Bower.
  2. If 'local.amd.json' files doesn't exist for the Bower package, create a 'libname.amd.json' file in the project root.
  3. Run 'grunt devel' (or 'grunt deploy' if ready to deploy an application).
  4. Add 'libname' to the application package's #imports: .

See also

References

  1. ^ a b Smalltalk Implementations (brief comparative summaries describing Smalltalk dialects)
  2. ^ a b c Eng, Richard (2015-06-09). "A Gentle Introduction to Amber: Engaging in Smalltalk with Her, Reads Like English, and It's Still Succinct!, "It's alive! It's alive!", The All-seeing Helios, Testing D3". Medium. Retrieved 2016-02-07.
  3. ^ Petton, Nicolas. "Amber Smalltalk". amber-lang.net. Retrieved 2016-01-30.
  4. ^ a b c d Schuster, Werner (August 22, 2011). "Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0". Retrieved October 20, 2011.
  5. ^ "Clamato". (Clamato Smalltalk project website)
  6. ^ Majda, David (2010–2016). "PEG.js: Parser Generator for JavaScript". PEG.js.org. David Majda. Retrieved 13 November 2016.
  7. ^ Petton, Nicolas (13 September 2011). "Bye, bye Jtalk... Hello Amber!". Google Groups. Google, Inc. Retrieved 13 November 2016. ... we are now making a first release humbly numbered 0.9. We are also taking the opportunity to pick a slicker name for Jtalk - Amber!
  8. ^ Shuster, Werner (June 22, 2010). "Dan Ingalls on the History of Smalltalk and the Lively Kernel". Retrieved October 26, 2011.
  9. ^ "amber-smalltalk/amber". GitHub. Retrieved 2016-01-30.
  10. ^ "amber-smalltalk/amber". GitHub. Retrieved 2016-01-30.
  11. ^ Petton, Nicolas. "Installing Amber". docs.amber-lang.net. Retrieved 2016-01-30.

External links