Pushup creator here. We're interested in feedback on the design. Pushup introduces a new lightweight template syntax that mixes Go code and HTML in the same page; pages are then compiled down to pure Go, relying on the net/http package. Pushup uses file-based routing, so adding a page adds a route to your app. The template language has an "inline partials" feature to make it easier support for modern hypermedia libra…
This looks really good. I like the compilation to a single binary. I'm already using Htmx with Flask for routing/templating. File based routing with a page as the unit of functionality sit well with me. The use of caret to denote Go code is quite clean, but given well formed HTML, could the parser detect anything not inside HTML tags as Go code and thus remove the need for a caret outside of HTML. I will be trying th…
Pushup: a new compiler for making web apps in Go
51–60 of 121 posts
Re: Pushup: a new compiler for making web apps in Go
#52Earlier quoted context omitted.
One counterpoint is React is doing gangbusters right now and uses the JSX syntax extension to embed HTML directly into JavaScript or TypeScript. To my money, the main issues with PHP had little to do with template embedding and everything to do with Perl being a messy language for writing correct code (coupled with too many people in the era underestimating the importance of "correctness" for HTML rendering when the…
Are you equating PHP and Perl? If so, that's incorrect - the relationship between the two is just one of influence, PHP has some influences from Perl (but also tons from C, C++, and Java).
Java, yes, mostly.
Re: Pushup: a new compiler for making web apps in Go
#53Earlier quoted context omitted.
I’m Finnish. The caret is not always easy to type in my experience on international keyboards. Not sure what the added value is of creating yet another convention here, as there are so many already with each new templating language.
Oh yes it's pretty hard to type on a German keyboard as well. In most editors you will need two keystrokes.
(Or even better against the {{ }} ones requiring 6)
Re: Pushup: a new compiler for making web apps in Go
#54Re: Pushup: a new compiler for making web apps in Go
#55It's a nice idea. I'm going to dig a little deeper in the design and developer experience choices. That being said, I am a little curious -- what is the intended use case here? The reason I am asking is because I've been doing lots of web-development, with Go as a primary backend lang, for the last 9 years but never have I seriously felt the need to do serve the UI from Go. I guess there is some advantage reducing n…
The imagined use-case for Pushup is the same niche that Rails, Django, and Flask apps occupy, which is a wide range but broadly I would describe as page-oriented, HTML-first, server-side frontends. I started Pushup because I asked myself, I like programming in Go and think (like you) it's great for web backends - but what is holding it back from being a great full-stack web dev language or environment? net/http is a…
Re: Pushup: a new compiler for making web apps in Go
#56This looks really promising — at first blush, I like this a lot more than normal Go templating! That said: maybe it's just my bias as someone who primarily works with React, but I'm wondering why not just mimic JSX, which has been incredibly successful and has millions of people who already understand it. The big missing piece to me here is composability. How can I encapsulate reusable bits of markup, styles and pres…
Definitely considered that. Might be worth revisiting.
> The big missing piece to me here is composability
You zeroed in on the right things ;^) I have a draft note to myself about pages-as-components. I have some ideas (basically, mimic ASP.net Razor components at the moment). Having a compiler with full control of the page makes this easier to figure out.
> without having to backtrack, since that last period is ambiguous in this grammar.
It doesn't backtrack, it just looksahead at the next token: https://github.com/adhocteam/pushup/blob/main/main.go#L3692
Re: Pushup: a new compiler for making web apps in Go
#57Earlier quoted context omitted.
same in french. it's a dead key on our keyboard, so it's basically two keystrokes instead of one to type it. to be fair most special characters are behind AltGr on azerty, soooo...
Interestingly, there's no such problem on Cyrillic keyboards despite being a totally different alphabet. We only need to switch the current layout to English which is what we do all the time anyway.
Personally, I use and love EurKEY [0] as I rarely type in German anyway and rather optimize for coding.
Re: Pushup: a new compiler for making web apps in Go
#58So basically PHP, but in Go? I love Go, but I honestly hope this doesn't become as widespread as PHP. There is a reason why we switched away from template-based frontends (à la PHP). On the other side, it's also true that some frontend frameworks are partially moving back to SSR...
One counterpoint is React is doing gangbusters right now and uses the JSX syntax extension to embed HTML directly into JavaScript or TypeScript. To my money, the main issues with PHP had little to do with template embedding and everything to do with Perl being a messy language for writing correct code (coupled with too many people in the era underestimating the importance of "correctness" for HTML rendering when the…
Re: Pushup: a new compiler for making web apps in Go
#59A sane, compiled template language for Go, integrated with a framework that pushes for HATEOAS via HTMX hits every row and column in my dream-webs-tack-bingo-card.
Looking forward to digging into this during the weekend.
Re: Pushup: a new compiler for making web apps in Go
#60Pushup creator here. We're interested in feedback on the design. Pushup introduces a new lightweight template syntax that mixes Go code and HTML in the same page; pages are then compiled down to pure Go, relying on the net/http package. Pushup uses file-based routing, so adding a page adds a route to your app. The template language has an "inline partials" feature to make it easier support for modern hypermedia libra…
"Pushup uses file-based routing, so adding a page adds a route to your app." Make sure to have a clean way of escaping that and having some richer concept of how to route. This was the original way routing worked, back in the ASP (not ASP.net, the predecessor), CGI, original PHP days. We moved away from it for good reasons. It works well early but has scaling problems over time. I'm not saying don't have it as a defa…
Agreed! Pushup pages compile down to structs that implement http.ServeHTTP. And an entire Pushup app is just a http.ServeMux too. So it should be trivial to insert middleware (although there isn't Pushup syntax for that yet), and/or embed a Pushup app in a larger Go app (this is quite possible today).