Skip to content

blinklabs-io/plutigo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plutigo

An implement of plutus in pure Go.

This package aims to only support Untyped Plutus Core because that is all that is needed for a full node. The other stuff like Typed Plutus Core and Plutus IR is for Plinth.

Usage

Install

go get github.com/blinklabs-io/plutigo

Example

package main

import (
	"fmt"

	"github.com/blinklabs-io/plutigo/pkg/cek"
	"github.com/blinklabs-io/plutigo/pkg/syn"
)

func main() {
	input := `
	(program 1.0.0
	  [
	    [
	      (builtin addInteger)
	      (con integer 1)
	    ]
	    (con integer 1)
	  ]
	)
	`

	pprogram, _ := syn.Parse(input)

	program, _ := syn.NameToDeBruijn(pprogram)

	machine := cek.NewMachine[syn.DeBruijn](200)

	term, _ := machine.Run(program.Term)

	prettyTerm := syn.PrettyTerm[syn.DeBruijn](term)

	fmt.Println(prettyTerm)
}

About

Untyped Plutus Core in Go

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 9