Bug 212012

Summary: [GTK] RFE: replace libicu by glib
Product: WebKit Reporter: Tomasz Kłoczko <kloczko.tomasz>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: aperez, bugs-noreply, dpa-webkit
Priority: P3 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Tomasz Kłoczko
Reported 2020-05-18 01:59:25 PDT
Looks like WebKit is uisng libicu on locale, charsets and time zones operations. As at the moment all that functions are provided by glib I think that it would be good to consider swithing from libicu to glib as WebKit alredy is heavyly using glib. This would allow memory usage and probably will make Webkit code simpler.
Attachments
Дилян Палаузов
Comment 1 2020-05-18 02:50:06 PDT
As mentioned at https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/216 WebKit includes JavaScript interpreter. This interpreter is supposed one day to return for input: new Intl.RelativeTimeFormat('de', {numeric:'auto'}).format(0, 'day') output heute How do you propose to implement Intl.RelativeTimeFormat in JavaScript without using ICU? Does glib offer `Relative Time` conversions?
Adrian Perez
Comment 2 2020-05-18 03:36:35 PDT
Some of the newest Web-facing APIs (and in particular the JS Intl ones) which rely on implementation behaviour provided by ICU. While the specs themselves may not explicitly mention ICU, they are often just exposing functionality present in the library; this has been mentioned recently in this webkit-dev mailing list thread: https://lists.webkit.org/pipermail/webkit-dev/2020-April/031162.html Therefore, we would need ICU anyway for those. If we are going to need the library anyway, there is no point in trying to avoid using it. If you need to reduce memory (or disk) usage, you can look into building ICU with some features and/or data tables removed. For example the support for EBCDIC encoding is in general unneeded in the context of a Web engine. If you are trying to build an embedded system where you know in advance which languages will be supported, you can also remove the data tables for languages you don't need to support (for example: if your target is the US market, remove the CJK/Thai/etc. break iterator dictionaries and rule sets). If you want to go down this route, please check the ICU site, which has some information on this topic: http://userguide.icu-project.org/icufaq#TOC-How-can-I-reduce-the-size-of-the-ICU-data-library-
Tomasz Kłoczko
Comment 3 2020-05-18 04:05:01 PDT
I must honestly say that I have no idea how low level details in glib and icu looks like. In reality I'm more software packager which operates on scale whole Linux distribution with some descent developers skills than blood and flesh software developer :) My observations and conclusions are formed from that kind above each software projects point of view. I see only that glib provides some level of some necessary routines and whole gnome ecosystem is happy with what is provided by glib. WebKit and e-d-s are kind of exceptions. If it is still something missing in glib which forces to use icu I think this is something which should be discussed with glib developers which actually wrote that part. Nevertheless wherever already is possible to replace icu API by glib one IMO it should be done without waiting on actual glib related answer because I see that Webkit already is heading to more and more of using glib :) Will try to pass the subject to glib developers because they help may significantly help finish transition and/or finish implementing still some missing bits in glib :)
Tomasz Kłoczko
Comment 4 2020-05-18 04:22:54 PDT
Just FTR: I've asked for some help of glib developers. Hopefully they will join with they forces :P https://gitlab.gnome.org/GNOME/glib/-/issues/2112
Adrian Perez
Comment 5 2020-05-19 14:40:41 PDT
*** Bug 211983 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.