Live data from Hacker News

Pushup: a new compiler for making web apps in Go

github.com

41–50 of 121 posts

Re: Pushup: a new compiler for making web apps in Go

#41
post #9

Earlier 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.

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.

Re: Pushup: a new compiler for making web apps in Go

#42
post #27

Earlier quoted context omitted.

"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…

I have the same instinct (JSP / JSF had the same concept) but I must say, making pages as files in next.js is really nice. You can have all your dynamism within them, but having a simple way to do overall routing is lovely.

It is nice. It is easy. There's a reason we started there.

Then, suddenly after a certain amount of scaling, it isn't. And it's not like that's an impossible situation either, but you end up with all the consequences of building a framework to do X and then having to build an inner platform[1] to do some other Y inside of X instead.

[1]: A technical term: https://en.wikipedia.org/wiki/Inner-platform_effect

Re: Pushup: a new compiler for making web apps in Go

#43

These programmers were so preoccupied with whether or not they could, they didn’t stop to think if they should. That abomination of a markup cum programming langauge is so ugly. Seriously tho, cool project but ugly syntax.

Do you think all template languages that combine logic and markup are ugly? Or just Pushup's?

I like that Flask has Jinja2, which has a simple template language in it, but doesn't let you run arbitrary Python.

Re: Pushup: a new compiler for making web apps in Go

#44
post #27

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…

"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…

At the day gig (old school in house python framework) we used file based routing.

Works great. The few times we need to get fancy mod_rewrite is pretty easy.

The lack of ceremony is refreshing.

Re: Pushup: a new compiler for making web apps in Go

#45

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 this out. Thanks for this project.

Re: Pushup: a new compiler for making web apps in Go

#46
post #9

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…

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.

I spent a lot of time in C# and ASP.Net, and I was struck by how closely this resembled Razor syntax, but with ^ instead of @. Switching to @ would make it slightly more familiar to that cohort, and it might even be possible to build on some Razor-parsing code for editor plugins or whatever.

Re: Pushup: a new compiler for making web apps in Go

#47
post #42

Earlier quoted context omitted.

I have the same instinct (JSP / JSF had the same concept) but I must say, making pages as files in next.js is really nice. You can have all your dynamism within them, but having a simple way to do overall routing is lovely.

It is nice. It is easy. There's a reason we started there. Then, suddenly after a certain amount of scaling, it isn't. And it's not like that's an impossible situation either, but you end up with all the consequences of building a framework to do X and then having to build an inner platform[1] to do some other Y inside of X instead. [1]: A technical term: https://en.wikipedia.org/wiki/Inner-platform_effect

Sure. It's a tradeoff either way - ergonomics for common cases or not. I imagine in your case you're constructing lots of custom logic anyway, whether it's in an API gateway (or similar) component to put the auth logic before the application, or put the logic in some before_request handler in the web application.

Re: Pushup: a new compiler for making web apps in Go

#48
post #12

This really seems like php. I also think that mixing UI with logic is a recipe for disaster and there is already php (and several others?) for that. I suppose the creators of such a thing have a decent knowledge of compilers and related domains, knowledge which really seems wasted on a project like this.

[deleted]

Re: Pushup: a new compiler for making web apps in Go

#49
This 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 presentational logic? In most JS frameworks, I'd extract them into a "component" (in React, that just means a function that returns JSX). Pushup has "partials," but it's not clear to me whether they're reusable or if that word means something different in Pushup than it does in other templating systems. I see that layouts can denote sections to be filled in by pages, but IMO that's backwards — a page now needs to know details about its "call site".

Using ^ as a delimiter seems odd, but I suppose that's just a familiarity thing. I do wonder though how you handle your example of

    

The time is now ^time.Now().String().

without having to backtrack, since that last period is ambiguous in this grammar.

Re: Pushup: a new compiler for making web apps in Go

#50
post #46
post #9

Earlier 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.

I spent a lot of time in C# and ASP.Net, and I was struck by how closely this resembled Razor syntax, but with ^ instead of @. Switching to @ would make it slightly more familiar to that cohort, and it might even be possible to build on some Razor-parsing code for editor plugins or whatever.

I was inspired in part by Razor, although I'm not a C#/ASP.net developer. I just liked the way it looked and worked from examples I saw.

I actually started with @ [1] but changed to ^ for 2 reasons: having to escape for email addresses (although in retrospect maybe it's not such a problem), and the admittedly cheeky ^ being the "up" in "Pushup" :^)

[1] https://github.com/adhocteam/pushup/commit/04aa00bb5401bc93b...

Post reply on HN