{"repo":"0xMacro/trim","free":true,"listed":false,"github":"https://github.com/0xMacro/trim","clone":"git clone https://github.com/0xMacro/trim.git","description":"An opcode-oriented language that compiles to the EVM","language":"TypeScript","stars":72,"topics":["evm","evm-bytecode","ethereum"],"license":null,"category":"blockchain-web3","readme_excerpt":"Trim Trim is a opcode-oriented programming language for the Ethereum Virtual Machine (EVM). It offers syntax for writing highly optimized code in a more readable manner, without introducing mental or complexity overhead. - Try it in your browser! - See the ETH Global Talk - Read the slides - Install the VS Code Extension Getting Started First install Trim (and ethereumjs/vm as you'll probably use its opcode definitions) Then use the binary... ...or import and compile: If you need to configure opcodes: Sample Here's a template to get started writing a full smart contract with Trim: Syntax First and foremost, Trim is a superset of bare assembly. You can always write opcodes in a plain manner. For example, this is valid Trim: What Trim introduces is s-expressions . An s-expression allows you to write in opcode-arguments notation: This code is equivalent to the previous example. You can also use the top operator ( ) to refer to the top of the stack. The following examples are all equivalent: Note how you don't have to write all your code in s-expressions. Features When you write a Trim s-expression, you gain access to a few features. Aside from defining a label, these features are only accessible within s-expressions. Strings Trim allows you to write double-quoted string literals. For example: Labels When deploying an EVM smart contract, you deploy both the initialization code and the runtime code as one long sequence of bytes. During this deployment transaction, the EVM will run","default_branch":null,"files":null,"tree":[],"storefront":"/r/0xMacro","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/0xMacro/trim/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}