News for hackers. Stuff that matters.
Re:Show HN: Lite – A small, fast text editor by mmm_grayons on Saturday May 09, 2020 @02:59PM (#23127425)
This is a very nice piece of work, and I think very important: it shows that it's very much possible to make slick interfaces without using javascript/web technologies. It's also just as hackable as something like vscode or vim. I hope there's a shift back to native or semi-native applications as opposed to web-based stuff. It's certainly not perfect yet (it has some scaling/rendering issues and is slow to open large files), but is still a pretty great start. My two cents.
Re:Show HN: Lite – A small, fast text editor by cwyers on Saturday May 09, 2020 @03:25PM (#23127599)
It's written in Lua and doesn't use the OS GUI APIs and widgets anywhere. I'm not sure I understand what makes this more "native" than Javascript.
Re:Show HN: Lite – A small, fast text editor by samtheprogram on Saturday May 09, 2020 @03:36PM (#23127680)
There’s way less abstraction going on in Lua app that has a hand-rolled GUI versus an app built on top of a web browser like Electron. Hand rolling you’re own UI doesn’t make it less native — is Ableton Live not-native?

Or are you drawing the line because Lua is a scripting language?

Re:Show HN: Lite – A small, fast text editor by nwienert on Saturday May 09, 2020 @03:41PM (#23127719)
You seem to be the one drawing the line saying Electron isn’t vs something like this is.

Is a WASM app that renders to WebGL native?

I guess the point is native should probably mean “using the toolkit the OS provides” and we should just use “performant” in most cases.

Re:Show HN: Lite – A small, fast text editor by didibus on Saturday May 09, 2020 @05:33PM (#23128474)
I don't know how people are finding ways to contradict your comment.

Native means using the native UI toolkit. Or if not about UIs, it can mean compiled to native machine code ahead of time.

People used to care about native vs non-native because of the look and feel.

Now people are complaining about performance, memory use, and startup times. Everyone would be happy using a non native toolkit if it was fast, used little memory and started quickly.

Why can't we be precise with our language? We're engineers, it seems critical to use precise terminology. If you don't like the look and feels let's discuss that, if you don't like the memory use, let's discuss that, if you don't like the distribution or install size, let's discuss that.

Re:Show HN: Lite – A small, fast text editor by nurettin on Saturday May 09, 2020 @06:12PM (#23128694)
People mainly want their autocomplete, accessibility and double-click text to work the same everywhere.

wxwidget guys on IRC used to showcase how their buttons titlebars and menus blended with the windows xp back in early 2000 but I'm sure they are past that at this point.

Re:Show HN: Lite – A small, fast text editor by giancarlostoro on Saturday May 09, 2020 @04:21PM (#23127991)
Electron is like a whole framework say JVM or .NET but for JavaScript GUIs... Its definitely heavier than a few thousand lines of C and Lua vs the amount of code behind both Chrome and Node.
Re:Show HN: Lite – A small, fast text editor by jcelerier on Saturday May 09, 2020 @06:23PM (#23128751)
just having the UI definition given in native code already is a gigantic boost in terms of latency since you don't have to setup a whole javascript engine and HTML DOM to reach actual UI code though, just pass a pointer to the root of your widget tree to your paint function and see magic happening.

e.g. compare Telegram made in Qt Widgets with Signal made with Electron - the latter is incredibly slow to come up (and has broken text rendering) while the former is more or less instant on my machine (which is an overpowered i7...): https://streamable.com/m48hg7

fun fact: approaches such as Qt or also Flutter from what I could see can be more performant than some of the OS-provided UIs of some platforms - in particular Android is a pretty slow mess while Qt has seen a lot of work poured into running on <1Ghz devices.

Re:Show HN: Lite – A small, fast text editor by nwienert on Sunday May 10, 2020 @01:42PM (#23134450)
Again you just hand waved “native”. The UI definition here is in Lua, it then calls a backend that renders to the system, not sure if that part is C or not.

But... this setup may be a lot simpler, but no different from Electron in that they are both scripting languages that eventually use C to render.

Also, you can’t just cherry pick an example. It’s very possible to write pretty fast interfaces using v8. Certainly going straight html/css is slow, but that’s not necessary and VSCode is a great counter example (not crazy fast, but faster than many “native” apps).

I think the HN crowd has invested so much emotional energy into hating electron they literally can’t think straight about it, including just admitting that this is no more native than any electron app.

In fact, if you take native to mean some combination of “using OS APIs” and “accessibility support and behavior similar to the OS”, then electron wins hands down because of the latter part: font rendering, text selection, input controls, copy and paste, everything mostly just works like native. It’s the Lua app that I’d say is far less native. It’s just a bit faster.

Re:Show HN: Lite – A small, fast text editor by rhlsthrm on Saturday May 09, 2020 @04:09PM (#23127892)
Can you make WASM apps using js toolkits that compiles to native desktop yet? Seems like that will be a huge step forward from electron apps.
Re:Show HN: Lite – A small, fast text editor by SahAssar on Saturday May 09, 2020 @04:34PM (#23128096)
Sure, as native as any language that runs in a VM. There is no reason a WASM app can or can't be any more or less native than something running on lua (like in this case), jvm or anything else.

People don't use Electron to get a js runtime, they use it to get a web-like runtime. Any javascript (including WASM) app can run without electron in either node or in the bundled runtimes that OSX/Windows/Gnome/Whatever has, but the point of electron isn't to write JS, it's to write web-like code. For that it requires a browser in a predictable version, which is what electron gives you (albeit at a high cost.)

Re:Show HN: Lite – A small, fast text editor by Wowfunhappy on Saturday May 09, 2020 @04:52PM (#23128216)
So, obviously, "native" is a spectrum. On OS X, Cocoa > QT > Java > Wine > Docker + X11 forwarding.

But one thing I think is being missed here is that Lua, Python, and other scripting languages are just a lot more resource efficient than electron, in terms of runtime size, memory usage, cpu usage, etc. A very highly optimized Electron app like VS Code might outperform a more run-of-the-mill Lua app, but that's an outlier.

Re:Show HN: Lite – A small, fast text editor by SahAssar on Saturday May 09, 2020 @05:11PM (#23128350)
You're comparing apples to oranges. Lua is a language runtime. Electron is a full browser and a language runtime.

If you want to compare them then compare node.js or JavaScriptCore to lua. Or compare Electron with a lua runtime that has a webkit/chromium engine integration.

I don't especially like Electron, and sometimes like writing lua, but the two are not solving the same problem or competing in the same space.

Re:Show HN: Lite – A small, fast text editor by saagarjha on Saturday May 09, 2020 @05:00PM (#23128283)
Actually, for a while Java was just below Cocoa for "nativeness" the LAF for it was maintained by Apple itself.
Re:Show HN: Lite – A small, fast text editor by Wowfunhappy on Saturday May 09, 2020 @05:07PM (#23128324)
I'd heard that before! I kind of debated whether to put Java or QT first—it came down to the fact that QT apps just feel closer to me on macOS. Although I don’t know how ugly they are under the hood.

Edit: What does LAF stand for?

Re:Show HN: Lite – A small, fast text editor by saagarjha on Saturday May 09, 2020 @05:34PM (#23128483)
LAF stands for "look and feel", which is basically Java's name for "UI theme". Another fun fact: Cocoa had official Java bindings at some point!
Re:Show HN: Lite – A small, fast text editor by didibus on Saturday May 09, 2020 @08:27PM (#23129340)
The Java SWT toolkit uses Cocoa native widgets under the hood. So it is a native UI toolkit. That said, like parent said, native doesn't necessarily translate to a user experience of being performant.

The rest of the application, being in Java, will often means it will have your typical JVM high memory usage and slow startup times.

Re:Show HN: Lite – A small, fast text editor by astrobe_ on Saturday May 09, 2020 @05:38PM (#23128506)
Yes, and there is no reason you can't have a cow as a pet because they have pointy ears and a tail, like cats. It seems you've lost your way, my friend.
Re:Show HN: Lite – A small, fast text editor by SahAssar on Saturday May 09, 2020 @07:02PM (#23128956)
Why is using JS or WASM as a building block for a app any worse than lua, python or ruby?

What is the material difference?

Re:Show HN: Lite – A small, fast text editor by astrobe_ on Sunday May 10, 2020 @05:40AM (#23131401)
The material difference is that this editor is an order of magnitude smaller than a browser. Sure, you can go "we have plenty of RAM/storage/battery these days", but consuming 10x more of every resource you can think of is quite the hint that you are not using the right tool for the right job, or that you do not employ the right person for the right job.
Re:Show HN: Lite – A small, fast text editor by SahAssar on Sunday May 10, 2020 @11:07AM (#23133181)
That's not because of JS or WASM, that's because of the browser. Using JS or WASM does not mean you need to use a browser, you can for example run quickjs, node or whatever other runtime without bundling a browser.

This editor could have been written in js and use the exact same libs for rendering. If it used one of the smaller js runtimes (like quickjs) I'm guessing it would have been similar in size and pretty close in performance.

I don't get why you are conflating using a certain language with bundling a full browser (like electron does). It's two completely different things.

Re:Show HN: Lite – A small, fast text editor by sp332 on Saturday May 09, 2020 @04:23PM (#23127999)
What would the defining difference be between the two? "Forward" along what dimension?
Re:Show HN: Lite – A small, fast text editor by thomasqm on Saturday May 09, 2020 @03:59PM (#23127832)
Yep, it’s not Win32, it is a software renderer (according to renderer.c).
Re:Show HN: Lite – A small, fast text editor by np_tedious on Saturday May 09, 2020 @05:57PM (#23128613)
What's ableton written in? Java / awt?
Re:Show HN: Lite – A small, fast text editor by jcelerier on Sunday May 10, 2020 @05:02AM (#23131270)
Their own C++ UI toolkit mostly
Re:Show HN: Lite – A small, fast text editor by pankajdoharey on Saturday May 09, 2020 @04:11PM (#23127907)
If you look at the source its not Lua its, pretty much small amounts of C to embed Lua, the renderer is a SDL renderer in C. Its a pretty decent architecture I have been toying with a similar idea past few days with C + chez scheme + SDL.
Re:Show HN: Lite – A small, fast text editor by coldtea on Saturday May 09, 2020 @05:22PM (#23128420)
>I'm not sure I understand what makes this more "native" than Javascript.

Not using a full blown web rendering engine (if that's the case) but OS painting (not necessarily GUI) APIs would make it much more native in my eyes...

Re:Show HN: Lite – A small, fast text editor by cwyers on Saturday May 09, 2020 @08:52PM (#23129449)
I don't see why. Electron apps, for all their faults, use the OS to render text, so they respect things like system-wide settings on scale, you can use your installed fonts, you can use screenreaders and other accessibility technologies.
Re:Show HN: Lite – A small, fast text editor by barrkel on Saturday May 09, 2020 @06:46PM (#23128878)
The comparable JS architecture would use little more than a canvas. Normally, JS manipulates a retained mode render graph, i.e. DOM+CSS. That enormous abstraction stack both empowers JS - you can get a lot done with very little code - and slows it down.

It's more "native" because the stack is much shorter, much more direct. If it was more common to have plain JS interacting directly with input APIs and plain canvas, the argument for parity would be stronger. But it's just very rarely the case.

Re:Show HN: Lite – A small, fast text editor by Pmop on Saturday May 09, 2020 @06:25PM (#23128765)
> It's written in Lua and doesn't use the OS GUI APIs and widgets anywhere. I'm not sure I understand what makes this more "native" than Javascript.

It is not running on a web browser shaped to act like a text editor instead.

Re:Show HN: Lite – A small, fast text editor by NewEntryHN on Saturday May 09, 2020 @06:20PM (#23128738)
Its interpreter is not a web browser.
Re:Show HN: Lite – A small, fast text editor by paulie_a on Saturday May 09, 2020 @03:53PM (#23127779)
Because JavaScript is not a native language.
Re:Show HN: Lite – A small, fast text editor by cwyers on Saturday May 09, 2020 @04:06PM (#23127877)
I mean, yes, Javascript isn't x86 assembly code, but neither is Lua. Sure, Javascript was designed to be embedded within other applications, but so was Lua. And neither _has_ to be. People seem to be using "native" to mean "lightweight" or "performant," but if that's what they mean, they should just use those words.
Re:Show HN: Lite – A small, fast text editor by paulie_a on Friday May 15, 2020 @05:06PM (#23197404)
Js isn't native. It's not c it's not c++, it's not Java or even fucking python.

It's a webscripting language. Which is totally fine but it will never be native.

Re:Show HN: Lite – A small, fast text editor by ubercow13 on Saturday May 09, 2020 @04:04PM (#23127862)
Neither is Lua
Re:Show HN: Lite – A small, fast text editor by lykr0n on Saturday May 09, 2020 @03:21PM (#23127569)
I 100% agree with you, but the R&D time for something like this would eclipse an equivalent effort in Javascript/web tech.

There needs to be focus on building tooling that enables rapid development of native applications. GTK is a good example. Glade is a perfectly fine editor, but the underlying tooling for GTK is a mixed bag.

Re:Show HN: Lite – A small, fast text editor by smolder on Saturday May 09, 2020 @03:56PM (#23127807)
> the R&D time for something like this would eclipse an equivalent effort in Javascript/web tech.

I think this is less true when you don't assume people know all about web tech already, IOW there would be less of a difference for someone coming into software dev completely naive of web tech.

> There needs to be focus on building tooling that enables rapid development of native applications.

Fully agree.

Re:Show HN: Lite – A small, fast text editor by rplnt on Saturday May 09, 2020 @04:14PM (#23127929)
The time and resources users waste on using such application eclipses the difference in development. One could be folding enzymes instead of waiting for syntax highlighting to finish rendering in vs code.
Re:Show HN: Lite – A small, fast text editor by dazzawazza on Saturday May 09, 2020 @03:42PM (#23127723)
I'm not sure I agree. There needs to be a focus on building "quality everything" and not "quickest to make anything".

Move fast and break things has become the cancer of software engineering.

Re:Show HN: Lite – A small, fast text editor by codegladiator on Saturday May 09, 2020 @03:44PM (#23127736)
I completely dislike the "isn't made is js/web/electron tech" argument

Because as you said "It's certainly not perfect yet"