To Learn a New Language, Read Its Standard Library

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
  • ziglings

    Learn the Zig programming language by fixing tiny broken programs.

    Ziglings [0] is a series of small problems where you solve bugs in Zig code, and I enjoyed working through them. The readme claims "you are not expected to have any prior experience with... C." When I did ziglings I found the most difficult part was adjusting to the type syntax (which I now love).

    I admittedly know C very well, but assuming you already know a language with a C-like syntax (C++, Java, JavaScript, C#, Rust, etc.) most things like functions, control flow, variables, statements map to Zig with only small syntactic differences.

    One thing that may be difficult to learn not knowing C is working with strings, since they are just arrays of bytes. Most other languages have a string type, but Zig is much more like C in that strings are null-terminated fixed-sized arrays of bytes.

    [0] https://github.com/ratfactor/ziglings

  • CPython

    The Python programming language

    I meant actual code from their library

    So https://github.com/python/cpython/tree/main/Python

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • libcxx

    Project moved to: https://github.com/llvm/llvm-project

    Here is a basic structure implemented in C++:

    https://github.com/llvm-mirror/libcxx/blob/master/include/ve...

    I would not recommend anyone ever look through that as a way to learn C++. Heck just something as basic as a struct that stores two member variables is a horror show in C++:

    https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b501...

  • node

    Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

    I'll make no comment on how masterful/well written this is, but these are the most used libraries in the JS world by far margin: https://github.com/nodejs/node/tree/master/lib

  • pacman.zig

    Simple Pacman clone written in Zig.

    My advice would be: to learn a new language, start writing some non-trivial projects in it (a few thousand lines of code or so). In some languages (like Python), the standard library is the actually important feature, in other languages (like C), it better to mostly ignore the stdlib. Example: I started learning Zig by writing a Pacman clone (https://github.com/floooh/pacman.zig) and a home computer emulator (https://github.com/floooh/kc85.zig), the Pacman clone doesn't use any Zig stdlib features at all, and the emulator only minimally for parsing command line args and loading data from files.

    Zig's stdlib is much more useful than C's, but it's still entirely possible to write useful programs without it and instead focus on learning Zig's language features first.

    But on the other extreme, the whole point why I learned Python was its "batteries included" standard library.

  • kc85.zig

    A KC85 emulator written in Zig

    My advice would be: to learn a new language, start writing some non-trivial projects in it (a few thousand lines of code or so). In some languages (like Python), the standard library is the actually important feature, in other languages (like C), it better to mostly ignore the stdlib. Example: I started learning Zig by writing a Pacman clone (https://github.com/floooh/pacman.zig) and a home computer emulator (https://github.com/floooh/kc85.zig), the Pacman clone doesn't use any Zig stdlib features at all, and the emulator only minimally for parsing command line args and loading data from files.

    Zig's stdlib is much more useful than C's, but it's still entirely possible to write useful programs without it and instead focus on learning Zig's language features first.

    But on the other extreme, the whole point why I learned Python was its "batteries included" standard library.

  • STL

    MSVC's implementation of the C++ Standard Library.

    (Hint: Empty base class optimization.)

    For reference: https://github.com/microsoft/STL/blob/main/stl/inc/xtree

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • learnxinyminutes-docs

    Code documentation written as code! How novel and totally my idea!

  • julia

    The Julia Programming Language

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts