Quick Start¶
This page gives a short first pass through MakrellTS. The aim is to show the basic CLI workflow and a few familiar Makrell forms in the TypeScript-hosted track.
Install the CLI¶
bun add -g makrellts
Run a MakrellTS source file¶
makrellts hello.mrts
Emit generated JavaScript¶
makrellts hello.mrts --emit-js
This is useful when you want to see how a MakrellTS source file lowers into the current JavaScript output.
Small example¶
a = 2
b = a + 3
[a b 5] | sum
{fun add [x y]
x + y}
{match a
2 "two"
_ "other"}
This example shows a few shared family ideas in one place:
ordinary expression flow
function definition
pipeline usage
pattern matching
Async example¶
{async fun fetchValue [value]
{await {Promise.resolve value}}}
{async fun addLater [x y]
left = {await {fetchValue x}}
right = {await {fetchValue y}}
left + right}
{await {addLater 20 22}}
MakrellTS now supports the shared family async baseline as part of the
v0.10.0 consolidation work.
Diagnostics¶
makrellts check hello.mrts --json
MRON example¶
owner "Rena Holm"
active true
count 3
This reminds you that the TypeScript track still lives in the broader family world of formats and structures.
MRML example¶
{html
{body
{h1 MakrellTS}
{p Generated from MBF-style syntax.}}}
Next steps¶
After this page, a useful route is: