You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back when Elchemy started a year ago producing an output as a binary was an obvious choice because of readability. Right now, however, with an Elixir formatter being built-in and generally much nicer tools to produce readable code out of AST it's worth considering if overhauling the compiler from
Elchemy Code -> Ast -> Elixir Code
to
Elchemy Code -> Ast -> Elixir Ast -> Elixir Code
Pros:
Better (hopefully) readability
A lot less unnecessary parens
Much better support of line ordering (it might even be possible to do 1 to 1 line representation)
Smaller chance of making a mistake in output code
Much more universal and easier to reason about
!!! FREE MACROS !!!
Cons
Time taking
Additional layer of abstraction
Might be harder to manage
Removes the possibility of doing dirty tricks with the code (double edged sword though)
A lot of work for (almost) no added functionality for the end user
The text was updated successfully, but these errors were encountered:
I'd definitely output AST, feed that through Macro.to_string then feed that through Code.format_strring!.
Removes the possibility of doing dirty tricks with the code (double edged sword though)
Actually this is entirely incorrect. Elixir itself is a reduced syntax, the AST can actually represent a lot of code that is just entirely invalid in Elixir's syntax itself (obviously you'd want to make sure to put in appropriate unquote's and such in the AST to allow the syntax itself to properly represent it if you want to format it). :-)
Since this card requires Elixir parts that'd mean it first needs Elchemy to be run in its self-hosted version or we'd need to store the AST in intermediate files.
Either way it's a too low in terms of bang for the buck ratio for right now.
It should stick around here until it's time for it though
Back when Elchemy started a year ago producing an output as a binary was an obvious choice because of readability. Right now, however, with an Elixir formatter being built-in and generally much nicer tools to produce readable code out of AST it's worth considering if overhauling the compiler from
to
Pros:
Cons
The text was updated successfully, but these errors were encountered: