Learn X in Y Minutes Documentation

repository·master·Indexed 9 days ago

https://github.com/adambard/learnxinyminutes-docs

A collection of 'whirlwind tour' programming language and tool tutorials presented as valid, commented code snippets. This set includes guides for the Asynchronous Module Definition (AMD) API and RequireJS, AngularJS (including directives, expressions, and $http service), and Ansible orchestration.

Tokens
221.3K
Snippets
900
Records
1K
Agent score
96%

What's inside Learn X in Y Minutes

  1. What is Zig and how does it compare to C

    master

    Zig is a programming language designed to be a replacement for C. It aims to provide low-level control while fixing many of C's undefined behaviors (UBs).

    Key differences from C include:

    • Improved Syntax: Reduced ambiguity compared to C.
    • Namespaces: Native support for namespaces.
    • Error Handling: Uses try and catch mechanisms that are efficient and optional.
    • Safer Pointers: The type system distinguishes between pointers to single values and multiple values. Slices (a structure containing a pointer and a runtime-known size) are the preferred way to handle memory access.
    • Enhanced Types: Enumerations, structures, and unions can contain functions.
    • SIMD Support: Simple access to SIMD operations for vector math.
    • Low-level Features: Support for features like packed structures.
    • Standard Library: Includes an extensive collection of data structures and algorithms.
    • Built-in Cross-compilation: Supports cross-compilation to any OS or architecture by default without external dependencies, utilizing different libc implementations to ease the process.
  2. What is the Fish shell?

    master

    Fish (friendly interactive shell) is a modern shell with a syntax that is independent of both the Bourne-Shell and the C-Shell. It is designed to provide many modern features out-of-the-box without requiring additional plugins like oh-my-zsh.

    Key features include:

    • Autosuggestions
    • 24-bit color support
    • Man Page Completions (automatic parsing of man pages for command options)
    • Web-based option configuration (when a GUI is installed)
  3. TOML Overview and Basic Syntax

    master

    TOML (Tom's Obvious, Minimal Language) is a data serialization language designed for minimal configuration files. It is intended to be more human-friendly than JSON and simpler than YAML, mapping unambiguously to a hash tables.

    Basic Rules:

    • The primary building block is the key/value pair.
    • The key, equals sign, and value must be on the same line (though values can span multiple lines).
    • Comments start with #.
    key = "value"
    # This is a comment
  4. LiveScript Syntax and Basic Values

    master

    LiveScript is a functional language that compiles to JavaScript. It uses indentation for blocks and whitespace for function application.

    Key Syntax Rules:

    • Comments: Use # for single-line comments. Use C-style /* ... */ for multi-line comments (these are preserved in JS output).
    • Lack of Value: Use the void keyword (safer than JS undefined) or null.
    • Booleans: Supports true/false and aliases on/off or yes/no.
    • Numbers: Double-precision floats. You can use underscores for readability (e.g., 12_344) and letter suffixes (e.g., 123km), which are ignored by the compiler.
    • Strings: Immutable sequences. Supports single quotes, double quotes, and triple-quoted multi-line strings. Use backslash notation (e.g., \keyword) to encode keywords.
    • Arrays: Can be defined with * (indented), square brackets [], or angle brackets <[ ... ]> for space-delimited strings.
    void            # same as `undefined` but safer
    null            # no valid value
    
    true
    false
    on
    off
    
    12_344km        # underscores and suffixes ignored
    
    "String"
    """Multi-line
       string"""
    \keyword        # => 'keyword'
    
    # Array styles
    fruits =
      * \apple
      * \orange
    
    fruits = [ \apple, \orange ]
    
    fruits = <[ apple orange pear ]>
  5. PowerShell Overview and Installation

    master

    PowerShell is a cross-platform task automation solution consisting of a command-line shell, a scripting language, and a configuration management framework. It runs on Windows, macOS, and Linux.

    • Windows PowerShell (v5.1): Ships with Windows and runs on the .NET Framework.
    • PowerShell 7.x: The modern, open-source edition built on .NET.
    • Executable Name: Starting with PowerShell 6+, the executable is pwsh.exe (previously powershell.exe).

    Unlike Bash, PowerShell primarily manipulates objects rather than plain text.

  6. M (MUMPS) Language Overview

    master

    M (or MUMPS) is a procedural language with a built-in NoSQL hierarchical key-value database. It is optimized for high-throughput transaction processing and real-time applications, commonly used in healthcare and finance.

    A key feature is that accessing local variables (in-memory) and globals (persistent storage) uses the same syntax. The database is organized into tree structures called globals, which are sparse data structures similar to JSON.

  7. SmallBASIC Language Overview

    master

    SmallBASIC is a fast, easy-to-learn BASIC interpreter designed for everyday calculations, scripting, and prototyping. It features structured programming syntax and includes built-in support for:

    • Trigonometric, matrices, and algebra functions
    • A powerful string library
    • System, sound, and graphics commands
    • JSON support

    Supported platforms include Linux (SDL2), Windows (SDL2), and Android (NDK).

  8. CoffeeScript Syntax Overview

    master

    CoffeeScript is a language that compiles one-to-one into JavaScript. It aims to produce readable, pretty-printed JavaScript that works in any JS runtime. It uses syntax inspired by modern languages like Ruby and Python.

    Key syntax features include:

    • Comments: Use # for single-line comments. Use ### for block comments (which compile to /* ... */ in JavaScript).
    • Assignment: Variables are assigned using name = value (compiles to var name = value).
    • Conditions: Supports inline conditional assignment using value if condition.
    • Existence: The ? operator (e.g., elvis?) checks if a variable is defined and not null.
    • Ranges: Use [start..end] to create a list of numbers.
    • Splats: Use ... in function parameters to capture remaining arguments into an array.
    # Single line comment
    ###
    Block comment
    ###
    
    number = 42
    number = -42 if opposite
    
    list = [1..5]
    
    race = (winner, runners...) ->
      print winner, runners
  9. Lisp Flavoured Erlang (LFE) Overview

    master

    Lisp Flavoured Erlang (LFE) is a functional, concurrent, general-purpose programming language and a Lisp dialect (Lisp-2). It is built on top of Core Erlang and the Erlang Virtual Machine (BEAM), allowing it to leverage the Erlang ecosystem directly.

    Development Environment

    • Build Tool: Use Rebar3 for managing projects and dependencies.
    • Workflow: Typically developed using a text editor (Emacs is preferred) alongside a REPL (Read Evaluate Print Loop) for live, interactive exploration of the system.
    • Ecosystem: Libraries from the Erlang ecosystem can be used directly.