mudasobwa
Metastatic - a MetaAST for Elixir, Erlang and technically every language
Metastatic is a library that provides a unified MetaAST (Meta-level Abstract Syntax Tree) intermediate representation for parsing, transforming, and analyzing code across multiple programming languages using a three-layer meta-model architecture.
“Build tools once, apply them everywhere,” they Java-evangelists said. I tried my own path to create a universal meta-model for program syntax that enables cross-language code analysis, transformation, and tooling.
Metastatic provides the foundation for that—the MetaAST meta-model and language adapters. Tools that leverage this foundation (mutation testing, purity analysis, complexity metrics) are built separately.
It’s already used in Ragex v0.19.0 — Documentation , https://cure-lang.org, and some WIP pets.
Now it’s probably a good time to release it to the wild.
iex|🌢|1 ▶ Metastatic.quote("defmodule M, do: def forty_two, do: 42", :elixir)
{:ok,
{:container,
[container_type: :module, name: "M", module: "M", language: :elixir, line: 1],
[
{:function_def,
[
name: "forty_two",
params: [],
visibility: :public,
arity: 0,
function: "forty_two",
language: :elixir,
line: 1
], [{:literal, [subtype: :integer], 42}]}
]}}
Most Liked
mudasobwa
They’ll find {:container, [container_type: :class … there. I write all my code in an assumption there are many violent java-coders knowing where I live.
dimitarvp
Wait until the Java devs find you with the pitchforks and torches for daring not to use “class” but “module” instead.
Asd
Last Post!
mudasobwa
BEAM languages do provide their own native AST which metastatic uses. JS/TS is planned by me, but not yet even taught.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









