Logo   SmallJS Tutorial
Home
Hello there, Smalltalk enjoyer!

This tutorial will teach you how to program in SmallJS.
First we'll go though some basics of the elegant Smalltalk language.
You can try out these expressions in the Playground page on this same site.
It's most convenient if you open the Playground a stand-alone browser window with this link:
https://small-js.org/Playground/Playground/index.html

!NEW! Use an AI assistant
AI can be a great help to get you started in SmallJS quickly.
Specifically Claude gives good results.
But because SmallJS is not a widely used language (yet :),
we'll first give Claude knowledge of all SmallJS unit tests and examples.

To set it up:
  • First download this context file: smalljs.txt .
  • Open a Claude.ai chat page.
  • Create a free account if you don't have one yet.
  • Click on the icon Projects in the sidebar on the left.
  • Now click on the button [New project] .
  • As the name, enter e.g.: SmallJS programming assistant .
  • For a description, enter e.g.: Assist me in writing code in SmallJS, a Smalltalk dialect. .
  • Save the project and open it giving a new chat.
  • Click on the button [+] to add a file.
  • Select the previously downloaded file smalljs.txt to upload.
Now you can ask Claude any question about SmallJS, like:

  In SmallJS, how to draw a rectangle on a HTML canvas?

And you will get a helpful answer! :-)