DEV Community

pwt
pwt

Posted on

A Conceptual Framework for Layered Programming Languages and an Operating System Built on Hardware Abstraction (Draft)

This article was partially developed with the support of AI-assisted writing tools.


1. Background

  • Contemporary mainstream languages such as C++ and Rust tend to “integrate everything,” resulting in overwhelming complexity. Developers are forced to confront the full feature set, creating substantial cognitive burden.
  • Although C offers limited abstraction capabilities, its minimalist philosophy leads to clearer program structure and more controllable error surfaces.
  • The current programming ecosystem is fragmented: assembly, C, Java, and JavaScript exist as isolated domains with inconsistent syntax and design philosophies. Developers must relearn mental models when transitioning across layers.

2. Core Principles

  • Layering rather than stacking: Language features should be distributed across well-defined layers instead of being accumulated into a single monolithic language.
  • Unified syntax: Hardware-level, system-level, application-level, and scripting-level languages should share a common syntactic foundation, enabling developers to work across layers with a single learning effort.
  • Complexity allocated by necessity: The closer a language is to hardware, the fewer features it should expose; the closer it is to business logic, the richer the abstractions it should provide.
  • Safety enforced at compile time: Ownership, borrowing, and lifetime mechanisms should operate purely during compilation, imposing no runtime overhead.
  • Escape hatches preserved: unsafe blocks or inline assembly should remain available when needed to ensure flexibility.

3. The Layered Language Pyramid

  1. Hardware-Level Language
  • Corresponds to assembly; direct manipulation of registers, memory, and interrupts.
  • Fully manual memory and pointer management.
  • Minimal macro-level abstraction.
  1. System-Level Language
  • Corresponds to C or a “safe C” dialect.
  • Introduces ownership, borrowing, and lifetime checks.
  • Provides minimal concurrency and modularity support.
  • Suitable for kernels, drivers, and database engines.
  1. Application-Level Language
  • Similar in positioning to Java but significantly lighter.
  • Incorporates limited object-oriented features (composition-first, interface-oriented).
  • Offers standard libraries for containers, networking, graphics, and persistence.
  • Suitable for enterprise applications and backend services.
  1. Scripting-Level Language
  • Analogous to JavaScript.
  • A dynamic subset sharing the same core syntax; supports interpretation or JIT execution.
  • Gradual typing to facilitate rapid prototyping.
  • Suitable for scripting, automation, and glue logic.

4. The V-ISA Concept (Virtual Instruction Set Architecture)

  • Define a virtual instruction set at the BIOS/firmware layer, implemented in assembly as the foundational abstraction.
  • Eliminate differences across CPUs and hardware platforms so compiler backends can target a unified V-ISA.
  • Benefits:
    • More consistent boot and device initialization processes.
    • More stable compiler backends and improved cross-platform portability.
    • Unified debugging and safety guarantees.
  • Risks:
    • Potential performance overhead; requires zero-cost mapping.
    • Significant coordination challenges among hardware vendors.

5. Vision and Significance

  • Developers are no longer forced to confront the full complexity of a single language; instead, they choose the appropriate layer based on their needs.
  • Learning costs decrease as mental models become unified across layers.
  • Ecosystems become continuous, with libraries and toolchains shared across the entire stack.
  • Language evolution returns to a philosophy of simplicity, clarity, and maintainability rather than unchecked complexity accumulation.

6. Conclusion

This document is a conceptual draft rather than a complete language specification. Its purpose is to stimulate discussion:

  • Should we reconsider the evolutionary trajectory of programming languages?
  • Do we need a unified-syntax, clearly layered family of languages?
  • Can breakthroughs be achieved at the hardware abstraction layer through a V-ISA?

Top comments (0)