Skip to content

Releases: fjl/geas

v0.3.1

22 Apr 10:14
@fjl fjl

Choose a tag to compare

This release introduces a source code formatting tool and a stack checking pass to the assembler.

Formatter

You can now use geas -f -w <file> to apply canonical formatting to a source file. It is also possible to assert whether a file is canonically formatted using the -check flag. At this time the formatter is not configurable in any way.

Stack Checker

The assembler now has a facility for checking the correctness of 'stack comments', which are instruction level comments declaring the operation's output stack. The stack checker is not enabled by default, you must enable it explicitly using the -stackcheck flag. For more information, see the stack checker documentation.

Targets

  • The fork definition of the Paris (a.k.a. "merge") fork was incorrect, making the BASEFEE opcode inaccessible.
  • The missing BLOBBASEFEE opcode has been added to the Cancun fork target.
  • Support for the Osaka fork (defining the CLZ opcode) has been added, and it is now the default latest fork used by the assembler.
  • Experimental support for the Amsterdam fork has been added. This includes EIP-8024 SWAPN, DUPN, EXCHANGE instructions, as well as the SLOTNUM opcode.

Other Improvements

  • The geas tool has improved error messages when the assembler input file escapes the project root directory
  • geas now supports using '/dev/stdin' as a filename.
  • Various minor inconsistencies in the assembler have been fixed.

v0.3.0

24 Oct 13:37
@fjl fjl

Choose a tag to compare

This release brings significant improvements to the expression language, as well as the ability to insert arbitrary bytes into the assembler's bytecode output.

Language

  • The new #bytes directive inserts raw bytes into the output.
  • There is also a way to "name" #bytes, which allow expressions to reference the length and output offset of the inserted bytes.
  • Values used by expression language computations now keep track of leading zero bytes.
  • Operator precedence has been changed to match Go. This is a backwards-incompatible change, which could lead to expressions being evaluated differently. Previously, operator precedence was C-like, with an ordering of multiplication > addition > bit-shifts > logic. The new precedence is simpler with only two levels: * / % & << >> (multiplication/and/shift) bind stronger than + - | ^ (addition/or).
  • Unary minus is now supported in expressions.
  • Escape sequences \n, \r, \t, \\, \", \xFF can be used in strings.
  • Dotted labels (i.e. labels without JUMPDEST) can now be accessed without the dot. This change is meant to make source text look less intimidating. No backwards-compatibility issues can result from this, since dotted and non-dotted labels share a namespace.
  • Similarly, it is now possible to call builtin macros without writing the dot prefix, i.e. you can write abs(-1) instead of .abs(-1).
  • Builtin macros bitlen(), bytelen() have been renamed to intbits() and len(). Their legacy equivalents are still present, but will produce a deprecation warning when used.
  • The #assemble directive has been deprecated in favor of a new assemble() builtin expression macro. You can use assemble() in combination with #bytes to do what #assemble did.

Disassembler

  • Invalid opcodes are printed as #bytes instead of erroring.
  • When disassembling with logical blocks, terminating instructions (STOP etc.) are treated as a block separator.

Targets

  • Geas now supports EVM opcodes added by in the Tron network (#19)

v0.2.2

18 Feb 14:25
@fjl fjl

Choose a tag to compare

  • Go API improvements:
    • asm.Compiler now provides SetGlobal for overriding macro values.
    • asm.Compiler resets internal state between compilation operations.
  • Instruction sets can now be found by their alternate name (like "merge" instead of "paris").

v0.2.1

17 Feb 18:12
@fjl fjl

Choose a tag to compare

This release adds a disassembler mode (geas -d) and information mode (geas -i) to the command-line tool.

v0.2.0

25 Nov 08:30
@fjl fjl

Choose a tag to compare

This release has some language changes and new compiler features.
Go 1.23 or later is required to build this version.

Macro definition language change

Expresssion macro definitions must now contain an equals sign (=) before the body expresssion.
New definition syntax:

#define macro1 = 1
#define macro2(a) = (100 + $a) / b

Note the old syntax without '=' is still accepted, but produces a warning.

EVM target

You can now declare the EVM version the program should be compiled for.
Use the #pragma target directive to change the target instruction set.

#pragma target "berlin"

All past forks up to "prague" are supported.

Other changes in this release

  • Binary operator precedence is now implemented.
  • Unused label detection: geas will now warn you about labels which are defined but never used.
  • Unreachable code detection: a warning will also be issued for code that can never be reached
    by the EVM, e.g. instructions after JUMP or STOP.

v0.1.0

20 Nov 06:38
@fjl fjl

Choose a tag to compare

The initial release of geas. With more experimental changes to come soon, this release can be used a stable baseline.
Building geas v0.1 requires Go version 1.21 or later.