-
Notifications
You must be signed in to change notification settings - Fork 62
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
Refactor compiler to separate impure and pure code #105
Comments
Sounds like a good idea! The compiler namespace has become quite overgrown as new features were added and I think the three phases that you proposed is a nice, logical way to split all of that up. Perhaps this would a be a good time to take a look at #98 as well. Stasis sounds like a good library to use in Cryogen as well. Is this something that you're interested in working on? |
Yeah, I'm interested in working on this. I could start by refactoring the way cryogen reads files as a relatively self-contained step. I'm thinking that there should be a function called |
Awesome!
That sounds like a good place to start. There's going to be a lot of code moving around for the full refactor so I definitely want this to be approached in an iterative fashion. |
I'm thinking that dealing with markups could be made better by:
|
Currently the compiler has quite a bit of io spread out in many functions. It would be nice to refactor it into three distinct phases.
All the difficult things are moved into the pure middle part, which becomes a lot more convenient to test and nicer to work with in general. (It's probably not necessary to be militant about purity, the printlns that are scattered around are kind of nice.)
The output data structure could be a map from url to finished html. There's a quite nice library that takes a data structure like that and either writes it to disk or serves it locally with ring. Using that we could save quite a bit of code in the compiler and, more importantly, code in the template.
It also has some other niceties.
Any thoughts on this?
The text was updated successfully, but these errors were encountered: