Add preliminary support for running code challenges written in Python, Rust, and Golang. [1]
This relies on an independent backend API which will handles compiling and executing challenges written in other programming languages. The repo for this backend is here: https://github.com/pairwise-tech/pairwise-code-runner-api.
This backend code runner is deployed using a Docker image which is packaged up with all of the utilities it needs to execute these other languages, e.g. cargo, python3, go, etc. It then executes these using Node's exec method via the shelljs library and parses the results to determine if the tests passed or failed, and returns this result back to the client.
The backend is built and deployed independently from the main Pairwise application. It's deployed via Google App Engine.
Implement keyboard arrow controls for navigating around the NavigationOverlay when it is open.
Update Admin dashboard to render pull request diffs for new courses.
Various other fixes and improvements.
Notes:
[1] Regarding alternative languages, supporting a few popular ones like, for instance, Rust, Python, Go, or even Bash might be interesting. You could have a course on Rust for example which walks through all of the language basics in like 50-100 challenges, and then concludes with maybe 5 projects (e.g. command line tool, command line game, server/API, etc.). Something like that would definitely be enough to get someone new off the ground in a new language.
[2] Like the JS challenges, this is not a perfect runtime environment. However, I think it is workable enough to introduce basic concepts and get some hands-on working practice with these languages.
Todo:
[x] Complete the multi course refactoring mentioned above.
[x] ~Improve the challenge execution to separate log output from the user's code and log output from the test environment.~ Separate log output for preview and test.
[x] Dockerize the test execution server and deploy it using Google App Engine.
[x] Add caching for the backend, e.g. code.replace(/\s/g, "") -> result to speed up future requests. Compiling Rust code on the fly takes some time?
[x] Complete a few introductory challenges in the new languages.
[x] Check workspace view on mobile for new challenges.
This PR:
cargo
,python3
,go
, etc. It then executes these using Node'sexec
method via theshelljs
library and parses the results to determine if the tests passed or failed, and returns this result back to the client.NavigationOverlay
when it is open.Notes:
[1] Regarding alternative languages, supporting a few popular ones like, for instance, Rust, Python, Go, or even Bash might be interesting. You could have a course on Rust for example which walks through all of the language basics in like 50-100 challenges, and then concludes with maybe 5 projects (e.g. command line tool, command line game, server/API, etc.). Something like that would definitely be enough to get someone new off the ground in a new language.
[2] Like the JS challenges, this is not a perfect runtime environment. However, I think it is workable enough to introduce basic concepts and get some hands-on working practice with these languages.
Todo:
code.replace(/\s/g, "") -> result
to speed up future requests. Compiling Rust code on the fly takes some time?Demo:
Rust code compiles and completes a challenge:
Compiler errors are pretty readable:
Python intro challenge:
Golang intro challenge: