Skip to content

Instantly share code, notes, and snippets.

@helins
Created April 15, 2021 11:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helins/eacfc7d8b92b97693a93dd46e8a89677 to your computer and use it in GitHub Desktop.
Save helins/eacfc7d8b92b97693a93dd46e8a89677 to your computer and use it in GitHub Desktop.
;; Decompiling and pretty printing a WASM program such as "my_program.wasm":
;;
;; $ bb babashka_wasm.clj my_program.wasm
;;
;; Following WASM specs 1.1
(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {io.helins/wasm {:mvn/version "0.0.0-alpha2"}}})
(require 'clojure.pprint
'[helins.wasm :as wasm])
(-> *command-line-args*
first
wasm/decompile-file
clojure.pprint/pprint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment