Giter Club home page Giter Club logo

taxsim.js's Introduction

taxsim.js

tooling to generate a JS/WebAssembly version of NBER TAXSIM

Uses the gfortran/dragonegg toolchain from StarGate01/Full-Stack-Fortran to convert taxsim.f from fixed-mode f90 fortran into LLVM bitcode, then uses emscripten to convert LLVM bitcode into a JS/WASM wrapper.

Note: taxsim.f is not included, and must be obtained separately from the NBER.

converting taxsim.f to WASM

$ make taxsim.js

the Makefile uses docker and the stargate01/f90wasm container to compile our fortran code. see Dockerfile for the build commands.

using taxsim.js

function taxsim(input: String): Promise
function taxsim(input: Object): Promise
let input = "taxsimid,mstat,year,ltcg,idtl\n1,2,1970,100000,5"
let output = await taxsim(input)
let output = await taxsim({
  year: 2020,
  mstat: 2,
  ltcg: 100000
})

in a browser

see demo.html (source) or the live version

via node.js

bash:

$ printf "year,mstat\n2020,2" | node -e "require('./taxsim.js')()"
$ node --input-type=module -e "import taxsim from './taxsim.js'; console.log(await taxsim({year:2020,mstat:2}))"

powershell:

> "year,mstat`n2020,2" | node -e "require('./taxsim.js')()"

via libv8, or d8

$ printf "year,mstat\n2020,2\n" | d8 -e "load('./taxsim.js'); taxsim()"
$ d8 -e "load('./taxsim.js'); function quit(){}; taxsim({year:2020,mstat:2}).then(console.log).catch(console.log)"

projects using taxsim.js

taxsim.js's People

Contributors

tmm1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.