This strikes me as incredibly clever.<p>The compiler and code-generation implementation seems equally straightforward and complex, my mind is racing trying to build a mental model of the whole thing.<p>The code generation comes after a feature-packed parser and "compilation" step. Emitting go source code is nice because subsequent compilation tells you if its valid or not.<p>I'm wondering if there is a specific reason the "framework" source code is emitted via a series of printf calls[0]. A library of go template "fragments" might be easier to manage (and debug).<p>[0] <a href="https://github.com/adhocteam/pushup/blob/0519a782c1c9fc7987728f1a71d408b2388d8c72/codegen.go#L780">https://github.com/adhocteam/pushup/blob/0519a782c1c9fc79877...</a>
I wonder if the template syntax with no explicit terminator for variables and expressions is a good idea. I can see many footguns for the user and the parser…
This is a neat take for sure, will have to play with it. Go is so great for APIs but really nobody has built anything that is anywhere near as good as say Django for general websites. I will admit I'm a bit skeptical that this approach doesn't follow say the Django approach of application/router/view a bit more closely as I think that's about as good a setup as I have seen but will reserve judgement until I play with it more. Either way kudos for doing this!
Go always felt like a fairly low-level approach to web-development. I'd love for it to see a higher-level, more-batteries-included framework as a viable alternative make it to mainstream. Here's me wishing good luck to the Pushup team.