View Source Orb.DSL (Orb v0.0.30)

The main DSL which is imported automatically when you call Orb.wasm/2.

Summary

Functions

Asserts a condition that must be true, otherwise traps.

call(f) deprecated

Call local function f.

call(f, args) deprecated

Call local function f, passing arguments args when list, or single argument otherwise.

call(f, a, b) deprecated

Call local function f, passing arguments a & b.

call(f, a, b, c) deprecated

Call local function f, passing argument a, b, c.

call(f, a, b, c, d) deprecated

Call local function f, passing argument a, b, c, d.

Call local function f, passing argument a, b, c, d, e.

Call local function f, passing argument a, b, c, d, e, f.

Declare a constant string, which will be extracted to the top of the module, and its address substituted in place.

Drop the last pushed value from the stack.

Execute the passed expression, but ignore its result by immediately dropping its value.

Run code at compile-time.

Run Elixir for-comprehension at compile-time.

Declare a loop that iterates through a source.

A no-op instruction.

Pushes a value onto the current stack.

Push value then run the block. Useful for when you mutate a variable but want its previous value.

For when there’s a language feature of WebAssembly that Orb doesn’t provide. Please file an issue if there’s something you wish existed. https://github.com/RoyalIcing/Orb/issues

Return from a function. You may wish to push/1 values before returning.

Return from a function if a condition is true.

Return from a function with the provided value only if a condition is true.

Denote a point in code that should not be reachable. Traps.

Used to bring back wasm-mode when inside inline/1.

Functions

Asserts a condition that must be true, otherwise traps.

This function is deprecated. Use typed_call/3 instead..

Call local function f.

This function is deprecated. Use typed_call/3 instead..

Call local function f, passing arguments args when list, or single argument otherwise.

This function is deprecated. Use typed_call/3 instead..

Call local function f, passing arguments a & b.

This function is deprecated. Use typed_call/3 instead..

Call local function f, passing argument a, b, c.

This function is deprecated. Use typed_call/3 instead..

Call local function f, passing argument a, b, c, d.

This function is deprecated. Use typed_call/3 instead..

Call local function f, passing argument a, b, c, d, e.

Link to this function

call(f, a, b, c, d, e, f)

View Source
This function is deprecated. Use typed_call/3 instead..

Call local function f, passing argument a, b, c, d, e, f.

Declare a constant string, which will be extracted to the top of the module, and its address substituted in place.

Link to this function

do_snippet(locals, block_items)

View Source

Drop the last pushed value from the stack.

Execute the passed expression, but ignore its result by immediately dropping its value.

Link to this macro

func(call, list)

View Source (macro)
Link to this macro

func(call, locals, list)

View Source (macro)
Link to this macro

func(call, result_type, locals, list)

View Source (macro)
Link to this macro

funcp(call, list)

View Source (macro)
Link to this macro

funcp(call, locals, list)

View Source (macro)
Link to this macro

funcp(call, result_type, locals, list)

View Source (macro)

Run code at compile-time.

Link to this macro

inline(arg, list)

View Source (macro)

Run Elixir for-comprehension at compile-time.

Link to this macro

loop(arg, list)

View Source (macro)

Declare a loop that iterates through a source.

Link to this macro

loop(identifier, options \\ [], list)

View Source (macro)

Declare a loop.

A no-op instruction.

See https://en.wikipedia.org/wiki/NOP_(code)

Pushes a value onto the current stack.

Push value then run the block. Useful for when you mutate a variable but want its previous value.

For when there’s a language feature of WebAssembly that Orb doesn’t provide. Please file an issue if there’s something you wish existed. https://github.com/RoyalIcing/Orb/issues

Return from a function. You may wish to push/1 values before returning.

Link to this function

return(value_or_condition)

View Source

Return from a function if a condition is true.

Return from a function with the provided value only if a condition is true.

Link to this function

typed_call(output_type, f, args)

View Source

Denote a point in code that should not be reachable. Traps.

Useful for exhaustive conditionals or code you know will not execute.

Link to this macro

wasm(mode \\ Orb.S32, list)

View Source (macro)

Used to bring back wasm-mode when inside inline/1.