Live data from Hacker News

Pushup: a new compiler for making web apps in Go

github.com

11–20 of 121 posts

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

#11
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 great building block, and html/template is solid, but I felt more was needed. Like opinionated project directory structure, for one. But also the world has changed since 2006 when Rails and Django debuted.

Obviously, we live in a world in which React and the SPA is seemingly dominant, but projects like htmx have recently shown that you can achieve modern UI/UX in the browser on a server-side app, which less JavaScript. BTW, more and more JavaScript frameworks, like Remix, are (re-)discovering the value of SSR.

I was also motivated to give an old-school mod_php feel of, just add a file and you automatically get a URL route. That's a nice developer experience but also good for long-term project maintenance.

Finally I was struck by this essay[1] about the demise of the "mildly dynamic" site. There is a wide diversity of types of sites and apps, from quick experiments and prototypes, small-to-medium sites of many kinds. But also since it's Go, I think it could scale up on performance to large-scale sites, and as a static binary, be nicely suited to edge apps like fly.io.

[1] https://www.devever.net/~hl/mildlydynamic

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

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

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

#13
This looks neat.

Always be wary of this on a new web framework:

> Pushup is an experiment. In terms of the development life cycle, it should be considered preview pre-release software

The biggest risk with such software as a web framework is security exploits. The nuances of the HTML escaping dance are subtle and hard to get right.

(Not to say this gets them wrong or can't get them right, only that all such code should be assumed-risky for security until proven otherwise).

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

#14

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

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 ability for a malicious operator to mutate HTML on a page can result in all manner of security exploits). Perl just has too many ways to write accepted almost-correct code that breaks abstraction / fails to string-escape in subtle and whole-farm-losing ways.

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

#15

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

> So basically PHP, but in Go?

You say that like it's a bad thing ;^)

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

#16

I don't like it. It looks like early php. This doesnt mean it is bad. I'm working on a web framework as well based on wasm in the browser. It's perfect except it's not really usuable/production ready due to high memory consumption of the go->wasm implementation. My hope is that one day there will be support for GC in wasm and somehow the issue will go away.

Have you looked into using TinyGo[0]? It's a Go-for-embedded compiler and can compile Go to WASM as well. It's supposed to result in much smaller artifacts. [0]: https://tinygo.org/docs/guides/webassembly/

In my experience, TinyGo is far from ready for prime time, mainly because of its lack of support for JSON marshaling/unmarshaling.

I run Go code in Cloudflare Workers, and just use the regular-ol' WASM targets (GOOS=js/GOARCH=wasm)

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

#17

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…

Hey cool!

Caddy plugin? :D I might be quite interested in this.

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

#18

I don't like it. It looks like early php. This doesnt mean it is bad. I'm working on a web framework as well based on wasm in the browser. It's perfect except it's not really usuable/production ready due to high memory consumption of the go->wasm implementation. My hope is that one day there will be support for GC in wasm and somehow the issue will go away.

Since Pushup is a compiler, one thought I've had is giving the ability to demarcate server-side and client-side code in a Pushup page, and compiling down to WASM for the client-side code. Then the compiler would generate the network code to do the hand-offs.

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

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

Post reply on HN