Skip to content

Small-JS/SmallJS

Repository files navigation

SmallJS README

SmallJS logo
Official website: small-js.org

News - SmallJS release 1.7 - 18-AUG-2025

With NW.js framework support for developing multi-platform desktop apps!
The GUI of these apps is made with familiar HTML and CSS.
And they take up less memory than Electron and are less complex to develop.

More info here: https://small-js.org/News

Enjoy!

Introducing SmallJS

SmallJS is a free and open source implementation of the elegant and powerful Smalltalk-80 (ST) language. It compiles to JavaScript (JS) that runs in modern browsers or in recent Node.js.

SmallJS is file based, not image based, so you can develop in your favorite IDE. The default setup is for Visual Studio Code, with ST syntax coloring and step-debugging! You code separately from the SmallJS base libraries (image) and only the parts you use are imported automatically when running your app.

SmallJS is fully object oriented, so customizable on every level. For usability, ST class and method names are kept mostly equal to their familiar JS counterparts.

JS libraries already encapsulated in ST are:

  • Browsers: Document, Window, HTML elements, events, CSS, streams.
  • Node.js: HTTP server, Express, files, 3 databases, 5 AI providers.
  • Desktop app options: NWjs, Electron, NodeGui.

To get you started quickly, there are several example projects using the above.

Code example

./Documentation/Example.png

Getting started

SmallJS is currently set-up for use with Visual Studio Code. For the back-end, Node.js is the framework of choice, also using Express. Databases SQLite, Postgres, MariaDB and MySQL are supported out of the box, where SQLite is built into Node.js de can be used right away.

Installing

Install prerequisite apps

To install all the prerequisite apps, look at:

./Documentation/Prerequisites.md

Install npm modules

Now run the bash script ./install.sh. On Windows, the .sh extension should be associated with Git Bash once. Do this by clicking on the file in the explorer and then choose open with Git Bash always.

This script:

  • Checks if the prerequisites are present.
  • Installs the SmallJS language extension in VSCode.
  • Installs npm modules for all Node.js projects.

Build SmallJS compiler and core projects

Run the bash script: ./build.sh, that:

  • Builds the Smalltalk to JS ./Compiler.
  • Builds the core ST projects and runs their unit tests.

Notes:

Check if everything builds tests successfully before going to the next step.

Examples

For a first impression of running SmallJS code, see the example projects:

./Examples/Examples.md

Contributions

Contributions to SmallJS that are not mart of the main system.

./Contributions/Contributions.md

Playground

To get a feed for Smalltalk and to quickly test out ST expressions. There's a browser based playground to compile and evaluate them in real-time. Check for more info, read:

./Playground/Playground.md

The playground is also accessible though the offical website

small-js.org/Playground/Playground.html

Documentation

The complete documentation is located here:

./Documentation/Documentation.md