Lurker News

Comments (271) 25 threads

karteum15 replies#
This looks nice !

However... "Low CPU and memory footprint (...) memory usage is under 20 MB for a Hello World program" : I am the only one who still thinks this is huge ? (-> https://tonsky.me/blog/disenchantment )

mixedCase#
It's definitely not. It's just a different toolkit that the one you already have in memory, so it can't "cheat".
afavour10 replies#
That blog post does speak to me, but 20MB for a program with a truly functional, modern UI doesn't outrage me that much.

IMO there's a tradeoff: we could be writing all our programs in C, still. But it would be enormously difficult and there'd be way more bugs. On the other end of the spectrum we can be lazy, use web tech everywhere and never optimise our ballooning JS codebases. This feels like it's at least somewhere in the middle.
OT but a bone to pick with that article:
> Modern text editors have higher latency than 42-year-old Emacs. Text editors! What can be simpler? On each keystroke, all you have to do is update a tiny rectangular region and modern text editors can’t do that in 16ms. It’s a lot of time. A LOT.
That isn't what my text editor is doing, though. It's doing autocomplete suggestions, linting code as I type... all sorts of things we never had a couple of decades ago and are huge productivity boosters. Sometimes I feel like people forget that.

setr2 replies#
However, most of that should be done in the background — it shouldn’t affect your actual text input speed. Auto-format is more along the lines of something that could be blocking, but we’re not dealing with latex problems as to be significant
andylynch12 replies#
Even putting that aside, just showing text on a screen is much slower on modern PCs then older ones, since you have a far more complicated graphics stack and latency at several added steps.

I remember an article a couple of years ago where someone rigged up a camera to measure key press to screen update on different machines and the results were eye opening.
edit: found it http://danluu.com/input-lag/. The Apple ][ ties for first place with an iPad Pro.

Continue this thread — 12 replies

tshaddox1 reply#
I’m pretty sure that none of these latency benchmarks are showing that text input speed is affected. You can definitely input more than 1 character every 40ms in modern “slow” text editors.

Continue this thread — 1 reply

anthk#
>all sorts of things we never had a couple of decades ago

We had them.

throwanem2 replies#
Emacs does those things too, these days. It's still snappier than anything else I've tried recently.
unknown23741 reply#
cough vim cough

I'm just kidding. Don't want to start a fight here.

Continue this thread — 1 reply

GuB-42#
Interesting how what was seen as slow and bloated back then become the opposite today. Eight Megabytes And Constantly Swapping, yep, back then, 8MB was unthinkably large for a text editor...

Another example is the Enlightenment window manager. It was considered a little heavy, but good looking. But because there was a large hiatus in development, it got "stuck in the past" and now, it is one of the lightest there is.

unknown23742 replies#
As mentioned in the other comment, emacs does those things, and so does Vim (with plugins of course).

I moved from sublime to atom to VS code, but eventually settled on Vim because I was able to get the same features (that I used) while getting almost instant response. A feeling that has completely changed how much I enjoy writing any sort of text.

higerordermap#
Yeah. LSP has changed a lot for me.

For C/C++, could use QT Creater or KDevelop too, which I think are pretty good in latency.

zant11 replies#
I tried to move from VS Code to NeoVim with NerdTree and some other plugins to make it more IDE-like.

But eventually wasn't able to get the same code completion, and searching was also a bit more painful.
How do you go about that? Would you mind sharing your setup? :)

Continue this thread — 11 replies

Aeolun2 replies#
> It's doing autocomplete suggestions, linting code as I type

Even so, shouldn’t it be able to do that in 16ms?

dsr_#
Fermi guess: 60 wpm, that's one 5 character word per second, it probably doesn't make sense to give a new prediction more often than once per character -- that's 200ms to chew on autocomplete and linting and fancy animations. Meanwhile, please render the specific character out of your lookup table in 16ms, thank you.

Do modern graphics drivers for X or Wayland hand off font rendering to the GPU? They probably should -- it's maybe 100 or so small textures per font-selection, 150KB or less prerendered with 3-bit alpha, and maybe 100 loaded up into graphics RAM at a time -- 10MB is nothing, really.

chii#
they certainly could. Games can do 16ms frames, while calculating full physics simulations.

It's just that text editors of the modern day are programmed by people who prefer to not write it that way - mainly because it's quite hard, and the modern OS doesn't usually fit well into this framework of rendering for multi-tasking. And it takes more effort too.
Much easier to rely on a UI framework which adds overhead. The expectation is that the user probably won't care, and prefer that the software be more feature rich.

badsectoracula1 reply#
I might sound like those weird language evangelists, but...

> we could be writing all our programs in C, still.
You don't need to use C, there are other languages. For example a hello world in Free Pascal[0] (a natively compiled language with no runtime or other dependencies, which supports object oriented programming and has RTTI rich enough to implement automatic object serialization, semi-automatic memory management, strings that know about their encoding, etc) is just 32KB.
Some time ago i wrote Fowl[1], a mostly complete recreation of the OWL toolkit that came with Turbo Pascal for Windows, the demo program of which is around 80KB.
Of course for a more realistic (and MUCH easier to use and develop with) approach, you'd need something like Lazarus[2]. A minimal application in Lazarus is 2.18MB. This might sound too big... and TBH it is, but the size doesn't grow too quickly from there. For example a profiler i wrote recently for Free Pascal applications is... 2.16MB (yes, smaller, why? Well, because i replaced the stupidly huge default icon with a smaller one :-P and without the default icon a minimal application is 2.05MB so the profiler added around 100KB of additional "stuff").
> It's doing autocomplete suggestions, linting code as I type... all sorts of things we never had a couple of decades ago and are huge productivity boosters
FWIW we had those, Visual Basic (or even QBasic) would format your code as you type it, Visual Basic 6 and Visual C++ 6 would profile auto-completion (VB6 even for dynamic stuff), etc. Only issue with C++ was that sometimes it wouldn't work around complex macros.
But modern editors do a bit more, still no excuse for being that sluggish. Lazarus does pretty much everything you'd expect from an IDE with smart code completion (e.g. things like declaring variables automatically, filling method bodies, etc) and code suggestions yet it runs on an original Raspberry Pi.
Now i'm not saying that you should not be using whatever you are using or that you should code on a Rasberry Pi or even to switch to Free Pascal / Lazarus (which honestly is far from being free of issues), but i think that you're overestimating what tools do nowadays and many people are so used to running slow and bloated software that take it for granted that things should be like that and cannot even imagine things being better.
[0] https://www.freepascal.org/
[1] http://runtimeterror.com/tech/fowl/
[2] https://www.lazarus-ide.org/

jbluepolarbear7 replies#
Visual Assist Tomato wouldn’t have existed if Visual C++ did what you said. I use Rider (mostly) and I don’t even know how I’d program without all the features it adds. Auto import, code cleanup, code optimizations, memory allocation and boxing highlights, decompile assembly, Unity engine integration. I remember the days using Visual C++ and banging away on trying to get QT to not look ugly. I don’t miss anything about the development process from 15 years ago.

Continue this thread — 7 replies

xvilka#
> IMO there's a tradeoff: we could be writing all our programs in C, still.

No need for that - you could use Zig or Rust. Though both need a better GUI frameworks, but it's certainly more efficient with them.

abraxas3 replies#
I wrote 3D visualization apps in 1998 using FLTK and OpenGL and the (statically linked) binary was less than 20 MB. I think my desktop had all of 64MB of RAM. It was snappier than a modern TODO app on Electron and far, far easier to write.

What on earth have we done to ourselves?

cwyers1 reply#
Among other things we've done to ourselves, we've got higher-resolution displays, and we have GUI apps that can scale to different resolutions seamlessly. We have support for high DPI displays. We have fonts with sub-pixel rendering for sharper, easier to read text. Speaking of font-rendering, we have Unicode and internationalization support, so that people who read and write Arabic, Chinese, Japanese and other languages that don't use the Latin alphabet can use their native language in file names, dialog boxes and in anywhere else they might want to. We have better support for screen readers for the blind. For people who aren't fully blind, but have vision problems, we have the ability to make text and UI features larger dynamically to support them. We have better multitasking support, including process isolation to keep a badly-behaved application from crashing the entire computer. We have better security at the OS level to prevent malicious applications to take over the whole machine.

That's a big part of what we've done to ourselves. And this makes computers better for a whole lot of people.

Continue this thread — 1 reply

akhilcacharya1 reply#
Easier to write? I’m curious are there any sample apps like this that I can read?

Continue this thread — 1 reply

EvilEy31 reply#
How much time and expertise did it take? Did automatically work on all OSs? Could person without tech background slap something like this in a weekend? Did it have accessibility built-in? Could you reuse it on web?

Continue this thread — 1 reply

naikrovek1 reply#
> That isn't what my text editor is doing, though. It's doing autocomplete suggestions, linting code as I type... all sorts of things

BEFORE the typed character shows up? Are you sure?
16ms should be an absolute upper bound for a character to show up. Everything else comes after.

andi9991 reply#
Before the second character is typed...

Continue this thread — 1 reply

Continue this thread — 1 more reply

Continue this thread — 13 more replies

danenania2 replies#
Looks really good! At first glance, this seems like probably the best Electron alternative I've seen posted on HN.

Apart from the consistent GUI layer, I think an underrated reason that many teams stick with Electron is the mature tooling for cross-platform builds and upgrades. It's pretty painful to DIY.
It looks like NodeGUI doesn't currently support cross-compilation--is that something that's on the roadmap? How about upgrade/auto-upgrade tooling? Code signing?

davej2 replies#
Strongly agree. Hello World apps are great but it would be even better to see a Hello World tutorial that can actually be distributed to customers. You probably also need auto-update, native installers, code signing (notarization on Mac) and the ability to build native modules cross-platform.

This is a super-interesting project though.

capableweb1 reply#
Sure, would be great if everything had everything we need at creation. But this is first a Show HN from a user here and secondly open source software, so I think you need to adjust your expectations a bit.

Agree with your final part, very exciting and gonna be interesting to see where nodegui goes, especially security wise.

davej#
This is awesome. Props to the authors. My comment was not meant to knock on this project. I'm just pointing out that people should consider distribution if they want to use a tool like this. Putting a desktop app in front of customers is not yet as easy as it is on the web but I'm working on making it better [1].

[1] https://www.todesktop.com/cli

jiofih2 replies#
Both the App Store and Microsoft Store deal with installs and updates, no need for custom wrappers. Not sure about Linux.
davej2 replies#
End-users are still more familiar with a download link on a website for a exe/dmg installer on desktop.

You also need to need to redo your subscription/payments to support the stores and give a percentage of your revenue to Apple/Microsoft. On mobile you have no option but on desktop it's hard to justify giving up so much of your profit margin when there's a popular alternative.
BTW, Linux has the Snap Store.

Continue this thread — 2 replies

hanniabu2 replies#
I have a mac laptop and windows desktop and I never use the app stores.

Continue this thread — 2 replies

m00x3 replies#
Flutter isn't a good Electron alternative? Flutter 2.0 just came out with desktop support for osx, windows and linux and will be the main GUI framework for Linux.
IshKebab#
Not yet. Or rather, I would say you can use it for simple stuff, like Etcher then it is a reasonable choice. But you wouldn't want to use it for something like Slack yet. Some basic stuff like ctrl-Z in text fields does not work yet. Doing normal desktop things like menus and file dialogs will be a pain.

That said, I am writing a Git desktop client in Flutter and I like it. But I don't expect to finish it for many years so hopefully by then they'll have ironed everything out.

heavyset_go1 reply#
> and will be the main GUI framework for Linux.

That's already GTK+ and Qt, and the big GTK+ and Qt projects aren't switching over to Flutter any time soon.

jart2 replies#
I'm seeing a lot of Qt vs. Chromium in this thread. Here's your mindblown.gif of the day: Chromium is based off Webkit which is based off KDE which is based off Qt. https://en.wikipedia.org/wiki/KHTML
anthk#
On GUI's, if Go had some GUI a la inferno (no, not the crap of node, the one from the Unix/C/Plan9 guys), it would be the best thing ever on interfaces.

Continue this thread — 1 more reply

ssss11#
Just thought it was worth mentioning that nodegui is a node & qt runtime. There are framework components for not just Svelte, but React and Vue as well... just search on github if you prefer a different framework.

Load more comments