Goal
Add fully functioning support for a new programming language to the current course repository.
Procedure
1. Environment Setup
Ensure all necessary tools are installed before proceeding:
- •Install Bun: Run
curl -fsSL https://bun.sh/install | bashand source the shell configuration (e.g.,source ~/.bashrc). - •Install Docker: Ensure Docker is installed and the daemon is running.
- •Install course-sdk: Run
bun installandmake installin the repository root to compile the SDK.
2. Initialization
Execute this SDK command to scaffold the basic directory structure:
course-sdk add-language <LANGUAGE>
3. Pattern Analysis & Implementation
You must ensure the new language follows the exact implementation patterns of existing languages in this course.
- •Read the
starter_templatesdirectory of 2-3 existing working languages (e.g.,starter_templates/go,starter_templates/python) to understand the challenge logic, SDKs, dependencies, and patterns. - •Resolve dependencies for the new language: If existing starters use a vendor SDK (e.g. OpenAI), first check whether that vendor provides an official client for the target language. Use the vendor's official SDK for that language if it exists; only then fall back to a community or "most similar" SDK.
- •Read the newly generated starter file for the target language (in
starter_templates/<LANGUAGE>). - •Edit the target language's source code to implement the necessary boilerplate and "Stage 1" logic.
- •Constraint: Prefer the same vendor's official SDK in the new language. If no official SDK exists for that language, use the most similar community SDK or dependency.
- •Constraint: Keep it minimal and matching the simplicity of other starter templates and don't complicate it with things not present in the other starter templates (e.g. extra functions when others have only one main function)
- •Constraint: Ignore any "DON'T EDIT THIS!" comments in the starter template.
4. The Iteration Loop (Compile & Test)
Repeat this process until tests pass:
- •Compile: Run
course-sdk compile <LANGUAGE>.- •If it fails: Read the error output, analyze the source code, fix the syntax/build error, and retry.
- •Test: Run
course-sdk test <LANGUAGE>. Do not timeout.- •If it fails: Compare the expected output vs. actual output. Check how other languages handle this specific test case. Adjust the code and retry.
5. Final Verification
Once course-sdk test <LANGUAGE> passes, run a final comparison:
- •Check if the code style is clean.
- •Ensure no unnecessary files were created.
- •Confirm the implementation matches the simplicity of other starter templates.