Oni: An IDE powered by Neovim
github.com
github.com
In contrast to most other non-constructive comments about how Electron sucks, I think the focis should either be how to improve Electron (as mentioned by others) or on how to improve the cross-platform story for more native technologies.
What makes Electron so attractive is that it is so very close to write once, run everywhere. No other technology today comes close, which I think is evident based on the number of Electron apps out there. There are some native languages which have great cross-platform stories (e.g. Go), but few of them seem have a great fronted story. Today the problem is that all major OS platforms are pushing their own framework and language walled gardens, but I think most developers would like their apps to be cross platform if they could. This is an example of where the community has to do it themselves because the major OS developers seem to have no interest in cross-platform tools.
What would it take to achieve something like Electron but native? Why hasn't it been done yet?
It's like shitty iOS cordova packaged web apps - they also require "minimum effort" and "cross-platform functionality". At the tiny expense of horrible user experience.
> What would it take to achieve something like Electron but native? Why hasn't it been done yet?
Are you really that ignorant? Never heard of Qt, SWT, GTK and myriad of other cross-platform tools and widgets used to develop cross-platform apps since the 80s?
https://appdb.winehq.org/objectManager.php?sClass=version&iI...
Yes, feels strange to think that you need to run a qt app against wine because the publisher does not support gnu/linux.
But it is available on linux via `apt install wine` and downloading the exe.
- KDE
- AMD's Radeon control panel
- VLC
- VirtualBox
Qt apps feel far more native than Electron apps in my opinion.
AMD's Radeon: admittedly, I have not used this.
VLC: hardly any UI. Mostly menu items.
VirtualBox: hardly any UI. Mostly menu items.
Edit: formatting.
The Radeon interface does not fit in at all with Windows (nor macOS or any Linux DE I've ever seen, for that matter) and is almost always glitchy for me.
VS Code presents a good experience and it's resource usage is more reasonable, it's a good example of a successful Electron application. On the other hand, it has Microsoft behind it and there's probably good reasons why it's so much more performant than Atom, for instance. I am not convinced it's reasonable to expect all Electron applications to hit this relatively high bar in terms of quality.
In my opinion, Electron applications "stick out" as much as any other non-native application, this isn't an advantage to Electron. Indeed, I think Electron has proven that people aren't all that interested in a native application, as long as it's reasonably attractive and the interaction is fun. This could open the door for a new class of cross platform UI toolkit, one that drops the faux-native UI in favor of something simple, attractive and straightforward.
I already know of the toolkits you mentioned, no need to call me ignorant. I have to admit I've never seen a single Qt, SWT, GTK app that looked and felt native. There probably are some but I would argue the effort is much higher than Electron.
"Favors developer user experience over end-user experience"
So, something that favors end-user experience over developer experience will produce spanking fantastic apps?
"It's like shitty IOS cordova.."
Like shitty android/ios apps without the cross-platform functionality?
"Are you really ignorant?"
Holy crap! Most of us here know the stuff from the 80's! We also know the awesome stuff we can do with modern tech.
Your comment sucks of classic cargo cow bullshit. Loosen up.
I disagree that the comments pointing out the high CPU and memory usage are non-constructive. These are real issues that literally limit the number of Electron apps that can run at a time on a particular machine. Some Electron apps perform reasonably well, VS Code is a good example. But many perform abysmally and Electron is treading dangerous ground by going against the trend of limiting resource usage in order to extend battery life. Indeed, in my experience running a handful of Electron apps is a sure way to shorten battery life.
I think that "Something like Electron but native" is a confusing idea. The browser engine that Electron uses is native to the OS it's running on... As others have pointed out, the best we could hope for is some sharing of the runtime that would allow more applications to run simultaneously.
You mention native languages that have a good cross platform story and I'd like to see some work toward a UI toolkit that is less demanding of resources. While people like Javascript, I do believe some of them will move to another language if they can do what they need to do: deploy to all OS environments with only minimal code changes. If Electron has taught us anything, it's that customer's don't really care that much about an application appearing to be "native".
> I think that "Something like Electron but native" is a confusing idea. The browser engine that Electron uses is native to the OS it's running on...
Here I meant native as in a natively compiled language. The browser is also invisible in this case, and the whole Electron model adds so many layers (which is part of the resource usage problem).
> If Electron has taught us anything, it's that customer's don't really care that much about an application appearing to be "native".
In this case I meant native as in blending in with the desktop environment, which I think Electron apps are more successful at than other toolkits (which are often natively compiled).
I think Electron is a very cost efficient dev environment. Can't really think of writing all this up in plain C++, wiring up native calls for various OSes, leveraging GPU, support rapid plugin dev/prototyping etc., etc. Once upon a time there was Qt, but now it's also doing qml+js..
Even if a NeoVim version of Eclipse (or whatever you think a 'more native IDE' is) is rolled up, by a small team comparable to oni's, are you going to _pay_ for it?
Oni: 17 contributors, one main dev. IntelliJ: 249 contributors, Github fails to load stats in one minute.
So why not stop complaining about the IDE and put efforts into optimizing electron-like platforms? There's still a fat headroom for improvements! (WebAssembly etc.)
Edit spelling
The other side of that is software that already exists, running in the background unnoticed. Things like your graphics driver. You wouldn't want that written in Java. If it were written in Java you might get a lot of features faster, but it sure would perform like crap. For core software like that, development costs are secondary. Performance matters first.
At the end of the day I think we need projects like neovim and oni. Editors are old technology and should be core software. Performance in my editor matters. I have five different IDEs installed and I still use vim.
The hell are you talking about, Electron still doesn't come near the marketshare when you look at acual apps using other cross-platform GUI toolkits.
Another bit seems to be some work in progress from the Xamarin guys at MS.
In the end, an XML based UI combined with a JS runtime engine seems to be a very powerful combination... getting similar points of integration with other languages could be equally nice.
Something resembling Material Design, or Bootstrap as a cross platform UI toolkit with an XML interface would be a great place to start. Electron really seems to be as close as it gets for the most part, with the least cross platform effort.
QML+JS is still primarily C++ in that the QML gets compiled into a scene graph that is then processed in C++ and OpenGL and your JS would typically only be setup and glue code. QML makes it super easy to write single objects in C++ and have them seamlessly communicate with QML/JS, so writing simple logic in JS and performance-sensitive code in C++ is easy to do. QML performs extremely well, while my brief experience with electron was less favourable.
> I found myself forced to implement it in Javascript, because the interop is both slow and cumbersome
I'm a bit confused by this because its different from my personal experience, where implementing custom QObjects was both developer-friendly (easy and quick to accomplish) and performant. I guess your experience was different. Would love to hear a bit more about your use case and why it didn't work for you.
> plugged into the great Qt4 legacy
Beyond the basic classes like QObject/QVariant/QVector and some of the addon libraries like QtConcurrent, when I used QtQuick/QML, I didn't have to use any of the Qt4 legacy stuff and had a pretty slick experience of developing UI in QML, glue in JS and any heavy lifting or platform interpo in C++ as custom QObjectf. Since C++11, its also been even slicker because they made most of the Qt Library classes interoperate with C++11 better (especially allowing you to connect lambda's directly to signals).
I wonder why you had such a different experience than I did? Although, to be fair, I haven't done any serious Qt work in ~2 years or perhaps a little more, so maybe my experience isn't representative (I used it to do the UI for a data analysis tool, it was performance sensitive but not THAAAAT much, so maybe if it had been more so it would have been problematic?)
Would love to hear more about what problems you faced!
Because it's faster to develop? You're basically trading developer time with user time and battery life.
> Can't really think of writing all this up in plain C++
IntelliJ is written in Java.
> Can't really think of writing all this up in plain C++, wiring up native calls...
Yes, it's more work and features will come slower, but the end result is a better application. Latency matters. It's extremely irritating that when I hold the delete key in an electron based application like visual studio code, that half my file continues to be deleted after I let go of the key. The application can't keep up with the key repeat speed, and it's running on a high end workstation! It's pathetically slow, even for all of the improvements that have been made over others like atom and brackets.
I'm excited by Oni, and it saddens me that the top comment is a negative comment complaining we should all just support electron.
What I mean is that we should put aside the cons brought by a piece of building block and appreciate the vision, and the ideas behind these "new old things" -- neovim, oni, etc., to which we have been on the same page. However, discussion about whether it's appropriate to use Electron in this thread, without technical explanation or a proposal for workarounds, are distractions in my opinion.
And I think the fat headroom for improvements is important to call out - when people talk about "Electron Bloat", they usually refer to one of 5 things:
1) Footprint (space on disk) 2) Memory usage 3) CPU usage (corresponding to battery life) 4) Responsiveness (esp typing latency) 5) Startup time
As you mentioned, across the board, there's a bunch of room for improvements - especially with tech like WebAssembly on the horizon! #1 and #2 are the hardest, because Electron will always have a fixed overhead - but when comparing to an IDE like Visual Studio, it's not over the top.
For my workflow, #4, #5, and #3 are most important, and Oni still has plenty of low-hanging fruit to tackle for each of those. If I find there is a blocker to getting to acceptable typing latency and startup time, I'd consider making a switch (potentially to a react-native-on -desktop solution), but I'm optimistic that with WebAssembly, React 16, Chrome 61, along with optimizations on the Oni side, there's still plenty of opportunity to improve performance.
Sadly, this is still an Electron app in the background. For comparison, my nvim install only needs 9.7MB to open a Ruby file with all my plugins loaded, while Oni requires 165MB just to open a blank file with no custom plugins.
Same thoughts here. Nevertheless, it's nice that it uses NeoVim as its editor.
I started to use Atom on a daily basis since 1.7 and 1.19 is pretty usable. Got tired of waiting for an open source editor comparable in features and functionaity to Sublime Text, but written in a lower level language such as C++, Dlang, Rust or Go compiled to native machine code. It also looks the same on every OS and has nice and original features such as automatic whitespace trimming that I haven't seen in Sublime, or a CSV editing addon for that matter.
Too bad each app comes with the burden of it's very own instance of Electron.
Electron, yes Electron
* It's being written by Raph Levien, known for his work on Inconsolata, Ghostscript, and font-rs[1] among other things.
* The design goals include incredibly high performance, beauty, reliability and developer friendliness[2].
* It's very fast at handling large files, though the editor is still missing a lot of functionality.
Raph was also interviewed on the New Rustacean podcast[3] and talks a fair bit about Xi. [1]: https://github.com/google/font-rs
[2]: https://github.com/google/xi-editor#a-modern-editor-with-a-backend-written-in-rust
[3]: http://www.newrustacean.com/show_notes/interview/_2/part_1/index.htmlThe point about using electron is that you can use the browser to render the UI, and is filled with a lot of baggage. Imagine a UI rendered just for build UIs, not tied to JS or DOM or CSS, but able to work react-like.
How much lightweight? Similar to Lua?
For the UI something like TCL or Lua or just some DSL is better.
Blazing fast and responsive even with 20MB+ files (in my experience), is extensible, and is cross platform.
Admittedly, not a IDE, and in C instead of C++. Extensions in Lua.
Not sure why it doesn't get more love.
Though electron slightly puts off, but not only that, I expected that by default it will pick up my ~/.vimrc or ~/.nvimrc files, though it didn't. I have not read in detail, but I can see that configuration is different.
Now this. I'm speechless.
I'm working on a side-project at the moment, a large part of which is a desktop application. Using electron allows me to get a cross-platform app out the door pretty quickly. If I had a team of more than one, perhaps I would consider using something else, but as long as it is just me electron just makes sense.
That said it still makes me sick. But what's the alternative? Lazarus? Gtk+? Yuck.
AIR was looking good, but now everyone is treating it like the plague.
Yeah, that's why you use JS and Electron, right?
What
High memory usage I'll give you, but calling it a slow language is very misguided.
In the case of JS, the biggest draw is probably platform portability and the amount of existing code to utilize. That and speed, as already mentioned.
Already the vim mode in this is pretty nice since its powered by an actual vim.
I wanted to do this a while back, but got stuck because nobody had yet written a messagepack implementation for Emacs Lisp. And it turned out writing one was too much like work for me to keep up with it.
https://gitlab.com/HiPhish/MsgPack.rkt
Though someone got started on elisp as well.
I'm not sure to what extent the same would be true of neovim embedded in emacs.
VSCode is maybe slower and less configurable, but it is years ahead in terms of language support at least for tsx.
It's definitely a goal of the project to be on-par with other IDEs in terms of language support, but unfortunately we aren't there yet.
That way you would have a declarative UI framework and be able to code in React without having to pay the penalties of having to use Electron.
But alas...