News for hackers. Stuff that matters.
Re:Marko: An HTML-Based Language by nbittich on Tuesday January 31, 2023 @04:16AM (#34593031)
To me, from the getting started, it looks like yet another JavaScript framework. Might be good, unfortunately I got framework fatigue. My personal website has about 30 lines of javascript, no framework and no library.
Re:Marko: An HTML-Based Language by bdcravens on Tuesday January 31, 2023 @04:27AM (#34593102)
The biggest difference is that it uses tags/components as a means to mix markup and code. (the "old" server-side language ColdFusion does this same thing)
Re:Marko: An HTML-Based Language by creshal on Tuesday January 31, 2023 @05:50AM (#34593616)
Remember when PHP was supposed to be that?
Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @06:13AM (#34593758)
I still slip <?php> tags straight into inline html a la 2004 from time to time, when it suits the purpose. I even occasionally use href="javascript:" if it saves time. No shame in using what works.
Re:Marko: An HTML-Based Language by mjburgess on Tuesday January 31, 2023 @07:14AM (#34594116)
It's not clear to me why a subset of PHP with an extremely fast compiler isn't available/common. That's what it's designed for...

People plug-in all sorts into python, why not `from microphp import tpl`, `tpl("blah.phtml")` etc.

    <html..> 
    <? foreach($xs as $y): ?>
        <? $y; ?>
    <? endforeach; ?>
    </html>
Re:Marko: An HTML-Based Language by creshal on Tuesday January 31, 2023 @07:29AM (#34594245)
PHP is pretty fast already if you use it that way, and don't bury it under 20,000 layers of recursive framework callbacks like wordpress etc. does.

But dedicated template languages have superior ergonomics these days, so why bother adapting PHP to it?

Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @07:49AM (#34594421)
templates are always limitations, my friend. albatrosses. You're so right about the awful structure of the big CMSs...

I've just used my own RYO CMS for 15+ years for website work... it's gone through lots of updates, but it's super simple. I'd never make it public as a framework because any decent dev should be able to roll their own anyway, and I don't need the aggravation. But it's basically a VERY simplified cross between {{handlebars}} and React, without attempting to bind the whole DOM to data, plus a DSL for specifying all the pages and modules of each website in SQL, and setting up english-language router rules.

I'd ditch ergonomics any day for understanding what's going on and being able to pare it down as much as possible. Simple website clients pay so little these days it's basically charity work... you need something you can both do in an hour AND never have to worry about WordPress updating.

Re:Marko: An HTML-Based Language by czx4f4bd on Tuesday January 31, 2023 @09:20AM (#34595286)
At least in Python, that's kinda what https://www.makotemplates.org is. Although if you're just using a subset of PHP suitable for templating, it's not really clear to me what benefit there is to PHP syntax versus, say, Jinja2 syntax.
Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @10:30AM (#34596305)
the whole thing with PHP, originally, was you just wrote HTML pages and slipped in PHP <? echo $hello; ?> code here and there where you wanted the server to fill something in with server-side processing as the page was served. This is how it was used before it became common to generate whole templates or pages out of code. You'd be serving a basically static webpage and have a counter at the bottom showing hits, for example, so you'd take your .html and rename it to .php and the counter would be tagged to be generated by the server but everything else would just be plain HTML. PHP still supports this and the fact that it evolved into a full fledged language where you generate HTML from it (as opposed to embedding its output in static pages) still seems slightly humorous to me.
Re:Marko: An HTML-Based Language by rchaud on Tuesday January 31, 2023 @12:09PM (#34597926)
This is close to Twig syntax, and Twig is pretty much the defacto standard for writing templated PHP.
Re:Marko: An HTML-Based Language by yamtaddle on Tuesday January 31, 2023 @12:59PM (#34598867)
PHP with a correctly-configured server is about as fast as web-oriented scripting languages get, in practice. Yes, including Node. To be sure to beat it you'll need to switch to something compiled, and then take great care not to make any mis-steps.
Re:Marko: An HTML-Based Language by conductr on Tuesday January 31, 2023 @04:43PM (#34602658)
The ease of deployment alone keeps me going back to PHP, but the speed is nice too
Re:Marko: An HTML-Based Language by yamtaddle on Tuesday January 31, 2023 @12:56PM (#34598793)
If I'm in a hurry I still just use the fucking <center> tag. It works and I can't be bothered to google what's correct this week, if I'm just dipping into HTML for a minute or two.
Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @06:20AM (#34593787)
ColdFusion is an interesting referent ... even as an Adobe subscriber I was surprised to just find out it still exists.
Re:Marko: An HTML-Based Language by bdcravens on Tuesday January 31, 2023 @06:39AM (#34593903)
Not as popular as it used to be, but definitely still around. The open source version (Lucee, formerly Railo) sees a lot of use as well. As for Adobe, I think it's treated as a step-child they acquired along with the rest of the Macromedia IP. I've actually been to trade shows where one part of the company was there and they didn't even know what ColdFusion is.
Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @06:57AM (#34594003)
I would so love if Adobe would just spin off Macromedia again. I remember working on Flex frontends with CF engineers in the early 2000s and ...I mean, there is no reason that couldn't be updated to be a killer framework now if it worked with modern stacks.

Not surprising, but sad that Adobe flacks don't even know what it is. The world would be a lot more interesting if Macromedia was still a going concern, maybe aligned with Unity or some other ecosystem for game production.

Re:Marko: An HTML-Based Language by throwntoday on Tuesday January 31, 2023 @07:23AM (#34594197)
>maybe aligned with Unity or some other ecosystem for game production

I think I recall Flash did try to offer some type of iPhone app development features towards the end of it's useful life but Jobs effectively sentenced Flash to death so most everyone had jumped ship by this point.

Re:Marko: An HTML-Based Language by noduerme on Tuesday January 31, 2023 @07:38AM (#34594333)
We built some games in Flash/Air that compiled to native iOS apps... they basically bundle the whole flash player into the game. It was and still is a working way to make an iOS game, it's just that Adobe no longer supports the plugin version... and you can't really trust them to support anything else going forward, so most devs moved to other languages and stacks like Unity.
Re:Marko: An HTML-Based Language by tabtab on Tuesday January 31, 2023 @12:35PM (#34598387)
ColdFusion is quite useful for internal (intranet) data search and reporting apps/pages that don't need lots of JavaScript eye-candy nor layer-happy frameworks. It makes it easy to stick hyperlinks in HTML data tables so managers can click to drill up, down, and all around to study data from different dimensions. There's also an open-source implementation or two, although I found the charting tools of the commercial version to be more mature.
Re:Marko: An HTML-Based Language by ficklepickle on Tuesday January 31, 2023 @12:25PM (#34598230)
It's a whole weird world that just doesn't die. I worked at a place with ~ half a million lines of CF last year. There is a thing called CF Script which has vaguely JS-like syntax which can be used instead of the XML-based logic. There are even open-source frameworks built on top, with religious quotes in the documentation for some reason[0].

[0] https://github.com/coldbox/coldbox-platform

Re:Marko: An HTML-Based Language by bdcravens on Tuesday January 31, 2023 @05:17PM (#34603085)
I know Luis, the creator of Coldbox. It's a great framework, and the quotes reflect his personal values, but other than finding that in the documentation, you won't find yourself being beat over the head with scripture. In years past, there were several other CF frameworks, and none could be characterized as having religious quotes, just the one :-)
Re:Marko: An HTML-Based Language by strogonoff on Tuesday January 31, 2023 @09:51AM (#34595687)
Contrarian take: the whole field of front-end frameworks seems to be lacking an all around good isomorphic solution to me.

Is there anything that would out of the box: 1) do fully static server-side rendering that outputs zero JS by default, 2) still be capable of rendering client-side interactive components where appropriate (for user agents with JS), 3) have both of the above as equal first-class citizens without contrived workarounds needed to achieve either interactivity or SSR, 4) handle all required bundling/fetching at build stage and load fast at runtime, 5) be isomorphic and leverage TypeScript typings to validate the correctness of the whole thing at build time as much as possible, and ideally 6) allow easy reuse of preexisting React components?

Re:Marko: An HTML-Based Language by mdavidn on Tuesday January 31, 2023 @10:35AM (#34596381)
Another comment already mentioned Svelte. Alternatively, Hotwire Turbo or htmx might be more along the lines of what you want. Choose your own server-side language. I sprinkle in fancier frameworks when individual components need it, but this is more the exception than the rule.

https://turbo.hotwired.dev/ https://htmx.org/

Re:Marko: An HTML-Based Language by tzekid on Tuesday January 31, 2023 @10:25AM (#34596251)
I'm using Astro + Svelte for a small project right now, and it sounds like that's the combo that you're looking for.
Re:Marko: An HTML-Based Language by no_wizard on Tuesday January 31, 2023 @10:25AM (#34596247)
Take a look at Qwik

https://qwik.builder.io/

Re:Marko: An HTML-Based Language by seandoe on Tuesday January 31, 2023 @11:18AM (#34597118)
Remix.run
Re:Marko: An HTML-Based Language by chrisweekly on Tuesday January 31, 2023 @12:25PM (#34598209)
Remix (https://remix.run) comes awfully close
Re:Marko: An HTML-Based Language by aabbcc1241 on Tuesday January 31, 2023 @02:10PM (#34600187)
Try ts-liveview (https://liveviews.cc) if you like JSX and querySelector without VDOM
Re:Marko: An HTML-Based Language by chrisweekly on Wednesday February 01, 2023 @07:49AM (#34609726)
Ooh, ts-liveview looks really interesting! Thnaks for sharing!
Re:Marko: An HTML-Based Language by pier25 on Tuesday January 31, 2023 @01:13PM (#34599140)
> My personal website has about 30 lines of javascript, no framework and no library.

"my use case doesn't need a JS framework so we don't need JS frameworks"

Re:Marko: An HTML-Based Language by classified on Tuesday January 31, 2023 @01:45PM (#34599770)
That's not what they said.
Re:Marko: An HTML-Based Language by rudiksz on Tuesday January 31, 2023 @04:29PM (#34602459)
That's pretty much what they said. Most programmers don't work on "personal websites" at their workplace, as strange as that might sound.