-
Notifications
You must be signed in to change notification settings - Fork 13
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
Not using bytestring-builder internally? #53
Comments
Sorry, submitted too soon. Editing the description now. |
The way this works internally is that the caller supplies a There is one issue though, and that is macros. The semantics of macros are such that whatever the macro code emits when run can be captured into a ginger variable, and of course in order to do that, it must be buffered in memory, and the mechanism that does that currently involves concatenating A solution for this would be to introduce a type family or fundep typeclass, something along the lines of:
And then capture macro output not into On a side note: using lazy texts wouldn't actually fix anything, because the Tower Of Hanoi problem still persists, we would just postpone the inevitable and build up a bunch of thunks - the only situation where we'd win anything would be when the output of a macro is thrown away, or truncated. If you feel like taking a stab at this, by all means go ahead; if not, I might be persuaded to do it myself, though I'm currently in between holiday trips, so I won't be able to work on it for at least another 2 weeks. HTH. |
I'm planning to use
ginger
as the underlying library for a static site generator. However, I'm puzzled why the only two types types implementing ContextEncodable areText
andHtml
(which itself is a newtype overText
).Doesn't ginger internally use lazy-text, lazy-bytestring, or a bytestring-builder? Wouldn't appending to a strict-text repeatedly be very expensive?
The text was updated successfully, but these errors were encountered: