Hacker News new | ask | show | jobs
by coldtea 3355 days ago
>Must every thread about VSCode and Atom start the same way

If many people believe this is the case, why not? All articles get some common types of responses based on the topic, this is just one topic/response combo that you happen to disagree with.

>It's a trade off: performance for a cross platform JavaScript app development.

It's an unnecessary tradeoff.

If a single developer can create ST from scratch for Windows, OS X and Linux, then surely GitHub or Microsoft (for VSCode) can create a cross platform native set of UI components in C or C++, wrap them, and have the rest of the development (plugins etc) happen in JS (to keep the familiar language, easy access to npm modules, etc).

7 comments

> If a single developer can create ST from scratch for Windows, OS X and Linux,

One of the reasons why some people are switching from ST to Atom/VSCode is the former's tortured development schedule, which has seen months or years go by without an update. Contrast VSC, which reliably delivers a heap of improvements every month. JavaScript is probably responsible for a big portion of this. Again, it's a tradeoff.

> then surely GitHub or Microsoft (for VSCode) can create a cross platform native set of UI components in C or C++,

Maybe they can. Or maybe they can't, and if they tried then they'd have the same slow pace as ST. You don't know.

VS Code's release record is impressive. And didn't it grow out of the Monaco browser-based editor? Microsoft probably wouldn't have funded the hypothetical C++ version.

That said, one of the Atom developers says using web technologies made development harder in many ways.[1] Very few solo developers can match a team with Microsoft's resources, and a monthly release schedule is more about discipline than anything else.

[1] https://news.ycombinator.com/item?id=14142124

>Contrast VSC, which reliably delivers a heap of improvements every month. JavaScript is probably responsible for a big portion of this.

I am pretty sure the project being open source and in the hand of a team in a big company instead of an independent developer has more to do with it.

> If many people believe this is the case, why not? All articles get some common types of responses based on the topic, this is just one topic/response combo that you happen to disagree with.

Because such comments tend to be repeats, making them not interesting. They also tend to derail interesting discussion. When there's an article on an interesting detail about X, but the top comment litigates why X should even exist, the interesting part of the article never gets discussed. And when that happens on all threads that involve any aspect of X, it's boring.

If this was truly that simple, don't you think someone would have already done it? Furthermore, is there even an actively maintained, open source, cross platform, development-focused text editor with native UI components?
>If this was truly that simple, don't you think someone would have already done it?

Someone already has done it. An one-man-shop built Sublime Text by himself.

Surely it's not having JS as an extension language as opposed to Python (the only difference between ST and what I propose) that's making it difficult.

>Furthermore, is there even an actively maintained, open source, cross platform, development-focused text editor with native UI components?

There's a "cross platform, development-focused text editor with native UI component" that's working great.

Whether there's an open source editor like that is orthogonal, since what I'm discussing is whether is technically feasible to create such a browser -- and the existence of ST proves that it is (and that's by a single developer: with resources such as that GitHub or even better MS, have, it would be much easier).

The choice of license is just a decision after that.

I think the developer behind Sublime Text is widely recognised as an outlier.

>> "Sublime Text 2 is mostly coded in C++ and uses a custom UI toolkit." ... [0]

How many other devs/teams are going to reasonably take that on.

(And how do you think the debugging story of his custom framework compares to Chrome Devtools).

[0] http://stackoverflow.com/a/9201645

> How many other devs/teams are going to reasonably take that on?

This strikes me as a sort of devolving-human standpoint that might lead to someone in 2050 asking how anybody could possibly walk 10 miles unassisted.

In the past, small teams of talented developers have written an entire game + game engine + associated tools from scratch, countless times.

Doing in-depth custom UI development for the desktop as part of creating a text editor does not bin as 'Mountain-moving; Don't even try' difficulty.

I don't think anyone is arguing that it's technically impossible to create anything. I was just pointing out that the tradeoffs that Atom accepted aren't simply trivial to solve. Jon has put an amazing amount of work into Sublime Text to get it where it is today; it's not some simple thing to build a great, native text editor. However, it's not like Sublime Text isn't without its own tradeoffs.
How long did it take to build Sublime Text vs. Electron + Atom? Are the original developers in Atom experienced in C++? How easy is it for 3rd party developers to contribute extensions to each? How do the extension catalogs compare, in size?
Qt Creator? Although at this point its UI is a mixture of wrapped native widgets and non-native QML widgets.
I wouldn't really call Qt Creator a text editor though.
IntelliJ does a good job of it without resorting to Electron.
No, it just resorts to the freaking JVM, which is not any more lightweight or native than Electron apps.
I don't think that's true. The JVM is far closer to native code than Javascript, both technically and in terms of actual performance. Here's some synthetic number crunching benchmarks: https://benchmarksgame.alioth.debian.org/u64q/javascript.htm...

Even on the I/O heavy workloads that Node/V8 should be able to handle best, Java is ahead: https://www.techempower.com/benchmarks/

And yes, there are many Java apps that like to eat memory but I don't believe it's as bad or worse than V8/Electron and I don't believe Java is as inherently memory hungry as V8/Electron.

The JVM is a virtual machine, just like V8, and neither is particularly "native." Java is an easier-to-optimize language than JavaScript, mainly because static types give better information to the compiler and prevent certain kinds of hard-to-optimize behavior from being written in the first place.

That being said, as someone who's used both Atom and IntelliJ a fair amount (although my daily driver is Vim), you can definitely see the downsides of using the JVM vs V8 in terms of startup cost. People complain about Atom being slow to start, but IntelliJ is so, so much worse — elsewhere in this thread dstaley mentioned it being almost 4x worse on a test file, and in large projects I've seen IntelliJ take literally minutes to begin being usable. The JVM is optimized for long-running server processes that can afford time to boot and warm up; the V8 team spends inordinate amounts of time ensuring that JS can begin executing quickly, even sometimes at the cost of peak performance. And RAM usage in IntelliJ isn't pretty either.

I don't think using the JVM instead of Electron buys much (if anything) in terms of editor performance compared to writing in native languages, like Rust or C++, and using native GUI toolkits instead of Swing/JavaFX or the DOM.

I don't think IntelliJ vs. Atom is a good comparison for Electron vs. JVM. IntelliJ is doing a lot of things Atom doesn't do, like loading/building an index of all of your code and dependencies in order to auto-complete and show docs on demand.
IntelliJ doesn't use native UI components though. Furthermore, Atom can open a single file in 3s, whereas opening the same file in IntelliJ takes 11s (these numbers are from cold starts). This is with clean installs of both IDEs on a 2016 MacBook Pro.
Using web technology was less about making development easier on us, because in many ways it made it harder. Web technology is about enabling extension authors to use a powerful and familiar technology to achieve their goals.
Could you give some examples of extensions that benefit from Atom being built on Electron instead of just embedding a JavaScript or Python interpreter?
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.
They could, but they chose not to. Maybe they know something about their organization that you don't. Either way, nothing is stopping anyone from writing a cross platform editor that you describe! If it's really so easy you should team up with all the people who show up to complain about electron in these threads. Until you or someone else makes an editor as good as Atom or VSCode I'll keep going to them as my first choice of text editor.
Aren't all tradeoffs unnecessary? I mean, it's part of the definition, right?
No they aren't, since when we talk about tradeoffs we are already assuming a specific desired outcome. The tradeoffs are necessary in order for us to achieve it.

But in order to achieve an outcome such as: "an editor that's cross platform and is programmable in JS", using Electron and/or the DOM is not a necessary tradeoff at all.

I feel silly asking but what is ST?

Edit: Sublime Text?

Yes.