WebAssembly & C++ (WORK IN PROGRESS)

  1. The basics of how to use C++
  2. WebASM & C++ for a simple Black-Scholes pricer.

What is a programming language

In one sentence, a programming language is a set of rules and syntax, so that we can translate mathematics and business logic (what we want to achieve), into a format that a computer can understand and do something with.

What is C++

C++ is a programming language created by Bjarne Strousoup (fun fact: he works at Morgan Stanley). It is widely used for quant finance and quant development in hedge funds and banks, and other applications (High Performance Computing, ), due to its speed.

Setup

C++ is a compiled language. What this means is that we first write our C++ code in a text editor, or IDE (Integrated Development Environment), and then it through the compiler, which is a system tool that translates or compiles our C++ code to a format our computer can run as a program. You therefore need:

  • A text editor or IDE, recommended Visual Studio Code
  • A Compiler:
    • Mac - You need to install
    • Windows -

Alternatively, you can install Virtualbox and install a Linux virtual machine

For the second half of the tutorial, we will export the functions we have written in C++ so that it can be used in a website, an online calculator for the ST213 pricing models we have learnt. More specifically, we will use WebAssembly, a new framework that allows for the compiling of C++ to Javascript, a web scripting language (which our browsers can understand).

Next, you need :