New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List of other projects that are interested in using an Elm AST #236
Comments
tl;dr an AST could enable the creation of editor plugins for generating decoders and encoders from types. Things like http://noredink.github.io/json-to-elm/ and editor-embedded versions of it could make great use of a public AST. There are two user experiences I can imagine here:
The first case it seems pretty straightforward, just get the AST for the file and walk through it, keeping track of where you are and generating an additional AST for decoders and encoders along side the found types. The second case requires knowledge of where the cursor is or maybe what part of the AST is bounded by the user's selection. And then for both cases it would be great to be able to figure out if the user has already generated a decoder for a particular type so that it can be updated in place rather than having a new one appended and leaving the wrong one still hanging around. Having detailed structured knowledge of the user's Elm code could be great for making guesses at how a user wants to write decoders and encoders for complicated things like union types, too. |
Hello everyone, just wanted to introduce myself. I'm Christoph Hegemann and spend most of my free time working on tooling for the PureScript community. I'm not really active in the Elm scene, but all the work you are doing on language tooling is very exciting to me and I think some of my ideas could be implemented in Elm (especially because you have the pretty printer I yearn for in PS 😄). One neat application of having an AST format that editors can consume is that you can stop using Regexes to highlight source code and instead use the semantics a compiler can gather about your code. The best example of this I know about is the Idris compiler. As Idris is a dependently typed language, values and types can appear interchangeably and you can't actually discern between the two from "just" parsing the source code. So extracting the highlighting after type checking allows to discern between types and values in the editors. Elm and PureScript are not as extreme in this regard, but it would definitely be nice to apply semantic highlighting. Regexes have tendencies to be very fragile and fail on edge cases. |
Another addition to this list: I'm working on a project that will generate |
I just deleted a few unused functions in a codebase and I thought it would be great if there was a tool that would go threw your code base and let you flag all the functions (and types) that you define and never use. I even know how to write it |
@zkessin I'm working on such a tool. I hope to make it public in a week or two. |
I'm looking into writing a graphical tool for creating/editing elm-style-animations (which would need to read/write your current Elm code, of course.) |
I would like to create an Elm plugin for a particular popular IDE. This kind of tool would be very valuable. Just as valuable would be a formal language syntax spec. BTW is there any intention of this becoming Elm's version of HIE |
@zkessin Released my tool as elm-analyse. Let me know what you think (ping me on slack) |
I am using elm-css because of its support for using a union type as CSS classes and ids. Now that I have a large amount of CSS in elm-css, I would like to reuse those selectors for the non javascript version so my site has a consistent theme. I use Rust to render the webpage, and I would like to export the Elm union types for classes and ids into Rust code so that my selectors are synchronized (and checked by the compiler). Ideally I would have Elm code be the source of truth for CSS selectors, because the designers are the ones in control of the selectors. Instead, because only the rust compiler has the ability to output the its ast representation as JSON |
As discussed here https://groups.google.com/d/topic/elm-dev/QPLPd8q1Od0/discussion
If you are working on a project that could benefit from elm-format producing / consuming a JSON-formatted AST, please comment on this issue to let others know about it.
Known projects (feel free to comment below with more details):
The text was updated successfully, but these errors were encountered: