Fyrd Programming Language

Introducing Fyrd

Introducing Fyrd, another programming language from Instant NFT that runs directly on the Ethereum blockchain. Fyrd is an APL dialect that runs directly on Ethereum, allowing the development of unprecedented on chain experiences by anyone with a little programming experience.

Fyrd is a specialized language for doing complex calculations on arrays of floats. Our number format uses the ABDKMath64x64 library, so you get high precision 64.64 fixed point numbers.

The Fyrd programming language can be used for generative art, pfps, or anything you can think of.

Fyrd is an APL dialect enhanced to run directly on the EVM. It supports:

  • Numbers are 64.64 fixed point.
  • Polymorphic operations that work the same with scalars and arrays of numbers.
  • A large number of primitives, including sin, cos, sqrt, ln, abs, exp, log_2, exp_2, neg, inv, pow, and random.
  • Advanced string operations to convert data to any format (for instance, svg data).
  • Very succinct and understandable code.
  • Tight integration with Gyve.

This document descibes the Fyrd features in detail.

Note on Names

Since storing large amounts of string data on the blockchain can be expensive, Fyrd uses very short names and symbols to cut down on the number of bytes in Fyrd programs. We also recommend that you use short variable and other names where possible to keep the total program size as small as possible.

Literals

Gyve supports floating point, integer, and string literals.

  • Strings are single quoted.
  • Numbers are 64.64 fixed point.
  • Primitives are rank polymorphic - they operate on scalars and arrays.

Predefined Primitives (WIP)

+ add


- subtract


* multiply


/ divide


% mod


$ generate array


$r generate array of random values


$rr generate array of random values in a range


#sqrt


#sin


#cos


#rr


<- assign


#s! to string


#j string join


!j set join arity


#sqrt


!> set return variable


#/ slice


#/s slice string


#neg negate


#abs


#inv


#pow


#log2


#ln


#exp2


#exp


#fl floor