Live data from Hacker News

Hydra: A lightweight OS X window manager with a powerful API

github.com

131–140 of 157 posts

Re: Hydra: A lightweight OS X window manager with a powerful API

#131

This looks great, but my favourite thing might be the Principles section: > Hydra must be stable. It should never crash > Hydra must be lightweight... never use more than 10 MB of memory > API should be completely transparent > API must not be bloated I think these principles should be the standard to which we all hold our software. Looking forward to testing this out! Edit to say: it would be really great to see som…

I do not like the "API should be completely transparent" and "API must not be bloated".

I personally think APIs exist to hide complexity. They should make sense, they should be usable, but they need not be transparent.

Let's have a rather contrived example. In SDL, you can call SDL_Init(). That does a lot of things, and what it does differs on windows, linux, and OSX. I absolutely don't want the more transparent API of SDL_Init_Windows_Video(), SDL_Init_Windows_Audio(), SDL_Init_Linux_Video() .... And so on. Realistically, for absolute transparency, you'd just do away with the API and write every line of code SDL currently hides (Reductio ad absurdum I know)

The entire point of having that one SDL_Init() call that's identical on all platforms, even though it does many opaque things underneath (and different things per platforms) is that it's easier to understand and use. The goal of an API is to be usable and useful, nothing else. Transparency can often get in the way of usability.

As for the "bloated" bit. Well, I'd rather be able to do too many things than too few. It's a great goal to have a purely orthogonal (no method may be accomplished with another combination of methods) API, but it should not be done at the expense of usability.

    > Nothing should be put into it except what's impossible or impractical to do in pure Lua, and what's extremely common and likely to be used in everyone's configs.
The entire quote makes it seem even more damning to me. Why would you cater to what's "likely to be used in everyone's configs"? That's another way of saying "Let's support only the least common denominator" which to me seems like a bad philosophy.

This philosophy would lead to twitter not having a friendship API because the only thing practically every api user does is login and (arguably) tweet, only a few deal with friendships or account settings. It would lead to linux not having a configuration option for running more than one physical CPU or hotswapping ram because the wide majority of people will never use these options.

I'm happy that the author of this software decided to make it simple and it seems to be working here, but in the majority of cases of API design, I'd much rather the API be usable, not transparent, and large, not minimalistic. I'd rather be able to call a method that does some common activity for me which I could technically do myself in a 1000 lines of code than not have such a method because it's "bloat".

Re: Hydra: A lightweight OS X window manager with a powerful API

#132

Earlier quoted context omitted.

Mind linking to the particular layout workflow you're talking about? Or is it now built in? I currently use spectacle, but would prefer to use Alfred.

Looks like he might be talking about this: http://projects.jga.me/layouts/ Github repo: https://github.com/jgallen23/layouts I personally find that I don't need anything more than what Spectacle gives me (splitting windows is really it). That said, I love me some Alfred workflows. Alfred is the single best software purchase I've ever made.

I did find that one and tried it out, but it doesn't have multiple monitor support. I'll stick with spectacle for the moment.

My alfred workflow library is incredibly sparse at the moment, so if you have any other good resources you'd like to share, that'd be great.

Re: Hydra: A lightweight OS X window manager with a powerful API

#133
post #17

Looks awesome. But I have some issues I can't seem to resolve - I saved the sample config in the specified path (it should be correct since on reload the app says "Hydra sample config loaded"), but I can't open the repl (Hydra Error: "Attempt to call a nil value"). And using the Cmd+Ctrl+Alt+J doesn't make the window shorter, only moves it to the right (going out of the screen). I am sure this is just a beta release…

Yep, that was indeed an error. Tried fixing it, released beta5. Actually fixed it, released beta6. Nothing like being on the front page of HN to make me rush enough to mess that up one-line-fix on the first try. :)

[deleted]

Re: Hydra: A lightweight OS X window manager with a powerful API

#134
post #17

Looks awesome. But I have some issues I can't seem to resolve - I saved the sample config in the specified path (it should be correct since on reload the app says "Hydra sample config loaded"), but I can't open the repl (Hydra Error: "Attempt to call a nil value"). And using the Cmd+Ctrl+Alt+J doesn't make the window shorter, only moves it to the right (going out of the screen). I am sure this is just a beta release…

Yep, that was indeed an error. Tried fixing it, released beta5. Actually fixed it, released beta6. Nothing like being on the front page of HN to make me rush enough to mess that up one-line-fix on the first try. :)

Unfortunately, I still get the same errors.

Re: Hydra: A lightweight OS X window manager with a powerful API

#135
post #56

I've been using Slate[1] for a while which may be worth considering as an alternative. Hydra does look pretty slick, though! [0] https://github.com/jigish/slate

I'm another Slate user -- looks like Hydra is a spiritual successor... I'll give it a go.

Ah I had no clue Slate wasn't actively maintained anymore. I just caught up with the new JS API. Damnit. Well, guess I'll look at Hydra now...

Re: Hydra: A lightweight OS X window manager with a powerful API

#136

If you're looking for a window manager for OSX without having to actually configure anything, you can try using Spectacle: http://spectacleapp.com/ For instance on my imac 27'' I have Option+Command+Left|Right keys mapped to side (similar to windows 7. And I can also have 4 windows open at once using Shift+Option+Command+Up|Down|Left|Right to move them to the different corners. Works really well with less than 2 minu…

I've been looking for this a while ago; all I could find were relatively expensive apps that didn't really work. Thanks <3

Re: Hydra: A lightweight OS X window manager with a powerful API

#137
post #131

This looks great, but my favourite thing might be the Principles section: > Hydra must be stable. It should never crash > Hydra must be lightweight... never use more than 10 MB of memory > API should be completely transparent > API must not be bloated I think these principles should be the standard to which we all hold our software. Looking forward to testing this out! Edit to say: it would be really great to see som…

I do not like the "API should be completely transparent" and "API must not be bloated". I personally think APIs exist to hide complexity. They should make sense, they should be usable, but they need not be transparent. Let's have a rather contrived example. In SDL, you can call SDL_Init(). That does a lot of things, and what it does differs on windows, linux, and OSX. I absolutely don't want the more transparent API…

You can't really compare a platform speciffic "window manager" to a multiplatform 3D/2D rendering api.

Re: Hydra: A lightweight OS X window manager with a powerful API

#139
post #102

Earlier quoted context omitted.

Nope, but I would venture to guess that most software would be improved by sticking to that.

I don't even feel confident in that claim. If keeping memory usage under 10 MB requires a significant amount of developer effort, that is effort that isn't going into something else that I might value a lot more than, say, 20 MB of RAM.

Not just developer effort, but also sometimes program runtime efficiency. RAM is cheap, RAM is pretty fast (compared to disk or network); cache shit there when it makes sense to do so for overall efficiency.

10MB is a fairly ridiculous modern standard to limit yourself to, IMO (and I started on the C64 and generally do dislike and try to avoid bloat).

Re: Hydra: A lightweight OS X window manager with a powerful API

#140

This looks great, but my favourite thing might be the Principles section: > Hydra must be stable. It should never crash > Hydra must be lightweight... never use more than 10 MB of memory > API should be completely transparent > API must not be bloated I think these principles should be the standard to which we all hold our software. Looking forward to testing this out! Edit to say: it would be really great to see som…

I'm not sure I fully agree. For example

> Hydra must be stable. It should never crash

It's clearly better to have an app that never crashes than an equivalent one that crashes all the time.

However, making sure that your app is 100% crash-free isn't a zero cost thing. It takes time and effort to (often, a lot of both) to get to a completely crash-free app, meaning that the app either costs more, takes longer, or has to compromise on features - or possibly all three. In some case, that trade off is clearly going to be worth it - I'd rather a self-driving car took 10 years longer to develop than have one that rebooted itself twice a day, but in others I'm fine living with the occasional crash if it means cheaper or more feature-rich applications.

Post reply on HN