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

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?

Popular in Blog Posts Top

New
lawik
One of the Erlang ecosystem’s spiciest nerd snipes are hot code updates. Because it can do it. In ways that almost no other runtime can.
New
jordiee
https://medium.com/@jpiepkow/distributed-state-is-hard-5a0d384c2f3c
New
paulanthonywilson
So you’re enjoying using WebSockets with Elixir’s Phoenix Framework, and you want to send some binary messages. Maybe it’s an audio clip,...
New
rlopzc
Learn how to leverage Erlang + Elixir’s GenServer to build a robust FTP Client. https://rlopzc.com/posts/elixir-ftp-client-genserver-par...
New
brainlid
Livebook was created for machine learning in Elixir but Livebook isn’t limited to machine learning. I found it works really well for docu...
New
John-BoothIQ
TL;DR: Good: AI is great at Elixir. It gets better as your codebase grows. Bad: It defaults to defensive, imperative code. You need...
New
wmnnd
Hey there, I’ve started a little blog series about building and deploying Elixir applications. Now I would like to share with you the fi...
New
paulanthonywilson
This is an overview of different ways to try and kill an OTP process (in Elixir) and the behaviour to expect when that happens. I know th...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New

Other popular topics Top

msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement