Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save agocorona/8c78a174a20aea3546ac98beca87ba70 to your computer and use it in GitHub Desktop.
Save agocorona/8c78a174a20aea3546ac98beca87ba70 to your computer and use it in GitHub Desktop.

The Evolution of Software Composition

Historical Timeline of Computing Paradigms

Era Innovation Impact
Machine Code Era Introduction of CPUs, interrupts, and high-level languages (FORTRAN) Enabled batch processing and direct formula execution through pure numerical algebra
Random Access Disk IO Era Introduction of DMA and synchronous I/O blocking in operating systems Facilitated interactive console applications with algebraic composition, albeit limited to single-threaded execution

The Object-Oriented Programming Era

Technology Methodology Outcome
Modern I/O Systems (Disk, GUI, Network) Object-oriented programming with message-based architecture and event loops Resulted in complex codebases with limited algebraic composition capabilities

The Concurrent Programming Era

Technology Methodology Outcome
Multi-threaded Systems Implementation of semaphores, critical sections, and asynchronous operations Achieved imperative execution with blocking operations, but failed to unify synchronous and asynchronous paradigms

The Web Development Era

Technology Methodology Outcome
Web Technologies Implementation of server routing, contexts, and event loops Required explicit state management without proper composition patterns

The Missed Opportunity: Continuations

The potential of continuations as a unifying concept was overlooked due to several factors:

  • Complex execution state management
  • Prevalence of object-oriented programming
  • Disconnect between academic research and industry requirements
  • Focus on immediate solutions rather than architectural vision
  • Emergence of alternative paradigms:
    • Modular programming
    • Information hiding
    • Separation of concerns
  • Limited solutions such as async/await
  • Artificial divisions between monolithic and microservice architectures

The Modern Distributed Computing Era

Technology Methodology Outcome
Distributed Systems Actor model and agent-based programming Limited advancement in composition patterns, resulting in bespoke solutions
Frontend Development Event-driven architecture with web services and callbacks Lacks imperative composition with explicit state management requirements
Blockchain Applications Similar architectural patterns Inherits comparable limitations

The Transient Framework: A New Unified Approach

Fundamental Principle: Universal composability across all programming concepts

Core Features:

  • Continuation-based thread execution
  • Asynchronous operations as continuation-based thread executions
  • Thread-based parallel execution paths
  • Stream processing through parallel applicative composition
  • Native support for implicit concurrency within applicatives
  • Multi-threaded applicative composition
  • Algebraic operations through applicative construction
  • Portable execution state through logging mechanisms
  • Continuation-based callback handling
  • Non-deterministic parallel stream processing

Technical Implementation:

  • Stack state propagation through request/response cycles
  • Route management through stack-based architecture
  • Stack serialization via execution logging
  • Optimized log management with scope-based pruning
  • HTTP GET requests as serialized execution logs
  • Cross-system state propagation via log transportation
  • Distributed state management through stack restoration
  • Bidirectional stack serialization
  • Universal state reconstruction capabilities
Tower of Pure Code Tower to the Heavens
buried ivory tower ivory tower all the way up
Your ivory tower of pure code, buried among pipelines connecting clients with servers and databases, microservices, users, logs, transactions and configurations Ivory tower all the way up to the heaven, in the clouds of immutable, ethernal distributed blockchain-enabled computing

Evolution of Composition

Grand Unification Timeline

CPU, Machine Code Era:

  • Technology: CPUs, Interrupts, High level languages (FORTRAN)
  • Result: Batch processing, direct execution of formulas (pure numeric algebra)

Blocking Disk IO era:

  • Technology: DMA, OS with synchronous IO blocking (Linux)
  • Result: Interactive console apps, algebraic composition with I/O blocking, single threading

The OOP Composition Ice Age

  • Technology: Disk I/O, Mouse, Communication Systems
  • Approach: Object-Oriented Programming (message-based), epoll, event loops
  • Result: Complex spaghetti code without algebraic composition

The Small Global Warming

  • Technology: Threading, Parallelism, Concurrency
  • Approach: Semaphores, critical sections, async/await patterns
  • Result: Imperative programming with blocking operations; algebraic composition absent; synchronous and asynchronous modes remain separate

Back to the Ice Age

  • Technology: Web Development
  • Approach: Web servers, routing systems, contexts, event loops
  • Result: Manual state management with no compositional benefits

The Paradise Lost

Continuations could have solved the composition problems but were abandoned due to:

  • Large execution states
  • OOP dominance
  • Disconnection of academia from real world programming needs
  • Lack of global vision (get things done)
  • Search for substitutes:
    • Modularity
    • Encapsulation
    • Separation of concerns
  • Partial solutions: async/await
  • False dichotomies: block programming versus microservices

Modern Distributed Era

  • Technology: Distributed Computing

  • Approach: Actor model, agent programming (OOP with other names)

  • Result: No advancement in composition, artisanal programming

  • Technology: Client-side Programming

  • Approach: Message passing, web services, JSON, callbacks

  • Result: No imperative composition, explicit state management

  • Technology: Multiuser Workflows (Blockchain contracts)

  • Approach: Same solutions

  • Result: Similar limitations

The New Grand Unification: Transient

Core Principle: Everything should compose with anything

Key Concepts:

  • New threads can execute continuations
  • "async x" is a thread that executes the same continuation with a different result x
  • Parallelism represents alternatives with different threads
  • Streaming is composition of parallel applicatives
  • Implicit concurrency is programmed within applicatives
  • Concurrency consists of applicatives of different threads
  • Formulas/binary operators can be constructed with applicatives
  • Execution states can be transported as logs and restored
  • Callbacks are continuations
  • Streaming is a composition of alternatives

Implementation Details:

  • Requests/responses send/receive stack states to build execution stacks of communicating machines upon previous states
  • Web routes are stacks
  • Execution logs are serializations of stack
  • Intermediate results can be removed from logs when not in scope
  • GET Web requests are logs
  • Messages/web/distributed requests can transport stacks as logs
  • Messages can address previous restored stacks to construct distributed computing state among different machines
  • Stacks serialize as logs
  • Deserialize to restore any execution state upon previous states
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment