News for hackers. Stuff that matters.
Re:First public release of Pushup: a new compiler for making... by denysvitali on Wednesday January 04, 2023 @11:24AM (#34247571)
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...

Re:First public release of Pushup: a new compiler for making... by shadowgovt on Wednesday January 04, 2023 @11:36AM (#34247741)
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:First public release of Pushup: a new compiler for making... by kennywinker on Wednesday January 04, 2023 @11:53AM (#34248012)
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).
Re:First public release of Pushup: a new compiler for making... by shadowgovt on Wednesday January 04, 2023 @12:25PM (#34248523)
To be fair, you haven't exactly augmented the single-element list [Perl] with a host of languages that I'd consider improvements on writing correct code. ;)

Java, yes, mostly.

Re:First public release of Pushup: a new compiler for making... by hiccuphippo on Wednesday January 04, 2023 @12:47PM (#34248852)
There's a difference though. JSX embeds html into strings while the way Php intermingles html and code uses global buffers. That makes composition more complicated since you have to deal with nested buffers, flushing, cleaning, etc. I really prefer the way JSX does it over Php's.
Re:First public release of Pushup: a new compiler for making... by paulsmith on Wednesday January 04, 2023 @11:37AM (#34247759)
> So basically PHP, but in Go?

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

Re:First public release of Pushup: a new compiler for making... by rad_gruchalski on Wednesday January 04, 2023 @11:52AM (#34247993)
Then why not <?go ... ?> instead of the random ^ soup?
Re:First public release of Pushup: a new compiler for making... by paulsmith on Wednesday January 04, 2023 @11:58AM (#34248104)
Why is that better?
Re:First public release of Pushup: a new compiler for making... by nablaone on Wednesday January 04, 2023 @12:10PM (#34248292)
Looks like other SSRs. FEDs will thank you.

In real word HTML template are 90% DIVs, 10% generated content.

Re:First public release of Pushup: a new compiler for making... by sunbum on Wednesday January 04, 2023 @12:08PM (#34248265)
Internationalization, not every keyboard has ^ easily accessible.
Re:First public release of Pushup: a new compiler for making... by andrewgilmartin on Wednesday January 04, 2023 @07:26PM (#34254076)
Please, no. Let's not intermix <> code fragments with <> html elements. Have you witnessed the nightmare of reading and updating JSTL, for example?
Re:First public release of Pushup: a new compiler for making... by rad_gruchalski on Wednesday January 04, 2023 @08:25PM (#34254651)
Meh, JSP and PHP do this already. JSP is of course <%… %>. ColdFusion does it all the time. It’s easier on the eye, especially with editor support, than having to scan for all those ^ characters.
Re:First public release of Pushup: a new compiler for making... by kevinfiol on Wednesday January 04, 2023 @12:09PM (#34248270)
> 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:First public release of Pushup: a new compiler for making... by denysvitali on Wednesday January 04, 2023 @04:12PM (#34251721)
Frontends became more interactive, and as such, you can't really template that interactivity / reactivity away. Hardly anyone uses Vanilla JS nowadays, and thus, hardly anyone can create a template-based website for today's standards. This is just my opinion though, happy to be proven wrong :)
Re:First public release of Pushup: a new compiler for making... by dakiol on Wednesday January 04, 2023 @04:12PM (#34251726)
> There is a reason why we switched away from template-based frontends (à la PHP)

Who is "we"? There are more websites out there written using template-based frontends (mostly PHP) than the other way around.