HairyDude / pdxparse

A parser for scripts used in Paradox Development Studios games, written in Haskell
MIT License
6 stars 7 forks source link

Compiling Messages.hs is slow #6

Open HairyDude opened 8 years ago

HairyDude commented 8 years ago

Loading Messages.hs in GHCi is quick enough, but compiling it is very slow, even with optimizations off. With -O2 my computer runs out of memory. This is probably a consequence of these GHC bugs:

In particular the second, since ScriptMessage is a record type with many constructors (one for each message, of which there are currently >300), and the ToMessage(?) instance is just a function with a huge number of patterns.

HairyDude commented 7 years ago

The untemplate branch works around this issue by replacing the mkMessage splice in Messages.hs with its expansion. It's much easier to add messages using mkMessage so I'd like to go back to doing that, but that will have to wait till these GHC bugs are fixed.