11 ms·
Marko: An HTML-Based Language
- mhd 4y agoThat's the ebay templating system, right? Has been around for almost 10 years, but never gained that much traction.
- eggie5 4y agoyes and doesn't have traction inside ebay either :)
- mpeg 4y agoI don’t have inside info like you might, but it seems like a mean-spirited comment considering ebay.com uses marko, as well as other sites in the ebay group. It definitely has not gained a lot of traction outside of ebay but there is a fair amount of buzz around the marko6 release with a completely new tags-based language. It is also one of the few frameworks that leverage html streaming in a simple way (and has for a long time) and offers islands-style partial hydration out of the box.
- threatofrain 4y agoYou’re explaining basic external observations to someone who is painting an internal picture of Marko’s political status within eBay. This kind of insider take is gold.
- eggie5 4y agoeveryone at ebay hates it -- the ebay blind is full of people hating on it
- chronogram 4y agoSo you're saying it doesn't have traction internally based on personal experience or based on what you read in an app?
- impalallama 4y agowhat do you want a signed affidavit from every ebay engineer
- eggie5 4y agoLOL
- celestius 4y agonot a good sign. why do they hate it?
- abrahms 4y agoPut simply, many people are using older versions. There have been large developer experience improvements in the past year or so.
- no_wizard 4y agoSolid JS guy cut his teeth maintaining it
- pier25 4y agoI don't think so. IIRC Solid existed years before Ryan joined the Marko team.
- OJFord 4y agoAnd eBay is easily the jankiest website I use on an at all frequent basis. Click about in profile/settings and you get randomly shuttled about between pages designed in (by the looks of them) 2010, 2002, 2003, and 2016...
- nikivi 4y agoThis is a nice discussion about it: https://www.youtube.com/watch?v=W9wfkP21c80 https://www.youtube.com/watch?v=W9wfkP21c80
- 2Pacalypse- 4y agoBased on the fact that this language shares the same name as me, I think it's one of the most beautiful languages that has ever existed. Jokes aside, this does look pretty neat.
- orra 4y agoNice to have a connection! It looks like Marko v6 is going to perform incredibly fast, up there with vanilla javascript and solidjs, ahead of Vue, React, and Angular. https://dev.to/ryansolid/marko-compiling-fine-grained-reactivity-4lk4 https://dev.to/ryansolid/marko-compiling-fine-grained-reacti... What's interesting is Marko and Solid are opposite in some ways: the first is HTML first, with sprinkles of interactivity; and the second is JavaScript first, in that it uses JavaScript and JSX primarily. Despite these opposite approaches, they are both iterating towards having very little runtime overhead.
- mpeg 4y agoYou joke, but we get kids in the discord constantly because they try their name as the discord invite code!
- philipphutterer 4y agolmfao, this is so hilarious.
- worldsavior 4y agoSo basically Python with Jinja.
- boomskats 4y agoNot really, no.
- asicsp 4y agoPrevious discussion: "Marko – An isomorphic UI framework similar to Vue" https://news.ycombinator.com/item?id=15057371 https://news.ycombinator.com/item?id=15057371 (276 points | Aug 20, 2017 | 148 comments)
- Semaphor 4y ago"Marko – An isomorphic UI framework similar to Vue" Aug 20, 2017; 150 comments https://news.ycombinator.com/item?id=15057371 https://news.ycombinator.com/item?id=15057371
- GrumpyNl 4y agoI always distrust it when they make a statement like "Code Elimination" and they represent a new way of coding in the HTML.
- svieira 4y ago"Code elimination" in this case is making reference to Marko's ability to compile away some of the one-time code in their `render` function (unlike something like React that has to run everything inside of `render` ever time it renders).
- deleted 4y ago[deleted]
- rmrfchik 4y agoHow "Declarative" and "this.state.count++;" can be used together?
- epolanski 4y agoBy the way "declarative" doesn't really mean anything with very specific boundaries. Would've been that better if you had some `increment(state)` that updated a ref anyway?
- rmrfchik 4y agoNo, it's has the same semantic. Method can return the whole new state, the changed fields or actions to be taken. Or method can call the passed continuation with changed values instead of return.
- pygy_ 4y agoThe view DSL is declarative (as most are). By definition, controllers must be imperative.
- rmrfchik 4y agoThey must not be imperative. As a quick reference erlang with OTP. One can emit new state without modifying old state.
- playingalong 4y agoImmutable data structures != declarative.
- satvikpendem 4y agoBecause you're not creating and updating nodes like in jQuery. You lay out a view, declaratively, fill out the holes where you want state, ie counter values, and then you have controllers to fill that out. When state changes, you recompute the entire view rather than imperatively changing out DOM nodes.
- bdcravens 4y agoSo it's ColdFusion?
- bdcravens 4y agoFrom the example, it'd be: <h1>My favorite colors</h1> <ul> <cfloop item="color" list="red,green,blue"> <cfoutput> <li style="color:#color#"> #ucase(color)# </li> </cfoutput> </cfloop> </ul> <cf_SharedFooter/><!--- ColdFusion custom tag --->
- aaronbieber 4y agoIt's a cute idea, but <cfquery> or bust! I wrote ColdFusion professionally for 7 years in the mid-'00s and I quite liked it back then. The issue, of course, was code organization and sprawl because you couldn't easily detach the logic from the view. Still, <cfquery> blocks and <cfloop>s around the results were one of the fastest ways to get something up on a page and working, in the days before very mature frameworks existed yet. It also forced everyone to know everything, so you could point to any dev on the team and they mostly understood the HTML, the CSS, the JS on the page, and the backend. I think the industry trend toward specialization is useful in some cases, but it has made organizations and products almost intolerably complex in many cases where it isn't strictly necessary for the product itself.
- bdcravens 4y agoWe still have some production code that I support, but for the most part I've moved on from CF. Still, it is the language that established my career, in many ways. Custom tags well before client-side components were the rage, in-memory SQL engine (ie, take any recordset and query against it using SQL, without hitting a database), etc are features I still wish for using things like Ruby and server-side JS. The community and to a lesser degree Adobe tried to address the advantages other platforms had (like a first-class package manager) but it was too little, too late. Still, tools like CommandBox and the rest of the tooling by Ortus are actually pretty great. I do find it interesting that client-side frameworks are "rediscovering" patterns from 25+ years ago :-)
- nbittich 4y agoTo 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.
- bdcravens 4y agoThe 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)
- creshal 4y agoRemember when PHP was supposed to be that?
- noduerme 4y agoI 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.
- mjburgess 4y agoIt'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>
- creshal 4y agoPHP 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?
- eggie5 4y agocreated at ebay and hated internally :)
- ihateolives 4y agoWhat's the main criticism?
- faldore 4y agoSpeaking as a former eBay engineer. The criticism is that it isn't React, and that nobody uses it but eBay. There's nothing really wrong with it other than that there's no reason for it to exist when other frameworks work fine and have community traction. There's nothing special about eBay that requires it's own special UI framework. And when we hire contractors to do anything they won't touch Marko so we have to use React anyway on a lot of projects. Just not an efficient way to spend the companys money creating and maintaining a superfluous framework nobody asked for.
- jeltz 4y agoGet better contractors. It is just a JS framework. I have had to work in various weird frameworks, backend and frontend, and it is easy to get started in an existing codebase. Most of the fundamentals are the same. I am so tired of developers who are scared of learning new things.
- patates 4y ago> And when we hire contractors to do anything they won't touch Marko What's the point of hiring contractors if they will show zero flexibility to work with your existing stack? A consultant could make you reevaluate your stack (and that would be the point) but IMHO contractors should just focus on getting the job done.
- anileated 4y agoReact is more of a library, if you want to compare Marko to something you could take Svelte, Next or Qwik. That said, React seems to be moving in the same direction with React Server Components (announced two years ago and still not available).
- pmontra 4y agoMaybe it's only me because I'm not a frontend developer and obvious things are not obvious to me, but it seems that there is nothing in the docs about deploying to a server and visiting a page it with a browser. Anyway, I traced the JavaScript code. There are files packed with Webpack. They're not minified and pretty easy to follow. I even found a comment linking to https://github.com/gorhill/uBlock/issues/205 https://github.com/gorhill/uBlock/issues/205 with the note "Do not handle added node directly from within mutation observer".
- mpeg 4y agoThere are some docs on how to deploy for different node servers (express etc) as well as an examples repo which has templates for different environments. I run Marko on cloudflare pages for some of my clients and couldn’t be happier, it’s the perfect framework for people who like writing plain html, but still want the advantages of a UI library like react.
- batmansmk 4y agoMarko v6 is an ambitious project that had its best parts stolen by modern frameworks. Solidjs for instance took a lot of inspiration from Marko, and solidjs would be my choice if the promise of marko resonates with you.
- mpeg 4y agoFYI Solid’s creator Ryan Carniato is a member of Marko’s core team (although he left eBay) Solid has definitely gained more traction recently and the syntax is close to react, but Marko is really closer to Solid + SolidStart, and the upcoming major version will bring resumability which only Qwik offers at the moment.
- goodpoint 4y agoIt generates websites that cannot be browsed with js disabled. No thanks.
- creshal 4y agoSo is the marko homepage not made with marko? It works fine without JS.
- bmacho 4y agoDoesn't work fine for me.
- davidmurdoch 4y agoI built an SSR node project with it a few years ago.
- dlivingston 4y agoLike it or not, the modern web is JavaScript. This is inescapable.
- goodpoint 4y agoNope.
- dlivingston 4y agoI get that you disagree, but can you explain why?
- anileated 4y agoThis seems to be not just false, but the opposite of reality. Marko renders static multi-pages sites by default, and JS is generated for components that need reactivity. In fact, Marko even lacks built-in client-side routing.
- LudwigNagasena 4y agoThat <if(user.loggedOut)> <a href="/login">Log in</a> </if> And that <ul> <for|color, index| of=colors> <li>${index}: ${color}</li> </for> </ul> Looks scary. ${index} and ${color} require escaping, (user.loggedOut) requires parentheses and |color, index| requires pipes. I just don’t understand what is going on. What I like React for is that I can use JavaScript for things that seem to belong to JavaScript, like conditionals and loops. And components just have properties that may be dynamic and conditioned, in which case they obviously require JavaScript. But here the syntax breaks that separation of concerns IMO.
- ianpurton 4y agoOne thing that's important for me is a design system and components. I want to write markup like this. ''' <tabcontainer> <tab> ... </tab> </tabcontainer> ''' So any markup technology these days needs that ability I think. Then there's Content Security Policy to think of too.
- martini333 4y agoLooks like Vue. Or rather petite-vue
- cabalamat 4y agoNot a big fan of this, but I will admit their homepage looks pretty.
- davidsergey 4y agoJavaScript community keeps re-inventing ColdFusion, MXML, and ActionScript 3.0 :) Very glad that we've got superb TypeScript datamodel, but jesus, it took a long time.
- jillesvangurp 4y agoJust a matter of time before somebody calls their framework Javascript Server Pages (JSP) without realizing they are reinventing a 20 year old wheel.
- bdcravens 4y agoOr when they server-side render their tag-based language, they can call it NodeFusion.
- bluelightning2k 4y agoLooking through the examples, it looks exactly like Svelte syntax. Not saying this is a bad thing. Svelte is universally loved. But it does raise the obvious question of why not Svelte. (Or Solid or Astro or...)
- yuchi 4y agoMarko predates scelte, by at least 3 years
- anileated 4y agoPer some tests as of last year[0], Marko[1] is much more performant than Svelte, which matters a lot for UX and for page rankings (especially in case of more complex sites). I’d expect Qwik to be faster than any of the above, but it seems not quite production-ready enough. [0] https://dev.to/this-is-learning/marko-for-sites-solid-for-apps-2c7d https://dev.to/this-is-learning/marko-for-sites-solid-for-ap... [1] In the Reddit the author mentions that, despite focusing on Solid+Astro in the article, Marko is actually still more performant than those: https://www.reddit.com/r/javascript/comments/ubs6i9/marko_for_sites_solid_for_apps/ https://www.reddit.com/r/javascript/comments/ubs6i9/marko_fo...
- beeb 4y agoLatest independent benchmarks indicate otherwise https://krausest.github.io/js-framework-benchmark/2023/table_chrome_109.0.5414.87.html https://krausest.github.io/js-framework-benchmark/2023/table...
- rk06 4y agoThis tests are referring to an unreleased version of marko which official benchmark, understandably, doesn't refer to. Hence this discrepancy is present
- beeb 4y agoRight, I can understand this. In any case, it's very hard to define if something is more performant than something else due to the vast number of metrics available to estimate the performance. Are we talking DOM manipulation, time to interactivity, SSR, number of parallel requests? With today's full-stack frameworks, it's even harder to put a number on these things, let alone make a ranking.
- pictur 4y agois this older than svelte? it looks like a soup where everything is done in a single file, just like svelte.
- nashashmi 4y agoAm I the only one perturbed by the use of invalid html? Could they not have marked up a new XSD/XML for these kinds of innovations? The browser and HTML renderers would know better to omit these kinds of markups.
- Existenceblinks 4y agoI still believe good old sever-side rendering + js sprinkle is still the best business value for the buck. Our industry seems to not have analysis on engineering cost compute with business value.
- 0xblinq 4y agoTotally agree with this.
- ARandomerDude 4y agoYour specific recommendation really depends on your use-case. But I think the general principle applies, and you can even go further: try building simpler things. This is why I use static websites + a little JS and some API calls until I absolutely need my own server/SPA/etc.
- Existenceblinks 4y agoThe technical lead needs to explain and link between highly interactive widget to business value. Breaking down feature/value to pieces and link each to what type of widget it needs. JS frameworks always sell like lets build the whole thing with this whole tools. It's not only not fined-grain solution, it's often mismatched. I don't buy the isomorphic thingy that reduces cognitive load because that's not only it's not absolutely true, it could be false and brings other type of problems.
- leke 4y agoI recently found htmx that allows me to do something like this in any backend language.
- Existenceblinks 4y agoI elaborate under the other comment. Htmx is good as long as there's not a lot of business value that needs highly interactive widgets. The whole thing is highly interactive sounds like a attempt silver bullet. The isomorphic invention currently doesn't solve client-server problems at all, it only solves 'I want to use one language' problem. Data still needs to live somewhere and move to somewhere, and there's physical distance between them, so it still has problems due to that condition.
- silent_cal 4y agoI actually really like this
- pier25 4y agoIs there an ETA for Marko v6?
- rglover 4y agoIf you want a pure HTML, CSS, and JavaScript component framework w/o any hacks, check out Joystick [1]. If you want a quick "why," give this a read [2]. [1] https://github.com/cheatcode/joystick https://github.com/cheatcode/joystick [2] https://github.com/cheatcode/joystick#what-distinguishes-joystick-from-other-frameworks https://github.com/cheatcode/joystick#what-distinguishes-joy...
- bonney_io 4y ago> So, an app you write in Joystick today will look the same 10 years from now (features will be added/improved over time, but core APIs will not be deprecated unless there is a major security or performance issue). We like to refer to Joystick as "The Honda Civic of JavaScript Frameworks." "Trust me, this thing -- which is very new -- will be around forever".
- rglover 4y agoIt's not a matter of trust. I designed the APIs to be stable from day one because I got tired of chasing unnecessary changes in the bigger frameworks. I spent a significant amount of time thinking ahead so changes weren't necessary.
- devwastaken 4y agoFrom the example: <for|item| of=input.items> I can hear a million souls googling in unison for the "for" html elements in vain. Logic and elements must be a separate syntax. When I see something between <>, that's an html elements.
- mpeg 4y agoSeriously asking: why? In frontend engineering where there is a separation of logic and presentation you end up with flimsy, broken code. We used to write websites in html and then add some js that targeted specific elements and that was impossible to maintain. Component based frameworks do away with all that because it doesn’t work. In react you’re mixing logic with your html too through jsx and this framework (and others like vue/svelte) go a step further and put everything related to a fragment of html in a single file. This works really well, it means your styles don’t leak unless you want them to, your js usually only affects the html in the same file it’s written and you can build robust apps.
- allynjalford 4y agoSo, Coldfusion?
- HLFH 4y agoHow about no?