06:35:56 RRSAgent has joined #js2wasm 06:36:00 logging to https://www.w3.org/2023/09/13-js2wasm-irc 06:36:00 RRSAgent, do not leave 06:36:04 RRSAgent, make logs public 06:36:05 Meeting: Accelerating the Web performance by compiling Javascript code to WASM 06:36:05 Chair: Wei Ding, Shi Ling 06:36:06 Agenda: https://docs.google.com/document/d/1skQFGhxvK9F-o9jIkQOAKUziuvPzUigGlRE6InwC3sQ/edit#heading=h.2zye3qyc2qk 06:36:09 clear agenda 06:36:11 agenda+ Pick a scribe 06:36:13 agenda+ Reminders: code of conduct, health policies, recorded session policy 06:36:15 agenda+ Goal of this session 06:36:19 agenda+ Discussion 06:36:21 agenda+ Next steps / where discussion continues 06:37:24 thank you @tidoust 06:37:31 q+ 06:38:40 ack dingwei 07:08:35 Dingwei has joined #js2wasm 07:08:53 q? 07:11:16 Roy has joined #js2wasm 07:11:38 agenda? 07:14:01 RRSAgent, make minutes 07:14:02 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html Roy 07:20:14 tidoust has joined #js2wasm 07:20:35 xueyuan has joined #js2wasm 07:24:10 zakim, agenda? 07:24:10 I see 5 items remaining on the agenda: 07:24:10 1. Pick a scribe [from tidoust] 07:24:10 2. Reminders: code of conduct, health policies, recorded session policy [from tidoust] 07:24:10 3. Goal of this session [from tidoust] 07:24:10 4. Discussion [from tidoust] 07:24:10 5. Next steps / where discussion continues [from tidoust] 07:24:10 Roy has joined #js2wasm 07:24:10 present+ 07:25:46 present+ 07:26:35 present+ 07:27:24 martin_alvarez has joined #js2wasm 07:28:24 xfq_ has joined #js2wasm 07:28:35 xfq has joined #js2wasm 07:28:42 scribe+ xfq 07:28:49 scribe+ xfq_ 07:29:15 present+ 07:29:17 rrsagent, make log public 07:29:23 rrsagent, make minutes 07:29:24 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xfq_ 07:29:31 present+ 07:30:08 Lei_Zhao has joined #js2wasm 07:30:08 present+ xueyuan 07:31:10 angel_ has joined #js2wasm 07:31:10 ChrisLorenzo has joined #js2wasm 07:32:15 ken has joined #js2wasm 07:32:15 JaseW has joined #js2wasm 07:32:15 Dingwei: welcome 07:32:15 jkup_ has joined #js2wasm 07:32:15 agenda? 07:32:49 ... is there any objections to recording this session? 07:32:49 [silence] 07:32:49 Dingwei: we have 2 presentations 07:32:49 ... and about 10 minutes Q&A 07:32:57 lilin has joined #js2wasm 07:33:03 ... health rules: https://www.w3.org/2023/09/TPAC/health.html 07:33:52 ... slides are in https://github.com/w3c/tpac2023-breakouts/issues/22#issuecomment-1717073937 07:33:52 ... my colleague Ling Shi will present 07:34:03 present+ 07:34:08 ling: thanks for joining us 07:34:18 ... my topic is 'web for apps' 07:34:21 shanhuaqi has joined #js2wasm 07:34:36 present+ Roy, xiaoqian, fuqiao, Li Lin, MartinA, Huaqi Shan, 07:34:58 ... when preparing this topic, I read the 7 Predictions For The Web 07:35:08 https://fagnerbrack.com/i-made-7-predictions-for-the-web-for-the-next-5-years-d750d93b1b5a 07:35:28 ... James Bankoski : 85% of All Apps use some level of web tech 07:35:50 ... Meituan is famous in China 07:35:57 xiaoqian has joined #js2wasm 07:36:06 ... the miniapp and native app versions have almost the same interface 07:36:24 Present+ Ding Wei, SHi Lin 07:36:29 ... let's review the history of building apps using frameworks 07:36:32 present+ 07:36:57 ... phonegap, cordorva etc. 07:37:32 ... frameworks like react-native, weex, and hippy are system UI frameworks 07:37:50 ... there are also self-rendering frameworks like Flutter 07:38:03 s/hippy/Hippy 07:38:25 ling: let's look at the web dev stack using the front-end perspective 07:38:53 ... application framework can only use limited DOM APIs 07:39:19 ... there's still no good optimization methods for application development 07:39:31 ... WASM is better, but rarely used 07:39:48 ... currently mainly used for compiled code like C++ 07:40:16 Present+ Chunming 07:40:17 ... JS continue to be the language for web dev 07:40:41 Present+ Zhao Lei 07:40:42 chunming has joined #js2wasm 07:40:44 ... here's an ideal Web Application Development Model we would like to discuss 07:41:06 ... even the system API calls are based on wasm 07:41:08 Present+ Xiaoshua Shi 07:41:29 ... of course, there are still many problems we need to solve to achieve such a model 07:41:38 ... some of them are already being discussed 07:42:05 ... how to compile JS to wasm? 07:42:19 ... there are still many problems that need to be studied and discussed 07:42:23 present+ 07:42:29 present+ 07:42:32 Dingwei: we have the next speaker 07:42:39 ... who will introduce the solution 07:42:42 ... and present online 07:42:48 Shi_Xiaohua_BeihangU: thanks Dingwei 07:43:04 ... I'm Shi_Xiaohua_BeihangU from Beihang University 07:43:25 ... I'll present JWST—— A JavaScript-to- WebAssembly Static Translator 07:43:55 ... we think that ait is useful to build a static compiler to compile from js to wasm 07:44:11 christianliebel has joined #js2wasm 07:44:24 [show code example] 07:44:44 present+ 07:44:51 Shi_Xiaohua_BeihangU: the example is simple, some compilers can statically analyze the code 07:45:06 ... in JS different types could be operating together 07:45:24 ... no compilers can know each type and generate the appropriate type 07:45:44 [Demonstration of dynamic types] 07:45:49 [Demonstration of dynamic loading] 07:46:12 Shi_Xiaohua_BeihangU: for static compiler, the JS features of dynamic loading are key challenges 07:46:25 ... now I would like to introduce JWST 07:46:45 ... it is a static compiler for compiling JavaScript to WASM and native code 07:46:59 ... it uses QuickJS bytecode as input, and outputs LLVM IR 07:47:15 ... it got the similar pass rate as QuickJS for ECMA test262 07:47:29 ... JWST is about 30% and 50% faster than node.js when running SunSpider 07:47:36 [show WASM Sample Code] 07:47:56 [WASM vs. Java Bytecode] 07:48:06 Shi_Xiaohua_BeihangU: wasm and Java bytecode are different 07:48:13 ... Java bytecode is designed for expressing Java programs 07:48:24 ... because they have almost the same semantic expression capability 07:48:31 tomayac has joined #js2wasm 07:48:36 present+ 07:48:41 ... WASM is designed for working with JavaScript 07:48:50 ... For instance, WASM is not a dynamically typed language 07:48:56 ... WASM does not have a GC, etc. 07:49:06 [Show JWST Compilation Process] 07:49:36 Shi_Xiaohua_BeihangU: all wasm code can be replaced with native code by the compiler 07:49:48 [Compilation process demonstration] 07:50:03 Shi_Xiaohua_BeihangU: on the left side it's JS code 07:50:12 ... the right side is QuickJS Bytecode 07:50:40 ... to solve the problem of dynamic types 07:50:52 ... JWST reuses the JSValue data structure of QuickJS 07:51:23 ... before each operation the type of the value must be determined 07:51:33 [Demonstration of Dynamic Type Compilation Process] 07:51:55 Shi_Xiaohua_BeihangU: here we demonstrate the dynamic type compilation process 07:52:47 ... if we already know a and b are integers there's no need to generate any @@ at all 07:53:00 [Type Profiling: Type information fusion] 07:53:05 q? 07:53:10 [Type Profiling: Example] 07:53:49 Shi_Xiaohua_BeihangU: the type information is shown on the figure 07:54:38 [Mixed running mode of compiled code and QuickJS Interpreter] 07:54:38 [Speculative Optimizations of Type Fixing] 07:54:43 Shi_Xiaohua_BeihangU: here's a more complicated mechanics for type fixing 07:55:01 ... determine whether the types are correct or not 07:55:29 [GC Support] 07:55:49 Shi_Xiaohua_BeihangU: the GC for QuickJS is used in JWST by default 07:55:54 [Exception Support] 07:56:10 Shi_Xiaohua_BeihangU: there is no exception table as we know in Java 07:56:28 ... we don't use exception tables 07:56:36 [async/await Support] 07:56:58 Shi_Xiaohua_BeihangU: when the program is executed to await, the function foo() pauses the execution 07:57:03 ... after the main function has been completed, the remaining code of the function foo() will be executed 07:57:12 [Asynchronous in mixed running mode] 07:57:18 [Typical Optimizations of JWST] 07:57:54 Shi_Xiaohua_BeihangU: type fixing has been introduced in the previous section 07:58:10 ... and inline cache 07:58:27 [Inline Cache] 07:58:49 Shi_Xiaohua_BeihangU: managed JS runtimes like V8 implement optimization called inline cache 07:59:20 ... it adds a cache area for object searching 07:59:25 [Array layout optimization] 07:59:51 [Global Function Caching] 08:00:05 Shi_Xiaohua_BeihangU: *Most* JS functions do not change their names after definitions 08:00:19 ... the compiler resolves the definitions at compile time, so the generated code calls into the function directly without going through dispatch() or other wrappers 08:00:32 [Performance Evaluation of the compiler] 08:00:59 Shi_Xiaohua_BeihangU: the compiler has a consistent pass rate compared to QuickJS 08:01:04 ... wrt test262 08:01:30 ... in terms of built-ins, 204 test cases related to Atomic require multithreading support, while WASM runtime does not support multithreading currently 08:01:40 ... 1 test cases related to floating-point precision 08:01:46 [Floating-Point Rounding modes] 08:02:22 Shi_Xiaohua_BeihangU: wasm only supports round-to-nearest 08:02:27 ... unlike native 08:02:42 ... we ran JWST on SunSpider 08:03:05 ... its total performance is ~50% faster than Node.js, for the first execution 08:03:43 ... the running time on Node.js include all the initialization 08:04:07 [Shi_Xiaohua_BeihangU introduces SunSpider@wasmer, Kirin 990E] 08:04:48 [SunSpider@wasmer, Intel i7] 08:05:14 [Show React Native Samples (TTI, 0.1x play)] 08:05:45 Shi_Xiaohua_BeihangU: the examples are V8 with cache and V8 without cache 08:06:17 ... significantly faster than V8 without cache 08:07:02 [Comparing JWST (WASM), JWST Native, V8-Cache, and V8-No-Cache] 08:07:16 [Evaluate the Start-up JS Scripts of a RN APP] 08:07:44 Shi_Xiaohua_BeihangU: when we analyze the overhead on the startup screen 08:07:54 the presentation will end at 10:10 followed by Q/A 08:08:06 s/startup screen/startup script 08:08:37 s/startup script/startup script of a release-mode RN app 08:08:37 the q is open, please do q+ if you like to speak 08:08:39 ... JWST-WASM is ~10.5x and ~126% faster than V8 without code cache and with code cache, respectively 08:09:00 [React Native Samples: Compilation Time and Code Size] 08:09:27 Shi_Xiaohua_BeihangU: the JS Release version is 1.3MB 08:09:56 ... JWST (JSBundle => LLVM IR) compilation time is 640s 08:10:15 ... on Intel Core i9-12900KF 3.20GHz with 32G Memory 08:10:24 [Expectations for WASM] 08:10:33 Shi_Xiaohua_BeihangU: 1. DLL Support 08:10:39 ... 2. GC Support 08:10:45 ... 3. DOM Support 08:10:50 ReinaldoFerraz_ has joined #js2wasm 08:10:56 ... 4. Furthermore, is it possible to use WASM as the fundamental language/bytecode for web applications? 08:11:11 ... that means running JavaScript and all other languages on WASM runtimes 08:11:22 Dingwei: thanks for sharing 08:11:43 ... before going to the Q&A session, I want to reintroduce the goal of the session 08:11:51 ... we would like to solicit comments 08:11:51 q+ 08:12:11 tomayac: thanks for the presentation 08:12:11 ack to 08:12:16 q? 08:12:44 tomayac: regarding the development experience, I was wondering if you have compared it to AssemblyScript 08:13:14 How is the developer experience compared to AssemblyScript? https://www.assemblyscript.org/ 08:13:16 Shi_Xiaohua_BeihangU ^^ 08:13:30 q? 08:13:34 ... second question, where can we find out more? 08:13:36 Where can we find out more? Is there a link to a repository? 08:13:47 ... I tried searching for them, but didn't find any information 08:14:09 shi_ling has joined #js2wasm 08:14:10 Shi_Xiaohua_BeihangU: the challenge for a static compiler is bigger 08:14:25 ... we will handle all the dynamic type features 08:14:39 q+ 08:14:45 ... for this part it is more difficult than AssemblyScript 08:14:53 gaochun has joined #js2wasm 08:15:00 ... we build this with Huawei 08:15:09 q? 08:15:13 q? 08:15:13 Dingwei: we will open source this 08:15:16 ack Dingwei 08:15:51 daniel: how is the point of view for a developer? 08:15:59 s/will open source this/ will consider to open source this and it is still in the process 08:16:18 ... if something goes wrong and do some tracing, is that supported through the whole process? 08:16:24 ling: this is a good question 08:16:32 ... we think debugging should be supported 08:16:41 q? 08:16:42 ... this is an attempt to compiling JS to wasm 08:16:52 q+ To ask if they have looked at WebAssembly Garbage Collection (WasmGC) 08:16:56 ... there are a lot of problems need solving 08:17:06 ... debugging is a problem that needs to be solved later 08:17:06 ack to 08:17:06 tomayac, you wanted to ask if they have looked at WebAssembly Garbage Collection (WasmGC) 08:17:24 tomayac: Chrome just sent an intent to ship WebAssembly Garbage Collection (WasmGC) 08:17:35 ... have you looked at it? 08:17:38 q? 08:17:58 Shi_Xiaohua_BeihangU: regarding GC, we just use the GC of QuickJS 08:18:13 q? 08:18:13 ... if wasm runtime has GC, I think we will use it 08:18:43 Dingwei: any other questions? 08:18:52 ... especially from the wasm WG 08:19:37 dape has joined #Js2wasm 08:20:01 Dingwei: we will continue to discuss on github 08:20:11 ... on this page: https://github.com/w3c/tpac2023-breakouts/issues/22 08:20:25 ... we want to collect more thoughts and discuss together 08:20:42 Is SIMD supported by JWST? 08:20:44 q? 08:21:11 Shi_Xiaohua_BeihangU: we have a compiler toolchain 08:21:35 ... if LLVM compiler supportsSIMD, we will support SIMD 08:21:36 q? 08:21:42 s/supportsSIMD/supports SIMD 08:21:56 s/if LLVM/if the LLVM 08:22:40 Dingwei: any more questions? 08:23:11 present+ 08:23:22 rrsagent, make minutes 08:23:24 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xfq 08:23:31 Present+ 08:23:36 present+ 08:23:39 rrsagent, make minutes 08:23:41 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xfq 08:23:59 present+ 08:34:19 xfq has joined #js2wasm 08:38:09 xfq has joined #js2wasm 08:39:05 Roy has joined #js2wasm 08:45:30 present+ Daniel Peintner, Ken Komatsu, Thomas Steiner, Jiantong Zhou, Christian Liebel, Andrew Comminos, Sam Weiss 08:51:12 present+ participants on Zoom (Kirk Lin, Jianxin Zhang, Larry Zhao, yu luo, Huihai Shen, davey, Alexandru Mihai, Davor Davidovikj, ripple, Dbettkk) 08:51:19 rrsagent, make minutes 08:51:20 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xueyuan 08:52:03 xfq has joined #js2wasm 08:53:08 present- participants on Zoom (Kirk Lin, Jianxin Zhang, Larry Zhao, yu luo, Huihai Shen, davey, Alexandru Mihai, Davor Davidovikj, ripple, Dbettkk) 08:53:13 rrsagent, make minutes 08:53:15 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xueyuan 08:53:55 present+ participants on Zoom (Kirk Lin; Jianxin Zhang) 08:54:00 rrsagent, make minutes 08:54:02 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xueyuan 08:54:54 present- participants on Zoom (Kirk Lin; Jianxin Zhang) 08:55:38 present+ participants on Zoom (Kirk Lin; Jianxin Zhang; Larry Zhao; yu luo; Huihai Shen; davey; Alexandru Mihai; Davor Davidovikj; ripple; Dbettkk) 08:55:43 rrsagent, make minutes 08:55:45 I have made the request to generate https://www.w3.org/2023/09/13-js2wasm-minutes.html xueyuan 08:58:29 xiaoqian has joined #js2wasm 09:01:00 tidoust has joined #js2wasm 09:21:18 sxh has joined #js2wasm 10:13:20 xiaoqian has joined #js2wasm 10:16:49 xiaoqian has joined #js2wasm 10:19:47 xfq has joined #js2wasm 10:22:01 Roy has joined #js2wasm 10:22:44 xueyuan has joined #js2wasm 11:30:38 Roy has joined #js2wasm 11:59:45 xfq has joined #js2wasm 12:00:39 Roy has joined #js2wasm 12:05:13 tidoust has joined #js2wasm