Earlier quoted context omitted.
I mostly agree with you but React isn’t just JavaScript. JSX is not JavaScript. It’s just that we’re so used to it we don’t consider it notable any more. Worth keeping in mind when you’re looking at a brand new framework.
That's true, sure. My response to that is in React you have JavaScript & JSX and there are clear boundaries. It's not mixed. I don't write In JSX I write JavaScript that returns JSX: {data.map(node => )} ^ ----- JS ----^ ^ ------ JSX -------^ or const elements = data.map(node => ) ... {elements} Really the most obscure syntax there is the splatting but it makes sense to you when you realize that JSX is just syntactic…
Marko – A declarative, HTML‑based language
71–80 of 189 posts
Re: Marko – A declarative, HTML‑based language
#72Maybe 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!
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.
Re: Marko – A declarative, HTML‑based language
#73Earlier quoted context omitted.
I mostly agree with you but React isn’t just JavaScript. JSX is not JavaScript. It’s just that we’re so used to it we don’t consider it notable any more. Worth keeping in mind when you’re looking at a brand new framework.
That's true, sure. My response to that is in React you have JavaScript & JSX and there are clear boundaries. It's not mixed. I don't write In JSX I write JavaScript that returns JSX: {data.map(node => )} ^ ----- JS ----^ ^ ------ JSX -------^ or const elements = data.map(node => ) ... {elements} Really the most obscure syntax there is the splatting but it makes sense to you when you realize that JSX is just syntactic…
Re: Marko – A declarative, HTML‑based language
#74I 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).
E.g., Why do you think JSX is the best? What limitations did you hit with those other template languages?
Re: Marko – A declarative, HTML‑based language
#75I 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).
Re: Marko – A declarative, HTML‑based language
#76previously: January 2023, 125 comments - https://news.ycombinator.com/item?id=34591625 August 2017, 150 comments - https://news.ycombinator.com/item?id=15057371 February 2015, 10 comments - https://news.ycombinator.com/item?id=9065447
Re: Marko – A declarative, HTML‑based language
#77I 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).
I wrote a Rust library with a more restricted/verbose API, and I've been enjoying using that. Unfortunately, I find it really hard to make it as fast as I want. It's really the perfect use case for arena allocation, but doing that and keeping the API as function calls mirroring HTML is not trivial, and probably requires macros to rewrite the tree as a series of stack pushes.
Re: Marko – A declarative, HTML‑based language
#78I especially love the pug style concise syntax which for some reason they have buried deep into the docs rather than showcasing front and center.
Re: Marko – A declarative, HTML‑based language
#79Today is ${new Date().toDateString()} Random number: ${Math.floor(Math.random() * 100)} 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?
That looks like a pretty normal template to me and nothing like plain PHP templates? What do you mean by "spaghetti mesh-up"?
Re: Marko – A declarative, HTML‑based language
#80As 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