54 comments

[ 3.0 ms ] story [ 55.2 ms ] thread

    <p>Today is ${new Date().toDateString()}</p>
    <p>Random number: ${Math.floor(Math.random() * 100)}</p>
Sorry, I don't like it. I already disliked that immensely in PHP. Not going back to that spaghetti mesh-up.

The intro is also incorrect in my opinion. It writes a "HTML-based language", but this is more a hybrid of HTML and JavaScript. Why is JavaScript not mentioned in the intro?

> I already disliked that immensely in PHP. Not going back to that spaghetti mesh-up.

That looks like a pretty normal template to me and nothing like plain PHP templates? What do you mean by "spaghetti mesh-up"?

The problem when taking several languages and mixing them together this way is that the result is supposed to have brevity, but it’s actually unreadable. You need slash to mean something grammatical, colon has to say something, you can speak “open brace” in a way that anticipates; @ means “at”. This code looks more like a compression scheme.
There’s some joke here about how that’s in contrast to Marketo…
Maybe off topic, but I’d kill for a HAML for TSX or Svelte!

Working with HAML really did make building web app fun IMO. I can’t be the only one!

Someone posted here, thanks for that!! It immediately reminded me of HAML: https://harcstack.org/

I like HAML a lot, it was the most pleasant to develop with. And it shares a lot in common with Stylus. They both shared things in common.

NO NEED FOR: Curly braces, parentheses and semicolons. The cool thing, it was all optional and I wasn't forced to make use of all shortcuts!

I developed my own CSS Framework in 2003, shared with some UX guy at Yahoo, who incorporated it into YUI mostly as is, after I waived all rights. Most of that became internet standard. Later I had my own PHP based CSS scaffolding framework in 2005 that could also generate grids (before flex-box). SCASS/LESS was really similar to my framework, when it came out.

But I disliked it, it just looked like PHP mixed with CSS. I thought why accept the ugly syntax, despite a compiler being available?

The best ever existed is: HAML + Stylus + (HARC?)

See the beauty of it: https://stylus-lang.com/docs/selectors.html

Now compare with HAML https://haml.info/

I think https://harcstack.org/ makes a good successor.

vue allows other languages in .vue files for both css & html similar to js
This is actually quite cool - JS inside HTML, rather than the more React-y HTML inside JS.

As I understand it, Ryan Carniato was a major part of this project, and later went on to lead SolidJS, which goes back to the React style HTML in JS. Has he spoken at all about why he went back to that templating style?

JS inside HTML! Groundbreaking! It's nothing like Netscape ever conceived in 1995...
Honestly I don't know... I'm somewhat skeptical about these "next big thing that will fix all your pains in web development". There is so much fragmentation in JS libraries / frameworks. Angular, React, Vue, Svelte, Asto, SolidJS, NextJS, Nuxt, Qwik... The list is so overwhelming. Almost each one claims that it fixes a problem in other framework, and a year later the other framework fixes that issue... I think it's better to stick to a big old player, such as Angular.
Why are you copy pasting the same comment, under different usernames everywhere?
Maybe just me but I actually think building web apps is already fun. I’ve got a hot reloading instant dev environment, I can publish to users in an instant… it’s great!

Looking at the Marko examples I feel the same way I do whenever similar stuff gets showcased: it’s trying to focus too hard on brevity and/or cutesiness and doesn’t seem like it would scale well to a full, complex web app. But maybe it’s not supposed to and maybe that’s fine.

React and Svelte and the rest can read clunkily at times but they have a clear separation of concerns and I’m glad for that.

React has a clear separation of concern? Excuse me? I only see do-it-all pre-styled components in the real world.
As someone who has actually worked on JavaScript frameworks, I think Marko is criminally underrated. The compile-time optimizations are extremely impressive: https://markojs.com/docs/explanation/fine-grained-bundling

I was not surprised for example that Marko came out very well in this performance comparison: https://www.lorenstew.art/blog/10-kanban-boards

That’s interesting. I’ve always held SvelteKit in high regard for greenfield projects because it balances capability, developer experience, and performance, but I’ll have to give Marko a look. I’d love to see a similar deep dive into Electron style desktop frameworks since that space still feels underexplored compared to mobile. I honestly wouldn’t know where to start for a video game interface, and that bothers me.
I remain convinced that RSC and the SSR craze was a result of someone (or multiple) people needing a raise and their friends wanting to start a company selling abstract compute. Statically hydrated, minimal React was pretty great when served over good CDN infrastructure. Then I watched the bundle sizes and lock-in balloon. That second article is a dragon slayer. It really lays out the problem with React. In marrying itself to Next.js and embracing the server, it's betrayed the platform. Meanwhile, the platform itself has matured. React practically built my career, and I just don't have a reason to choose it anymore.
This sort of stuff is just a big nope:

    <let/count=0>
Why make a special language? Just use HTML and TypeScript that will be compatible with editors, tooling, etc. This is the same mistake Imba made.

It's a shame because the core of Marko looks phenomenal: streaming, fine-grained bundling, rendering performance, etc.

Also not sure about the file-based routing of Marko Run. That was a big reason why I abandoned SvelteKit.

Let’s not pretend that useState() is plain TypeScript either. It’s a DSL in disguise.

JSX is amazing for stateless rendering of templates. Not so much for state management. That should really have been given a dedicated DSL. Here I think Marko did the right thing, why they then made even for-loops a dsl is more questionable.

I wonder how this compares to htmx, seems similar though obviously different in terms of approach. I'm getting a little jQuery feels too.
Here’s an informing recent DevTools podcast episode featuring someone from the Marko team, https://www.devtools.fm/episode/
Some interesting context from the podcast:

> A lot of people are coming to eBay from a link that someone shared or from a search engine... This whole "amortized cost savings" you get from a Single-Page App (SPA) you don't necessarily get with eBay. Or people might go to eBay and open up ten [browser] tabs... If that's ten SPAs you're opening you're not really saving that much.

> At the same time in 2012 people are coming out with React, Angular... the question was "can we just use these tools?" and the answer was "kinda no"... Initially React was considered but the things we needed right out of the gate was streaming [sending as much HTML as... available without waiting for services responding with loaded data for the specific page]... With streaming you can send out stuff to the browser and have the browser [start] showing content to user without having to wait for your slowest service. At eBay there are a lot of services... Essentially if we were to adopt React or Angular the fact that there wasn't streaming would essentially mean that we're throwing away two seconds or so... which is not acceptable.

It reminded me of ColdFusion, which could be something better if it hadn't ended up in Adobe's hands.
It looks interesting and in a past life I probably would have tried it out but do you know why I like React? Because it's just JavaScript.

This `<let/variable=...>` and `<for ...>` syntax is awful.

React has not been just JavaScript for a long time. The react DSL just keeps getting more and more bloated as they add more hooks for more and more edge cases (useFormStatus, useActionState, etc…). It’s becoming just another bloated mess now. And I used to love react! This looks promising though. The syntax looks very straightforward. Even though it’s not “just JavaScript” it is very easily understood by most programmers. I’ve glanced at it for all of 2 minutes and it all makes perfect sense. Functions look like functions. Variables look like variables. I think it looks cool!
Really, this point can't be stated often enough.

It was my reason for switching to React when I learned TypeScript after getting more into JS frameworks via Vue.JS.

My starting point was Vue 2.7, and I started out using string templates haha :)

Even wrote some reactive custom code (without Vue, just regular DOM code) in a customer widget that utilized Object.defineProperty et al, inspired by Vue.

And today, while I'm using React at $job, I also think Vue 3 is probably a solid framework as well.

Last time I checked, they improved on DX of their component and templating system. But I'm not even sure whether they still recommend the v-if etc helper tags.

For what it's worth, even Vue 2 always also supported JSX and later TSX

To each their own. This syntax actially resonates with some people, which is why template-based frameworks like Vue and Svelte are also popular. In fact, at first glance this reminds me a lot Vue in some of its approach and syntax.

BTW - with Vue you can use entirely JSX of you dislike HTML component syntax (I don’t know enough about Svelte to know if it allows the same).

In a past life we did try it... Marko has been around for years.

It started as a project at eBay and then got spun out to an open project around 2015

Do you really believe React is just javascript?
No Vue, is just JavaScript. React is JSX.
Agreed on the syntax part. We’ve had good syntax for templates before:

  <ul>
    {% for user in users %}
      <li>{{ user.firstName }}</li>
    {% endfor %}
  </ul>
And we have good syntax for templates now:

  <ul>
    {#each users as user}
      <li>{user.firstName}</li>
    {/each}
  </ul>
Why do we have to squish everything into HTML-like-but-not-quite blocks?

But no, JSX isn’t that great either:

  <ul>
    {users.map(user => (
      <li>{user.firstName}</li>
    ))}
  </ul>
After two decades of this churn we are back to the equivalent of JSP. It was the correct paradigm all along but millennials wouldn't be caught dead working with such a "lame" technology so they bestowed SPA on us and now they are slowly walking it back.
It looks like they reinvented ColdFusion for modern web apps.
I didn't look deep into Marko yet, but in my opinion JSX is by far the best HTML template language there is. And it's not restricted to React.

Most other template languages hits serious limitations really fast. I tried and hated (for non trivial things): Angular, Handlebars, Razor (dotnet) and Vue (which does support JSX optionally).

(comment deleted)
[flagged]