Hacker News new | ask | show | jobs
by pseudalopex 3355 days ago
Could you give some examples of extensions that benefit from Atom being built on Electron instead of just embedding a JavaScript or Python interpreter?
2 comments

Most of them!

The minimap extension is made easy because they can just throw some HTML in a side pane, the image preview plugin just leverages the image displaying abilities of the browser, custom styling is as easy as throwing some CSS in a file, the extensions which let you preview the web page you are working on right in the browser use the full extent of the browser, the plugin that lets you easily preview markdown just uses a simple markdown->html converter then just displays the HTML/css. Themes are just a set of CSS which targets certain classes. Plugins can move, change, hide, show, do anything.

It also let's plugin authors do things the original developers never imagined possible. 3D object preview using webgl in a custom pane, replacing the whole implementation of tabs with something else, completely redesigning how the sidebar works and looks because it's all just HTML.

And while none of that can ONLY be done in a browser, the fact that a browser is the UI means that it's much easier, much quicker, and much more maintainable.

An embedded scripting language is only part of the story. Think about all of the APIs the browser exposes. For starters there's the DOM... there's no UI toolkit more that's more universally understood. Then there's CSS. Look how many Atom themes there are out there because people can tweak styling with a system they already understand. Then there's the long list of other standardized APIs. WebRTC, fetch, WebGL. Chromium is a very full-featured cross-platform environment that offers us more than embedding a scripting language would. I'm not denying it doesn't come with some negative trade-offs, but I do think those will diminish as Chrome improves and we improve our usage of Chrome... we're also dropping critical components to C++, which Electron makes it easy to do, so over time Atom will evolve into an increasingly "native" application with a cross-platform standards-based interface layer. The overhead of that layer will always be there though.