owickstrom / idris-vimscript

Compile Idris to Vimscript, like you always wanted.
Other
130 stars 5 forks source link

DCE improvements #25

Closed owickstrom closed 6 years ago

owickstrom commented 6 years ago

Seems the DCE optimization recorded all functions' names and prevented elimination of them (not sure anything was eliminated). I've fleshed out the pattern matching a bit and added tests. Could perhaps be cleaned up with Uniplate, but an improvement nonetheless.

Before:

$ wc -l examples/*.vim
  575 examples/loop.vim                                                                                                                           
 1464 examples/misc.vim                                                    
 2039 total         

After:


$ wc -l examples/*.vim  
  346 examples/loop.vim                                                                                                                                             
 1163 examples/misc.vim                                                                                 
 1509 total                           
``
mrkgnao commented 6 years ago

Awesome work!

owickstrom commented 6 years ago

@mrkgnao Cool! I'm working on a more robust version tracking references in a graph, to find more dead code.