Skip to content
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

Generate intermediate AST for elm-deps #175

Closed
wende opened this issue Aug 21, 2017 · 2 comments
Closed

Generate intermediate AST for elm-deps #175

wende opened this issue Aug 21, 2017 · 2 comments

Comments

@wende
Copy link
Owner

wende commented Aug 21, 2017

Since parsing takes most of the time (Compiling Elchemy takes 29 minutes for parsing and 10 seconds for compiling). It'd be a good choice to cache files from elm-deps and save their AST instead of parsing them each time.

Stuff to be done:

  1. Modify compiler to take saved ExContext.Context
  2. Find a way to serialize and deserialize AST (https://github.com/mpdairy/elm-frontier ?)
  3. Use serialized AST when file exists or parse the file otherwise
  4. Add elchemy deps to recompile dependencies in case of changed dependencies
@wende
Copy link
Owner Author

wende commented Aug 21, 2017

This might help a lot
https://stackoverflow.com/a/14802843/2086804

@wende
Copy link
Owner Author

wende commented Aug 21, 2017

After some thought's, the only stuff that has to be exported are:

Modules, TypeDeclarations and TypeAliases.

Adding to the compiler an check abstractly represented by something like this would be sufficient:

  1. Check if file elm/NAME.elm newer than lib/NAME.elchemy.ex
    a) if yes then compile the entire thing
    b) if no then take only module, type and type aliases and somehow inject them into the starting context. One way of doing that would be a special way of telling to the compiler it's a meta file and shouldn't have an output
  2. Compile files to new ex files, but only if they have changed

Gains:

  • MUCH better compilation time
  • Compile deps once, use them forever

@wende wende changed the title Generate intermediate AST for files that didn't change Generate intermediate AST for elm-deps Jan 10, 2018
@wende wende added this to the Elchemy 0.6 milestone Jan 25, 2018
wende added a commit that referenced this issue Jan 30, 2018
* deps 2

* Incremental compiler
wende added a commit that referenced this issue Jan 30, 2018
================

  * Closes #175 - Incremental compilation (#264)
  * Access macros (#263)
  * Update README.md
  * 0.5.6 / 2018-01-28 ================
  * 0.5.6
  * Elixir 1.6 support (#262)
  * Add new, init, clean, and version to usage message (#259)
  * No change-log in README anymore. It's always contained in a release
wende added a commit that referenced this issue Feb 6, 2018
================

  * Updated core
  * Non english locale bug (#289)
  * Closes #285 - Gitbook without summary (#286)
  * Update BASIC_TYPES.md (#282)
  * Update README.md (#279)
  * Update COMMENTS.md (#280)
  * Supplies #257 roadmap (#278)
  * Update README.md
  * Closes #257 roadmap (#277)
  * Supplies #272 with removed overload (#275)
  * Better contributor list
  * Contributors list
  * Progress updated
  * Closes #272 nested case fix (#273)
  * modernize .travis
  * Properly build website each time
  * stable release
  * 0.6.3 / 2018-01-30 ================
  * 0.6.3
  * Closes #270 bugfix type aliases recompilation (#271)
  * Moduledoc for the example (#269)
  * 0.6.2 / 2018-01-30 ================
  * 0.6.2
  * HOTFIX: No Error on empty files (#266)
  * Elchemy-page release for 0.6.1
  * Elchemy-page release for 0.6.1
  * 0.6.1 / 2018-01-30 ================
  * 0.6.1
  * Include new files into npm release
  * 0.6.0 / 2018-01-30 ================
  * 0.6.0
  * Closes #175 - Incremental compilation (#264)
  * Access macros (#263)
  * Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant