Lurker News

Comments (170) 40 threads

Earlier comments
watermans2 replies#
> Chromium is awesome, it really is. But not for embedders.

> the API is currently available for C++ only and requires Direct3D 11 on Windows and Metal on macOS.
“Embedders” here seems to mean “people who want to embed a web UI in a desktop application.” This confused me at first because I wondered why an embedded systems UI framework only supported Windows and macOS instead of Windows and small Unixes.

adamjs#
Thanks for the tip, will update the language to clarify.
oldmanhorton#
"Embedding" is often the term used to describe using a scripting language runtime within a larger app, for example embedding a Lua runtime in a game or a Javascript engine in a database. I'd imagine that was the context for using that term here.
tabulatouch#
Hi, I was a former Awesomium user (.NET bindings) and i think you did a good job, then told everyone to wait for the next version (2 years?) and.. there comes Ultralight which is a completely different beast. It can be impressive for people who need an embedded html front-end, but who wants to embed a real browser is left with CEF.. which is really cumbersome.

I think you should open source Awesomium also, allowing contributors to maintain it.

disqard4 replies#
This looks like a useful framework.

To the creator: Could you help me understand how lightweight this is, in terms of memory usage? For instance, how much memory is used to render the Wikipedia sample page, when using Ultralight, vs. using a single Chrome browser tab to do the same?
Thanks!

lossolo#
I second this. Some real world comparisons would be indeed great, to see how much lighter it really is. I would also add some heavy page to compare in context of CPU and memory usage between chromium and this framework.
samstave#
Where can I find the canonical list of how efficiently each tool renders that wiki page, I'd really like to see it?
adamjs4 replies#
That's a great suggestion and I will make a better comparision with real numbers in the next release.

Currently, the memory usage is similar or less than that of Chrome/Safari, with most memory being allocated by the JavaScriptCore VM, render geometry pools, and some by the GPU texture atlas.
So far, we've managed to reduce the total binary size to about 25% of a similar Electron-based app by reducing dependencies to the bare minimum and punting platform features to be handled by the embedder instead. See our Platform API [1].
As far as runtime memory usage goes, a lot of that memory is being allocated by pools and cache structures to improve performance (the same is true in most browsers). We will be implementing a memory management API soon so that this behavior can be configured (offering users the ability to strike a balance between memory usage and performance).
Additionally, Ultralight is NOT multi-process. The overhead of tens to nearly a hundred renderer processes makes sense for sandboxing in a browser situation but not for HTML UI where the assets are controlled by the user and security is less of a concern.
- [1] https://github.com/ultralight-ux/ultralight-0.9-api/tree/mas...

sesteel1 reply#
Out of curiosity, who is "we"? How big is your team?
adamjs#
The team is currently me :). Will be hiring soon.
c-smile#
> … HTML UI where the assets are controlled …

Real life HTML UI requires a bit more than standard HTML/CSS.
At some point you will discover that you will need something like this:

    elem.popup(popupElem, at)
to show arbitrary DOM elements as popup elements (DOM-element-in-its-own-window) like here https://terrainformatica.com/w3/sciter-tooltip.png

Yet pure HTML desktop windows: https://sciter.com/html-window/ with support of Acrylic/Vibrancy: https://sciter.com/sciter-4-2-support-of-acrylic-theming/
And at some point you may discover that by adding this to CSS:

   div.widget {
      prototype: MyWidget url(/js/widgets.js);
   }
and extending DOM Element by simple

   elem.merge(newHtml[, callback])

you will have the whole ReactJs thing obsolete/not-needed.

All that ...
If you want you can contact me so we can discuss all these in details.

derefr2 replies#
> with most memory being allocated by the JavaScriptCore VM

If I'm writing a green-field HTML5 app, and I don't derive any benefit from Javascript, is the interface between Ultralight and JavaScriptCore clean enough to just rip out the JS support altogether, replacing it with something simpler?
I'm picturing:
1. I embed Ultralight into a process that exposes a simple script-loading API, ala the one in JSCore;
2. I write HTML with no

c-smile#
Just in case you can do that with Sciter already.

In your CSS to define

    div.my { behavior:my-widget; }
While loading HTML that contains you will get SC_ATTACH_BEHAVIOR callback with the DOM event handler reference. By handling SC_ATTACH_BEHAVIOR you will return DOM event handler (a.k.a. behavior) - just a native function pointer that receives all DOM events on that element: mouse, keyboard, etc.

That's the same mechanism as HWND and WndProc but with lightweight DOM elements instead of Windows.
Example of such behavior that implements panels with tabs container: https://github.com/c-smile/sciter-sdk/blob/master/include/be...

adamjs#
Interesting, it's not too farfetched of an idea since there is a C++ API for accessing the DOM in WebCore and we have the ability to disable JS completely. I've added this to the issue tracker as an idea to explore. [1]

[1] - https://github.com/ultralight-ux/ultralight/issues/14

deeringc#
I'm sorry to hear that it's not multi-process. Ticked all of our boxes right up until that point. We have a use case to render our own UI, which from a threat modelling perspective can run in-proc, but also have another use case of running untrusted web content which absolutely needs to be out of proc. Do you have any plans to consider making it optional? I take it you've probably made architectural decisions that would make that extremely difficult?
c-smile1 reply#
Just in case, here is Sciter rendering HTML 3.2 specification document using Direct2D/DirectX backend on 3840x2160 screen:

https://sciter.com/sciter-fps/
Real FPS is shown in window's caption (490 FPS).
Sciter Engine (HTML/CSS/script) is fully contained in sciter.dll (4.9 Mb) (https://github.com/c-smile/sciter-sdk/tree/master/bin/32) without external dependencies. It works on all Windows versions starting from Windows XP and provides choice of four backends to use: Direct2D (GPU and WARP), Skia (OpenGL and CPU) and GDI+ (just in case someone is still interested in mammoth's shit).
On MacOS it uses Skia/OpenGL or CoreGraphics. On Linux it uses by default Cairo (good enough) and Skia/OpenGL as an option.

sounds1 reply#
Skia is not a small dependency, FWIW.
c-smile#
I mean binary dependency here - external DLLs.

But in any case I am building sciter.dll as with Skia (sdk/bin/skia32/) as without it (sdk/bin/32/)

krapp4 replies#
Using HTML/CSS for UI design on the web[0] makes sense in that you don't really have an alternative besides embeds like Flash, Java, etc.

But surely it's non-optimal for native applications that have direct access to the native renderer and GUI systems, or at least to limit them to HTML and CSS and not some more optimal domain specific subset of XML?
[0]assuming one accepts the premise that "web apps" should even be a thing, which I know is controversial on HN to say the least...

solarkraft1 reply#
Pure HTML for UI is pretty shit, with Vue/Angular/React it's bearable to develop in (though now huge), but:

Everyone knows how to produce "fuck it, it works" results with it.
Everything (almost) supports it.
It already runs on the web.

krapp#
That's a valid excuse for the web, but there's no reason we can't take what works about the HTML/CSS as UI model and make it work better for native applications. Just sticking to the web model because it's familiar is laziness.
panopticon#
I imagine the intent of something like this is so you can embed things in your app that you've already published online (e.g., support documentation, news posts, etc).
Pxl_Buzzard#
In addition to the other responses, when I was developing a game / game engine we chose Awesomium to render the UI to improve modding capabilities. A lot more people are willing to manipulate a website than some other scripting language. Planetary Annihilation had the same thought as well, if you want to see results on a published title.
sounds#
There's a balance to be found by each app developer between roll-your-own and just-use-a-web-browser.

There's room in there for Ultralight, Awesomium, Chromium, Dear Imgui, SDL, Cairo, WPF, even GDI+.
That's basically because (I think) there's still a lot of effort being put into recreating UIs - especially for apps, games, and embedded.
(In embedded, as in, embedded systems running linux or VxWorks or something, the story is less well known, but it's the exact same balance and set of choices.)

Load more comments