Skip to content

Demo benchmarking JS middleware against middleware refracted through C++

License

Notifications You must be signed in to change notification settings

BufoOS/refractile-example

 
 

Repository files navigation

refractile example

This repo was developed to test and showcase the functionality of the refractile npm package.

Overview

The app itself benchmarks Express middleware written using C++ and Go with JavaScript using equivalent implementations of the same algorithm that calculates the nth value of the fibonacci sequence.

Beyond its functionality, it also showcases exactly how refract coordinates polyglossic resources directly within a single project's backend. The two example languages — C++ and Go —— also serve as descriptive examples of working with compilers that generate glue code and those that do not, requiring developers to come up their own.

To read more about WebAssembly concepts, like glue code, you can find a helpful description in this post.

For instance, the wasm-src folder, you can find:

  • source code written in C++
  • source code written in Go
  • Gluecode for connecting the Go Wasm module to JS

In refractile.config.js, you'll see how to work with these files to create two modules — fibonacci, which is built with C++, and — fibonacciGo, which is built with Go.

Dependencies

To run this project, make sure that you have the following dependencies installed:

Running prjoect

After installing the above dependencies, install node packages by running npm i

Then run the command npm start to build the front-end, compile the WebAssembly modules, and start the server.

About

Demo benchmarking JS middleware against middleware refracted through C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 73.6%
  • JavaScript 18.6%
  • C++ 3.3%
  • Go 2.7%
  • HTML 0.8%
  • Makefile 0.7%
  • CSS 0.3%