# Huff (programming language)

**URL:** <https://forum.openzeppelin.com/t/huff-programming-language/1899>\
**Category:** General\
**Tags:** languages, huff\
**Created:** [December 6, 2019, 10:34pm UTC](https://forum.openzeppelin.com/t/huff-programming-language/1899 "2019-12-06T22:34:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DericEcourcy](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@DericEcourcy](https://forum.openzeppelin.com/u/DericEcourcy)\
**Post date:** [December 6, 2019, 10:34pm UTC](https://forum.openzeppelin.com/t/huff-programming-language/1899/1 "2019-12-06T22:34:57Z")

</div>

> Find resources about other languages in the [Programming Languages Reference List](https://forum.openzeppelin.com/t/programming-languages-reference-list/1878).

Huff is an extremely low-level language for writing smart contracts. It compiles to EVM bytecode, so it functions on all blockchains that run an EVM. It is designed to make extremely gas-efficient smart contracts, at the cost of user-readability and developer sanity. It is similar to solidity assembly, with the notable distinction that it uses "macros", which can be easily tested on their own. It was developed by the [AZTEC protocol](https://www.aztecprotocol.com/) team while writing their `Weierstrudel` smart contract.

## Source Code Repository

- [https://github.com/AztecProtocol/huff](https://github.com/AztecProtocol/huff)

## Example Code

- [https://github.com/AztecProtocol/weierstrudel](https://github.com/AztecProtocol/weierstrudel)
- [https://github.com/AztecProtocol/Oliver](https://github.com/AztecProtocol/Oliver)

## Guides

- [Smart contract programming in Huff - part 1](https://medium.com/aztec-protocol/from-zero-to-nowhere-smart-contract-programming-in-huff-1-2-ba2b6de7fa83) (Also see parts [2](https://medium.com/aztec-protocol/from-zero-to-nowhere-smart-contract-programming-in-huff-2-3-5438ef7e5beb), [3](https://medium.com/aztec-protocol/from-zero-to-nowhere-smart-contract-programming-in-huff-3-4-6b347e23d66e), and [4](https://medium.com/aztec-protocol/from-zero-to-nowhere-smart-contract-programming-in-huff-4-4-9e6c34648992))
- [Huffing for Crypto with Weierstrudel](https://medium.com/aztec-protocol/huffing-for-crypto-with-weierstrudel-9c9568c06901)

## Video Introduction

- [Huff Basics - Video introduction to Huff (programming language)](https://forum.openzeppelin.com/t/huff-basics-video-introduction-to-huff-programming-language/2384)

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 8, 2019, 11:21pm UTC](https://forum.openzeppelin.com/t/huff-programming-language/1899/2 "2019-12-08T23:21:50Z")

</div>

❤ the Huff guide:

> Huff is also a game, played on a chess-board. One player has chess pieces, the other draughts pieces. The rules don’t make any sense, the game is deliberately confusing and it is an almost mathematical certainty that the draughts player will lose. You won’t find references to this game online because it was “invented” in a pub by some colleagues of mine in a past career and promptly forgotten about for being a terrible game.
> 
> I found that writing Huff macros invoked similar emotions to playing Huff, hence the name.

---

<div class="post-metadata">

**Author:** ![DericEcourcy](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@DericEcourcy](https://forum.openzeppelin.com/u/DericEcourcy)\
**Post date:** [December 9, 2019, 6:40pm UTC](https://forum.openzeppelin.com/t/huff-programming-language/1899/3 "2019-12-09T18:40:22Z")

</div>

> [@abcoathup](#):
>
> ❤ the Huff guide

Fully agree! Even if you don't plan to learn huff, reading the guides has some pretty great entertainment value
