Teaching with AlgoML
How to use AlgoML in an algorithms course, from the first lesson to the exam.
Why it works in class
Students write the algorithm in a notation close to the one on the board. The generated code is real: it compiles, it runs, and they can see the link between each AlgoML line and the C, Java or Python line it produces.
A typical lesson
- Present the idea on the board, in AlgoML.
- Students type the algorithm in VS Code. The checker catches the simple mistakes (types, undeclared variables) before you have to.
- They generate the code and run it with test values.
- They compare the AlgoML and the generated code: where are the braces, why
range(1, n + 1), whyscanf("%d", &n), whytab[i - 1].
Checking exercises
Every example on this site comes with an input file and the expected output. Do the same for your exercises: write the .in and .expected files, generate the student's work, run it and compare. The script used for this site, scripts/examples.mjs, does exactly that for C, Java and Python.
Moving to a real language
After a few weeks, ask students to modify the generated code directly, for example to add a feature in C. They start from code they understand because they wrote the algorithm.
Share your course
Publish your exercises in a public GitHub repository with the topic algoml-lang and they will appear on the Projects page.