Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> a v2 atm, which switches from Lua to JavaScript :D

Presumably that'll be released in [checks calendar] 18 days?




Well, I guess the motivation (use a more easily integrated extension language) makes sense but ugh, Javascript is a dirty sack of sewage.

I'd take a minor quibble with one of the Reddit commentators:

> "Lua is a language that was built for people that are not programmers, and Hammerspoon (or at least building it's extensions) is targeted specifically at programmers."

Hammerspoon[0] isn't targeted at programmers because it's abstracting hard things (interfacing with macOS system libraries, etc.) into easier ones (the Lua spoons) where accessibility to non-programmers is surely a goal.

[0] I'm excluding extensions because the included spoons cover many scenarios people would be interesting in using and, to be honest, building "extensions" to something as tricky as Hammerspoon would be beyond many programmers[1], never mind non-programmers.

[1] I'm reasonably experienced and pretty fast at the "huh? <-> search <-> experiment <-> kludge <-> test <-> passable code" cycle even with completely new technologies and I definitely wouldn't be keen on attempting a Hammerspoon extension.


I'll happily agree that JavaScript is not a very nice language, but to be honest, I don't think Lua is a very nice language either. It's easy to embed in C though, which is why we were able to do all of the things that Hammerspoon does.

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.


Firstly, thanks for all the Hammerspoon work - it is a marvellous thing (and I'd love Apple to support something like it as an extension to OSA.)

> Where JS massively wins here, to my mind, is that there is so much tooling available for it

Yeah, I can see that being a big win for development and people already invested in the JS ecosystem.

(I'll stick with Hammerspoon v1 until it breaks and then figure something else out because it'll be a cold day in hell before I subject myself to JS/Node/Typescript again. The trauma runs deep and wide.)

> I'm already not actually writing my v2 config in JS at all, I'm writing it in TypeScript

Will give v2 a go with `lua2js`[0] transliteration and see if that's workable.

[0] https://github.com/xiangnanscu/lua2js




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: