click the compile button and the dasm will appear here
> hello

Docs

Section labels:

Section labels start with '@' character and are:

  1. @DATA The data section holds immediate values. These have to be defined outside of the code because they are loaded into memory, while regular constants are held in the actual machine code. If you want to have a constant that needs a function call to be computed, for example vec2 a = (0, 0) + 2 you can define it as _#name, and then in the program section you can assign it name = something(_1), where # is some unique number. This signals the compiler that the value is constexpr and can be computed only once and clobbered into memory. Uniforms cannot be consetexpr.
  2. @FUNCTIONS This section holds all your callable functions. Look at the code sample I think you get the syntax. Generally the compiler will attempt to inline everything, but not always. If your function is not inlined, in the wasm it will just be a regular function that is called. This is mostly fine but inlining is usually better for performance. If your function is called <2 times it will always be inlined.
  3. @PROGRAM This is where the main code goes.
Yes this makes dasm annoying to write, but this is an assembly like language. your lucky i let you put multiple operations per line.

Variables: Variables can be of type num (default desmos number type), vec2, vec3 and lists of these types (eg. vec3[]). Things can also be declared as any this works generally the same as templates in c++. If you need to restrict what the template can be, you can use any[] for lists of any type, or vecn and vecn[] to restrict to any vector type. Most variables and operations will be fused if possible. eg. if you do num b = 1 + a; num c = b - 20 it will be treated the same as num c = 1 + a - 20.

Functions: Functions can be defined with the syntax return_type function_name(param_type param_name, ...): followed by a block of code. The return value is specified with the return statement.

Compiler options: compiler options can be specified by adding a # on the first line of the source, follow by space separated options. These are like command args. Current options are: