Basic Bites: Languages

Rust, C++, C#, Python, ...

Our goals for this "Languages" section are to provide working mental models that help us understand the artifacts of programming languages, e.g., objects and their relationships, managed versus unmanaged execution, and how to create, use, and dispose of instances of user-defined types. We will not get into a lot of programming details in favor of emphasizing relatively simple models for these activities. The models help us reason about and make good design decisions for our code.
Fig 1. Language History

In this Basic Bite we adopt the definition:
Programming Language:
Text that creates an executable, like Rust, or declares a structure or style, like HTML.
We choose a language based on application needs: or because a language is mandated by the development organization.

1.0 Language History

Figure 1. shows a selection of historically significant languages and their relationships. Each is annotated with its first stable release. The relationships show languages that adopt features of their predecessor. For example, Algol introduced block structured code, where each block defines a scope. When the thread of execution enters a scope, stack memory is allocated to hold its parameters and local variables. That memory is released when execution leaves the scope. All of its successors are block structured. Some relationships indicate focus rather than specific features, e.g., Lisp is the first of the AI languages. Its successors do not adopt a lot of specific features, but do adopt the notion of first class functions and create their designs with function compositions. The languages we focus on in this site are highlighted, in Figure 1., with darker backgrounds, e.g., Rust, C++, C#, Python, JavaScript, HTML, and CSS. With the exceptions of HTML and CSS, they are all imperative and block structured but differ significantly in their type system design.
more details with help from ChatGPT 4.0
  • Fortran (1956)
    Language developed by John Backus at IBM for scientific and engineering computation.
    Description: FORTRAN (FORmula TRANslation) is imperative (describing how the computation is to be carried out) and procedural (based on function definitions) compiled language.
    Features: It emphasizes mathematical syntax, supports multi-dimensional arrays, and produces highly optimized machine code.
  • Algol (1958)
    Algol was developed by John Backus, Peter Naur, and Friedrich Bauer, sponsored by ACM and GAMM.
    Description: Algol (ALGOrithmic Language) is compiled, imperative, and introduced block structured code.
    • Block Structure is used by many modern languages, including Rust, C++, C#, Python, and JavaScript.
    • Block structure defines function scope and scopes for loops and branches in a function's code.
    • It provides very efficient use of stack memory by allocating memory as the thread of execution enters a scope, to hold parameters and local variables, and returns the allocated memory when execution leaves the scope. Essentially, each allocation is a scratchpad for temporary computations.
    Features: Algol was the first language to be described with Backus-Naur Form (BNF) grammar. It is commonly used as a standard notation for algorithms.
  • C++ (1979)
    Developed by Bjarne Stroustrup at Bell Labs to add object-oriented features to the C language.
    Description: General-purpose, multi-paradigm compiled language, designed for high performance and large software systems.
    Features: C++ is imperative, object-oriented, and provides templates for generic programming. It provides constructors and destructor to allocate and return resources when the thread of execution enters and leaves a scope. Unique among all the programming languages, C++ has an internal meta-language used to make certain types of computations during compile-time. That is called template-metaprogramming.
  • Rust (2015)
    Developed by Graydon Hoare et. al. at Mozilla to provide memory-safe computation and eliminate data races for multi-threaded programs.
    Description: Rust is a compiled, statically typed language that is largely imperative but adds some functional programming with iterators.
    Features: Rust has a strong type system and ownership model that supports memory safety without using garbage collection. High level constructs like traits and iterators compile to efficient machine code. Rust provides pattern matching and enumerations that can hold instances of another type. Rust comes equipped with a tooling ecosystem that supports efficient production and testing of programs.
  • C# (2000)
    Developed by Anders Hejlsberg, et. al. at Microsoft to be multi-paradigm, object-oriented, and type safe as part of the .NET platform and compiles to Common Intermediate Language (CIL) for execution on the Common Language Runtime (CLR) virtual machine.
    Desicription: Initially designed to support Windows development, it supports object-oriented, functional, event-driven, concurrent, and component-based programming.
    Features: provides strong static typing, garbage collection, classes, interfaces, and properties. C# incorporates a data language called LINQ, delegates and events, pattern matching, attributes and reflection for making queries about an object's types and methods at run-time. The current version can generate code for Windows, Linux, and macOS and its compiler runs on those platforms as well.
  • Python (1991)
    Developed by Guido van Rossum at CWI in the Netherlands, Python is high-level, interpreted, multi-paradigm programming language.
    Description: Python has concise and readable syntax, defining scopes with white-space indentations. It is dynamically typed, so many errors are not caught until run-time. Features: High-level data types: lists, dictionaries, sets, and strings, with powerful methods. Python programs are structured with modules and packages providing a productive development environment. Its interpreted execution provides quick code development, but high latency and low throughput at run-time. It provides garbage collection, and runs on most platforms.
  • JavaScript (1995)
    Developed by Brendan Eich at Netscape Communications.
    Description: High-level, interpreted, multi-paradigm programming language, most often used to build interactive web pages. All popular browsers support an execution environment for JavaScript.
    Features: Standardized as ECMAScript, is dynamic and weakly typed. JavaScript supports imperative, event-driven, functional, and prototype object-oriented programming. It provides first class functions, closures, asynchronous execution, and uses the HTML DOM interface to build user-interactive operations that effect the style and structure of web pages.
  • HTML (1991)
    Developed by Tim Berners-Lee at CERN to support communcation between scientists at CERN.
    Description: HTML (HyperText Markup Language) is declarative, the standardized markup language used to structure and display content of web pages.
    Features: It defines semantics and lyout of documents (pages) using a system of tags, to guide browsers in rendering text, images, links, forms, and multimedia.
  • CSS (1987)
    Developed by Hakon Wium Lie and Bert Bos for W3C, to support styling web pages.
    Description: CSS uses a declarative stylesheet language to define layout, color, fonts, ...
    Features: CSS uses selectors to target HTML elements by tag, class, ID, and relationships. Each style starts with selector(s), then provides a braced scope with individual style rules. Each rule has a key, value structure. The key identives a style attribute, like width, and the value defines its setting. CSS has a complex inheritance structure, a box model that wrap each element in a box with border, padding, and content. It provides powerful collections using Flexbox and Grid. It provides custom reusable properties using var(--var-name) syntax.

2.0 Languages

This "Languages" section presents models for Block Structure, Types, (Static, Stack, and Heap) memory, Native Code, and Managed Code. Each of these links opens a Basics Bites page devoted to one topic. The goal is to provide a working model for Native Code versus Managed Code: advantages, disadvantages, and things you need to know to program with these models effectively.

3.0 References:

Rust TopicLink
Rust Home Page rust-lang.org
rust-lang blog blog.rust-lang.org
large collection of links, articles, and code github.com/rust-unofficial
C++ TopicLink
C++ reference site cppreference.com
Discussions, Notes, and FAQ isocpp.org
Herb Sutter Blog blog articles
C# TopicLink
C# language docs learn.microsft.com/dotnet/csharp
technical dotnet blogs devblogs.microsoft.com/dotnet
Python TopicLink
Python Home Page python.org
Tutorials realpython.com
Yasoob Khalid blog python tips
JavaScript TopicLink
Mozilla Dev Network (MDN) JavaScript (MDN)
technical articles and blog posts 2ality.com
articles and links javascriptweekly.com