Mishadoff

mishadoff.com · Personal blog · on HN since 2015

Mishadoff writes about Java internals such as Unsafe and SecurityManager, and about Clojure.

What HN saysHN commenters recommend its Clojure design patterns post as a good read that maps GoF patterns to functional code and applies to other dynamic languages.
17HN people shared it
10linked it in comments
9stories submitted
486story points
11 months agolast shared
2015people per year2026

Most-shared posts

  1. 1
    Clojure Design Patterns
    12 people · 479 points · first shared 2015 · 126 comments on HN
  2. 2
    Java Magic. Part 4: Sun.misc.Unsafe
    4 people · 2 points · first shared 2015 · 2 comments on HN
  3. 3
    Java Magic: 0xCAFEBABE
    1 people · 4 points · first shared 2015 · discussion on HN
  4. 4
    Java Magic. Part 5: SecurityManager (2014)
    1 people · 1 points · first shared 2018 · discussion on HN

What HN people wrote when they linked it

capableweb · 2021-03-07
> The second best explanation is that patterns are often a sign of shortcomings in the language Agree. Came across a blogpost that describes this very well by using Clojure as an example: http://mishadoff.com/blog/clojure-design-patterns/
austinbirch · 2017-10-29
I have found this to be a good read[1]. Examples are in clojure but will apply to other dynamic languages with first-class functions etc. [1]: http://mishadoff.com/blog/clojure-design-patterns/
signal11 · 2025-12-11
Design patterns are language independent, but a lot of the ones many Java devs focus on are a bit meh. In a world with only assembly language, for instance, it’s a bit like making a big deal about a “guarded repetition” pattern (aka a while loop). Eg in Lisps, a lot of patterns become one-liners. At that point these patterns become a “can you write decent Lisp” question[1]. [1] https://mishadoff.com/blog/clojure-design-patterns/
emil0r · 2024-08-09
There is a functional core in js, and as such it might be an idea to take a look at common OOP design patterns and how they translate to an FP approach. This is Clojure based, but there is a lot of similarity to js once you get past the syntax: https://mishadoff.com/blog/clojure-design-patterns/
ignoramous · 2019-09-19
> The open question in my mind is whether pure functional languages scale well to problems of real life complexity. I came across this website [0] on news.yc way back when: It has a nice one-to-one mapping of GoF design patterns in C++/Java to Clojure. > The open question in my mind is whether pure functional languages scale well to problems of real life complexity OCaml [1] really shines in this aspect having used it in a project involving static code analysis. Facebook's ReasonML is based on it. The rust-lang compiler was once written in OCaml. And then there's amirmc's unikernel.org / mirage.io, as well. [0] https://mishadoff.com/blog/clojure-design-patterns/ [1] https://ocaml.org/learn
bluejekyll · 2019-07-11
> Java doesn’t have unsafe code at all, not even in standard library, and it’s very hard to interop with. Isn’t all JNI code in Java considered unsafe? Then there is http://mishadoff.com/blog/java-magic-part-4-sun-dot-misc-dot-unsafe/
wellpast · 2018-10-16
You can slap "command pattern" on anything. But I'm speaking directly in the traditional form that implies a OO type hierarchy. You don't need that at all. Here is a "proof" of sorts: http://mishadoff.com/blog/clojure-design-patterns/#episode-1-command
anarcticpuffin · 2015-09-01
This is very similar to Java's CMS collector[1]. Unfortunately, 10ms is still far too long for some applications. I have hopes for something like Azul's pauseless GC[2] eventually becoming a common GC strategy, but I'm not holding my breath. In the meantime, there's always sun.misc.Unsafe[3] in the JVM world :-( [1] - https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms… [2] - http://www.azulsystems.com/zing/pgc [3] - http://mishadoff.com/blog/java-magic-part-4-sun-dot-misc-dot-unsafe/
veqq · 2025-03-24
> Functional programming can express patterns just as well as OOP. No! Patterns are just crutches for missing language features or "design patterns are bug reports against your programming language." GoF patterns are concepts useful in OOP, but the recurring patterns and architectures you see in other paradigms are totally different. And they don't apply to Lisp: https://www.norvig.com/design-patterns/ Most don't even apply in Go: https://alexalejandre.com/programming/software-architecture-today/#in-… > visitor is type switching, singleton global variables, command and strategy are first class functions with closures, state is building a state machine with first class functions If you could perfectly compress your code, repeated patterns would be factored away. Macros do this. In Lisp, when you find a pattern, you write code which generates that pattern, so you don't have to. https://mishadoff.com/blog/clojure-design-patterns/ > if patterns are discovered, arise out of independently invented idioms Yes. That's the point behind Christopher Alexander's pattern concept - he found architectural patterns which seemed to promote good social habits, happiness etc. Gabriel's Patterns of Software presents this far better than GoF. I strongly suggest you read it: https://www.dreamsongs.com/Files/PatternsOfSoftware.pdf
dirtydroog · 2020-05-24
There is an open-source project by LMAX (a forex trading company) called Disruptor[1] that squeezes as much as possible out of the JVM. It's awesome. I ported it to C++ years ago when I wanted to learn about low-latency techniques. However, if you look at the code they need to actually break out of the JVM's safety net to get the performance they need[2]. I couldn't help but ask myself why they didn't just use C++, and when asked one of the devs did admit that their own C++ ports had an approx 10% performance increase (although this was ~7 years ago maybe) Rust is certainly interesting and it's on my radar. I wonder though, when it comes to having it in use in anger if its guarantees turn out to be over sold, just like the JVM's safety claims were. Time will tell. Edit: I tend to focus on comapring against the JVM because pretty much any framework you use on The Cloud is JVM based. I'm of the opinion that there are cost savings to be had if these were ported to more appropriate languages, hence the Cassandra vs Scylla comparison. The money saved was 'noticeable'. [1] https://github.com/LMAX-Exchange/disruptor [2] http://mishadoff.com/blog/java-magic-part-4-sun-dot-misc-dot-unsafe/

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