Amber Smalltalk

Amber Smalltalk
Original author(s) Nicolas Petton
Developer(s) Amber Community
Initial release September 13, 2011 (2011-09-13)
Stable release 0.15.1 / February 6, 2016 (2016-02-06)
Development status Active
Written in Smalltalk, JavaScript
Operating system Cross-platform
Type Object-oriented programming language, IDE
License MIT license
Website www.amber-lang.net

Amber Smalltalk, formerly known as 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 called Helios.[2]

Key Features

Amber includes an integrated development environment with a class browser, Workspace, transcript, object inspector and debugger. Amber is written in itself, 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, called "Clamato", created by Avi Bryant.[4][5] Both Amber and Clamato use Parsing Expression Grammar (PEG) libraries for parsing Smalltalk sourcecode. Amber uses the JavaScript based PEG.js library[6][7] written by David Majda and Clamato uses PetitParser, a Smalltalk-based library written by Lukas Renggli.[4] Both Clamato and Amber were influenced by earlier work by Dan Ingalls in developing the Lively Kernel implementation of Morphic in the web browser using JavaScript.[4][8]

Starting with version 0.12.0, Amber modules are compiled to AMD modules.[9] Starting with version 0.12.6, the development helper CLI tool is extracted to dedicated module 'amber-cli', which can be installed from npm; and setting up the project and its JS 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 Amber

You need to install git, if you don't already have it. Writing down the following commands will install amber:[2]

# for OS X and Linux, you need 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. You can set the default answer for most of them. The next step is to start the server:

amber serve

After that if you type http://localhost:4000 in your browser you will get to the application. Note that most browsers will block Helios pop-ups by default, so you may need to change your browser settings to allow the Helios application popup to appear.

Integrating External JavaScript Libraries

You can use bower to access a vast array of JavaScript libraries. following only four steps, you can integrate a JavaScript library:[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 you're ready to deploy your application).
  4. Add 'libname' to your application package's #imports: .

See also

References

  1. 1 2 Smalltalk Implementations (brief comparative summaries describing Smalltalk dialects)
  2. 1 2 3 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. 1 2 3 4 Schuster, Werner (August 22, 2011). "Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0". Retrieved October 20, 2011.
  5. "Clamato". (Home page for the Clamato Smalltalk project)
  6. "PEG.js". (Home page for the PEG.js JavaScript parser generator project)
  7. "Amber 0.9 Announcement". (Announcement email of Amber 0.9 includes switch to PEG.js)
  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

This article is issued from Wikipedia - version of the Friday, April 29, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.