An open API service indexing awesome lists of open source software.

https://github.com/rangertaha/langorithms

An Exploration of the Fundamental Building Blocks of Programming Languages
https://github.com/rangertaha/langorithms

bash golang javascript lua python rust typescript

Last synced: 3 months ago
JSON representation

An Exploration of the Fundamental Building Blocks of Programming Languages

Awesome Lists containing this project

README

          

# [Langorithms](https://langorithms.readthedocs.io/en/latest/)

While diverse in syntax and paradigms, programming languages comprise a common set of fundamental building blocks. Here's a breakdown:

## **Syntax**
- **Definition**: Rules that define the structure of valid statements.
- **Examples**: Keywords, symbols, indentation, punctuation.

## **Data Types**
- **Primitive Types**: Integer, Float, Boolean, Character, String.
- **Composite Types**: Arrays, Lists, Tuples, Maps, Sets.
- **User-defined Types**: Classes, Enums, Structs.

## **Variables and Constants**
- **Variables**: Named storage for mutable data.
- **Constants**: Immutable values.

## **Control Structures**
- **Conditional Statements**: `if`, `else`, `switch`.
- **Loops**: `for`, `while`, `do-while`.
- **Break/Continue**: Alter loop execution flow.

## **Functions**
- **Definition**: Reusable blocks of code.
- **Components**: Parameters, Return values, Scope.
- **Variants**: Lambdas, Anonymous Functions, Generators.

## **Object-Oriented Constructs** (Optional)
- **Classes/Objects**: Encapsulation of state and behavior.
- **Inheritance**: Sharing functionality across classes.
- **Polymorphism**: Multiple forms of functions or methods.

## **Memory Management**
- **Static Allocation**: Fixed memory at compile-time.
- **Dynamic Allocation**: Variable memory at runtime.
- **Garbage Collection**: Automatic memory cleanup (optional).

## **Error Handling**
- **Mechanisms**: `try`, `catch`, `finally`, `throw`.
- **Patterns**: Return codes, Exceptions.

## **Input/Output**
- **File I/O**: Read/write to files.
- **Console I/O**: User interaction through the terminal.
- **Network I/O**: Communication over protocols (HTTP, TCP).

## **Concurrency** (Optional)
- **Threads/Processes**: Parallel execution.
- **Locks/Mutexes**: Synchronization.
- **Async/Await**: Non-blocking operations.

## **Libraries/Modules**
- **Built-in Libraries**: Standard functionality.
- **Third-party Modules**: Extensible components.
- **Import Mechanisms**: `import`, `require`, `use`.

## **Compilation and Interpretation**
- **Compilers**: Transform code to machine language.
- **Interpreters**: Execute code line-by-line.
- **Hybrid**: Bytecode execution (e.g., JVM, Python).

## **Type Systems**
- **Static Typing**: Checked at compile-time.
- **Dynamic Typing**: Checked at runtime.
- **Type Inference**: Automatic type deduction.

## **Metadata**
- **Annotations**: Meta-information for the compiler/runtime.
- **Comments**: Human-readable explanations.

## **Execution Environment**
- **Virtual Machines**: Platform independence (e.g., JVM).
- **Native Execution**: Platform-specific binaries.

## **Extensibility**
- **Macros**: Code-generation tools.
- **Plugins**: Extendable functionality.

## **Security Constructs**
- **Access Control**: Private, Public, Protected.
- **Encryption Libraries**: Cryptography support.
- **Sandboxing**: Isolated execution.

## **Tooling**
- **Package Management**: Installing, maintaining, and publishing libraries.
- **Linting**: Checking code for style issues, bugs, and errors
- **Build**: Compiling or pacakging code for distribution
- **Test**: Running unit tests
- **Run**: Run code during development
- **Publish**: publish to code specific repositories

This breakdown encapsulates the foundational concepts present in most programming languages.