Repository navigation
Jamo 0.7.0
Jamo 0.7.0 brings a real debugger. Stop your program on any line, step through it, and see exactly what every variable holds, in the console or right inside VS Code. And files used with as now keep their own structs too, so big programs stay tidy.
Get started
- Download jamo-0.7.0-windows.zip below, unzip it anywhere, and double-click install.cmd.
- Open a new terminal and type
jamo version. It should sayJamo 0.7.0. - Try the debugger:
jamo debug examples\star_guard.jamofrom inside the unzipped folder.
Already have an older Jamo? Just run the new install.cmd. Your own programs stay as they are.
For the debugger in VS Code, plus colors, red underlines, hover help and go to definition, download jamo.vsix below. In VS Code, open the Extensions panel, click the ... menu at its top, and choose Install from VSIX.
What's new
A debugger
When a program does something strange, stop it and look inside. In the console:
> jamo debug game.jamo
Debugging game.jamo. It stops at its first line. Type help for the commands.
Stopped at game.jamo line 20
20 | var count = 3
(jamo) b 14
Breakpoint at game.jamo line 14.
(jamo) c
Stopped at game.jamo line 14 (breakpoint)
14 | var left = e.hp - amount
(jamo) v
amount: int = 4
e: Enemy = Enemy{name: "orc", hp: 10, speed: 1.5, mood: Mood.ANGRY}
Set breakpoints, step over a line (n), into a call (s) or out of one (o), see the calls the program is in (w), and every variable, including what's inside structs, arrays and enums.
In VS Code it's one click: click left of a line number to drop a red breakpoint dot, then press F5. The program stops there, the variables show on the left, you can hover over a name to see its value, and the buttons at the top step and continue. No setup needed.
It's fast, too: a loop of ten million lines runs in under a third of a second with the debugger attached. Normal jamo build and jamo run don't change at all.
Files with their own structs
A file used with as now owns its structs and enums too, so two files can each have their own Enemy:
use "enemies.jamo" as foes
use "items.jamo" as loot
func main()
var orc = foes.Enemy{hp: 5, mood: foes.Mood.CALM}
var slime = loot.spawn()
end
Interfaces are still shared by the whole program.
One change to old code: a struct from a file used with as now needs the file's name in front, like foes.Enemy{hp: 7}. Leave it off and Jamo tells you exactly what to write: Did you mean foes.Enemy?
Built carefully
- The debugger was checked from both ends: the console debugger with a script of typed commands, and the VS Code side by a test that plays VS Code's part, message by message.
- Both of Jamo's compilers make byte-for-byte the same
.exe, debug builds included, and the Jamo-written one still builds itself the same every time. - The whole test suite passed after each change, and every code sample in the guide is built and run by the tests.
Good to know
jamo debugworks injamo.exe, not in the C++ backup compiler.- A function stored in a variable shows as
(lambda 1)in the list of calls. Variables a function written in place picks up from around it don't show in its variable list yet. - Windows may still warn about a program it has never seen before. Click More info, then Run anyway.
The full list is in CHANGELOG.md.