Presentation: AutoCAD & WebAssembly: Moving a 30 Year Code Base to the Web
Share this on:
What You’ll Learn
-
Learn how AutoDesk took a thirty year old code base and was able to port it to the web using WebAssembly.
-
Understand how they solved changes around build time, shared memory access, and Synchronous/Asynchronous code.
-
Hear tips and tricks building with WebAssembly today.
Abstract
AutoCAD is a computer-aided design desktop software application that was first released in 1982. With the advent of the internet age, there comes a need to extend AutoCAD's capabilities to the browser. However, the massive, complex, and constantly changing code base makes it impractical to rewrite everything in JavaScript. Therefore, the question remains: Can we really find an elegant way to leverage AutoCAD on the Web?
Enter WebAssembly! A compilation target for languages such as C/C++ that runs on modern browsers. For the first time in history, legacy code bases can now run on the Web at near native speed with the help of the Emscripten compiler. Nevertheless, there are mismatches between the programming paradigms of the desktop and Web world which greatly complicate the porting effort. Some of these include the use of synchronous blocking calls and shared memory on the desktop.
The goals of this session are two-fold. Firstly, the solutions for overcoming the above challenges will be explored in the context of existing Web APIs. Secondly, both the build time and performance implications of porting such a large code base will be addressed as well. As such, this talk will be helpful for developers who aspire to reuse their legacy software on the Web.
Your talk is about porting AutoCAD on the desktop to a browser with WebAssembly. How do you plan to go about the talk?
I plan to start my talk with how we arrived at our current technology stack (which is Emscripten and WebAssembly Binaryen) by talking about our journey from trying flash, JavaScript, asm.js, and, finally, getting to WebAssembly. After that, I would like to highlight some of the peculiarities of the large and constantly changing AutoCAD codebase that we had to deal with as well.
From there, I’ll talk about some of the challenges we faced with WebAssembly. Things like the larger code size, dealing with build time, and different programming paradigms on the desktop. I will talk about how we used ServiceWorkers and show some architecture diagrams for this, and I will demonstrate underlying memory accessors and dynamic linking example. Finally I will talk about how browser vendors are helping us improve performance.
Can you give me some example of some of the challenges with the different paradigms when dealing with the web vs desktop?
For example, you have synchronous vs asynchronous programming issues on the web. How you handle a blocking call on your desktop code base is very different than on the web. Another is shared memory between threads. Synchronous writes is supported on the desktop because you have shared memory that allows you to share data but you don’t have that on the web. There are also things like performance hits due to underlying memory accessors and lack of support for exceptions.
Are you going to talk about the interaction between javascript and WebAssembly or will you focus mostly on the performance, build time and asynchronous calls?
Emscripten handles most of the interaction between javascript and WebAssembly, so I will not focus on this aspect.
AutoCAD web application runs on a dual thread architecture. My focus will be on the build time and some of the tips and tricks to make it build fast. I will also focus on how we are passing messages from one thread to another.
I will also talk about some of the things that can help in reducing the binary size.
What do you hope a developer will take away from this talk?
I want them to go away with the conviction that it is possible to reuse their legacy apps on the web rather than rewrite code from scratch. I want to give them the practical knowledge on how to go about doing this, including the challenges they will face to make it work. Finally, I hope to pass on some tips and tricks to make things easier.
Similar Talks
Tracks
-
Microservices: Patterns & Practices
Evolving, observing, persisting, and building modern microservices
-
Developer Experience: Level up Your Engineering Effectiveness
Improving the end to end developer experience - design, dev, test, deploy, operate/understand. Tools, techniques, and trends.
-
Modern Java Reloaded
Modern, Modular, fast, and effective Java. Pushing the boundaries of JDK 9 and beyond.
-
Modern User Interfaces: Screens and Beyond
Zero UI, voice, mobile: Interfaces pushing the boundary of what we consider to be the interface
-
Practical Machine Learning
Applied machine learning lessons for SWEs, including tech around TensorFlow, TPUs, Keras, Caffe, & more
-
Ethics in Computing
Inclusive technology, Ethics and politics of technology. Considering bias. Societal relationship with tech. Also the privacy problems we have today (e.g., GDPR, right to be forgotten)
-
Architectures You've Always Wondered About
Next-gen architectures from the most admired companies in software, such as Netflix, Google, Facebook, Twitter, Goldman Sachs
-
Modern CS in the Real World
Thoughts pushing software forward, including consensus, CRDT's, formal methods, & probalistic programming
-
Container and Orchestration Platforms in Action
Runtime containers, libraries, and services that power microservices
-
Finding the Serverless Sweetspot
Stories about the pains and gains from migrating to Serverless.
-
Chaos, Complexity, and Resilience
Lessons building resilient systems and the war stories that drove their adoption
-
Real World Security
Practical lessons building, maintaining, and deploying secure systems
-
Blockchain Enabled
Exploring Smart contracts, oracles, sidechains, and what can/cannot be done with blockchain today.
-
21st Century Languages
Lessons learned from languages like Rust, Go-lang, Swift, Kotlin, and more.
-
Empowered Teams
Safely running inclusive teams that are autonomous and self-correcting