top | item 24302553

C++ Lightweight, cross-platform, HTML rendering engine for desktop apps

168 points| plp12 | 5 years ago |github.com | reply

110 comments

order
[+] antonyh|5 years ago|reply
A few things strike me immediately here:

1. Whole sections of the license are missing, such as section 5 - it's just not possible to agree to something in this state.

2. It's governed by the laws of Texas, so internationally that's not going to work - I'd have to hire a lawyer just to figure out what this means

3. Most importantly, I've no idea why I'd want to use this over embedding Chrome or Servo.

4. There's no ARM support. So no use on RPi, and potentially no use on Mac OS on Apple Silicon, depending on the secret sauce used.

That's before I even start to dig deeper - is it thread safe? Can it fall back to software renderer if needed? Will it be contentious for the GPU with other code that wants to use it?

Only the C & C++ bindings are official, the others are 'community maintained'. Whatever that means.

What I don't get, is why couldn't a dev team just embed WebKit directly - what does this really give? Can it put a browser in game in 3D, or is it a 2D overlay? Will it work with VR / AR?

The website makes a big deal over memory usage, which might be important in some cases, but what about CPU cycles? GPU cycles? Latency? Impact on framerate? Compatibility with Unreal, Unity, Godot, other engines?

I think it's a good project, but there's a lot of considerations before I'd even download for experiments.

[+] MaxBarraclough|5 years ago|reply
Good spot regarding the non-Free licence. Instant deal-breaker. It forbids distribution of the source-code, forbids reverse-engineering, and forbids commercial use.
[+] KenanSulayman|5 years ago|reply
1. Valid point.

2. ?

3. Chrome (or more specifically CEF -- Chromium Embedded Framework, the one used by Spotify et al.) is significantly more heavy than UL. Memory use is massive. Google doesn't care about API stability and ABI breakage is so common you'll have to keep up with all API changes (the ones published and documented anyway...) to get anything done. Good luck embedding Servo!

4. ARM support is coming.

---

> the others are 'community maintained'. Whatever that means.

I maintain the Rust binding to Ultralight [0] via the CAPI to provide an ergonomic way for people to work with it. Adam is busy improving Ultralight itself, so I find it worthwhile to maintain it. That's what it means.

[0] https://github.com/psychonautwiki/rust-ul

[+] ensiferum|5 years ago|reply
"What I don't get, is why couldn't a dev team just embed WebKit directly - what does this really give? Can it put a browser in game in 3D, or is it a 2D overlay? Will it work with VR / AR?"

It really is not that simple. Rendering a modern webpage or webapp requires a lot of components. You can't just take webkit and call it a day. For example in the chromium engine Blink which is the Webkit fork doesn't event render pages. It consumes HTML and CSS and produces "display lists" i.e lists of drawing commands. Those are fed to a rasterizer engine that must maintain a whole stack of trandormable layers which are managed in various render trees. Finally pages are radterized in tiles and then composited together for the final image that is show in the viewport. All of this covers millions of lines of code on top of Blink! And we're not even talking about things such as executing JS or syncing JS input handlers with the rendering or doing the actual page loads over HTTP/S or handling windowing and platform APIs and user input etc. All of which are really more or less essential in order to make anything that is actually useful.

[+] adamjs|5 years ago|reply
Hi there, lead dev of UL here (seems HN found our beta :)):

1. That Section (5) is left intentionally reserved (empty) since the commercial version of the contract provides commercial license grants. This is typical when offering multiple versions of a contract.

2. Contracts are typically governed by laws of a certain government (this is called venue). You can indeed enter into an agreement with another party using a venue in another country. (FWIW I agree the Free License is a bit too unwieldly-- I'm going to switch to an slimmer alternative that's more grokkable)

3. You would use UL for lower-level control over the embedding itself-- the library allows you to override file system loaders, font loading, drawing/rasterization, clipboard integration, and drawing itself (via GPU display lists). You can think of it like a smaller, lighter, cross-platform WebKit that's way more "hackable" and is designed to display HTML in an existing app rather than function as a standalone browser (right now, we're primarily used in games).

4. ARM64 support is on the way, there'll be an Apple Silicon port later this year.

For your other questions:

- [Is it thread safe?] This is in our docs, the API is not currently thread safe but you can run the whole thing on another thread. (an upcoming multi-process RPC layer is being built around the core API, and that will be thread-safe/async)

- [Can it fall back to software?] Latest build of UL can fully render on CPU, so yes.

- [Will it be contentious for GPU?] The overhead is minimal. Views are painted on an as-needed basis to GPU display lists, you can see the full GPUDriver interface here [1].

- [Only the C & C++ bindings are official] Several users of our community maintain open-source bindings for other languages, we will move into supporting them directly as the project grows.

- [Why couldn't a dev team just embed WebKit?] As one who has worked on exactly that for 11 years, it's really not that simple. The API of WebKit itself is not designed for embedding inside an existing application, and also much of the design decisions of the engine itself is designed to build a browser, not render HTML. Furthermore, most WebKit ports are tied to a specific windowing-system which is a big deal breaker if you're embedding HTML inside exotic, cross-platform environments likes games and headless server apps.

- [What about CPU cycles? GPU cycles? Latency?] Sure I can put up more benchmarks to that effect, the website is undergoing a refresh for the 1.2-stable release so it's out of date.

- [What about Unreal, Unity, Godot?] Several users have already used the API to integrate into Unreal and Unity, we will make an official plugin for all three later.

Hope this helps clear things up! I'm usually available in Discord [2] if you have more questions.

* [1] <https://github.com/ultralight-ux/Ultralight-API/blob/master/...

* [2] <https://chat.ultralig.ht>

[+] zelly|5 years ago|reply
Seems kind of misleading to post a github link that contains no code and it's actually nonfree software
[+] saagarjha|5 years ago|reply
This seems like it’s based on WebKit, parts of which are LGPL. Did they not modify it at all? (If so, why should I use this?) If they did, where is the code?

Edit: I think it’s at https://github.com/ultralight-ux/WebCore.

[+] adamjs|5 years ago|reply
Hi there, lead dev of UL here (we didn't post the link, HN just found our beta :)).

That top-level repo is just our packager/samples, 90% of our code is open-source and available on GitHub (released under LGPL), see our WebCore [1] and AppCore [2] modules.

The product as a whole contains two proprietary modules which are indeed non-free but allow free use in non-commercial and commercial projects up to $100K in gross revenue.

* [1] https://github.com/ultralight-ux/WebCore

* [2] https://github.com/ultralight-ux/AppCore

[+] Rochus|5 years ago|reply
The website https://ultralig.ht/ says "No source code for proprietary modules." for the free version. So it's technically not an open source project and therefore not a suitable candidate for my projects.

Anyway the sole core benefit proposition compared to chrome seems to be less memory use.

[+] michannne|5 years ago|reply
Especially ridiculous considering they have a site, a very professional one, at that
[+] bioipbiop|5 years ago|reply
The code is available under other repos on their account.
[+] minus7|5 years ago|reply
Proprietary renderer (not even source-available; Linux binaries linked against god knows what version of libc, libstdc++, etc) ontop of WebKit? No thanks.

Edit: I mean, sure, you could use it in your proprietary Electron app to make it more lightweight. At least on Windows, macOS and some Linuxes, the rest of users is left out then, but those free software enthusiasts are unlikely to use your software anyway.

[+] swiley|5 years ago|reply
A lot of people really don’t seem to get that users rejecting Linux binaries isn’t just them being idealist, it’s also a big usability thing.
[+] codegladiator|5 years ago|reply
Wow this is great.

> https://forum.ultralig.ht/t/community-language-bindings/20

``` Several awesome members of our community have created bindings for other languages!

Check them out below:

    C# – https://github.com/ImpromptuNinjas/UltralightSharp 104
    Rust (High Level) – https://github.com/psychonautwiki/rust-ul 21
    Rust (Low Level) – https://github.com/psychonautwiki/rust-ul-sys 7
    Java – https://github.com/Janrupf/ultralight-java 10
    Go (High Level, Framework) – https://github.com/ImVexed/muon 22
    Go (Low Level)-- https://github.com/raff/ultralight-go 19
Let me know if I’m missing any and I’ll add it to this sticky!```
[+] rcarmo|5 years ago|reply
There should be a list of Electron alternatives somewhere. This looks like a promising start, at least.
[+] ilkkao|5 years ago|reply
This lead me to think that there are huge amount of legacy HTML functionality that Electron could potentially drop if it was possible. Electron doesn't really need to care about breaking the web. So there's definitely room for alternatives.
[+] kartickv|5 years ago|reply
Is there an Electron alternative that uses the OS's rendering engine (Webkit on macOS, Edge on Windows), for developers who think that bundling a whole browser with their app is not the right tradeoff?
[+] pjmlp|5 years ago|reply
They are called native WebWidgets and exist since KHTML and MSHTML were created in the mid-90's.

Anything else is just the laziness of not caring about Web standards and shipping an whole browser instead.

Every day ChromeOS is one step closer to overtaking all desktops.

[+] niutech|5 years ago|reply
Here is a list of lightweight alternatives for Electron: electrino, neutralino, Quark, Ultralight, Miniblink, Deskgap, WebWindow, litehtml, cztomsik/graffiti, yue, nodegui.
[+] sunflowerdeath|5 years ago|reply
It looks strange to me that it tries to use HTML, because then it should be compatible with Web APIs and should render the same. Then it would be basically a browser, not very different from what is used today in Electron. But if it will differ from Web platform, why not to just make lightweight alternative DOM-like API.
[+] formerly_proven|5 years ago|reply
Been there, done that. Qt has had a renderer for a reasonable subset of HTML4 and CSS2 since the Qt 3(?) days. If you see a Qt app and there's colored text or bold/italics inside a label or editor, that's all done using that flavor of HTML. It gets rendered through the standard QPainter engine.
[+] pornel|5 years ago|reply
I hoped Servo would fill that niche.

It's nearly impossible to write a new browser engine that is compatible with all the legacy mess on the wild web, but for packaged webapps a modern minimal engine is exactly what they need.

[+] Tarq0n|5 years ago|reply
Servo isn't necessarily dead, though it is ambitious for a community-run project. There's still activity on the repo.
[+] rsp1984|5 years ago|reply
Ultralight is free for non-commercial use and free for commercial use by companies with less than $100K gross annual revenue.

Something that I have always asked myself is: If the code is open source, how would it ever be possible to enforce such a licensing model?

[+] gridlockd|5 years ago|reply
It isn't open-source in the "FOSS" sense. You can't have such terms in a FOSS license.

However, you can have parts of a codebase be FOSS licensed, if the license is compatible with non-FOSS code. BSD, MIT and Apache licenses allow this, copyleft licenses like the GPL don't.

[+] Tarq0n|5 years ago|reply
That definition is really ambiguous for government use, I wish people would address that specifically in these clauses.
[+] Rochus|5 years ago|reply
I had a brief look at the github repositories and don't think that all source code is available. At least I'm missing the source code of the core renderer. Maybe I didn't look close enough yet though.
[+] sradman|5 years ago|reply
According to the Architecture section of the GitHub page [1]:

> Ultralight is a new port of WebKit combined with a new [proprietary] lightweight renderer intended specifically for embedding in apps and games.

And the Licensing section:

> Ultralight is free for non-commercial use and free for commercial use by companies with less than $100K gross annual revenue. For more info see LICENSE.txt

Pricing [2] is available from the main web site.

[1] https://github.com/ultralight-ux/Ultralight#architecture

[2] https://ultralig.ht/#pricing

[+] rawoke083600|5 years ago|reply
For once I want to see "heavyweight" in the sales line... Just to see how it compares to all these "lightweight" offerings. Once you add in all the corner cases and bug fixes it seldom stays "lightweight". Good job on releasing it though.
[+] miki123211|5 years ago|reply
How does the accessibility story look like? If there's no accesibility, the usual disclaimers apply, get legal advice before building anything professional with it. Be aware of not just current laws, but future ones, especially those we definitely know are coming.
[+] fwsgonzo|5 years ago|reply
This looks very promising. Will there be PS4/PS5 support, or is that not under consideration?
[+] pjmlp|5 years ago|reply
PS already supports WebWidgets, the menu selection was done in WebGL.
[+] adamjs|5 years ago|reply
Yep, Xbox port is nearly finished, PS4, PS5 and Switch ports are next.
[+] dusted|5 years ago|reply
9 MiB is lightweight?
[+] gridlockd|5 years ago|reply
That's RAM usage. Not sure what this measures, but a single Full-HD backbuffer at 32bpp is already 8MiB.
[+] newsbinator|5 years ago|reply
Their pricing model could be adjusted.

It doesn't make sense to charge $2000/yr for an app that makes $1 of revenue.

[+] jashmatthews|5 years ago|reply
$1 revenue startups pay $0. $100k+ revenue startups have to pay $2k for the commercial license. Seems fair to me.
[+] qppo|5 years ago|reply
What ever happened to Awesomium? Wasn't that more or less the same project by the same author?
[+] genocidicbunny|5 years ago|reply
I'm pretty sure this is what Awesomium became. When I last looked into Awesomium (like 8 years ago now) its development seemed to have stagnated and the developer was trying to find a way to monetize it.