Skip to content

Modify the Programming Language

Thomas Tan edited this page May 10, 2021 · 8 revisions

By default, when you install cadet-frontend, npm uses the latest version of js-slang available here. However, you can change the programming language implementation that is used by the Frontend (for example, in the Playground), by giving it a different js-slang distribution, possibly one that you modified.

In order to run your own cadet-frontend development version using your own language implementation, do the following:

  • Follow the cadet-frontend Installation README
  • Change your frontend if needed; build the frontend if needed
  • The app should use the current master copy of js-slang, automatically put in the node_modules folder/directory by npm
  • To modify js-slang, proceed to install yarn - this must be used to process js-slang into a proper TypeScript module
  • Install js-slang - preferably in another folder/directory
  • Change your js-slang if needed
  • Build js-slang using yarn build
  • Copy over folder js-slang/dist to cadet-frontend/node_modules/js-slang/dist (replace the old folder entirely)
    • If you know your way around your system, symlinks and hardlinks may work for you.
  • Start frontend as per normal, using npm start

To change the language implementation in your own production frontend, fork js-slang and use package.json in cadet-frontend to point to your fork.