HNHacker News
TopNewBestAskShowJobs

JoelMcCracken

2,777 karma · joined February 27, 2009

Pittsburgh dev. Haskell mostly.

Contact me at mccracken.joel@gmail.com

If your reply to me seems unnecessarily combative, pedantic, or uncharitable, I will probably not reply. Its not worth talking with someone who appears to be intentionally misconstruing my words. Ain't nobody got time for that.

submissionscomments
JoelMcCracken··on The next chapter of the Microsoft–OpenAI partnership
You’re absolutely right!
JoelMcCracken··on The Programming Languages Zoo
Yes, “wrong” was a bit of a strong word, but do note that I intentionally framed it as an opinion and not as, like, objectively wrong.

UI is still important, but I do not think it really defines a language.

Let’s say I created a new Haskell compiler, and it had the best error messages in the world, a hiccup-free LSP experience, maybe an alternative syntax format that’s more familiar to mainstream devs. But it still has all the same semantics. Is that still Haskell? Why or why not?

Now let’s say I took whatever has the best tooling currently, idk what it would be, maybe TypeScript, but gave it say non-strict semantics. Is that still typescript?

JoelMcCracken··on The Programming Languages Zoo
I don’t disagree, but if you set it up as “ui vs math”, you signify certain things. And based upon your comment it did not say “they mean how the programmers mental model maps to the problem”. In fact I’d say that’s more math like than not
JoelMcCracken··on The Programming Languages Zoo
I do agree with this, but also, I don't really understand a lot of the tradeoffs, or at least to me they are false tradeoffs.

Her first example is excellent. In Haskell, we have global type inference, but we've found it to be impractical. So, by far the best practice is not to use it; at the very least, all top-level items should have type annotations.

the second one, structural typing: have your language support both structural types and nominal types, then? This is basically analogous to how haskell solved this problem: add type roles. Nominal types can't convert to one another, whereas structural types can. Not that Haskell is the paragon of language-well-designed-ness, but... There might be some other part of this I'm missing, but given the obviousness of this solution, and the fact that I haven't seen it mentioned, it is just striking.

on dynamic dispatch: allow it to be customized by the user - this is done today in many cases! Problem solved. Plus with a global optimizing compiler, if you can deal with big executable size, you have cake and eat cake.

on JIT: Yes, JIT can take some time, it is not free. JIT can make sense even in languages that are AOT compiled, in general it optimizes code based upon use patterns. If AOT loop unrolling makes sense in C, then I certainly think runtime optimization of fully AOT compiled code must be advantageous too. But, today, you can just about always figure that you can get yourself a core to do this kind of thing on, we just have so many of them available and don't have the tools to easily saturate them. Or, even if you do today with N cores, you probably won't be able to on the next gen, when you have N+M cores. Sure, there's gonna have to be some overhead when switching out the code, but I really don't think that's where the mentioned overhead comes from.

Metaprogramming systems are another great example: Yes, if we keep them the way they are today, at the _very least_ we're saying that we need some kind of LSP availability to make them reasonable for tooling to interact with. Except, guess what, all languages nowadays of any reasonable community size will need LSP. Beyond that, there are lots of other ways to think about metaprogramming other than just the macros we commonly have today.

I get her feeling, balancing all of this is hard. One think you can't really get away from here is that all of this increases language, compiler, and runtime complexity, which makes things much harder to do.

But I think that's the real tradeoff here: implementation complexity. The more you address these tradeoffs, the more complexity you add to your system, and the harder the whole thing is to think about and work on. The more constructs you add to the semantics of your language, the more difficult it is to prove the things you want about its semantics.

But, that's the whole job, I guess? I think we're way beyond the point where a tiny compiler can pick a new set of these tradeoffs and make a splash in the ecosystem.

Would love to have someone tell me how I'm wrong here.

JoelMcCracken··on The next chapter of the Microsoft–OpenAI partnership
Citation needed? I don't mean this in a snarky way, though. I genuinely have not seen anything that these things can train on their own output and produce better results than before this self-training.
JoelMcCracken··on The next chapter of the Microsoft–OpenAI partnership
this is something I think about. state of the art in self driving cars still makes mistakes that humans wouldn't make, despite all the investment into this specific problem.

This bodes very poorly for AGI in the near term, IMO

JoelMcCracken··on The next chapter of the Microsoft–OpenAI partnership
what's super weird to me is how people seem to look at LLM output and see:

"oh look it can think! but then it fails sometimes! how strange, we need to fix the bug that makes the thinking no workie"

instead of:

"oh, this is really weird. Its like a crazy advanced pattern recognition and completion engine that works better than I ever imagined such a thing could. But, it also clearly isn't _thinking_, so it seems like we are perhaps exactly as far from thinking machines as we were before LLMs"

JoelMcCracken··on The Programming Languages Zoo
You can certainly think of them that way if you want. And, you'll be wrong, at least IMO, and in what seems to be the consensus of people who study and work on PLs.

"UI" issues, while not at all unimportant, are surface level. Semantics are fundamental. Get the semantics of your language wrong, and you are stuck. Indeed, this is what happens with most popular languages that aren't well-considered:

- lang author creates some random new lang, throws whatever feels like a good idea to them into the lang

- lang community discover that these features interact in rather surprising ways, ways that keep tripping up newcomers to the language, and would like to change it.

- lang author, having had X more years of experience now, identifies that changing the behavior could break user programs who rely on that behavior (wittingly or un-)

- lang author decides to write a new, backwards-incompatible version, community has 20 years of turmoil before recovering (python3), if it ever does (perl6).

JoelMcCracken··on Simplify your code: Functional core, imperative shell
Yeah, I haven’t read Scott’s books, but my understanding of ddd is such that it should be extremely applicable to DDD.

DDD is described in terms of OOP, but really imo it makes far more sense in fp contexts.

JoelMcCracken··on United MAX Hit by Falling Object at 36,000 Feet
https://www.calculatorsoup.com/calculators/math/speed-distan...

180 mph taken from a bit of googling, ballpark figure on upper end.

So this was really immediately after takeoff. My understanding of commercial airliners is they usually fly fairly parallel with the ground just after takeoff to pick up speed before ascending, so I would guess they hadn’t much altitude at all.

Anyway it’s a very interesting article, ty to poster! And it was an interesting question to think about.

JoelMcCracken··on United MAX Hit by Falling Object at 36,000 Feet
Given this happened 400 ft past the end of the runway, I really don’t think the altitude involved would be very surprising
JoelMcCracken··on What Dynamic Typing Is For
There are practical limits on global type inference; eg, sometimes writing Haskell youll be not sure what’s going on with some code that won’t typecheck, and the way to deal is break it down piece be piece, add type annotations, until you see where your mental model is failing.

This only gets harder with more type inference, as the actual issue may be far away from where the type error occurs.

This is why in haskell it is considered best practice to add type annotations to all top level definitions, at the very least.

JoelMcCracken··on IDEs we had 30 years ago and lost (2023)
Yeah that’s fair. In many ways the spacemacs/doom model is more akin to what you describe, with a lot of caveats; it’s not a total rework of all key bindings. In emacs novice affordances are usually an afterthought, not part of the core design and community norms.

Of course, I must say there is a trade off here: you can design for novices or for advanced users, but very often not both.

JoelMcCracken··on IDEs we had 30 years ago and lost (2023)
For most fundamental operations there are menus available. Most heavy emacs users opt to turn them off however.

You can even see the menu atop the screen shot in the article, with the familiar names etc.

JoelMcCracken··on IDEs we had 30 years ago and lost (2023)
To navigate emacs, you really only need to know ctrl, alt, and the basic norms of keyboard usage (return for newline/accept, shift for capitals)

Really, compared to what I see here, the chief difficulty with emacs is the sheer volume of possible commands, and the heterogeneity of their names and patterns, which I believe is all a result of its development history. But the basics are just as you describe.

JoelMcCracken··on MPTCP for Linux
Interesting, thanks! I had no idea. It makes sense that it might be used in specific instances even if it’s not widely used on the internet generally.
JoelMcCracken··on Lead Limited Brain and Language Development in Neanderthals and Other Hominids?
Sorry for the grumpy comment y’all/OP. I’ve had a migraine for days during my vacation week and it’s getting to me.
JoelMcCracken··on Lead Limited Brain and Language Development in Neanderthals and Other Hominids?
Do most people just not know how to write an interrogative sentence anymore? It is wild to me how often these fragments of questions appear on the front page.

I use this form sometimes myself in a dialogue, as it fits that context. But as an isolated story title, I invariably end up reading the whole sentence several times, trying to parse it.

JoelMcCracken··on What is going on with all this radioactive shrimp?
So, as an aside, I think consumer reports could do so much to embrace the digital era and access new generations of consumers.

My parents read it regularly, and I subscribed for a year or two about a decade ago and felt so strongly how it hadn’t seemed to change since I was a kid in 1990s. And as I’m deep in tech, I feel the lack of content and communication.

JoelMcCracken··on MPTCP for Linux
Funny enough, the first and last time I heard of sctp was in “Unix network programming”. It seemed so promising according to Stevens.
JoelMcCracken··on Global Village Construction Set
Seems like a neat thought experiment taken to (some stage of) implementation. Like OLPC. Solving problems we think people might have, while missing the more important issues (whatever they may be; I certainly don’t know myself). Idea is nice but feels “too cute”.

I like that it focuses on repairability. Seems like these might be fun to experiment with. Or as a kit for a “homestead” in remote Alaskan wilderness, where you’d like to be able to repair yourself without having to deal with long travel time and expensive shipping.

JoelMcCracken··on Effect Systems vs. Print Debugging: A Pragmatic Solution
And, just like tfa alludes, it is awkward because of laziness; in non trivial scenarios it can be quite surprising how your trace isn’t tracing.

This is bc of non strict eval in Haskell, but still the core is that the lang is designed to not eval stuff when it’s not necessary.

JoelMcCracken··on E-paper display reaches the realm of LCD screens
So why do eink monitors with ac power supplies still have lower refresh rates?
JoelMcCracken··on Comptime.ts: compile-time expressions for TypeScript
Every once in a while I get a strong urge to hack on sweet.js to add typescript support
JoelMcCracken··on A Rust Shaped Hole
I asked a bad question; what I meant was specifically thinking about ownership in terms of being required everywhere and to manage memory. But there are for sure real benefits I can see for _other_ properties in certain situations, like avoiding data races that might occur in Haskell. GHC added a linear type extension, for that matter (though AFAIK its still not very great to use). But some of that seems distinct from the question "do I benefit in some data modeling way from thinking about the ownership of memory in my program" as opposed to creating/sharing references whenever convenient.
JoelMcCracken··on A Rust shaped hole
The author really doesn't want to do manual memory management. The table is there to summarize things discussed, but he never says he wants to do manual memory management. I just went back and checked. If you do find something that indicates that, I'd appreciate you pointing it out to me, because idgi
JoelMcCracken··on A Rust shaped hole
Thanks for explaining what you think the author meant; i meant to reiterate that I was trying to actually understand as opposed to argue, but I forgot; I think sometimes "hey I don't get what you're saying because of reasons XYZ..." comes across as "I think you're wrong".

Composing monads is another one of those painful parts of haskell. I remember being so frustrated while learning Haskell that there was all of this "stuff" to learn to "use monads" but it seemd to not have anything to _do_ with `Monad`, and people told me what I needed to know was `Monad`. Someday I wanna write all that advice I wish I had received when learning Haskell. A _lot_ of it will be about dealing with general monad "stuff".

The thing that frustrated me in Rust coming from something like Ruby was how frequently I could not _do_ a very straightforward thing, because, for example, some function is a fnOnce instead of fnMulti, or the other way around, or whatever. Here's some of the experience from that time https://joelmccracken.github.io/entries/a-simple-web-app-in-.... It became clear to me eventually that some very minor changes in requirements could necessitate massive changes in how the whole data model is structured. Maybe eventually I'd get good enough at rust that this wouldn't be a huge issue, but I had no way of seeing how to get to that point from where I was.

In contrast, I can generally predict when some requirement is going to necessitate a big change in haskell: does it require a new side effect? if so, it may need a big change. If not, then it probably doesn't. But, I've found it surprisingly easy to make big changes from the nice type system.

I really don't get when rust folks claim "memory safety" like this; we've had garbage collection since 1959. Rust gives you memory safety with tight control over resource usage; memory safety is an advantage that Rust has over C or C++, but not over basically every other language people still talk about.

If you just clone/copy every data structure left and right, then you're at a _worse_ spot than with garbage collection/reference counting when it comes to memory usage. I _guess_ you are getting the ability to avoid GC pauses, but, why not use a reference counted language if that's the problem? copy/clone data all of the time can't be faster than the overhead from a reference counting, can it??

In haskell, I did find that once I understood the various pieces I needed to work with, actually solving problems (e.g. composing monads) is much easier. I don't generally have a hard time actually programming Haskell. All that effort is front-loaded though, and it can be hard to know exactly what you need to learn in order to understand some new unfamiliar thing.

Your preferring Rust over Haskell is totally fine BTW, I'm just trying to draw a distinction between something that's hard to _use_ vs something that's hard to _learn_. Many common languages are much harder to use IME; I feel like I have to think so hard all of the time about every line of code to make sure I'm not missing something, some important side effect that I don't know about that is happening at some function call. With Haskell, I can generally skim the code and find what's important quite quickly because of the type system.

I do plan to learn Rust at some point still whenever the planets align and I need to know something like it. Until then, there are so many other things that interest me, and not enough hours in the day. I still wonder if I have really missed out on some benefit from learning to think more about data ownership in programs.

JoelMcCracken··on A Rust shaped hole
Wow, a lot of stuff in here surprises me. C definitely can/does have spooky at a distance. Just share a pointer to a resource with something else and enjoy the spooky modifications. Changes are local as long as you program that way, but sometimes it can be a bit not-obvious that this is happening.

regarding redefining functions, what could the author mean? using global function pointers that get redefined? otherwise redefining a function wouldn't effect other modules that are compiled into separate object files. confusing.

C is simple in that it does not have a lot of features to learn, but because of e.g. undefined behavior, I find its very hard to call it a simple language. When a simple bug can cause your entire function to be UB'd out of existence, C doesn't feel very simple.

In haskell, side effects actually _happen_ when the pile of function applications evaluate to IO data type values, but, you can think about it very locally; that's what makes it so great. You could get those nice properties with a simpler model (i.e. don't make the langague lazy, but still have explicit effects), but, yeah.

The main thing that makes Haskell not simple IMO is that it just has such a vast set of things to learn. Normal language feature stuff (types, typeclasses/etc, functions, libraries), but then you also have a ton of other special haskell suff: more advanced type system tomfoolery, various language extensions, some of which are deprecated now, or perhaps just there are better things to use nowadays (like type families vs functional dependencies), hierarchies of unfamiliar math terms that are essentially required to actually do anything, etc, and then laziness/call-by-name/non-strict eval, which is its own set of problems (space leaks!). And yes, unfamiliar syntax is another stumbling block.

IME, Rust is actually more difficult than Haskell in a lot of ways. I imagine that once you learn all of the things you need to learn it is different. The way I've heard to make it "easier" is to just clone/copy data any time you have a need for it, but, what's the point of using Rust, then?

I wonder if the author considered OCaml or its kin, I haven't kept track of whats all available, but I've heard that better tooling is available and better/more familiar syntax. OCaml is a good language and a good gateway into many other areas.

There are some other langs that might fit, like I see nim as an example, or zig, or swift. I'd still like to do more with swift, the language is interesting.

JoelMcCracken··on Binding Application in Idris
ah nice explanation. I've actually read (or tried to) the "macros as a set of scopes" paper that IIUC lean 4's scoping is based upon; I did watch the talk on lean4's macro system. Does it not have some kind of "set of scopes" tracking?
JoelMcCracken··on An interview question that will protect you from North Korean fake workers
It would seem like a German who spoke perfect American English bc they had grown up here would be able to answer these basic facts
← PreviousPage 2 of 24Next →