Your first SML program
The fastest way into ViSML is to build something small, watch the Code panel turn it into text as you go, and get the one caveat that matters — ViSML writes SML, it does not run it — out of the way early.
Opening ViSML
Open visml.l-workshop.my.id and you land on an empty workspace, the toolbox sidebar on the left, the Code panel on the right. There is nothing to install and nothing to sign in to — it is a static, client-side application, and everything you build stays in your browser until you export it.
Your first binding
Build the simplest possible program, a val binding:
- From the Declaration category, open the Value/Variable subcategory
and drag a
dec_valblock onto the workspace. - Give it a name in its identifier field —
xis fine. - From Constant, drag an integer literal into the value socket and set it to
42.
The Code panel updates as you connect the blocks, and settles on val x = 42. That
live sync is the thing to get used to: there is no separate “compile” step for the
text view, because the generator runs on every edit.
Building Factorial
For something with more shape, load the Factorial example from the
Examples menu rather than building it block by block on your first pass — it is the
clearest illustration of what a recursive fun with multi-clause pattern matching
looks like as blocks, and it is small enough to read in one screen.
With it loaded, generated code reads close to:
fun fact 0 = 1
| fact n = n * fact (n - 1)
val result = fact 5
Click through the blocks that make up the two fact clauses and watch the corresponding
lines highlight in the Code panel. Then try the reverse direction: edit the generated text
directly and use Apply to Blocks to rebuild the workspace from it — this is
covered in full in Code Generation.
Finding a block fast
Once you know the name of the block you want, dragging through ten categories is slower than searching for it. Press Ctrl + F to focus the toolbox's search field, type part of a block's name, and the matching categories open with the results highlighted. This is the fastest path once you have a rough sense of the grammar — see Blocks for the full category list.
ViSML does not run programs
There is no interpreter, no stepper, no console. ViSML computes exactly one thing: SML source text, generated from your blocks. The command palette (Ctrl + Shift + P) makes this explicit — type “run” and the one result you get is a permanently disabled entry, RUN — Execution runtime is not configured. To actually execute a program, copy the generated code out of the Code panel and run it in a real SML implementation: SML/NJ, MLton, or Poly/ML all accept it unmodified. This is a deliberate scope boundary, not a missing feature — see Code Generation for the fuller picture, and Overview for how that sets ViSML apart from its siblings.
Reading the status bar
Along the bottom edge: the current file name (Untitled workspace or the
.vsml you loaded), the autosave state (Autosaved HH:MM once it has run), and
the current perspective. Right-click the workspace background for Screenshot
(exports the block diagram as a PNG — a picture of the blocks, not a code export) and
About.