Earlier quoted context omitted.
How would you prefer to write those examples?
Personally, I'd either just put the content in an ID-ed span and have a script to replace the content. Another, perhaps better, way is to use Alpine.JS which excels at this kind of stuff.
Marko – A declarative, HTML‑based language
11–20 of 189 posts
Re: Marko – A declarative, HTML‑based language
#12Earlier quoted context omitted.
How would you prefer to write those examples?
Personally, I'd either just put the content in an ID-ed span and have a script to replace the content. Another, perhaps better, way is to use Alpine.JS which excels at this kind of stuff.
Re: Marko – A declarative, HTML‑based language
#13Working with HAML really did make building web app fun IMO. I can’t be the only one!
Re: Marko – A declarative, HTML‑based language
#14As 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?
Re: Marko – A declarative, HTML‑based language
#15There’s some joke here about how that’s in contrast to Marketo…
Re: Marko – A declarative, HTML‑based language
#16Today 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?
How would you prefer to write those examples?
Re: Marko – A declarative, HTML‑based language
#17Earlier quoted context omitted.
How would you prefer to write those examples?
Personally, I'd either just put the content in an ID-ed span and have a script to replace the content. Another, perhaps better, way is to use Alpine.JS which excels at this kind of stuff.
And so your script is broken when someone else in your team (or maybe even yourself) renames or removes the ID and forgets to search in the whole project if some piece of code depends on this ID. JSX fixed all that mess 10+ years ago.
Re: Marko – A declarative, HTML‑based language
#18The 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.
1. There is HTML (tags) with, but without interpolation {...} you can put string literals, variables and everything that type checks as HTML children.
2. There is CSS but only in style blocks where you can interpolate any expression you need and put in if and case expressions too.
3. There is the normal Mint code you write the logic in (this would be the JavaScript in other languages).
Here is an example which have all three: https://mint-lang.com/examples/7guis/flight-booker
The challenge was to make it seamless enough that so it doesn't look like that we tried to mash languages up, but to make them form a different language that is consistent and simple at the same time.
Re: Marko – A declarative, HTML‑based language
#19Maybe 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 used to use it years ago. So much nicer than HTML.
Re: Marko – A declarative, HTML‑based language
#20Earlier quoted context omitted.
Personally, I'd either just put the content in an ID-ed span and have a script to replace the content. Another, perhaps better, way is to use Alpine.JS which excels at this kind of stuff.
Either solution sounds more verbose than the example and require writing code in at least one other source file
Terseness is good for code golf [1]. I disliked CoffeeScript after writing it for some time: nearly any typo can result in another syntactically correct program which, of course, does not what you wanted the original program to do, or fails the compilation in an unrelated place. A practical language has safety margins, aka some redundancy.
[1]: https://en.wikipedia.org/wiki/Code_golf#Dedicated_golfing_la...