Skip to content

Instantly share code, notes, and snippets.

@MangaD
Created July 31, 2026 19:43
Show Gist options
  • Select an option

  • Save MangaD/86e81a89023e14101c2ae77133d32722 to your computer and use it in GitHub Desktop.

Select an option

Save MangaD/86e81a89023e14101c2ae77133d32722 to your computer and use it in GitHub Desktop.
Software Building Blocks Explained: Libraries, Frameworks, Engines, SDKs, APIs, Runtimes, and More

Software Building Blocks Explained: Libraries, Frameworks, Engines, SDKs, APIs, Runtimes, and More

CC0

Disclaimer: ChatGPT generated document.

Software engineering is filled with terminology that often sounds similar but refers to very different concepts. Terms such as library, framework, engine, SDK, API, runtime, platform, and middleware are frequently used interchangeably by beginners, even though each describes a different role within a software system.

One reason for this confusion is that modern software products often belong to multiple categories simultaneously. For example, a game engine may also contain libraries, frameworks, an SDK, a runtime, a plugin system, and development tools. Likewise, a web framework may include dozens of libraries, command-line tools, templates, middleware, and a dependency injection container.

This article explains the most important software concepts, how they relate to one another, and where each fits into the overall software ecosystem.


Understanding Software as Layers

Imagine a modern web application.

Your Application
       │
Web Framework
       │
Libraries
       │
Runtime
       │
Operating System
       │
Hardware

Each layer depends on the one below it.

  • Hardware performs computation.
  • The operating system manages hardware.
  • The runtime executes your language.
  • Libraries provide reusable functionality.
  • Frameworks organize applications.
  • Your application contains business logic.

Once you understand these layers, the terminology becomes much easier to understand.


Source Code

Everything begins with source code.

Source code is the human-readable instructions written by programmers.

Examples include:

  • Python
  • Java
  • C++
  • Rust
  • JavaScript

Example:

def greet(name):
    print(f"Hello {name}")

Source code is not directly useful to a computer. It must eventually be interpreted or compiled into something the processor can execute.


Function

The smallest reusable unit of behavior is usually a function.

A function:

  • accepts inputs
  • performs work
  • returns outputs

Example:

def square(x):
    return x * x

Functions help eliminate duplicated code and improve organization.


Class

A class describes a type of object.

Example:

class Car:
    def drive(self):
        print("Driving")

The class is the blueprint.

Objects are created from the blueprint.


Object

An object is a concrete instance of a class.

Class
  ↓
Object

Example:

my_car = Car()

Object-oriented programming revolves around objects interacting with one another.


Module

A module is a logical unit of code.

Usually:

  • one file
  • related functionality
  • imported by other code

Example:

math.py

Inside:

def add(a,b):
    return a+b

Then:

import math

Modules improve organization.


Package

A package groups multiple modules together.

Example:

requests/
    api.py
    auth.py
    sessions.py

Packages make distribution easier.

Python packages are installed using pip.

Java packages use namespaces.

JavaScript packages are distributed through npm.


Namespace

A namespace prevents naming conflicts.

Imagine two libraries both defining:

print()

Without namespaces, collisions occur.

Instead:

math.sqrt()

graphics.sqrt()

Namespaces organize identifiers.


Library

A library is one of the most fundamental concepts in software.

A library is simply reusable code.

Instead of writing everything yourself, someone else writes code that solves common problems.

You call the library whenever you need it.

Your Program
      │
calls
      ▼
Library

Examples include:

  • mathematical libraries
  • networking libraries
  • graphics libraries
  • cryptography libraries

Python:

import random

random.randint(1,10)

Here your program controls everything.

The library only helps when asked.

Think of a library as a toolbox.

You decide which tool to pick.

Advantages

  • saves time
  • well tested
  • reusable
  • easier maintenance

Disadvantages

  • additional dependencies
  • version compatibility
  • sometimes larger executable size

Static Library

A static library becomes part of your executable during compilation.

Program
+
Library
↓

Single executable

Advantages:

  • self-contained executable
  • no external dependencies

Disadvantages:

  • larger executable
  • duplicated code across programs

Dynamic Library

Dynamic libraries remain separate files.

Examples:

Windows

DLL

Linux

.so

macOS

.dylib

They are loaded while the application runs.

Advantages:

  • smaller executables
  • shared memory
  • easier updates

Disadvantages:

  • version conflicts
  • missing library errors

Standard Library

Most languages include an official library.

Examples:

Python Standard Library

os
json
math
threading
pathlib

Java Standard Library

java.util
java.io
java.net

These libraries ship with the language itself.


Framework

A framework is much more than a library.

Instead of helping your application...

...it organizes your application.

The key idea is:

Inversion of Control

Instead of:

You
 ↓
Library

A framework works like this:

Framework
     ↓
Your code

The framework owns the execution.

You only provide pieces.

Example:

Django

def home(request):
    return HttpResponse("Hello")

You never call this function.

Django does.

It decides:

  • startup
  • routing
  • configuration
  • lifecycle
  • error handling

Examples:

  • Django
  • Spring
  • Ruby on Rails
  • Angular
  • ASP.NET

Think of a framework as a restaurant.

You cook one dish.

The restaurant manages:

  • customers
  • seating
  • payments
  • cleaning
  • reservations

Library vs Framework

This is the single most important distinction.

Library

You
 ↓
Library

Framework

Framework
      ↓
Your code

A library gives you freedom.

A framework gives you structure.


Toolkit

A toolkit is simply a collection of related libraries.

Example:

Qt

Contains:

  • GUI library
  • networking
  • threading
  • multimedia

Instead of solving one problem...

...a toolkit solves an entire category of problems.


Engine

An engine performs specialized work.

Usually computationally intensive.

Examples:

Game engine

Handles

  • rendering
  • lighting
  • sound
  • animation
  • physics

Search engine

Handles

  • indexing
  • searching
  • ranking

Database engine

Handles

  • storage
  • indexing
  • transactions

Rendering engine

Turns HTML into pixels.

Examples:

  • Blink
  • Gecko
  • WebKit

Unlike a framework, an engine focuses on doing work rather than organizing applications.

Think of it as a machine.

Input goes in.

Results come out.


Runtime

The runtime is the environment where your program executes.

Responsibilities include:

  • memory allocation
  • exception handling
  • loading code
  • garbage collection
  • threading

Java

Program
 ↓
JVM
 ↓
Operating System

Python

Python Code
 ↓
CPython
 ↓
Operating System

Without a runtime, programs cannot execute.


Virtual Machine

A virtual machine simulates another execution environment.

Two major types exist.

Language virtual machine

Example:

JVM

Runs Java bytecode.

System virtual machine

Example:

VirtualBox

Runs entire operating systems.

Virtual machines provide portability and isolation.


Compiler

A compiler translates source code into another representation before execution.

Source
 ↓
Compiler
 ↓
Machine Code

Languages commonly compiled:

  • C
  • C++
  • Rust
  • Go

Advantages:

  • fast execution
  • optimization

Disadvantages:

  • compilation time
  • platform-specific binaries

Interpreter

An interpreter executes code directly.

Source
 ↓
Interpreter
 ↓
Execution

Languages:

  • Python
  • Ruby
  • Lua

Advantages:

  • easier debugging
  • portability

Disadvantages:

  • generally slower execution

Many modern implementations combine interpretation with bytecode and JIT compilation.


JIT Compiler

JIT means Just-In-Time Compilation.

Instead of compiling beforehand...

the runtime compiles while the program runs.

Examples:

  • Java
  • .NET
  • JavaScript engines

Benefits:

  • adaptive optimization
  • better performance

SDK

SDK stands for Software Development Kit.

An SDK is much larger than a library.

Typical SDK contents:

  • libraries
  • compiler
  • debugger
  • documentation
  • emulator
  • templates
  • command-line tools

Android SDK includes:

  • emulator
  • adb
  • build tools
  • Android APIs

Think of an SDK as an entire workshop rather than a single tool.


API

API means Application Programming Interface.

An API is not software.

It is a contract.

It specifies:

  • available operations
  • parameters
  • return values
  • expected behavior

Function API

sort(list)

REST API

GET /users

Operating system API

CreateFile()

The API describes what is available.

Not how it works.


SDK vs API

API

  • specification
  • contract
  • interface

SDK

  • implementation
  • tools
  • libraries

You often use an SDK to access an API.


Platform

A platform is an entire ecosystem where applications run.

Examples:

  • Android
  • Windows
  • Linux
  • iOS

A platform often includes:

  • runtime
  • operating system
  • APIs
  • SDK
  • security
  • deployment model

Everything needed for applications to exist.


Middleware

Middleware sits between two components.

Example:

Request

↓

Authentication

↓

Logging

↓

Compression

↓

Application

Each middleware receives the request.

Performs work.

Then forwards it.

Typical middleware:

  • authentication
  • logging
  • caching
  • CORS
  • compression
  • rate limiting

Plugin

A plugin extends another application.

Examples:

  • Photoshop plugins
  • VS Code extensions
  • Browser extensions

Plugins cannot exist independently.

The host application loads them.


Extension

Extensions are similar to plugins.

Sometimes the terms are interchangeable.

Generally:

Plugin

Adds new capabilities.

Extension

Modifies or enhances existing behavior.

The distinction depends on the software ecosystem.


Service

A service is software that provides functionality to other software.

Example:

Authentication Service

Payment Service

Notification Service

Services usually communicate over a network.


Microservice

A microservice is a small service focused on one business capability.

Instead of one huge application:

Monolith

You build:

Orders

Payments

Inventory

Shipping

Each can be deployed independently.

Advantages:

  • scalability
  • independent deployment

Disadvantages:

  • operational complexity
  • networking overhead

Daemon

A daemon is a background process.

Examples:

  • print service
  • SSH server
  • scheduler

Users usually never interact with daemons directly.


Process

A process is a running program.

Each process owns:

  • memory
  • resources
  • threads

Opening Chrome creates multiple processes.


Thread

Threads execute work inside a process.

Process

├ Thread

├ Thread

└ Thread

Threads share memory.

This makes communication easier but synchronization harder.


Kernel

The kernel is the heart of the operating system.

Responsibilities:

  • CPU scheduling
  • memory
  • file systems
  • networking
  • devices

Applications never directly control hardware.

Everything passes through the kernel.


Driver

Drivers allow the operating system to communicate with hardware.

Examples:

  • GPU driver
  • printer driver
  • Wi-Fi driver

Without drivers, hardware is unusable.


Shell

The shell provides a user interface to the operating system.

Examples:

  • Bash
  • PowerShell
  • Zsh

Commands:

ls

cd

mkdir

The shell converts user commands into system calls.


Container

A container packages:

  • application
  • dependencies
  • runtime
  • configuration

into an isolated environment.

Container

App

Libraries

Runtime

Dependencies

Containers share the host kernel.

This makes them lightweight.

Examples:

  • Docker
  • Podman

Virtual Machine vs Container

Virtual Machine

Guest OS

↓

Virtual Hardware

↓

Host

Container

App

↓

Shared Host Kernel

↓

Host

VMs provide stronger isolation.

Containers use fewer resources.


Dependency Manager

Modern applications rely on many libraries.

Dependency managers automate installation.

Examples:

Python

pip

JavaScript

npm

Rust

cargo

Java

Maven

Gradle

Build Tool

A build tool automates software creation.

Tasks include:

  • compilation
  • testing
  • packaging
  • deployment

Examples:

  • Make
  • Gradle
  • Maven
  • MSBuild

Linker

The linker combines compiled pieces into one executable.

Object Files

+

Libraries

↓

Executable

Loader

The loader starts programs.

Responsibilities:

  • loading executable
  • loading libraries
  • allocating memory
  • starting execution

Package Manager

Package managers distribute software.

Examples:

Operating systems

apt

dnf

brew

Programming languages

pip

npm

cargo

ORM

ORM means Object Relational Mapping.

Instead of writing SQL:

SELECT * FROM users;

You write:

User.objects.all()

The ORM translates objects into SQL.


Adapter

An adapter converts one interface into another.

Imagine:

USB-C

↓

HDMI

Same idea in software.


Facade

A facade simplifies a complex system.

Instead of calling twenty functions...

You call one.


Proxy

A proxy stands between clients and servers.

Uses:

  • caching
  • security
  • monitoring
  • load balancing

Repository

A repository abstracts data access.

Instead of:

SELECT...
INSERT...
UPDATE...

You write:

repository.save(user)

Dependency Injection

Instead of creating dependencies yourself...

Someone provides them.

Without DI

Car creates Engine

With DI

Engine

↓

Car

DI makes testing and maintenance much easier.


Putting Everything Together

Imagine building an online shopping application.

  • You write your source code.
  • It is organized into functions, classes, modules, and packages.
  • Your application uses libraries for JSON, encryption, networking, and logging.
  • It is structured by a web framework such as Django or Spring.
  • Middleware handles authentication, logging, and compression.
  • An ORM translates your objects into SQL.
  • A database engine stores your data.
  • External services process payments and send emails.
  • The application runs inside a language runtime, which may use a JIT compiler or garbage collector.
  • It is packaged into a container for deployment.
  • The container runs on an operating system, whose kernel manages hardware resources.
  • Users interact with the application through its API, while developers build it using an SDK and a build tool.

Viewed this way, these concepts are not competing definitions but complementary layers. A modern software system is an ecosystem of specialized components, each solving a different class of problem. Understanding where each fits—and how they interact—is one of the key steps from simply writing code to understanding software architecture as a whole.

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