2,516 karma · joined Jun 10, 2010 (16y ago) · 853 submissions
comment 1d ago · link · parent
The reasoning behind the rewrite and the change of configuration language is that the project is over 12 years old at this point, and was somewhere around 100k lines of Objective C and Lua that nobody really had any motivation to work on anymore, myself included.
Maintaining a bunch of ObjC that bridges native objects bidirectionally with Lua, is not a ton of fun.
Switching to Swift for the native parts means that I actually want to work on it, and using Apple's JavaScriptCore framework means we get the object bridging essentially for free.
I started work on this rewrite a little over a year ago and wrote the core of the app by hand, because I wanted to explore and understand how to build on top of JSC. I then wrote the first few modules myself so I could flesh out how the bridging lifecycles work, and ensure I had an architecture that could grow and scale.
Once I'd figured all of that out, I created agent skills that codified how modules should be written and how bridged types should behave. From there I've been using Claude to help create/port all the other modules.
I do not buy into the ideas like "no need to read the code" - I'm on the hook to support this for myself and others for the next 12 years, so I've read every bit of code Claude has written, and very often disagreed with it and redirected it.
It's been a ton of fun though, and I'm convinced that, as a spare time project, this would have taken me easily another year to do fully by hand.
Happy to answer any questions people might have!
2.
Show HN: Hammerspoon 2 Beta 1 is released(hammerspoon.org ↗)
5 points · by cmsj · 1d ago · 2 comments
comment 5mo ago · link · parent
comment 8mo ago · link · parent
That means the core of Hammerspoon goes from being incredibly complicated, to really just a protocol conformance.
comment 8mo ago · link · parent
I have a feeling that letting people do what Hammerspoon can do, but in a TypeScript environment that they're much more likely to know, than Lua, will be huge for the project.
comment 8mo ago · link · parent
Beyond my enjoyment/productivity on the developer side though, I think v2 will be a big boost to user enjoyment/productivity, mostly because they'll be able to get much nicer IDE integrations for their config file, and be able to do things like write their config in TypeScript.
comment 8mo ago · link · parent
Honestly, in 2026, I do not want to be maintaining a 100k line Objective C program.
So, my current experimentation with a v2 is to see how easily I can catch up with where v1 is, just using Swift and JavaScriptCore.
There are lots of things about the Lua APIs that I don't like, and I'm addressing some of those as I go, but I'm currently in a phase where I'm targeting parity with everything I need for my v1 config, at which point I can cut over to running v2 and then see how things are looking and what can be refined/reworked.
comment 8mo ago · link · parent
Where JS massively wins here, to my mind, is that there is so much tooling available for it, to the point that I'm already not actually writing my v2 config in JS at all, I'm writing it in TypeScript and compiling it to JS.
comment 8mo ago · link · parent
The more complex answer is that Hammerspoon is currently about 100k lines of Objective C, and none of us really want to work on it anymore when Swift is the much nicer place to be doing macOS development.
Technically we could slowly convert in-place from ObjC to Swift, but there will always be a need for "LuaSkin", the bridging code we've accumulated over the last 13+ years, and rewriting that in Swift would be significantly complicated.
JavaScript, however, is already bridged for us because WebKit needs it.
comment 11mo ago · link · parent