Static Typescript

Total Page:16

File Type:pdf, Size:1020Kb

Static Typescript 1 Static TypeScript 56 2 57 3 An Implementation of a Static Compiler for the TypeScript Language 58 4 59 5 60 6 Thomas Ball Peli de Halleux Michał Moskal 61 7 Microsoft Research Microsoft Research Microsoft Research 62 8 Redmond, WA, United States Redmond, WA, United States Redmond, WA, United States 63 9 [email protected] [email protected] [email protected] 64 10 Abstract 65 11 66 12 While the programming of microcontroller-based embed- 67 13 dable devices typically is the realm of the C language, such 68 14 devices are now finding their way into the classroom forCS 69 15 education, even at the level of middle school. As a result, the 70 16 use of scripting languages (such as JavaScript and Python) 71 17 for microcontrollers is on the rise. 72 18 We present Static TypeScript (STS), a subset of TypeScript (a) (b) 73 19 (itself, a gradually typed superset of JavaScript), and its com- 74 20 piler/linker toolchain, which is implemented fully in Type- Figure 1. Two Cortex-M0 microcontroller-based educational 75 21 Script and runs in the web browser. STS is designed to be use- devices: (a) the BBC micro:bit has a Nordic nRF51822 MCU 76 22 ful in practice (especially in education), while being amenable with 16 kB RAM and 256 kB flash; (b) Adafruit’s Circuit Play- 77 23 to static compilation targeting small devices. A user’s STS ground Express (https://adafruit.com/products/3333) has an 78 24 program is compiled to machine code in the browser and Atmel SAMD21 MCU with 32 kB RAM and 256 kB flash. 79 25 linked against a precompiled C++ runtime, producing an ex- 80 26 ecutable that is more efficient than the prevalent embedded 81 interpreter approach, extending battery life and making it 27 girls, increases confidence in both students and teachers, and 82 possible to run on devices with as little as 16 kB of RAM 28 makes lessons more fun [2, 16]. 83 (such as the BBC micro:bit). 29 To keep costs low for schools, these devices typically em- 84 This paper is primarily a description of the STS system 30 ploy 32 bit ARM Cortex-M microcontrollers (MCUs) with 85 and the technical challenges of implementing embedded 31 16-256kB of RAM and are programmed using an external 86 programming platforms in the classroom. 32 computer (usually a laptop or desktop). Programming such 87 33 Keywords JavaScript, TypeScript, compiler, interpreter, mi- devices in a classroom presents a number of technical chal- 88 34 crocontrollers, virtual machine lenges: 89 35 90 (1) the selection/design of an age-appropriate program- 36 91 ming language and environment; 37 1 Introduction 92 (2) classroom computers running outdated operating sys- 38 Recently, physical computing has been making headway in 93 tems, having intermittent and slow internet connec- 39 the classroom, engaging children to build simple interactive 94 tivity, and locked down by school IT administrators, 40 embedded systems. For example, Figure 1(a) shows the BBC 95 which makes native app installation difficult; 41 micro:bit [1], a small programmable Arduino-inspired com- 96 (3) the transfer of the student’s program from the com- 42 puter with an integrated 5x5 LED display, several sensors 97 puter to the device, where it can run on battery power 43 and Bluetooth Low Energy (BLE) radio technology. The de- 98 (as many projects embed the device in an experiment 44 vice first rolled out in 2015 to all year 7 students (age 10to 99 or “make”). 45 11) in the UK and has since gone global, with four million 100 46 units distributed worldwide to date via the micro:bit Educa- With respect to these challenges, there are various embed- 101 47 tion Foundation (https://microbit.org). Figure 1(b) shows a ded interpreters for popular scripting languages, such as 102 48 different educational device featuring RGB LEDs: Adafruit’s JavaScript (JerryScript [8, 15], Duktape [22], Espruino [23], 103 49 Circuit Playground Express (CPX). mJS [20], and MuJS [19]) and Python (MicroPython [9] and 104 50 Research suggests that using such devices in computer its fork CircuitPython [12]). The interpreters run directly on 105 51 science education increases engagement, especially among the MCU, requiring just the transfer of program text from the 106 52 host computer, but forego the benefits of advanced optimiz- 107 53 MPLR 2019, Under submission, ing JIT compilers (such as V8) that require about two orders 108 54 . of magnitude more memory than is available on MCUs. 109 55 1 110 MPLR 2019, Under submission, Thomas Ball, Peli de Halleux, and Michał Moskal 111 • the STS compiler generates surprisingly efficient and 166 112 compact machine code, which unlocks a range of ap- 167 113 plication domains such as game programming for low- 168 114 resource devices such as those in Figure 2, all of which 169 115 were enabled by STS. 170 116 Deployment of STS user programs to embedded devices 171 117 does not require app or device driver installation, just access 172 118 to a web browser. Compiled programs appear as downloads, 173 119 which are then transferred manually by the user to the device, 174 120 which appears as a USB mass storage device, via file copy 175 121 (or directly through WebUSB, an upcoming standard for 176 122 connecting websites to physical devices). 177 123 The relatively simple compilation scheme for STS (pre- 178 124 sented in Section 3) leads to surprisingly good performance 179 125 on a collection of small JavaScript benchmarks, often com- 180 126 parable to advanced, state of the art JIT compilers like V8, 181 127 with orders of magnitude smaller memory requirements (see 182 128 Section 4). It is also at least an order of magnitude faster 183 129 Figure 2. Three microcontroller-based game handhelds with than the embedded interpreted approach. A novel aspect of 184 130 160x120 color screens. These boards use ARM’s Cortex-M4F evaluation is a comparison of different strategies for dealing 185 131 core: the ATSAMD51G19 (192kB RAM, running at 120Mhz) with field/method lookup spanning classes, interfaces, and 186 132 and STM32F401RE (96kB RAM, running at 84Mhz). dynamic maps. 187 133 188 134 1.2 MakeCode: Easy Embedded for Education 189 135 Unfortunately, such embedded interpreters are between 190 STS is the core language supported by the MakeCode Frame- 136 one and three orders of magnitude slower than V8 (see Sec- 191 work.1 MakeCode enables creation of custom programming 137 tion 4), affecting responsiveness and battery life. Even more 192 experiences for MCU-based devices. Each MakeCode experi- 138 importantly, due to the representation of objects in memory 193 ence (we often call them editors, though they also bundle a 139 as dynamic key-value mappings, the memory footprint can 194 simulator, APIs, tutorials, documentation, etc.) targets pro- 140 be several times that of an equivalent C program. This can 195 gramming of a specific device or device class via STS. [7] 141 severely limit the applications that can be deployed on low- 196 Most MakeCode editors are deployed primarily as web 142 memory devices such as the micro:bit (16 kB RAM) and CPX 197 apps, including a full-featured text editor for developing STS 143 (32 kB RAM). 198 programs based on Monaco (the editor component of Visual 144 199 1.1 Static TypeScript Studio Code), as well as a graphical programming interface 145 200 based on Google’s Blockly framework (STS metadata in com- 146 As an alternative to embedded interpreters, we present Static 201 ments defines the mapping from STS APIs to Blockly and 147 TypeScript (STS), a syntactic subset of TypeScript,[3] sup- 202 MakeCode translates between Blockly and STS). 148 ported by a compiler (written in TypeScript) that generates 203 The MakeCode editors, including the primary coding ex- 149 machine code that runs efficiently on MCUs in the target 204 periences for BBC micro:bit and for Adafruit CPX,2 have 150 RAM range of 16-256kB. The design of STS and its compiler 205 been used by millions of students and teachers worldwide 151 and supporting runtime were dictated primarily by the above 206 to date. 152 three challenges. In particular: 207 STS supports the concept of a package, a collection of STS, 153 • STS eliminates most of the “bad parts” of JavaScript; 208 C++ and assembly files, that also can list other packages as 154 following StrongScript [14], STS uses nominal typing 209 dependencies. This capability has been used by third parties 155 for statically declared classes and supports efficient 210 to extend the MakeCode editors, mainly to accommodate 156 compilation of classes using classic techniques for v- 211 hardware peripherals for various boards.3 Notably, most 157 tables. 212 of the packages avoid pitfalls of unsafe C/C++ completely 158 • the STS toolchain runs offline, once loaded into aweb 213 and are authored solely in STS, due to the efficiency of the 159 browser, without the need for a C/C++ compiler – the 214 STS compiler and the availability of low-level STS APIs for 160 toolchain, implemented in TypeScript, compiles STS 215 161 to Thumb machine code and links this code against 216 1See https://makecode.com. The framework, along with many editors, is 162 217 a pre-compiled C++ runtime in the browser, which open source under MIT license, see https://github.com/microsoft/pxt. 163 is often the only available execution environment in 2See https://makecode.microbit.org and https://makecode.adafruit.com. 218 164 schools. 3For example for micro:bit, see https://makecode.microbit.org/extensions 219 165 2 220 Static TypeScript MPLR 2019, Under submission, 221 276 222 277 223 278 224 279 225 280 226 281 227 282 228 283 229 284 230 285 231 286 232 287 233 288 234 289 235 290 236 291 237 292 238 293 239 294 240 295 241 296 242 297 243 Figure 3.
Recommended publications
  • Full-Stack Javascript Development with Mean Pdf Free Download MEAN.JS Tutorial
    full-stack javascript development with mean pdf free download MEAN.JS Tutorial. The term MEAN.js refers to full stack JavaScript framework, used for building dynamic websites and web applications. MEAN is an acronym that stands for M ongoDB, E xpress, N ode.js and A ngularJS, which are the key components of the MEAN stack. Audience. This tutorial is designed for software programmers who want to learn the basics of MEANjs and its programming concepts in simple and easy ways. This tutorial will give you enough understanding on components of MEANjs with suitable examples. Prerequisites. Before proceeding with this tutorial, we are assuming that you are already aware of the basics of HTML, CSS, and JavaScript. Free Download Full Stack JavaScript Development with MEAN – Value $30. Today's free download from Wccftech Deals offers you to get Full Stack JavaScript Development with MEAN e-book for absolutely free. Originally valued at $30, you can now download this ebook for free. This ebook is designed to help intermediate-level web designers and developers with previous experience with HTML, CSS, and JavaScript. Full Stack JavaScript Development with MEAN (free eBook - $30 value) With modern tools, it is possible to create production-grade applications using only JavaScript, HTML, and CSS. The combination of MongoDB, Express, AngularJS, and Node.js, all JavaScript technologies, has become so popular that it’s been dubbed the MEAN stack. This book will explore the MEAN stack in detail. We will begin by covering Node.js, as it will lay the groundwork for all of our server-side work.
    [Show full text]
  • Emscripten: an LLVM to Javascript Compiler
    Emscripten: An LLVM to JavaScript Compiler Alon Zakai Mozilla What? Why? Compiling to JavaScript ● The web is everywhere – PCs to iPads – No plugins, no installation required – Built on standards ● The web runs JavaScript Existing Compilers to JavaScript ● Google Web Toolkit: Java (Gmail, etc.) ● CoffeeScript ● Pyjamas: Python ● SCM2JS: Scheme ● JSIL: .NET bytecode ● (and many more) ● But C and C++ are missing! Emscripten ● Enables compiling C and C++ into JavaScript ● Written in JavaScript ● Open source http://emscripten.org https://github.com/kripken/emscripten Demos! ● Bullet ● SQLite ● Python, Ruby, Lua ● Real-world code – Large, complex codebases ● Manual ports exist – Typically partial and not up to date The Big Picture C or C++ LLVM Bitcode JavaScript Low Level Virtual Machine (LLVM) ● A compiler project (cf. GCC) ● Intermediate Representation: LLVM bitcode – Very well documented – Great tools ● Much easier to compile LLVM bitcode than compile C or C++ directly! How? Code Comparison #include <stdio.h> int main() { printf(“hello, world!\n”); return 0; } Code Comparison @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 define i32 @main() { entry: %retval = alloca i32, align 4 call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) store i32 0, i32* %retval ret i32 %retval } Code Comparison define i32 @main() { function _main() { entry: %retval = alloca i32, var _retval; align 4 call i32 (i8*, ...)* _printf (..); @printf (..) store i32 0, i32* _retval = 0; %retval ret
    [Show full text]
  • Assignment of Master's Thesis
    ASSIGNMENT OF MASTER’S THESIS Title: WebAssembly Approach to Client-side Web Development using Blazor Framework Student: Bc. Matěj Lang Supervisor: Ing. Marek Skotnica Study Programme: Informatics Study Branch: Web and Software Engineering Department: Department of Software Engineering Validity: Until the end of summer semester 2019/20 Instructions The majority of applications we use every day shifted from the desktop to the web. And with this transition, there was an explosion of approaches to the client-side development. The most recent advancement is a WebAssembly technology which allows executing low-level code in a web browser. A goal of this thesis is to create a proof-of-concept application using this technology and evaluate its strengths and weaknesses. Steps to take: Review the WebAssembly technology and the Blazor framework. Compare Blazor to the state-of-the-art client-side web development approaches. Design and create a proof-of-concept application in Blazor. Evaluate Blazor's strengths and weaknesses and its readiness to develop modern web applications. References Will be provided by the supervisor. Ing. Michal Valenta, Ph.D. doc. RNDr. Ing. Marcel Jiřina, Ph.D. Head of Department Dean Prague December 10, 2018 Czech Technical University in Prague Faculty of Information Technology Department of Web and Software Engineer- ing Master's thesis WebAssembly Approach to Client-side Web Development using Blazor Framework Bc. MatˇejLang Supervisor: Ing. Marek Skotnica 7th May 2019 Acknowledgements In this place I want to thank Bc. Katerina Cern´ıkov´aandˇ Mgr. Jakub Klement for language corrections. I want to thank my master thesis supervisor - Ing. Marek Skotnica for his patience and advice.
    [Show full text]
  • Learning React Functional Web Development with React and Redux
    Learning React Functional Web Development with React and Redux Alex Banks and Eve Porcello Beijing Boston Farnham Sebastopol Tokyo Learning React by Alex Banks and Eve Porcello Copyright © 2017 Alex Banks and Eve Porcello. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/insti‐ tutional sales department: 800-998-9938 or [email protected]. Editor: Allyson MacDonald Indexer: WordCo Indexing Services Production Editor: Melanie Yarbrough Interior Designer: David Futato Copyeditor: Colleen Toporek Cover Designer: Karen Montgomery Proofreader: Rachel Head Illustrator: Rebecca Demarest May 2017: First Edition Revision History for the First Edition 2017-04-26: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781491954621 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Learning React, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
    [Show full text]
  • Typescript Language Specification
    TypeScript Language Specification Version 1.8 January, 2016 Microsoft is making this Specification available under the Open Web Foundation Final Specification Agreement Version 1.0 ("OWF 1.0") as of October 1, 2012. The OWF 1.0 is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. TypeScript is a trademark of Microsoft Corporation. Table of Contents 1 Introduction ................................................................................................................................................................................... 1 1.1 Ambient Declarations ..................................................................................................................................................... 3 1.2 Function Types .................................................................................................................................................................. 3 1.3 Object Types ...................................................................................................................................................................... 4 1.4 Structural Subtyping ....................................................................................................................................................... 6 1.5 Contextual Typing ............................................................................................................................................................ 7 1.6 Classes .................................................................................................................................................................................
    [Show full text]
  • Typescript-Handbook.Pdf
    This copy of the TypeScript handbook was created on Monday, September 27, 2021 against commit 519269 with TypeScript 4.4. Table of Contents The TypeScript Handbook Your first step to learn TypeScript The Basics Step one in learning TypeScript: The basic types. Everyday Types The language primitives. Understand how TypeScript uses JavaScript knowledge Narrowing to reduce the amount of type syntax in your projects. More on Functions Learn about how Functions work in TypeScript. How TypeScript describes the shapes of JavaScript Object Types objects. An overview of the ways in which you can create more Creating Types from Types types from existing types. Generics Types which take parameters Keyof Type Operator Using the keyof operator in type contexts. Typeof Type Operator Using the typeof operator in type contexts. Indexed Access Types Using Type['a'] syntax to access a subset of a type. Create types which act like if statements in the type Conditional Types system. Mapped Types Generating types by re-using an existing type. Generating mapping types which change properties via Template Literal Types template literal strings. Classes How classes work in TypeScript How JavaScript handles communicating across file Modules boundaries. The TypeScript Handbook About this Handbook Over 20 years after its introduction to the programming community, JavaScript is now one of the most widespread cross-platform languages ever created. Starting as a small scripting language for adding trivial interactivity to webpages, JavaScript has grown to be a language of choice for both frontend and backend applications of every size. While the size, scope, and complexity of programs written in JavaScript has grown exponentially, the ability of the JavaScript language to express the relationships between different units of code has not.
    [Show full text]
  • Webassembly a New World of Native Exploits on the Web Agenda
    WebAssembly A New World Of Native Exploits On The Web Agenda • Introduction • The WebAssembly Platform • Emscripten • Possible Exploit Scenarios • Conclusion Wasm: What is it good for? ● Archive.org web emulators ● Image/processing ● Video Games ● 3D Modeling ● Cryptography Libraries ● Desktop Application Ports Wasm: Crazy Incoming ● Browsix, jslinux ● Runtime.js (Node), Nebulet ● Cervus ● eWASM Java Applet Joke Slide ● Sandboxed ● Virtual Machine, runs its own instruction set ● Runs in your browser ● Write once, run anywhere ● In the future, will be embedded in other targets What Is WebAssembly? ● A relatively small set of low-level instructions ○ Instructions are executed by browsers ● Native code can be compiled into WebAssembly ○ Allows web developers to take their native C/C++ code to the browser ■ Or Rust, or Go, or anything else that can compile to Wasm ○ Improved Performance Over JavaScript ● Already widely supported in the latest versions of all major browsers ○ Not limited to running in browsers, Wasm could be anywhere Wasm: A Stack Machine Text Format Example Linear Memory Model Subtitle Function Pointers Wasm in the Browser ● Wasm doesn’t have access to memory, DOM, etc. ● Wasm functions can be exported to be callable from JS ● JS functions can be imported into Wasm ● Wasm’s linear memory is a JS resizable ArrayBuffer ● Memory can be shared across instances of Wasm ● Tables are accessible via JS, or can be shared to other instances of Wasm Demo: Wasm in a nutshell Emscripten ● Emscripten is an SDK that compiles C/C++ into .wasm binaries ● LLVM/Clang derivative ● Includes built-in C libraries, etc. ● Also produces JS and HTML code to allow easy integration into a site.
    [Show full text]
  • The Journey of Visual Studio Code
    The Journey of Visual Studio Code Erich Gamma Envision new paradigms for online developer tooling that will be as successful as the IDE has been for the desktop 2012 2011 Eat your own dogfood hp 2011 2012 2012 2013 Meanwhile Microso; Changes Run on Windows Run everywhere Edit in Visual Studio Use your favorite editor Black box compilers Open Language Service APIs Proprietary Open Source Hacker News: Microso “Hit List” h@ps://hn.algolia.com/?query=MicrosoH Pivot or Persevere? Visual Studio A tool that combines the simplicity of a code editor withCode what developers need for the core code-build-debug-commit cycle editor IDE lightweight/fast project systems keyboard centered code understanding file/folders debug many languages integrated build many workflows File>New, wizards designers lightweight/fast ALM integraon file/folders with project conteXt plaorm tools many languages ... keyboard centered code understanding debug task running Inside Visual Studio Code – OSS in AcGon Electron, Node TypeScript Monaco Editor It’s fun to program in JavaScript Compensating patterns for classes, modules and namespaces. Refactoring JavaScript code is difficult! Code becomes read only Defining and documentation of APIs is difficult. Type information in comments are not checked TypeScript OpVonal stac types – be@er tooling: IntelliSense, Refactoring Be@er APIs docs More safety delete this.markers[range.statMarkerId]; // startMarkerId Use features from the future (ES6, ES7) today Growing the Code VS Code Preview – April 2015 Extensions Eclipse Everything is…
    [Show full text]
  • Javascript to Webassembly Cross Compiler Studienarbeit
    JavaScript to WebAssembly Cross Compiler Studienarbeit Abteilung Informatik Hochschule für Technik Rapperswil Herbstsemester 2018 Autoren: Matteo Kamm, Mike Marti Betreuer: Prof. Dr. Luc Bläser Projektpartner: Institute for Networked Solutions Inhaltsverzeichnis 1 Abstract 3 2 Einführung 4 2.1 Ausgangslage . .4 2.2 Übersicht . .5 2.2.1 Beispiel . .6 2.3 Struktur des Berichts . .7 3 Language Set 8 3.1 Grundsatz des Subsets . .8 3.2 Typen . .9 3.3 Unterstützte Sprachkonstrukte . .9 4 Cross Compilation 11 4.1 Typinferenz . 11 4.2 Template-Based Code Generation . 11 4.2.1 Unäre Operatoren . 12 4.2.2 Binäre Operationen . 12 4.2.3 Expression Statements . 13 4.2.4 Arrayzugriffe . 13 4.3 Control Flow . 15 4.3.1 Block Statement . 15 4.3.2 Branching . 15 4.3.3 While-Loop . 17 4.3.4 For-Loop . 19 4.4 Variablen-Allokation . 19 4.5 Funktionsaufrufe . 20 5 Laufzeitunterstützung 21 5.1 Prüfen der Funktionssignatur . 21 5.2 Kopieren der Array Parameter . 21 5.3 Konvertieren des zurückgegebenen Resultats . 21 5.4 Out Parameter . 21 5.5 Speicher . 22 5.5.1 Import . 22 5.5.2 Export . 22 6 Auswertung 23 6.1 Testfälle . 23 6.2 Setup . 23 6.3 Resultate . 24 6.3.1 Speedup . 24 6.3.2 Varianz . 26 6.3.3 Vergleich zu C++ . 27 6.3.4 Webpack Development Modus . 28 6.4 Fazit . 28 7 Schlussfolgerung 29 7.1 Ausblick . 29 1 Anhang 30 A Erläuterung Language Set 30 A.1 Typen . 30 A.2 Numerische Erweiterung . 30 A.3 Abweichungen der binären Operatoren zu JavaScript .
    [Show full text]
  • The Complete Beginner's Guide to React
    The Complete Beginner’s Guide to React By Kristen Dyrr Software Engineer and Web Developer This book is brought to you by Zenva - Enroll in our Full-Stack Web Development Mini-Degree to go from zero to Full-Stack engineer. © Zenva Pty Ltd 2018. All rights reserved Table of Contents Chapter 1: Beginner’s Guide to React.js, With Examples Download the source code Learn React online Tutorial requirements Downloading React and getting started Why React is better with JSX Understanding React components React component states How to use props Organizing your interface Chapter 2: Form Validation Tutorial with React.JS Download the source code Tutorial requirements Getting started with the tutorial Setting up for form submission Creating abstract form elements Creating input fields Chapter 3: How to Submit Forms and Save Data with React.js and Node.js Download the tutorial files Tutorial requirements Making revisions to a React user interface Displaying new data from everyone Submitting form data Emptying fields on form submission Saving data to the server Chapter 4 Creating a Crossword Puzzle game with React.JS Download the source code Tutorial requirements Intro to JSFiddle Downloading React Defining Components Rendering Components Populating Props Populating Properties in the Game Composing Components Events Forms This book is brought to you by Zenva - Enroll in our Full-Stack Web Development Mini-Degree to go from zero to Full-Stack engineer. © Zenva Pty Ltd 2018. All rights reserved Chapter 1: Beginner’s Guide to React.js, With Examples React.js is a JavaScript library that was created by Facebook. It is often thought of as the “view” in a model-view-controller (MVC) user interface.
    [Show full text]
  • Hi, My Name Is Chad Ausen, Technical Director at IMVU, and Today We're Go
    Hi, my name is Chad Aus0n, technical director at IMVU, and today we’re going to talk about a library we’ve developed for connec0ng C++ and JavaScript with Emscripten. 1 2 IMVU is an online social plaorm where you can sign up, dress up an avatar, and meet people from all around the world. We offer other ac0vi0es such as games as well. 3 The content in our world is created by our customers, and to our knowledge, we have the largest catalog of 3D virtual goods on the Internet. 4 We currently offer a downloadable applicaon for Windows and Mac. Windows and Mac are great plaorms, but in recent years, other plaorms have grown to prominence. We’d like our content available everywhere: mobile plaorms, desktop, server-side renderers, and even the web browser! For almost all plaorms, it’s obvious that C++ is a great choice for the core engine. However, our big ques0on was, what about the web browser? In 2011, I benchmarked an upcoming tool called Emscripten and was quite impressed. 5 Emscripten works very well in prac0ce, so the implicaon is that C++ is the portable, high-performance language EVERYWHERE. 6 Here is our Emscripten applicaon running in Firefox. UI is HTML and CSS. Chat over WebSockets, graphics in WebGL. 7 asm.js is the subset of JavaScript that can be stacally compiled into machine code. More informaon at h`p://asmjs.org/ 8 The C heap is stored in an ArrayBuffer in JavaScript. One con0guous blob of memory. This memory is indexed by eight different typed array views that alias each other.
    [Show full text]
  • Choosing the Right Javascript Framework for Your Next Web
    Choosing the Right JavaScript Framework for Your Next Web Application by Brandon Satrom © 2017 Progress. All Rights Reserved. All Rights © 2017 Progress. 2018 WHITEPAPER Table of Contents The Current State of Web Frameworks / 3 Tooling Considerations / 22 Evaluation Criteria / 5 UI & Component Libraries / 22 Ecosystem Considerations / 7 IDE & Tooling Support / 23 History & Longevity / 7 Companion & CLI Tools / 24 Popularity / 9 Enterprise Considerations / 26 Corporate Support / 11 Licensing / 26 Community & Ecosystem / 12 Support & Upgrade Paths / 27 Framework Considerations / 13 Security / 29 Getting Started Experience / 13 Talent Pool & Resources / 30 Skill Requirements / 15 Making a Choice / 33 Completeness of Offering / 17 Size & Performance / 18 Beyond the Browser Options / 21 © 2018 Progress. All Rights Reserved. All Rights © 2018 Progress. Progress / Kendo UI 2 The state of web application development has changed drastically in the past ten years. These changes have been spurred on by greater bandwidth for many, more powerful and feature-rich browsers. The result is a thriving web ecosystem with sites, apps and experiences that would have been hard to imagine a decade ago. And yet, for many developers, this ecosystem often feels like a bazaar, stuffed with libraries and frameworks that do anything and everything one could imagine. For every need there are a dozen options to choose from, and with new stalls (libraries) opening every day, it’s no wonder many of us pine for the days when starting a new project was as simple as dropping jQuery in a script tag. The Current State of Web Frameworks There’s no doubt that the web has grown in complexity, and our development tooling options have grown along with it.
    [Show full text]