Hacker News new | past | comments | ask | show | jobs | submit login

Why did you chose to do Objective-J -> JS processing in the browers? For sake of speed, wouldn't it be a good idea to do it server-side and then just serve the JS?



Actually, we use both methods. You can preprocess the code ahead of time if you want, and serve content that way. We do this for our core frameworks (AppKit and Foundation). Most of our application code is not preprocessed though. One of the benefits of being able to run without having to "compile" (which is essentially what having to preprocess ahead of time is) is that you have a much more dynamic development environment. You can change code, hit refresh, and see your changes immediately reflected, instead of compiling and waiting.


The main advantage of doing it in the browser is for the developer: you don't need the explicit compile step: just write code, save it, refresh the browser. It also enables neat things like a REPL.

That said, the nice thing about writing the preprocessor in JavaScript was we can do preprocessing ahead of time on the server, if we need to. However, doing it client-side is not as slow as you would expect.

edit: Ross beat me to it, but we said basically the same thing


It also seems that you can easily have a "testing mode" where you run the preprocessing client side when you are just building the app, and then when you deploy like "for real", run the preprocessing server side to keep things fast(er).

If the site gets too hammered, then you could even have it switch, where an overloaded server tells clients to preprocess for themselves while the server catches up. This would be an interesting way to handle spikes in usage (like now for example)


Presumably the code doesn't change very often, so we actually just preprocess it once per revision and serve up the static files, so there's no extra load on the server or the client.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: