Live data from Hacker News

Pushup: a new compiler for making web apps in Go

github.com

31–40 of 121 posts

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

#31
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.

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

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

#32

This looks great for simple projects, but I'm curious who is working on projects small enough to not be worth a separate dedicated and feature-filled frontend (ala JS/Flutter), but large enough to warrant server-side logic. That's certainly not to say they don't exist, and Pushup is certainly filling a niche, but my mind immediately goes to those "forgotten" services like email unsubscription and confirmation links.

Yep, or admins or settings apps, for example. Pushup is partly designed to support the "mildly dynamic" site https://www.devever.net/~hl/mildlydynamic

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

#33
There's an interesting conversation to be had about developer ergonomics. For me, on a Mac, it's far more easier to use characters and symbols on the bottom of the keyboard.

.

It's even easy to use a select few symbols from the number row.

!, @, #, $ uses my left pinky on the left shift, left hand middle (or index) finger on the number

&, *, (, and ) use my left pinky on the left shift, right hand finger on the number.

^ (and % + & to an extent) seem to be a no-mans land, similar to smart phone screens only allowing limited easy reach.

If you're going to be typing a symbol character to mark a variable (or whatever else) it certainly needs to be easy to reach, and for me at least, the ^ isn't.

Maybe it's just my typing style or that I have small fingers :(

Edit: Also, what about IDE plugins? I would hate to lose type safety or smart suggestions for a line like this:

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

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

#34
TBH all I want are Django's generic views implemented in Go to make it easy to map routes to DB resources to speed up making APIs.

Ideally it would automagically expose a whitelisted list of DB tables as API endpoints but allow the ability to override queries for each table and perform logic as necessary (i.e. support custom handlers as well as lightweight default ones).

If anyone knows of anything like that please let me know.

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

#35
post #6

It'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…

Really great explanation, thanks. I've definitely felt a bit silly spinning up an entire react project for a "mildly dynamic" site

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

#36

TBH all I want are Django's generic views implemented in Go to make it easy to map routes to DB resources to speed up making APIs. Ideally it would automagically expose a whitelisted list of DB tables as API endpoints but allow the ability to override queries for each table and perform logic as necessary (i.e. support custom handlers as well as lightweight default ones). If anyone knows of anything like that please l…

sqlc.dev plus gongular and you have a quick REST api

sqlc.dev plus gql-gen and you have a quick GraphQL server

sqlc.dev plus goa.design and you have a full-featured REST + gRPC server with OpenAPI for easy client generation

No need to write model code and validation for inputs/outputs. Just define your SQL queries and your request objects (or typedefs for GraphQL) and then let these tools generate everything else.

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

#38

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

> There is a reason why we switched away from template-based frontends (à la PHP).

Can you elaborate on that reason? Genuine question. As you mentioned in your post, a lot of what newer web frameworks are doing (SvelteKit, Astro, Enhance.dev, etc.) are reminding me a lot of my early days with PHP. The benefits of SSR are widely acknowledged amongst the proper JS frameworks.

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

#39
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…

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.
Post reply on HN