diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a1e3f4842296ba925e0ec59910098c93a882393..11ba060046b79c4b9faeadb50def4a62ae4d5579 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ pages: script: - mkdir public - - cp -r site public + - cp -r site/* public artifacts: paths: - public diff --git a/site/feed.xml b/site/feed.xml index a4fe98d5418a6713a2734c539479079b2116988e..e23c0754340db352a5f2ad989a75f5576635b699 100644 --- a/site/feed.xml +++ b/site/feed.xml @@ -1,4 +1,4 @@ -null_radixRecent Posts2020-03-21T17:36:34-0400Merklizing ASTsmjbeczemjbecze@riseup.net2015-12-29T13:22:00-0500<p><em>Special thanks to <a href="http://juan.benet.ai/">Juan Benet</a> for mentioning this idea at Devcon 1.</em></p><p>Recently I wrote a draft of <a href="https://github.com/ethereum/EIPs/issues/48">EIP 105</a> which propose using a subset of webassembly as Ethereum’s VM. If you aren’t aware webassembly “is a new, portable, size- and load-time-efficient format suitable for compilation to the web.” One interesting note about Webassembly doesn’t compile to linear byte code. Instead it uses an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax Tree (AST)</a>. This might not surprise you if you have an experience with LLVM IR. But for me it was a new concept to have bytecode in this form.</p><h2>What is an AST?</h2><p>It is just a tree repesentation of some code. Each node of the AST represents an expression. Each function body consists of exactly one expression. Compared to the source code, an AST does not include certain elements, such as inessential punctuation and delimiters (braces, semicolons, parentheses, etc.).</p><p>To give you a better idea here is a textual representation of some webassembly code using <a href="https://en.wikipedia.org/wiki/S-expression">s-expressions</a>.</p><pre><code> <span class="syntax-comment">;; Recursive factorial +null_radixRecent Posts2020-03-21T17:43:12-0400Merklizing ASTsmjbeczemjbecze@riseup.net2015-12-29T13:22:00-0500<p><em>Special thanks to <a href="http://juan.benet.ai/">Juan Benet</a> for mentioning this idea at Devcon 1.</em></p><p>Recently I wrote a draft of <a href="https://github.com/ethereum/EIPs/issues/48">EIP 105</a> which propose using a subset of webassembly as Ethereum’s VM. If you aren’t aware webassembly “is a new, portable, size- and load-time-efficient format suitable for compilation to the web.” One interesting note about Webassembly doesn’t compile to linear byte code. Instead it uses an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax Tree (AST)</a>. This might not surprise you if you have an experience with LLVM IR. But for me it was a new concept to have bytecode in this form.</p><h2>What is an AST?</h2><p>It is just a tree repesentation of some code. Each node of the AST represents an expression. Each function body consists of exactly one expression. Compared to the source code, an AST does not include certain elements, such as inessential punctuation and delimiters (braces, semicolons, parentheses, etc.).</p><p>To give you a better idea here is a textual representation of some webassembly code using <a href="https://en.wikipedia.org/wiki/S-expression">s-expressions</a>.</p><pre><code> <span class="syntax-comment">;; Recursive factorial </span> <span class="syntax-open">(</span><span class="syntax-symbol">func</span> <span class="syntax-symbol">$factorial</span> <span class="syntax-open">(</span><span class="syntax-symbol">param</span> <span class="syntax-symbol">$i</span> <span class="syntax-symbol">i64</span><span class="syntax-close">)</span> <span class="syntax-open">(</span><span class="syntax-symbol">result</span> <span class="syntax-symbol">i64</span><span class="syntax-close">)</span> <span class="syntax-open">(</span><span class="syntax-symbol">if_else</span> <span class="syntax-open">(</span><span class="syntax-symbol">i64.eq</span> <span class="syntax-open">(</span><span class="syntax-symbol">get_local</span> <span class="syntax-symbol">$i</span><span class="syntax-close">)</span> <span class="syntax-open">(</span><span class="syntax-symbol">i64.const</span> <span class="syntax-symbol">0</span><span class="syntax-close">)</span><span class="syntax-close">)</span> <span class="syntax-open">(</span><span class="syntax-symbol">i64.const</span> <span class="syntax-symbol">1</span><span class="syntax-close">)</span>