Programming Languages

🖥️ Programming (the activity)

Programming is the process of designing instructions for a computer. Those instructions ultimately need to be executed by hardware (CPU, memory, I/O devices). Programmers think in algorithms, but the computer only understands electrical signals and binary (0s and 1s).

  • Definition: Programming is the process of designing and writing instructions that a computer can execute.
  • Goal: To solve problems, automate tasks, or build systems/software.
  • Core steps:
    1. Problem analysis → understand what needs to be solved.
    2. Algorithm design → plan the step‑by‑step solution.
    3. Coding → translate the algorithm into instructions a computer understands.
    4. Testing & debugging → check correctness and fix errors.
    5. Maintenance → update and improve over time.
  • Key skills: Logical thinking, abstraction, decomposition, debugging.
  • Analogy: Programming is like writing a recipe — you break down a dish into clear steps the cook (computer) can follow.

📚 Language (the tool)

Programming languages are the tools that translate human logic into something hardware can execute. High‑level languages (Python, Java, PHP) are abstract and easy for humans. Low‑level languages (Assembly, C) are closer to hardware, giving more control. Compilers and interpreters act as bridges:

Interpreter → translates line by line while running.

Compiler → translates code into machine instructions before running.

  • Definition: A programming language is the formal system used to express those instructions.
  • Role: Provides the vocabulary (keywords) and grammar (syntax) to communicate with the computer.
  • Types of languages:
    • Low‑level: Machine code, Assembly — close to hardware.
    • High‑level: Python, Java, C++ — closer to human thinking.
    • Domain‑specific: SQL (databases), MATLAB (math), HTML (web).
  • Paradigms:
    • Imperative (step‑by‑step commands).
    • Object‑oriented (classes and objects).
    • Functional (pure functions, immutability).
    • Declarative (state what you want, not how).
  • Analogy: A language is like the grammar and words you use to write the recipe.

Classification

  • By generation:
    • 1GL — machine code (binary)
    • 2GL — assembly (mnemonics mapped to machine instructions)
    • 3GL — high-level (C, Java, Python)
    • 4GL — domain-specific/productivity (SQL, MATLAB)
    • 5GL — logic/constraint-based (Prolog)
  • By paradigm:
    • Imperative: Step-by-step commands (C, Python)
    • Object-oriented: Organize code as classes/objects (Java, C++, C#)
    • Functional: Emphasize pure functions and immutability (Haskell, Scala)
    • Declarative: Describe desired outcomes, not steps (SQL, Prolog)
    • Scripting: Interpreted, quick automation and glue (Python, JavaScript)
  • By domain:
    • Systems: C, Rust
    • Web: JavaScript, TypeScript, PHP
    • Mobile: Swift (iOS), Kotlin (Android)
    • Data/AI: Python, R, Julia
    • Scientific/Math: FORTRAN, MATLAB
    • Business/data ops: COBOL, SQL

⚙️ Hardware

  • Hardware = the physical components (CPU, RAM, disk, GPU, network card).
  • The CPU only understands machine code (binary instructions).
  • Every program, no matter the language, must eventually be converted into machine code for the hardware to execute.
  • Example:
    • Programmer writes in Python → Python interpreter translates into C → compiled into machine code → CPU executes instructions.

How programs run

  • Compiled: Code is translated to machine code ahead of time for speed (C, Rust, Go).
  • Interpreted: Code is executed line-by-line, flexible and portable (Python, JavaScript).
  • Hybrid (VM/bytecode): Code compiles to bytecode, then runs on a virtual machine (Java, C#).
  • JIT compilation: Runtime optimization blends interpretation and compilation (JavaScript engines, JVM).

Popular languages at a glance

  • Python: Readable, vast ecosystem; great for web, data, AI, automation.
  • JavaScript/TypeScript: Dominant for web front-end; TypeScript adds static types.
  • Java: Portable, enterprise-scale; strong tooling and ecosystem.
  • C#: Modern OOP with .NET; cross-platform apps, games (Unity).
  • C/C++: High performance and control; systems, embedded, game engines.
  • Go: Simple concurrency and speed; cloud services and tooling.
  • Rust: Memory safety with performance; systems and high-reliability software.
  • Swift/Kotlin: First-class for iOS/Android; modern language features.
  • SQL: Declarative database queries; cornerstone of data work.

đź”— Programming + Language + Hardware Together

  • Programming is the act of creating solutions.
  • Language is the medium through which those solutions are expressed.
  • Without programming, a language is just symbols; without a language, programming has no way to reach the computer.
  • Programming = the activity (designing solutions).
  • Language = the medium (expressing solutions).
  • Hardware = the executor (running solutions).

Flow:

  1. Programmer designs algorithm.
  2. Writes it in a programming language.
  3. Compiler/interpreter translates it into machine code.
  4. Hardware executes the binary instructions.
Like(0) Tip
Article Title:《Programming Languages》
Article Link:https://sslgadgets.com/internet/development/programming-languages/
Images and content in this article are sourced from the internet. If any copyright infringement is found, please contact us for removal.
Share To

Comment Get first!

Must log in before commenting!

 

Sign In

Forgot Password

Sign Up