Amber Smalltalk

Last updated
Amber Smalltalk
Original author(s) Nicolas Petton
Developer(s) Amber Community
Initial releaseSeptember 13, 2011;11 years ago (2011-09-13)
Stable release
0.30.0 / February 23, 2021;2 years ago (2021-02-23) [1]
Repository lolg.it/amber/amber
Written in Smalltalk, JavaScript
Operating system Cross-platform
Platform Web browser
Available inEnglish
Type Object-oriented programming language, IDE
License MIT
Website www.amber-lang.net

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

Contents

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. [4] This one-to-one mapping with JavaScript differentiates Amber from other Smalltalk variants such as Pharo, Seaside, and Squeak. [2] Developing Amber project requires Node.js to run the tooling; the deployed project only needs browser to run. 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. [5] Amber was influenced by an earlier Smalltalk in browser project, named Clamato, created by Avi Bryant. [5] [6] [7] Amber and Clamato both use parsing expression grammar (PEG) libraries to parse Smalltalk source code. Amber uses the JavaScript based PEG.js library [8] [9] written by David Majda. Clamato uses PetitParser, a Smalltalk-based library written by Lukas Renggli. [5] 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. [5] [10]

Starting with version 0.12.0, Amber modules compile to asynchronous module definition (AMD). [11] Starting with version 0.12.6, the development helper command-line interface (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. [12] 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. [13]

Installing

Up-to-date instructions should be at https://lolg.it/amber/amber.

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

# for macOS and Linux, needs the following two commands:  npmconfigsetprefix=~/npm exportPATH="$PATH:$HOME/npm/bin"# add to .bash_profile or .bashrc  npminstall-ggrunt-cligrunt-init@ambers/cli 

To create a new project, write:

# Create the empty project dir mkdirexample-project cdexample-project  # Create and initialize a new Amber project amberinit 

"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: [3]

  1. Install the library using npm.
  2. If 'local.amd.json' files doesn't exist for the npm 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: .

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

Related Research Articles

TypeScript is a free and open-source high-level programming language developed by Microsoft that adds static typing with optional type annotations to JavaScript. It is designed for the development of large applications and transpiles to JavaScript. Because TypeScript is a superset of JavaScript, all JavaScript programs are syntactically valid TypeScript, but they can fail to type-check for safety reasons.

<span class="mw-page-title-main">CodeLite</span> Integrated development environment

CodeLite is a free and open-source IDE for the C, C++, PHP, and JavaScript (Node.js) programming languages.

<span class="mw-page-title-main">Google Closure Tools</span> JavaScript developer toolkit

Google Closure Tools is a set of tools to help developers build rich web applications with JavaScript. It was developed by Google for use in their web applications such as Gmail, Google Docs and Google Maps.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source server environment that can run on Windows, Linux, Unix, macOS, and more. Node.js is a back-end JavaScript runtime environment, runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

<span class="mw-page-title-main">Lively Kernel</span> Open-source web programming environment

The Lively Kernel is an open-source web programming environment, developed by Dan Ingalls when he was at SAP Research. It supports desktop-style applications with rich graphics and direct manipulation abilities, but without the installation or upgrade troubles of conventional desktop applications. Development began at Sun Microsystems Laboratories in Menlo Park, California, and later moved to the Hasso Plattner Institute in Potsdam-Babelsberg near Berlin.

npm JavaScript package manager

npm is a package manager for the JavaScript programming language maintained by npm, Inc. npm is the default package manager for the JavaScript runtime environment Node.js. It consists of a command line client, also called npm, and an online database of public and paid-for private packages, called the npm registry. The registry is accessed via the client, and the available packages can be browsed and searched via the npm website. The package manager and the registry are managed by npm, Inc.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. The programming language can be used to develop web and mobile apps as well as server and desktop applications.

Mustache is a web template system with implementations available for ActionScript, C++, Clojure, CoffeeScript, ColdFusion, Common Lisp, Crystal, D, Dart, Delphi, Elixir, Erlang, Fantom, Go, Haskell, Io, Java, JavaScript, Julia, Lua, .NET, Objective-C, OCaml, Perl, PHP, Pharo, Python, R, Racket, Raku, Ruby, Rust, Scala, Smalltalk, Swift, Tcl, CFEngine, and XQuery.

<span class="mw-page-title-main">Cloud9 IDE</span> Online integrated development environment

Cloud9 IDE is an Online IDE, published as open source from version 2.0, until version 3.0. It supports multiple programming languages, including C, C++, PHP, Ruby, Perl, Python, JavaScript with Node.js, and Go.

<span class="mw-page-title-main">Socket.IO</span> Library for realtime web applications

Socket.IO is an event-driven library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers. It consists of two components: a client, and a server. Both components have a nearly identical API.

Yeoman is an open source client-side scaffolding tool for web applications. Yeoman runs as a command-line interface written for Node.js and combines several functions into one place, such as generating a starter template, managing dependencies, running unit tests, providing a local development server, and optimizing production code for deployment.

<span class="mw-page-title-main">Ember.js</span>

Ember.js is an open-source JavaScript web framework that utilizes a component-service pattern. It allows developers to create scalable single-page web applications by incorporating common idioms, best practices, and patterns from other single-page-app ecosystem patterns into the framework.

<span class="mw-page-title-main">Nodeclipse</span>

Nodeclipse is a set of third-party developer solutions for Eclipse for programming in JavaScript, CoffeeScript with focus on Node.js.

A headless browser is a web browser without a graphical user interface.

<span class="mw-page-title-main">Ionic (mobile app framework)</span> Open-source framework to develop hybrid mobile apps

Ionic is a complete open-source SDK for hybrid mobile app development created by Max Lynch, Ben Sperry, and Adam Bradley of Drifty Co. in 2013. The original version was released in 2013 and built on top of AngularJS and Apache Cordova. However, the latest release was re-built as a set of Web Components using StencilJS, allowing the user to choose any user interface framework, such as Angular, React or Vue.js. It also allows the use of Ionic components with no user interface framework at all. Ionic provides tools and services for developing hybrid mobile, desktop, and progressive web apps based on modern web development technologies and practices, using Web technologies like CSS, HTML5, and Sass. In particular, mobile apps can be built with these Web technologies and then distributed through native app stores to be installed on devices by utilizing Cordova or Capacitor.

NativeScript is an open-source framework to develop mobile apps on the iOS and Android platforms. It was originally conceived and developed by Progress. At the end of 2019 responsibility for the NativeScript project was taken over by long-time Progress partner, nStudio. In December 2020 nStudio also oversaw the induction of NativeScript into OpenJS Foundation as an Incubating Project. NativeScript apps are built using JavaScript, or by using any programming language that transpiles to JavaScript, such as TypeScript. NativeScript supports the Angular and Vue JavaScript frameworks. Mobile applications built with NativeScript result in fully native apps, which use the same APIs as if they were developed in Xcode or Android Studio. Additionally, software developers can re-purpose third-party libraries from CocoaPods, Maven, and npm.js in their mobile applications without the need for wrappers.

gulp is an open-source JavaScript toolkit created by Eric Schoffstall used as a streaming build system in front-end web development.

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file. Grunt was created by Ben Alman and is written in Node.js. It is distributed via npm. As of October 2022, there were more than 6,000 plugins available in the Grunt ecosystem.

<span class="mw-page-title-main">PostCSS</span> Software development tool that uses JavaScript-based plugins to automate routine CSS operations

PostCSS is a software development tool that uses JavaScript-based plugins to automate routine CSS operations. It was designed by Andrey Sitnik with the idea taking its origin in his front-end work for Evil Martians.

<span class="mw-page-title-main">Yarn (package manager)</span> JavaScript package manager

Yarn is one of the main JavaScript package managers, developed in 2016 by Sebastian McKenzie of Meta for the Node.js JavaScript runtime environment. An alternative to the npm package manager, Yarn was created as a collaboration of Facebook, Exponent, Google, and Tilde to solve consistency, security, and performance problems with large codebases.

References

  1. "Release version 0.30.0". lolg.it. Retrieved 2021-03-25.
  2. 1 2 Smalltalk Implementations (brief comparative summaries describing Smalltalk dialects)
  3. 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.
  4. Petton, Nicolas. "Amber Smalltalk". amber-lang.net. Retrieved 2016-01-30.
  5. 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.
  6. "Clamato". (Clamato Smalltalk project website)
  7. Petton, Nicolas (August 2011). Jtalk, the Smalltalk for Web developers. European Smalltalk User Group Conference (ESUG). Edinburgh, Scotland, United Kingdom. Archived from the original on 2012-01-28. Slides.
  8. Majda, David (2010–2016). "PEG.js: Parser Generator for JavaScript". PEG.js.org. David Majda. Archived from the original on 27 April 2011. Retrieved 13 November 2016.
  9. 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!
  10. Shuster, Werner (June 22, 2010). "Dan Ingalls on the History of Smalltalk and the Lively Kernel" . Retrieved October 26, 2011.
  11. "amber-smalltalk/amber". GitHub. Retrieved 2016-01-30.
  12. "amber-smalltalk/amber". GitHub. Retrieved 2016-01-30.
  13. Petton, Nicolas. "Installing Amber". Amber-lang.net. Retrieved 2016-01-30.