Giter Club home page Giter Club logo

szymongib / languages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codecrafters-io/languages

0.0 0.0 0.0 553 KB

Powers multi-language support for CodeCrafters challenges

Home Page: https://codecrafters.io/

License: MIT License

Shell 8.24% JavaScript 6.93% Ruby 27.01% Python 6.18% C 2.85% PHP 1.28% Java 1.19% Haskell 0.75% Clojure 1.63% Go 8.08% C# 8.00% Rust 10.25% Nim 0.53% Elixir 1.18% Kotlin 0.69% Crystal 0.58% Swift 0.02% Makefile 4.62% Dockerfile 9.99%

languages's Introduction

This repository powers multiple language support for CodeCrafters challenges.

Table of Contents

Objective

The language one uses for a CodeCrafters challenge is an integral part of the challenge experience. A few questions to think about:

  • Is it easy to setup locally?
  • Does the standard library have all required functions to complete the challenge?
  • Are there any tricky areas where people are likely to get stuck?

We'll tackle these problems through a combination of:

  • Sample code to get started
  • Troubleshooting advice in the README
  • Helpful language-specific hints in stages wherever applicable

Components

For a language to be supported in a specific challenge, we need the following things in place:

  • A Dockerfile, which'll be used to build the container where code is evaluated.
  • A starter repo, like this one.

Dockerfile

You'll need one Dockerfile per language version supported. These'll be placed under the dockerfiles/<course> folder.

The Dockerfile needs to setup the language + all required dependencies, and make the tester executable available at /bin/tester.

Wherever possible, utilize Docker's build cache.

Starter Repo

The starter repo needs to contains the following files:

  • codecrafters.yml
  • README.md
  • An executable script / entry point, based on the challenge. your_docker.sh for Docker, your_git.sh for Git etc.
  • An app folder, that contains boilerplate code that the user will build upon. This code must also include a section that can be commented out to pass the first stage.

Any language-specific code must adhere to common conventions or style guides for that language.

Since starter repos for different languages are likely to have a lot of similar code, we use templates to create these. The raw files are under starter_templates, the compiled versions are under compiled_starters.

Constraints

Fast build times

Slow build times drastically affect the codecrafters challenge experience. Building an image for a language and executing the starter should be snappy - ideally under 1 second.

To achieve this, we use Docker's build caching.

Easy to start

The experience of downloading a repository, running it locally, receiving results via a git push etc. can be pretty daunting to a new user who isn't used to how CodeCrafters works.

We make this easier by adding a concise step-by-step README, and also including all code needed to pass the first stage.

Contributing

Thank you for considering contributing to this project!

Here's a detailed guide on Adding support for a new language. If you need help, feel free to ask in the Discord server.

languages's People

Contributors

awong503 avatar bert2 avatar bobbyrward avatar byarr avatar dependabot[bot] avatar garimaaroraa avatar goodhamgupta avatar jdrupal-dev avatar na-null avatar nixypanda avatar rohitpaulk avatar sarupbanskota avatar smaccombie avatar tapankavasthi 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.