L

Leo Horie

lhorie.github.io · Personal blog · on HN since 2014

Leo Horie, creator of the Mithril JavaScript framework, writes about the framework and front-end design choices.

What HN saysCommenters recommend Mithril as small, fast, and close to plain JavaScript, and say the Mithril blog is worth reading even if you never use it.
52HN people shared it
43linked it in comments
18stories submitted
373story points
7 years agolast shared
2014people per year2026

Most-shared posts

  1. 1
    Show HN: My new JavaScript MVC framework
    30 people · 306 points · first shared 2014 · 159 comments on HN
  2. 2
    Comparison
    6 people · first shared 2014
  3. 3
    A spreadsheet in 60 lines of JavaScript
    3 people · 5 points · first shared 2016 · discussion on HN
  4. 4
    Getting over a fear of Turing complete templates
    3 people · 2 points · first shared 2014 · discussion on HN
  5. 5
    Mithril blog
    3 people · first shared 2014
  6. 6
    Getting started
    3 people · first shared 2014
  7. 7
    Asymmetrical data bindings
    3 people · first shared 2014
  8. 8
    Mithril : lessons learned from AngularJS
    2 people · 5 points · first shared 2014 · discussion on HN
  9. 9
  10. 10
  11. 11
    Mithril.render
    2 people · first shared 2015
  12. 12
    Todomvc benchmark
    2 people · first shared 2014
  13. 13
    Tools
    2 people · first shared 2014
  14. 14
    Curry flavored promises
    1 people · 28 points · first shared 2014 · 17 comments on HN
  15. 15
    Mithril.js Components
    1 people · 10 points · first shared 2015 · discussion on HN

What HN people wrote when they linked it

ryannevius · 2016-02-29
React made me sad, so I switched to Mithril[1]. Not only is it significantly smaller in size, but it's way faster and includes a router and AJAX methods out of the box. I wish more people would give it a shot. That said, I do still love React Native, and use React on a daily basis to take advantage of the "write once, run anywhere" paradigm. [1] https://lhorie.github.io/mithril/
qwertyuiop924 · 2016-01-06
Thanks for the pointer, Leo. Also, thank you for the mithril blog. It is amazing. Everybody else, if you haven't read the mithril blog[1], YOU SHOULD BE READING THE MITHRIL BLOG. Even if you never plan to use mithril, you'll probably learn something interesting. 1: https://lhorie.github.io/mithril-blog/
rish · 2015-08-06
I like Mithril which is similar to React/Ractive. https://lhorie.github.io/mithril/ It doesn't abstract away too much from JavaScript and provides good methodologies as outlined in the Learn/Guide section of the site. As per your points: 1. A good couple of hours to about 6 depending on expertise just to test the workflow, get comfortable with MSX and to read the docs. 2. I've not used it in production as for current as I am still in an experimentation speed, but the whole premise is that it acts as a UI layer amongst the business logic that you may already have. It is fairly transportable. 3. This would be on a medium scale level depending how you couple your code and how modular you keep it. 4. Because it is fairly straight forward to get up and running. The blog posts alone provide great insight into application structure. Also the benchmark claims are quite appealing.
mdtusz · 2015-07-17
I've never seen Cycle before, but this looks somewhat similar to Mithril (http://lhorie.github.io/mithril/index.html), which is based on a semi-FRP virtual-dom approach. The thing that I prefer about Mithril though is that at the end of the day, your code looks like regular, vanilla js and is extremely readable. It's a pretty much invisible framework that you can use however you see the best fit - it just takes care of rendering and updating without any magic, and provides you with some helpful tools for managing models. My immediate grip with Cycle is the api - it just looks messy and more complex than it needs to be.
lhorie · 2015-03-18
A couple of other things I do w/ Mithril.js ( http://lhorie.github.io/mithril/ ) - write documentation for the API methods (and arguments, return values, and arguments to callbacks and their return values, if applicable) and show examples of usage - follow semantic versioning (x.x.X for bug fixes, x.X.x for backwards-compatible changes, X.x.x for breaking changes) - consider versioning documentation in addition to releases if your project can be used as mission critical software (e.g. if it's a framework). This can be as simple as creating a task that copies a snapshot of the docs to an archive - maintain a change log - make sure your release is on the master branch (not gh-pages) if you're publishing to component.github.io - setup channels of communication for discussion and support (gitter.im, IRC, mailing list, etc) - create a tag in StackOverflow.com
o_____________o · 2014-12-01
React, which is "just the V in MVC" Combine that with Reflux[1], which is a more opinionated framework around it. It's conceptually a little different than the Flux pattern that Facebook recommends, but the changes make sense after you have some insight into the Flux pitfalls. Stir in some react-router[2]. It's still not as full featured as Angular or Ember, so you'll need to adjust your expectations there. On that note, the Ember team has stated[3] they're going to to take the best ideas from React, so it's probably a good idea to keep an eye on that project as well. Mithril[4] also looks React-ish and interesting. 1: https://github.com/spoike/refluxjs 2: https://github.com/rackt/react-router 3: https://docs.google.com/presentation/d/1afMLTCpRxhJpurQ97VBHCZkLbR1TEs… 4: http://lhorie.github.io/mithril/
pygy_ · 2014-11-24
This post reminds me of these other two [0, 1] that ultimately lead Leo Horie to create Mithril [2], a tiny (5 KB down the line) but complete MVC framework that also eschews most of the criticism raised by the OP. The Mithril blog is also worth a look, it addresses a lot of concrete scenarios with recipies to solve common front end problems with the framework. For example, here's a post on asymetrical data binding [3]. ———— 0. http://lhorie.blogspot.fr/2013/09/things-that-suck-in-angularjs.html 1. http://lhorie.blogspot.fr/2013/10/things-that-suck-in-angularjs-follow… 2. http://lhorie.github.io/mithril/ 3. http://lhorie.github.io/mithril-blog/asymmetrical-data-bindings.html
jonahx · 2014-11-17
Since a lot of the complaints here are about bloat, complexity, and the steep learning curve, I'd recommend that anyone with similar concerns check out Mithril: http://lhorie.github.io/mithril/ It has a wonderfully simply design philosophy (similar to React's), can be learned in a matter of hours, and weighs in at 5k.
fiatjaf · 2014-07-18
I seems to me that Mithril is inspired by React, and it's awesome that someone is trying to make things better than React. That said, I have a bad impression of Mithril, because, in any case, its author should bear some respect to React, as a son to his father. But, instead, he appears very arrogant when talking about React (look here: http://lhorie.github.io/mithril/comparison.html#react) as if it was React that was inspired by Mithril and was reimplement Mithril ideas with worse performance. That bad impression, caused just by words (and other comments from its author here), pulls me away from Mithril, which is a situation I don't love.
jbergens · 2014-05-21
It was a great article! Very nice to read about how someone else thinks when making descisions. Regarding your choice I think you should look a little bit more at javascript frameworks like Mithril and React, they can be used on the server or on the client which holds many doors open for you. Mithril might fall for your demands on previous usage and minimum age but it seems to get web programming very close to other programming and is small enough that you should be able to do maintenance of if yourself if you have to a few years down the line. http://lhorie.github.io/mithril/
jmulho · 2014-03-18
The author provides an insightful comparison of Mithril to existing frameworks: http://lhorie.github.io/mithril/comparison.html
deckiedan · 2016-10-04
There's some truth to that. My own experience was in writing a lot of vanilla JS, being pretty happy with it, and then wanting to grow bigger I investigated some of the frameworks. At the time, Angular 1.x was considered the thing, so I implemented a project in that (multiple drag and drop lists, items from lists into other lists, and so on), and tried to follow best practices as far as I could tell. DRY, decoupling, etc. It was pretty horrendous. I ended up with so many different services, service providers, components, dependency injectors, and all kinds of (to me) really quite complex abstract boilerplate that had nothing to do with the actual business problems. I eventually got it all working, and thought I was doing pretty good. I then took a break from that project and came back to it 2 months later, and couldn't make head nor tail of it. So many angular-specific concepts and terminologies. I've since come across mithril.js, and found it (for me) perfect. It's designed to let you build stuff really fast, and modularise things around your business logic, rather than have the whole of you application design enforced from the framework. Leo's blog posts https://lhorie.github.io/mithril-blog/ are fantastic, and I think made me understand a lot more of javascript itself, and how to design applications in much more 'well designed, but not framework specific' ways.
jarpineh · 2015-08-15
This looks really fun way to develop React apps. I just developed a React app, and managed to trip over state related problems at every stage. First with full state outside components, then within a top component, then I tried with a simple store type concept. Whenever I had to deal with async issues, I made a mistake with communicating ongoing state or getting React to notice changed state. I was waiting for Redux to go 1.0 (which it apparently did yesterday!). I wonder how async updates, like network requests, to the model should work? Perhaps two channels, one for events from the components to what ever is handling requests for you (I just used D3, since I have some other uses for it), and then it can message the results via channel to what actually updates the model. OP's example reminded me strongly of Mithril [1]. Though with addition of CSP channels to communicate changes, and explicit external render call, which Mithril allows also, but I don't remember having to use. It's clean and simple looking, and I like it. Now I got one more way to mess with my app state. And should I decide to use Mithril again on other projects, CSP seems like a worthy addition if it can be applied this easy. [1] https://lhorie.github.io/mithril/
alexc05 · 2015-05-26
I "failed" a job interview recently to the reason that they didn't have faith in my jQuery (any by extension Javascript) skills. I managed to write a multi-page response explaining how the modern frameworks were moving away from jquery in favour of data bindings, virtual dom, etc... while I acknowledge that there is still a place for jQuery, it has a very much diminished role in modern web development. In the end, I never sent the email in response. While it was cathartic to write, I really didn't want to come across as "sour grapes". (and truth be told, I respected their decision... I'd feel a better fit in a more technology forward environment, their reliance on "old faithful" technologies can still make money) I feel like even angular has come-and-gone as a framework the 1.x just isn't performant on busy pages. Anything with a log of ng-repeats gets out of hand. Though I suppose that could also mean that I'm writing bad pages too. My most recent favorite is Leo Horie's https://lhorie.github.io/mithril/ We've got some of that running in production and it really is beautiful to work with. I'd like to try REACT, but haven't found the right project for it yet. I've sortof started rambling here... my point was I share your experience with employers looking for "old" tech.
ufo · 2014-05-14
I experimented with React a bit but I was a bit bugged by how large it was. The basic idea of rendering to a virtual DOM and having unidirectional data flow is really simple but I had trouble actually diving in to React's source code and seeing things under the hood (for example, I had to find a blog to see how the diffing algorithm worked). What are the other libraries out there that we can use for this virtual DOM pattern right now? I only found mithril[1] that similarly does the template rendering with Javascript but I still don't know how different to React it is in the end? Is the diffing algorithm similar? Do they handle corner cases the same (many attributes need to be treated specially when writing them to DOM)? Simplifying it a bit: other than the virtual DOM, is the rest of React also the best way to structure apps? What would the ideal "barebones" virtual DOM library look like? [1] http://lhorie.github.io/mithril/
k__ · 2017-02-07
This. "Good view layer code means that templates should be as declarative as possible, NOT that the view layer as a whole should avoid procedural logic altogether." - https://lhorie.github.io/mithril-blog/getting-over-a-fear-of-turing-co…
zwerdlds · 2016-08-30
Mithril's omission is telling, as it it often faster than even Elm by 50% or so. http://lhorie.github.io/todomvc-perf-comparison/todomvc-benchmark/
PhiLho · 2015-11-23
Alternative links: [2] http://lhorie.github.io/mithril/ (using its own virtual Dom); I think there are other implementations around, too. [3] http://cycle.js.org/ (have a native driver) FYI.
christophilus · 2015-11-17
I'd be interested in seeing https://lhorie.github.io/mithril/) added to this list.
ausjke · 2015-10-27
how is this compared to mithril? https://lhorie.github.io/mithril/ , trying to find a front-end js framework/library these days for an embedded product (use browser to configure it), angular seems a bit heavy for me, have not learned react yet.
beefsack · 2015-09-13
I'm still yet to be convinced that JSX is a good idea, why break existing tooling and significantly complicate parsers for what appears to only be a minor convenience at the surface level? Mithril manages similar functionality without any modifications to syntax. https://lhorie.github.io/mithril/
EGreg · 2015-06-07
What about Mithril? It's tiny, efficient and predates React. Here is a good overview of it: https://lhorie.github.io/mithril/comparison.html
davexunit · 2015-05-12
Trust me, I know Lisp. In Lisp, there's built-in templating via quasiquote, so we can easily construct HTML documents by first writing them as s-expressions. JSX is a far cry from how Lisp does things. You get all of the nastiness of the redundant typing involved with hand-writing HTML mixed in with your JavaScript, plus the addition of another compilation step in your build! I like Mithril's virtual DOM API[0] much more. It's really pleasing to use, but of course not as good as SXML in Lisp because JavaScript doesn't have macros or quasiquote. [0] https://lhorie.github.io/mithril/mithril.html
dyscrete · 2015-04-06
I don't think anyone will see this but here goes. Try Meteor[1]. Over the past few years using things like Angular, mithril[2], React[3], Vue[4] Meteor, and Ember[5] for large production sites, I've found Meteor painstakingly easy to quickly build real-time "isomorphic" web applications. If you haven't tried it and you're thinking about creating an app with a FRP[6] app I recommend giving it a whirl. [1] http://meteor.com [2] https://lhorie.github.io/mithril [3] http://reactjs.org [4] http://vuejs.org [5] http://emberjs.com [6] https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 Edit: Fix spacing
ArthurClemens · 2015-04-02
Mithril already uses a diffing algorithm: "diffs the new tree against the existing one and intelligently modifies only the portions that have changed": http://lhorie.github.io/mithril/mithril.render.html
hardwaresofton · 2015-02-02
Maybe it's time to make a truly F/OSS React clone? For those who may want other options to React after reading this, mithril is small & has JS DOM: https://lhorie.github.io/mithril/getting-started.html How it's rendered: http://lhorie.github.io/mithril/mithril.render.html Differences with React: http://lhorie.github.io/mithril/comparison.html#react
galfarragem · 2014-12-04
Do you think Mithril can be integrated in meteor? Edit: I just found a blog post on that. [1] [1] http://lhorie.github.io/mithril-blog/mithril-and-meteor.html
MrBuddyCasino · 2014-11-24
An interesting framework, somewhat similar to Mithril (http://lhorie.github.io/mithril/), and nearly as fast, which means its quicker than Angular / Ember / Bootstrap etc.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close