Skip to content

Add C language support (compiled_lang) #30

Description

@darkn3rd

Add C as a new language in lessons/compiled_lang/, alongside the existing C++/C#/Go/Java/Rust.

Based on cpp/ as the reference (not go/ - C shares C++'s two-stage compile-then-link build model via make, unlike Go/Rust's single-step toolchain compilers), since C and C++ also share the same underlying compiler toolchain:

  • New lessons/compiled_lang/c/ directory: Makefile(.win) (adapted from cpp/Makefile - CC := gcc, CFLAGS := -std=c17 -O2 -Wall, -static-libgcc on Windows for the same DLL-mismatch reason cpp/Makefile already documents, no -static-libstdc++ since C doesn't link libstdc++), Rakefile (imports shared testbox.rake), psakefile.ps1, src/ with one .c file per lesson (~60 files mirroring cpp/src's set, minus anything that's specifically a C++ language feature rather than a general lesson topic), bin//target/ output dirs
  • No new entries needed in Brewfile/choco.config/cygwin_pkgs.txt/msys2_pkgs.txt - confirm the existing C++ toolchain packages (gcc-core/gcc-g++, mingw-w64-x86_64-toolchain, visualstudio2022buildtools w/ VCTools, Homebrew's make + Xcode CLI tools) already provide a working C compiler on every platform, since gcc/clang ship C support alongside C++
  • Add a C entry to the Compiled Languages area in scriptbox/scripts/verify_commands.rb's AREAS
  • lessons/compiled_lang/README.md update

This is a full new-language port (~60 lesson files), so likely worth breaking into smaller PRs rather than one large one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions