ArticleslgStudy

science

Amber Smalltalk

Amber Smalltalk is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Amber Smalltalk rather than just read about it. In short: 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.

Amber Smalltalk — main illustration
Amber Smalltalk — illustration

Key takeaways

  • Amber Smalltalk belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Amber Smalltalk to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Amber Smalltalk from memory before moving on to harder problems.

Reference excerpt

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. The programming environment in Amber is named Helios.

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. This one-to-one mapping with JavaScript differentiates Amber from other Smalltalk variants such as Pharo, Seaside, and Squeak. 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. Amber was influenced by an earlier Smalltalk in browser project, named Clamato, created by Avi Bryant. Amber and Clamato both use parsing expression grammar (PEG) libraries to parse Smalltalk source code. Amber uses the JavaScript 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 in developing the Lively Kernel implementation of Morphic to run in web browsers via JavaScript. Starting with version 0.12.0, Amber modules compile to asynchronous module definition (AMD). 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. 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 must be installed first, if it is not already. The following commands will install Amber: To create a new project, write:"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 Seaside (software) Squeak

References

External links Official website Amber-smalltalk on GitHub

Worked examples

Example 1 — a first encounter with Amber Smalltalk

Start with the simplest possible case. Write down what Amber Smalltalk claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Amber Smalltalk before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Amber Smalltalk ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Amber Smalltalk

In research
Amber Smalltalk appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Amber Smalltalk in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Amber Smalltalk is common in secondary-school and first-year university syllabi. It links to neighbouring topics Smalltalk programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for Amber Smalltalk outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Amber Smalltalk” →

How to study Amber Smalltalk in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Amber Smalltalk means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Amber Smalltalk out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Amber Smalltalk in simple terms?

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.

Why does Amber Smalltalk matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Amber Smalltalk?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Amber Smalltalk.

Tags

  • Smalltalk programming language family

Keep exploring