Closed setop closed 2 months ago
I should be able to whip up some support for elixir somewhat quickly, but I know literally nothing about the language. Expect the first few iterations to suck a lot :)
The language is really nice, just pattern matching and pipe operator are god's gifts. But that's not the topic :)
I don't know the effort for CodeMovie to support a new language. You did not published the generator, only the runtime, did you ? I looks like it is based on tokens and not depending on the language syntax, is it ? Elixir is supported by highlightjs, I don't know if it helps.
It roughly works like this:
In theory a 10 line wrapper around lezer-elixir world add "support" for elixir, but without step 2, it would not be particularly great support. The diffing algorithm works best when the CST is augmented with all sorts of context information, some language-specific magic numbers might need adjusting. Some nodes in the CST even need to be broken down more than any regular parser would normally do (eg. parse natural language inside strings and comments).
We'll see how it goes. I will take a stab at elixir in the next few days.
Progress report: I worked my way through most of the documentation and should have most syntax working properly. The next step is to extract more context info for the diffing algorithm, but that should not take too long, given what I now know about Elixir and the parse tree. Expect a release (extremely buggy) in a few days.
Screenshot from my test bench:
This is as far as I got without really trying to build some animations (and actually learning elixir in the process). Probably not perfect, but maybe okay for a first release. Expect that in a few days, once the playground and the docs have been updated.
lovely
https://code.movie/blog/elixir-support-and-improved-stability-in-0.0.14.html :sparkles:
LMK if you find any bugs, strange behavior, missing syntax etc.
I tested with a more larger code snippet. It is beautiful :)
I tried with Elixir code but syntax highlighting is not supported making the result a bit disappointing.