Skip to main content

Compact

Compact is Midnight's dedicated smart contract programming language, designed for building secure, efficient, and adaptable decentralized applications.

Link to related documentation


Release 0.14.0TESTNET

Compactc 0.21.0

23 January 2025

Summary

  • Witness return values may need to be “disclosed”.
  • Square brackets construct TypeScript-compatible tuples.
  • You can use TypeScript-compatible destructuring.
  • The Void type is removed.
  • The syntax of for loops is aligned with TypeScript.
  • The Cell ledger ADT is now implicit.
  • Ledger ADT names are now part of the standard library.
  • Exported circuits are allowed to have the same name as witnesses.
  • We have improved syntax error messages.

Release 0.13.0TESTNET

Compactc 0.20.0

27 November 2024

Summary

  • Include search order has changed.
  • Modules can be imported from files.
  • The standard library is now a builtin module.
  • New structure creation syntax.
  • Spread syntax in structure creation.
  • The new keyword is removed.
  • Arrow circuit syntax for map and fold.
  • Anonymous circuit syntax is removed.
  • Sequence (“comma”) expressions allowed outside parentheses.
  • Improvements to error reporting.
  • The order of exported circuits is the same in TypeScript as in Compact.
  • The install.sh script is removed.
  • Bug fixes.

Release 0.11.0TESTNET

Compactc 0.19.0

18 October 2024

Summary

  • Generics now use angle brackets.
  • Size parameters in generics are prefixed with #.
  • Unsigned Integer is changed to Uint.
  • Bounded unsigned integers have new syntax.
  • null() for default values is now default<>.
  • map and `fold expressions have different syntax.

Release 0.10.1TESTNET

Compactc 0.18.2

26 September 2024

Summary

  • There is a new public ledger declaration syntax.
  • The ledger keyword is no longer used for ledger field access.
  • Ledger kernel operations are available on kernel.
  • Ledger-field update shortcuts are now statements.
  • Unsigned Integer sizes can now be generic.
  • There is better static typing of subtraction.
  • There is new precedence for the relational operators.
  • Generics can no longer be parameterized over generics.
  • The identifier contract is now a reserved word.
  • The run-compactc.sh shell script is renamed to compactc.