Compiler

scalus.Compiler
object Compiler

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Compiler.type

Members list

Type members

Classlikes

case class Options(targetLoweringBackend: TargetLoweringBackend, generateErrorTraces: Boolean, optimizeUplc: Boolean, debug: Boolean)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def compile(e: Any): SIR
def compileDebug(e: Any): SIR
inline def compileInline(inline code: Any): SIR

Generates a Compiler.compile(code) call at compile time.

Generates a Compiler.compile(code) call at compile time.

When you want to use Compiler.compile in an inline method you can't do it directly, because the Scalus compiler plugin finds the call to Compiler.compile and replaces it with the compiled code. Which is not what you want in this case!

For example this will not work:

 inline def myTest(inline code: Any): SIR = {
     Compiler.compile(code).toUplc().evaluate
 }

Instead, you should use this method:

inline def myTest(inline code: Any): SIR = {
   Compiler.compileInline(code).toUplc().evaluate
}

Attributes

inline def fieldAsData[A](inline expr: A => Any): Data => Data

Concrete fields