Charms.Defm (charms v0.1.4)

Charms.Defm is a DSL for defining functions that can be JIT-compiled.

This module defines the defm DSL syntax as macros and special forms.

Extending the defm

There are two kinds of functions in Charms:

  • Intrinsic: use beaver's DSL to define, which can be called in the function body of a defm
  • defm: use defm to define, can be JIT-compiled Although they are different in terms of underline implementation, they share the same syntax to invoke.

Summary

Functions

call a local function with return

call a function defined in another Charms module with return

cond expression requires identical types for both branches

create an MLIR operation

create an MLIR operation and return the result value(s)

while loop

Functions

call(arg)

(macro)

call a local function with return

call(mod, arg)

(macro)

call a function defined in another Charms module with return

cond_br(condition, clauses)

(macro)

cond expression requires identical types for both branches

for_loop(expr, list)

(macro)

for loop

op(_)

(macro)

create an MLIR operation

value(expr)

(macro)

create an MLIR operation and return the result value(s)

while(expr, list)

(macro)

while loop