not really known
Go to file
2020-08-05 07:33:41 -04:00
.vscode initial version of using ts compiler to remove unused locals 2020-07-31 21:22:56 -07:00
elm-packages/elm/parser add a copy of the elm/parser elm code so we can parse it 2020-08-01 18:36:35 -04:00
src add inlineEquality transformation 2020-08-03 22:38:41 -04:00
test added first version of inlining functions that were wrapped and returned from other functions 2020-08-02 09:02:53 -07:00
testcases fast forward elm-obj-file 2020-08-05 07:33:41 -04:00
.gitignore gitignore elm stuff 2020-07-25 10:29:10 -04:00
.gitmodules add elm-ui-2 2020-08-04 09:19:51 -04:00
add-benchmark.sh update add-benchmark script to account for branch 2020-08-04 09:21:24 -04:00
jest.config.js first iteration of custom types shapes optimization and inlining functions 2020-07-21 18:46:57 -07:00
LICENSE Initial commit 2020-07-20 08:37:25 -04:00
LINKS.md Create LINKS.md 2020-07-31 11:01:00 -07:00
package-lock.json add terser and report file sizes 2020-08-01 09:59:24 -04:00
package.json add terser and report file sizes 2020-08-01 09:59:24 -04:00
README.md Project Sketch 2020-07-20 09:50:54 -04:00
transformations.md add transformation note 2020-08-01 12:56:23 -04:00
tsconfig.json fixed ts-node launch 2020-07-25 14:38:20 -07:00
TSDX_README.md first iteration of custom types shapes optimization and inlining functions 2020-07-21 18:46:57 -07:00

Elm Optimize

This project is meant to explore different optimizations that are specific to elm-generated code.

I'd like to avoid aspects that can handled by terser, uglify or prepack just because it seems like this is a huge area and there's already a ton of work done. We should focus on things specific to Elm, and possibly make it easier for these tools to be even more effective.

The first focus is to implement transformations that were explored by Robin in this dev.to post

Needed work

  • - Set up a basic test example (e.g. fold through a list of maybe Ints and sum them).
  • - Set up complation pipeline
    • We want to be able to compare different JS outputs to get a handle of who does what transformation. So let's set up a pipeline that will generate multiple js files in a folder at different stages of the pipeline (e.g. elm.js, elm.optimized.js, elm.optimized.prepack.js. This will allow us to diff stages and ultimately compare how our tool can potentially allow other tools to function more effectively.

Choose AST tool We need some tool(s) that will allow us to do the following:

  1. Parse Elm code and extract information such as a type definition (i.e. what are all the variant names and their structures).
  2. Parse JS code and transform bits of the AST.

Options

Opimization exploration

  • 1. Parse Elm code and prepare a summary that matches custom type variant names to their type definition
  • 2. Fill out variant constructors with nulls so that the shapes of the objects are the same. (See V8 fast properties reference. Is there some way to check how V8 is implementing a specific object?)
  • 3. Transform A2(author$project$Main$add, 1, 2) to author$project$Main$add.f(1, 2) when appropriate

References

  1. V8 Fast Properties