in ,

roman01la / clj-wasm, Hacker News

roman01la / clj-wasm, Hacker News


        

    

  

                  

      

        

                    

Join GitHub today

          

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

          

Sign up        

      

    

      

          Clojure-flavored WASM’s text format           

       

Clojure            WebAssembly        

      

    

        

                    

        

Clojure-flavored WASM’s text format

Turns this

(module  (defnadd[^i32 a ^i32 b]     (let[x1]       (if(=ax)         (ax)         (ab))))    (defnmain[]     (add9(8) )) )

into this

(module   (type $ return_add) func (param $ ai 32) (param $ bi 32) (result i 32)))    (func $ add (param $ ai 32) (param $ bi 32) (result i 32) (local $ xi 32)     (block (result i 32)       (local.set $ x (i 32 .cont  (1) ))       (if(result i 32)         (i 32.EQ          (local.get $ x)           (local.get $ a))         (then           (i 32             (local.get $ x)             (local.get $ a)))         (else          (i 32             (local.get $ b)             (local.get $ a))))))    (export"add"( func $ add))    (type $ return_main) func (result i 32)))    (func $ main (result i 32)     (call $ add       (i  Const9)       (i  Const8)))    (export"main"( func $ main)))

  

  

    

     

Brave Browser
Read More

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Farage wants to sue us. And he's using EU law to do it ‍♀️, Hacker News

Farage wants to sue us. And he's using EU law to do it ‍♀️, Hacker News

‘Maharashtra govt illegitimate, cannot stay a day more’: Congress – Hindustan Times, Hindustantimes.com

‘Maharashtra govt illegitimate, cannot stay a day more’: Congress – Hindustan Times, Hindustantimes.com