mudasobwa

mudasobwa

Creator of Cure

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}]}
  ]}}

Metastatic v0.23.0 — Documentation

https://github.com/oeditus/metastatic

Most Liked

mudasobwa

mudasobwa

Creator of Cure

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

dimitarvp

Wait until the Java devs find you with the pitchforks and torches for daring not to use “class” but “module” instead.

Asd

Asd

How does it compare to TreeSitter ASTs?

Last Post!

mudasobwa

mudasobwa

Creator of Cure

BEAM languages do provide their own native AST which metastatic uses. JS/TS is planned by me, but not yet even taught.

Where Next?

Popular in Announcing Top

zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10789 141
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement