mudasobwa

mudasobwa

Creator of Cure

A Score for an Invisible Orchestra

Imagine a conductor forced to relearn musical notation every time a new instrument joins the orchestra. Violin—one system of writing. Cello—another. Oboe—a third, with reversed polarity, no less. The trumpet flatly refuses to acknowledge the existence of the staff and insists on a tablature of its own invention. Absurd, of course. In the real world every instrument reads the same score. Notes, rhythm, dynamics are universal. Only the technique of execution differs.

MetaAST is that score.

Most Liked Switch mode

Lucassifoni

Lucassifoni

Pandoc for programming languages ? I like the idea, the “common core” as other posters said needs to be arbitrarily defined because concepts vary a lot across languages. But that kind of constraint is what makes those endaevours both desperate and interesting - best kind of project if you ask me. Good luck !

dimitarvp

dimitarvp

A bit pretentious writing style but I enjoyed the article.

Extremely ambitious project that I’d join and would try to help. I do agree that each language’s AST is kind of a distraction and if we can standardize a converter from that to the meta-AST then we’d score huge wins in code analysis. Which we desperately need recently.

One problem is that many languages don’t have a stable AST – Elixir is one of them. However, combining the language and its version allows us to pin down exact AST details. Requires more work – but it’s only done once.

Really though: amazing idea. Would love to see it bear some fruit.

Asd

Asd

Strange post.

First of all, there are no concepts which exist in all languages. Even variables don’t exist in all languages (like stack-oriented languages or assembly languages).

Second, is that purity is a higher-level construct and what pure and what is not — defined strictly by the developer. In a language like C, setting data by some local pointer can be a side effect, given that it can be used as a way to share some information with another thread. And even if you define what is pure and what is not (what will most likely be different from the developer’s understand), you can’t just write a generic analyzer, because not all languages have functions, and those who have them, usually can’t provide a guarantee that all code reachable by the function will be a part of the call graph.

Even in Elixir, this code is pure

def add_five(x) do
  x + 5
end

But so is this

def add_five(x) do
  ref = make_ref()
  caller = self()
  spawn_link(fn -> send(caller, {ref, x + 5}) end)
  receive do
    {^ref, result} -> result
  end
end

And the fn inside is invisible in the call graph. You may argue that the latter version changes the state of the system by introducing a new process. But I will say that the first version changes the current_stacktrace field of the process info. So, again, developer defines what “pure” means.


I mean, you can represent different languages in the similarly structured AST, but this would just offload semantic differences of the languages on the programs which would analyze such AST. There would be no universal algorithms, just universal representation with lots of language-specific algorithms around it

Where Next?

Trending in Blog Posts Top

bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
ryanzidago
Hi all, In this article, I make the case for each test owning its setup. Usually I forbid my AI agents to use the setup callbacks; I mu...
New
zorn
As I’ve leaned into AI code generation on LocalCents, the volume I ship has climbed, and my worry shifted from any single change to the l...
New
jswanner
I wrote about an issue I had with a LiveView application, and how I solved the problem by debouncing updates server-side (within the Live...
New
abreujp
I’ve published a new article in my Elixir learning series on dev.to exploring what happens when tagged tuples aren’t enough - the try, re...
New
zorn
A recent ex_money v6 upgrade was blocked because Timex pins an old gettext. Rather than one big remove-and-rewrite PR, I used a shim: a m...
New
pckrishnadas88
This article demonstrates how to build a minimal stateful process using only Elixir’s core concurrency primitives: spawn/1, send/2, recei...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement