About this project
CodeWorld is an educational programming environment implemented in Haskell. It provides a simple mathematical model for geometric figures, animations, and interactive or multi-player games. The web-based environment aims to support teaching with a zero-setup editor and compiler, easy sharing and cloud storage of projects, and the ability to run programs directly in the browser using GHCJS.
Variants
- CodeWorld (code.world) uses an educational variant of Haskell and libraries designed to support mathematics instruction.
- CodeWorld Haskell (code.world/haskell) targets standard Haskell, so programs can run on the site with GHCJS or be compiled natively using the codeworld-api package and blank-canvas.
- CodeWorld Blocks (code.world/blocks) offers a drag-and-drop interface for younger students; the README notes it still has bugs and is not recommended for use.
Status and support
CodeWorld is described as stable and has been used in schools for years, with a partial list of users in the repository docs. Breaking changes are scheduled between typical U.S. K-12 school semesters to reduce disruption. Google distributes the code but states CodeWorld is not an official Google project and provides no support; questions go to the codeworld-discuss mailing list, and a student-oriented Q&A forum exists at help.code.world.
Getting started
Users can visit code.world directly; no download or installation is required to use the hosted service. The repository is intended for those who want to fork, modify, or contribute to the environment.
Building and deployment
Building and running CodeWorld is described as lengthy but automated by installation scripts in the root directory, working on most Linux distributions including Debian, Ubuntu, RedHat, and CentOS. Steps: change to the project root, run ./install.sh, then ./run.sh, and access the system at localhost:8080. After changes, ./build.sh recompiles CodeWorld itself using previously installed tools and libraries, then ./run.sh starts the server. Docker build and run commands are also documented, though the README says Docker is not yet the recommended development method and the container lacks client ID access, shared NFS mounting, and other setup steps. Stack is noted as unsupported for local builds and does not currently work as a substitute for the shell scripts or Docker.
Authentication
CodeWorld supports Google authentication, local authentication, or running with authentication disabled with reduced functionality. Without authentication, users can write, build, and run code but cannot save or manage projects and folders.
Google authentication requires a Google API key stored in web/clientId.txt; the running instance picks up changes to that file. The README links to Google Cloud documentation for creating a project and an OAuth client ID, and notes this is the mechanism used by the official live site.
Local authentication uses a SQLite3 database, stores only BCrypt password hashes, and uses JWT-based stateless authentication. It is enabled when a codeworld-auth.db file is present in the application root. The codeworld-auth CLI tool manages accounts: init-accounts creates an empty database, create-account creates a user with a randomly generated password and an account status such as Expired, and other subcommands handle updates and deletion. A JWT secret must be generated into codeworld-auth.txt with generate-secret; the server should not expose this secret.
Caveats
On virtual servers, default RAM is often insufficient for GHC because CodeWorld compiles very large Haskell projects during installation. The README suggests creating a 2 GB swap file with dd, mkswap, and swapon; installation may be slow but should succeed, and the swap file can usually be removed after the first server run unless very large programs are intended.
Contributing
Contributing involves agreeing to a Contributor License Agreement, with details in CONTRIBUTING.md. Bugs and formal feature requests go to the GitHub issue tracker.
Comments
0 people shared their preference · Deer Point appears after 10 participants
Sign in to join the discussion.