about
7/02/2024

BasicBites - Introduction

Platform, Programming, and Object Models

Contents Note
Many parts of this site could be usefully improved by injecting sets of Example/Post-Mortem discussions.
  • Provide an interesting example with illustrated structure and results
  • Simply, clearly explain its working parts
  • show how they fit together
  • make a very short video to cover example
For example, Program Execution could present a timer program that loads a library and times calls into its functions and methods. Provide a diagram that shows the relationship between the timer, the loaded library, and other functionality, like I/O. Show a few results. Then quickly and simply analyze the parts in the context of Program Execution, as presented in that page. This would benefit greatly from a side-by-side comparison of the example executed in C++, Rust, and C#.
Adding a 5-10 minute video relating to each example might improve accessibility.
Obviously there is tension between this restructuring and adding new content related to .Net, Webasssembly, GUIs, ...
Professional software development is a complex process with non-trivial goals, products, tools, and often applied to large software systems (think hundreds of thousands of lines of code or more). To design and implement software effectively you need models of how the target platform behaves and how your program structures data and operates on it. The purpose of these pages is to provide simplified bite-sized models that help you reason about consequences of the target platform and language you choose for implementation.

Table - Basic Models

Platform Models Contents
OS Platforms Platform family tree - Posix, Unix, macOS, Linux, Windows
Work Scheduling Scheduling windows threads and Linux processes
Virtual Memory pages and memory mapped files
I/O and Events Raw input queue, message queues, IO completion
System-wide Resources Kernel objects, naming and sharing
Program Models Contents
Programming Programming language models effect performance, safety, and visibility
Program Execution Processes, Threads, unmanaged and managed code execution
Types Value and Reference types, aliases, strong types
Functions Functions, methods, lambdas
Code Safety managing references and allocations
Program Structure functions, packages, libraries, executables, systems
Platform APIs System-wide shared programming interface
Object Models Contents
Introduction Object model determines instance lifetiime, location, management of resources
Instance lifetime Time from creation to destruction, focusing on how and when destruction occurs
Resource Management Allocating and disposing of resources used by objects
Ownership Code safety is determined by object ownership policies
Model Summaries Models affect performance, safety, and implementation convenience
Native Code One compilation phase for each component at build time, component responsible for managing all resources it needs.
Managed Code Compiles to byte code at build time, then "jitted" at load and run time. Virtual machine handles a lot of the component's resources.
Platform models do not attempt to describe detailed differences across platforms (machine and OS). As presented here, they map fairly closely to Windows, but differences for Linux and Unix are cited, at a high level, in a few places to avoid misleading readers. Our goal is to support common sense reasoning about program activities. The program models focus primarily on high level differences between unmanaged and managed code. They are not concerned with differences between the Java Virtual Machine (JVM) and .Net Common Language Runtime (CLR). Object models explore guarantees (or lack thereof) made by specific language types, e.g., C++, Rust, C# and Java. Understanding these is the first step to become a proficient developer.
  Next Prev Pages Sections About Keys