M
Marcel Weiher
blog.metaobject.com · Personal blog · on HN since 2012
Marcel Weiher writes about programming language design, Objective-C and Swift, software architecture, and performance, drawing on long experience with Apple platforms.
What HN saysHN commenters point to his work on storage combinators and critiques of Swift syntax and compiler direction, and some argue with his architecture views.
47HN people shared it
28linked it in comments
192stories submitted
3.7Kstory points
3 months agolast shared
2012people per year2026
Most-shared posts
- 1UIs are not pure functions of the model (2018)7 people · 228 points · first shared 2018 · 121 comments on HN
- 2M1 Memory and Performance6 people · 66 points · first shared 2020 · 36 comments on HN
- 3The Safyness of Static Typing5 people · 66 points · first shared 2014 · 100 comments on HN
- 4Jitterdämmerung4 people · 149 points · first shared 2015 · 108 comments on HN
- 5Cc -Osmartass4 people · 1 points · first shared 2014 · discussion on HN
- 6The Curious Case of Swift's Adoption of Smalltalk Keyword Syntax3 people · 147 points · first shared 2020 · 161 comments on HN
- 7Blackbird: A reference architecture for local-first connected mobile apps3 people · 77 points · first shared 2022 · 7 comments on HN
- 8Native-GUI distributed system in a tweet3 people · 48 points · first shared 2022 · 25 comments on HN
- 9Model Widget Controller (MWC) Aka: Apple “MVC” Is Not MVC3 people · 10 points · first shared 2015 · discussion on HN
- 10M1 Memory and Performance3 people · 9 points · first shared 2020 · discussion on HN
- 11Instant Builds3 people · 8 points · first shared 2019 · discussion on HN
- 12“What Alan Kay Got Wrong About Objects”2 people · 246 points · first shared 2019 · 231 comments on HN
- 13Lisp Macros, Delayed Evaluation and the Evolution of Smalltalk2 people · 138 points · first shared 2019 · 111 comments on HN
- 14Maybe visual programming is the answer, maybe not2 people · 136 points · first shared 2020 · 149 comments on HN
- 15Dependency Injection is a Virtue2 people · 120 points · first shared 2013 · 84 comments on HN
What HN people wrote when they linked it
mpweiher · 2025-09-08
Hmmm...the problems you recount are exactly the problems of putting (way too much) logic into the controller...and not enough logic into the model...which is exactly what MVC recommends you not do, and which is exactly what I criticized about your approach...and which is exactly the critique you seem unwilling to accept.
¯\_(ツ)_/¯
What gives?
Put all the logic in the model. If you want authentication, put that in an "authenticated model" that wraps your model. Don't put it in the controller.
> Controller controls the boundary between the system and the user.
Nope. That is Apple-MVC. Aka Massive-View-Controller. It is not MVC.
The model API is the boundary between the model and the rest of the system.
https://blog.metaobject.com/2015/04/model-widget-controller-mwc-aka-ap…
metapsj · 2023-03-27
You have to follow Marcel Weiher's work on combinators aka connectors.
The following article references his work on in-process rest, polymorphic identifiers, and storage combinators.
What Alan Kay Got Wrong About Objects
https://blog.metaobject.com/2019/11/what-alan-kay-got-wrong-about-obje…
Here's an ACM SIGPLAN talk he gave on storage combinators...
Storage Combinators @ SPLASH'19
https://www.youtube.com/watch?v=6FFlmkFS1YY
The ACM SIGPLAN talk is a very good starting place to get an understanding what he is talking about.
lenkite · 2022-09-10
It is well accepted that GC-based runtimes greatly increase memory footprint. A tracing GC might need upto several times the memory to match manual memory management. Nothing interesting about the "viewpoint".
https://people.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf
https://blog.metaobject.com/2020/11/m1-memory-and-performance.html
nyanpasu64 · 2021-12-18
There's some odd syntax in this post, which passes colon-delimited indented code blocks to function calls, than control flow primitives. It reminds me of Ruby/Kotlin blocks or Swift's blocks (criticized in https://blog.metaobject.com/2020/06/the-curious-case-of-swift-adoption… but it's quite unusual from my Python/C++/Rust background and I think it's worth explaining in the blog post, since I don't know if it's passing a key-value map/struct or a lambda.
b3morales · 2021-12-13
Same here, I was never a proponent of the dot syntax. As we know, compiler development at Apple got taken over at some point by C++ people, and we can all see the results: https://blog.metaobject.com/2014/06/remove-features-for-greater-power-…
klelatti · 2020-11-26
It's a great piece and as you say it's a shame that we won't see more detailed info from Apple but I've seen a couple of interesting comments (leaks?) from Apple employees with more details (e.g. the tweets embedded in the article below). I suspect that we'll know an awful lot about the M1 by the time we've finished!
https://blog.metaobject.com/2020/11/m1-memory-and-performance.html
to3m · 2015-12-20
I claim this is all highly unhelpful. Both the C and C++ standards explicitly permit an implementation to do something sensible in the face of undefined behaviour, the sort of thing that a regular user of the system in question might expect. It's a bit unclear to me why compiler authors don't just do that. Undefined means exactly what it says, nothing more, but people seem to love this idea that it has to be some kind of here-be-dragons nightmare scenario.
Mandatory reading: http://blog.metaobject.com/2014/04/cc-osmartass.html, http://robertoconcerto.blogspot.co.uk/2010/10/strict-aliasing.html
dozzie · 2015-06-08
It will in more or less the same amount as Objective-C, meaning, it actually
won't.
ObjC suffered greatly from not having a standard container library. What
delivered GNUstep was far, far too little for widespread use, and you needed
to actually pull in the whole framework.
Even if Swift will have a container library, it has tough competition that was
carried though designing phase, with the result of not being composed purely
of edge cases (http://blog.metaobject.com/2015/05/i-am-jealous-of-swift.html).
And it's not obvious how would Swift interact with C or C++ libraries
(meaning: ABI and/or an equivalent of FFI).
All in all, I don't see any reason at all to use Swift as a server-side
language. Extracting it from MacOS simply cripples it too much, and the
language itself adds virtually nothing to the landscape.
rektide · 2023-01-28
The very nature of what we do is so different. We have so many more interactions with so many different libraries & technologies than we used to have.
I'm missing some of the other good recent discussions, but there's a core idea I love & think is true: that modern software dev is much more about "glue" code, about combining existing libraries, services, systems. Some recent pieces: https://www.oreilly.com/radar/thinking-about-glue/ https://blog.metaobject.com/2021/06/glue-dark-matter-of-software.html
By comparison, software dev used to be a purer act of raw artifice: I remember we had our db.perl & db.php at the little webshack I started at. We authored/maintained/grew it, and it was just our little library of helpers, totally independent of the rest of the world. Imported across the dozens of properties we webmastered. That's how software was! Independently developed, owned, & operated. Now, there is much assumed context, countless tools & technologies in play in every situation. Rather than big levers, we adjust large systems, or graft on new sub-machines.
Perl, in my mind, was the real starting place, the pivot where open source let us start to consume each other's code rapidly: CPAN was a great early way to start finding & using code, rather than writing it yourself. Since then, online package repos have only increased.
And some years after that, hosted services started growing in popularity. Cloud platforms started emerging. Rather than being a master-crafter…
mucholove · 2020-08-26
Yesterday I made a glue program that imports my model code and http code and makes requests to my running server.
I’ve loaded it with assertions and anytime my server code is wrong—it’s just so easy to find out.
The biggest issue for me is trying to get XCode to launch my server first and my test program second every time I make a change.
Besides that—having the test program is a joy. Took me an hour to setup.
All this is to say—testing is very much alive and well in me.
The biggest mistake made is that these IDE’s or programs usually make the testing command something you need to run besides the program. They really should run together. Once click. Test everything.
PS — my favorite testing framework is MPWTest because it brings my code to life as a living document.
With HTTP or server code it hiccups of course—hence my need to roll my own.
https://blog.metaobject.com/2020/05/mpwtest-reducing-test-friction-by-…
DonHopkins · 2019-12-20
My remark was just an old Java joke I repurposed for Ant!
"Java is a DSL for taking large XML files and converting them to stack traces." -Andrew Back
https://www.reddit.com/r/programming/comments/eaqgk/java_is_a_dsl_for_…
But in all seriousness:
OpenLaszlo used XML with embedded JavaScript in a way that let you extend XML by defining your own tags in XML+JavaScript. I've done a lot of work with it, and once you make your peace with XML (which seemed like a prudent thing to do at the time), it's a really productive enjoyable way to program! But that's more thanks to the design of OpenLaszlo itself, rather than XML.
https://en.wikipedia.org/wiki/OpenLaszlo
OpenLaszlo (which was released in 2001) inspired Adobe Flex (which was released in 2004), but Flex missed the point of several of the most important aspects of OpenLaszlo (first and foremost being cross platform and not locking you into Flash, which was the entire point of Flex, but also the declarative constraints and "Instance First Development" and the "Instance Substitution Principal", as defined by Oliver Steele).
https://en.wikipedia.org/wiki/Apache_Flex
https://blog.osteele.com/2004/03/classes-and-prototypes/
The mantle of constraint based programming (but not Instance First Development) has been recently taken up by "Reactive Programming" craze (which is great, but would be better with a more homoiconic language that supported Instance First Development and the Instance…
ludwigvan · 2015-04-05
I would like to hear more discussion on this subject, since there seems to be a confusion in the community regarding MVC (myself included.) see also author's previous article http://blog.metaobject.com/2015/04/model-widget-controller-mwc-aka-app…
I'm a React developer, have little experience with native development myself. With that in mind, here is a small implementation of how I would envision how developing a native app with React's always rendering in mind: https://github.com/ustun/mvc-vs-react/blob/master/singleviewtest2/View…
Notice every UI action results in a call to a model method, immediately follows by render. The whole model-view syncronization is centralized in a render method, so it is not allowed to modify view manually in UIAction methods, you just set model methods and then render.
What React does is to make this seamless, that is you call setState which in turn triggers render automatically. This way, the data flows from your model to your view.
Of course this doesn't take into account how this flow goes when child views are involved, normally you would want to call render in each childview as well, and that's where virtual DOM comes into play with React.
mwcampbell · 2024-12-11
I still think @mpweiher's original response to the release of GitHub Copilot is spot on: https://blog.metaobject.com/2021/06/don-generate-glueexterminate.html
That is, rather than use an LLM to generate boilerplate code from an ambiguous natural-language prompt, use a high-level programming language to precisely, concisely, and directly express what you want.
GeekyBear · 2024-09-27
Reference counting doesn't have the same cost as a sweeping garbage collector.
Apple has also optimized their custom ARM core to further reduce the cost.
> retaining and releasing an NSObject takes ~30 nanoseconds on current gen Intel, and ~6.5 nanoseconds on an M1
https://blog.metaobject.com/2020/11/m1-memory-and-performance.html?m=1
That said, Swift is working toward adding a future opt-in Rust inspired approache to memory management for those who need it.
https://forums.swift.org/t/manifesto-ownership/5212
https://forums.swift.org/t/a-roadmap-for-improving-swift-performance-p…
michaeljbishop · 2023-03-14
Yes. Software-based ICs.
https://blog.metaobject.com/2019/03/software-ics-binary-compatibility-…
MaysonL · 2022-08-12
Check out this blog post: https://blog.metaobject.com/2022/08/native-gui-distributed-system-in-t…
Eric_WVGG · 2022-02-08
These are all true, but you’re missing the main one.
“Apple Silicon” is very highly optimized for strict reference counting (instead of garbage collection). The retain/release performance is just off-the-wall — even in Rosetta. Details here: https://blog.metaobject.com/2020/11/m1-memory-and-performance.html
Anecdotally, I spent most of last year in Docker, XCode and Node on an 8gb Air, smoove sailing
userbinator · 2021-07-11
If anything I think they are written by people who are too smart --- theoreticians who care only about the standard and can't be bothered exercising common sense when the standard doesn't specify what to do.
http://blog.metaobject.com/2014/04/cc-osmartass.html
pjmlp · 2021-05-22
Other languages need special hardware to beat C#, so I guess the language wasn't the issue.
https://github.com/ixy-languages/ixy-languages
https://blog.metaobject.com/2020/11/m1-memory-and-performance.html
tzahola · 2018-05-01
Nah, nobody in their right mind would use Java/C# over C/C++ for performance...
http://blog.metaobject.com/2015/10/jitterdammerung.html?m=1
adamnemecek · 2016-05-27
> And if you've read my blog and think I write about type theory, then you are utterly confused.
http://blog.metaobject.com/2014/06/the-safyness-of-static-typing.html
alvatar · 2015-03-31
That's the point.
Here is further discussion of this: http://blog.metaobject.com/2014/06/the-safyness-of-static-typing.html
dang · 2014-11-13
This review is surprising in two ways: how thorough it is and how even-handed. It must have been a lot of work to put together and I'm glad you did it so the rest of us don't have to.
It's refreshing to see posts like this and http://blog.metaobject.com/2014/06/the-safyness-of-static-typing.html pointing out that we don't have strong evidence on this and keeping an open mind. A trend? One can hope.
PKop · 2024-08-17
UI is not a pure function of state[0], "UI state" is relatively stable and does not have to be recreated constantly when data input changes.
[0] https://blog.metaobject.com/2018/12/uis-are-not-pure-functions-of-mode…
>you want to be able to reevaluate your templates repeatedly with new state
No you don't. It is inefficient and increases complexity. You then have to extract and keep track of state yourself where the platform/UI components could have done much of this themselves.
Calling the same method over and over again is wasteful. So we don't do that. First, we did not start with the obviously incorrect premise that the UI is a simple "pure" function of the model. Except for games, UIs are actually very stable, more stable than the model. You have chrome, viewers, tools etc. What is a (somewhat) pure mapping from the model is the data that is displayed in the UI, but not the entire UI. So if we don't make the incorrect assumption that UIs are unstable (pure functions of model), then we don't have to expend additional and fragile effort to re-create that necessary stability.
lern_too_spel · 2020-11-25
Indeed, one of the articles cited by the article that this discussion is about (https://blog.metaobject.com/2020/11/m1-memory-and-performance.html) links to a paper saying that GC needs 4x the memory to match manual memory management and then makes a huge wacky leap to say that ARC could achieve that with less. It can't. ARC will always be slower than manual memory management because it behaves the same way as naive manual memory management with some overhead on top.
On the other hand, that same paper shows that for every single one of their tested workloads, the generational GC outperforms manual memory management. Now obviously, you could do better with manual memory management if you took the time to understand the memory usage of your application to reduce fragmentation and to free entire arenas at a time, but for applications that don't have the developer resources to apply to that (the vast majority), the GC will win.
I'm not saying that better memory management is the reason Android wins these launch to interactivity benchmarks because the difference is so stark relative to the hardware performance that memory management isn't nearly enough to explain it, but it does contribute to it. (My own guess is that most of the performance difference comes from smarter process initialization from usage data. Apple is notoriously bad at using data for optimization.)
chenglou · 2019-01-22
Apple uses and maintains https://sproutcore.com, not Cappuccino. The latter was made by ex-applers a long time ago. Though Apple also isn't monolithic and has many teams independently evaluating Angular, React and others.
Not too coincidentally, the author of Objective-Smalltalk, who said above that he wants to leverage Cappuccino, has also written up his criticism of React here: https://blog.metaobject.com/2018/12/uis-are-not-pure-functions-of-mode…
Related: I've talked to a Cappuccino founder recently too, and my casual observation (which he agreed with) was that had they done Cappuccino all over again, they should have probably dropped Objective-J. Imo it's just a bit too much of a language bikeshedding and I don't think it would have changed framework _that_ much (proof: Swift works well with UIKit and AppKit). Though my opinion was just based on practicality of adoption; if Objective-smalltalk wants to take its time exploring around more than anything else, then I'd say it + cappuccino seems like a nice fit.
I'm really looking forward to Cappuccino staying alive for another ten years (and I wish all the luck to Objective-smalltalk's author) =). Though the recent Cappuccino conf doesn't feature many younger programmers.
quanticle · 2017-02-02
AOT native results in slower runtimes for applications with one simple
exception: startup time. In every other case a modern JIT compiler like the
JVM will win due to gathering information and layered compilation.
That's not necessarily true. JIT compilation is severely constrained in the amount of analysis that it can do for the simple reason that JIT has to be fast. Fast enough to not noticeably slow down the app. Meanwhile, an AOT compiler can take all the sweet time it needs, and roam all over the program in order to discover optimizations.
JIT compilers work very well on untyped languages like Smalltalk because the compiler can discover the type information at runtime, and then pre-compile the types that it sees most often. But that's not really that useful on the JVM, because Java is typed, as are most other JVM languages, with the exception of Clojure.
Most funnily Microsoft was heavily advertising AOT with .net framework 1.0
but in general switched to dynamic profiling and optimization in later
versions of .net. (System assemblies that everybody uses during startup are
AOT compiled using ngen, however)
Actually, with .Net Native, Microsoft is back to advertising AOT.
http://blog.metaobject.com/2015/10/jitterdammerung.html
tom_ · 2023-08-21
My UB links list is getting on in years, but somehow remains vaguely relevant.
"These people simply don't understand what C programmers want": https://groups.google.com/forum/#!msg/boring-crypto/48qa1kWignU/o8GGp2…
"please don't do this, you're not producing value": http://blog.metaobject.com/2014/04/cc-osmartass.html
"Everyone is fired": http://web.archive.org/web/20160309163927/http://robertoconcerto.blogs…
"No sane compiler writer would ever assume it allowed the compiler to 'do anything' with your code": http://web.archive.org/web/20180525172644/http://article.gmane.org/gma…