#+INCLUDE: theme/style.org 
#+TITLE: Technology Landscape - Big Picture 
#+DESCRIPTION: cpp/c++ code examples and demonstrations.
#+AUTHOR:      Caio Rodrigues Soares - caiorss [DOT] rodrigues [AT] gmail [DOT] COM
#+STARTUP: content 

* Big Picture - Technology Landscape 
** Domains where C++ is used

 *General:*

 + 3D game engines and AAA (triple-A) games.
 + System Programming - It means, operating systems, device drivers,
   hardware interfacing, USB drivers ...
 + Embedded Systems - DSP (Digital Signal Processors),
   Microcontrollers, Embedded Processors and so on. 
 + Imaging processing and artifical vision.
 + Neural Networks
 + High perfomance numerical simulation (Number crunching)
 + High Performance Computing (HPC)
 + High Perfomance reusable libraries and software components
 + Physics
 + High Energy Physics - See CERN

 *Applicability:*

 + Peformance critical code 
 + Hard real time and soft real time systems.
   * Hard real time: audio, signal processing, radar, some control
     systems, UAVs - Unmanned Aerial Vehicles, Robots ... 
   * Soft real time: Games, audio and video streaming.
 + System Programming
 + Resource contrained systems => Embedded Systems
 + Any situation where low level access to operating system is
   needed.
 + Self-contained applications with less runtime dependency as possible:
   - For instance, a Java application, needs the Java runtime to run,
     a Python app needs the Python interpreter. It is a reasonable
     requirement that an Unix-like OS login shell or an installer
     should require no runtime dependency or interpreter to  run.

 *Non applicability:*

C++ may not be the best or the most productive choice for the
following cases: 
 
 + Web applications where fast iteration is needed.
 + CRUD-like (Create-Read-Update and Delete) Business applications
   with lots of forms and database access.  
 + Short scripts and programs where languages like Ruby or Python
   would be better choice. 
 + Non peformance critical code.

** Technology Landscape 
*** Computer Graphics GPU APIs 

   + [[https://en.wikipedia.org/wiki/OpenGL][OpenGL]] (Khronos Group) - Cross platform 2D and 3D computer graphics
     API widely used for Games, Computer Graphics and CAD - Computer
     Aided Design Implementation.
     + Official web site: https://www.opengl.org/
     + https://www.khronos.org/registry/OpenGL-Refpages/
     + https://www.khronos.org/opengles/resources
     + https://github.com/g-truc/ogl-samples

   + [[https://en.wikipedia.org/wiki/Vulkan_(API)][Vulkan]] (Khronos Group) - Cross platform 2D and 3D computer
     graphics low level API.
     + Official web site: https://www.khronos.org/vulkan/
     + https://vulkan-tutorial.com/

   + [[https://en.wikipedia.org/wiki/DirectX][DirectX]] (Microsoft MFST) - Windows-only API for 2D and 3D
     computer graphics.
     + See: https://docs.microsoft.com/en-us/windows/win32/directx
     + https://github.com/Microsoft/DirectX-Graphics-Samples

   + [[https://en.wikipedia.org/wiki/Metal_(API)][Metal]] (Apple Inc.) - Apple-only, MacOSX and iOS-only computer
     graphics API.
     + Official Web Site: https://developer.apple.com/metal/

*** Operating Systems 
**** Desktop and/or Servers

    + [[https://en.wikipedia.org/wiki/Windows_NT][Windows]] (Windows-NT family) - Most used Desktop operating
      system for games, enterprise and specialized tools because it was
      the first OS able to run in early IBM-PC computers that became
      the dominant computer architechture. 


    + [[https://en.wikipedia.org/wiki/Linux][Linux]] (Unix-like) - Most used on servers, data centers and
      super computers. Powers the internet as most web servers are
      Linux powered.

    + [[https://en.wikipedia.org/wiki/Berkeley_Software_Distribution][BSD Family]] (Unix-like) - [[https://en.wikipedia.org/wiki/FreeBSD][FreeBSD]], [[https://en.wikipedia.org/wiki/OpenBSD][OpenBSD]], [[https://en.wikipedia.org/wiki/NetBSD][NetBSD]] - BSD-family
      operating systems have been highly regarded by the quality of
      their network TCP/IP stack and its high throughput. Due to
      those capabilities, they have been used by ISPs Internet
      Service Providing companies and network streaming companies
      like Whatsapp and Netflix. Some highly regard features are:
      permissive BSD license; good documentation and consistency;
      high-throughput and low-latency network TCP/IP stack; firewall
      pfSense, aka PF and ZFS file system. 

    + *Mac OSX* (Unix like)
**** Consumer Mobile Devices OSes

    + [[https://en.wikipedia.org/wiki/Android_(operating_system)][Android]] (Linux Kernel + Bionic => BSD-derived C-library
      replacing GNU C-Library GLIBC + Dalvik virtual machine replacing
      JVM)
    + [[https://en.wikipedia.org/wiki/IOS][iOS]] - Apple Inc. AAPL's mobile OS (U-nix lilke)
    + [[https://en.wikipedia.org/wiki/Symbian][Symbian]] - discontinued operating system for feature phones. ([[https://github.com/SymbianSource/oss.FCL.sf.os.kernelhwsrv][old source code]])
**** Operating Systems for Embedded Systems

    + Embedded Linux based distributions

    + Embedded Linux OS for routers
      + [[https://en.wikipedia.org/wiki/OpenWrt][OpenWrt]]
      + [[https://en.wikipedia.org/wiki/DD-WRT][DD-WRT]] 

    + Android (Linux-based) - Most used in consumer mobile devices
      and devices touching user interface.

    + [[https://simple.wikipedia.org/wiki/Windows_CE][Windows CE]] (Windows CE familiy, Not Windows-NT Kernel) -
      Operating system developed for embedded applications that can
      be used in automotive systems, kiosks, mobile phones, set top
      boxes, industrial robots, industrial and medical machines and
      so on. Supported architecture (x86m ARM, MIPs and SH4) -- [[https://blogs.msdn.microsoft.com/mikehall/2007/01/17/windows-mobile-and-windows-embedded-ce-whats-the-difference/][more]]

**** Operating Systems for Embedded Systems - RTOS - Real Time OS

  + [[https://en.wikipedia.org/wiki/Real-time_operating_system][(RTOS)]] *Real Time Operating Systems for Embedded systems*

    + [[https://en.wikipedia.org/wiki/FreeRTOS][FreeRTOS]]

    + [[https://www.embedded.com/design/connectivity/4023328/Real-Time-Linux][RTLinux]]

    + [[https://www.rtai.org/?Homepage][Linux + RTAI Extension]] 

    + [[https://en.wikipedia.org/wiki/VxWorks][VxWorks]] 

    + [[https://en.wikipedia.org/wiki/QNX][QNX]]

    + [[https://en.wikipedia.org/wiki/LynxOS][LynxOS]]

    + [[https://en.wikipedia.org/wiki/Integrity_(operating_system)][Integrity OS]]

*** Hardware

 *General*

  + Vanilla processors _Intel-x86_ (IA32) 32 bits or Intel (IA64) or
    AMD _x86-x64_ 64 bits processors. 
    + Most well-known processor architecture, used in the IBM-PC
      computer architecture (servers, desktops and laptops) that
      became popular due to the widespread cloning and reverse
      engineering of the IBM-PC architecture by many manufacturers
      and also due to the licensing of Microsft MSDOS and later
      Windows-NT to those manufacturers.

  + Embedded Processors
    + Processors designed for embedded applications, low power or
      battery-powered embedded systems. Most common: ARM-base
      processors, MIPS-based processors and PowerPC.

  + Microncontrollers
    + SOC - System-on-Chip - Almost a whole-computer on a chip, a
      micronctroller has a CPU, general purpose digital IO, ADC -
      analog to digital converters, ROM (Read-Only Memory) EPROM and
      limited RAM memory. MCUs are used in embedded systems and on
      every day appliances such as keyboards, mouses, cars, toys,
      ... Most well-known: Atmel AVR Atmega (Arduino).

  + GPU - Graphical Processing Units 

  + DSP => Digital Signal Processor 


*Processor Architectures*

 + Most used for personal computers (based on x86)
   + Intel x86 or IA32 (32 bits).
   + AMD/Intel x86-64 or IA64 (64 bits).

 + Widely cores on Embedded Systems:

   + [[https://en.wikipedia.org/wiki/ARM_architecture][ARM Core]] (32 bits) - Widely used in Smartphones, PDAs, Tablets,
     Printers and so on. Note: ARM is not an specific processor, it
     is a CPU architechture designed by the [[https://en.wikipedia.org/wiki/Arm_Holdings][Arm company]] and licensed
     to IC (Integrated Circuit Manufacturers) which embbeds the CPU
     in their devices. So, the ARM-based CPUs, embedded processors
     and microncontrollers are produced by many manufacturers which
     makes them highly available and cost effective.
     + Some ARM-based device manufacturers: Samsung, Apple, Nvidia,
       Qualcomm, Phillips, Atmel, Texas Instruments,
       STMicroelectronics and many others. 

   + *MIPS* (32 and 64 bits) - CPU designed by [[https://en.wikipedia.org/wiki/MIPS_Technologies][MIPS Techonologies]]  that
     is licensed IC manufacturers in a similar manner to ARM core.
     + Some manufacturers: Sony, Toshiba, Boradcom, NXP and Semiconductors.
     + [[https://en.wikipedia.org/wiki/List_of_MIPS_architecture_processors][List of MIPS processors]]

   + *Power PC* (Former Motorola)

*Computer Architectures*

  + IBM-PC Architecture

  + Mainframes 

  + Game Consoles (Proprietary computer architectures)

  + PLC (Programmable Logic Controllers) - Proprietary Computer
    Architecture with a human-friendly interface used for industrial
    automation.


 *Graphical Stack* - Outline of the most common graphical interface systems.

 + X Windows System - X11 - XServer/Xlib Unix (Linux, BSD, FreeBSD)
 + Windows API / Microsoft Windows OS
 + MacOSX  - Cocoa 

 *Main C/C++ GUI - Graphical User Interfaces Libraries and APIs*

  + *QT toolkit* / C++ - Cross Platform. QT is the most supported cross
    platform toolkit, but it is hard to be called from languages
    other than C++ as it is written in C++ and this language doesn't
    have a standard ABI (Application Binary Interface).
  + *GTK* / C with C++ inteface - Cross platform, most common in Linux OS.
  + *Windows API*. / Only available on Windows.
  + *Cocoa* / MacOSX - Not cross platform. It is only available on MacOSX.
  + [[https://en.wikipedia.org/wiki/X_Window_System][X-Windows Systems]] (XServer/X11 + XLib) - Most low level graphical user
    interface library on Linux, BSD and others. Note: In Linux and
    BSD, the graphical user interface is not part of the Kernel.

 *Native Executable Binary Formats*

 + Windows / .exe, *.dll files         ([[https://en.wikipedia.org/wiki/Portable_Executable][PE]] - Portable Executable)
 + Linux   / No extension, *.so files  ([[https://en.wikipedia.org/wiki/Executable_and_Linkable_Format][ELF]] - Executable and Linkable Format)
 + MacOSX  / *.dylib                   ([[https://en.wikipedia.org/wiki/Mach-O][Mach-O]] - Match Object )

 *Some Firmwares (EEPROMs, Microcontrollers) Binary Formats*

 + [[https://en.wikipedia.org/wiki/SREC_(file_format)][SREC]] 
 + [[https://en.wikipedia.org/wiki/Intel_HEX][Intel HEX]]
 + SquashFS 

 *Tooling*

 + _Compilers_

   + [[https://en.wikipedia.org/wiki/GNU_Compiler_Collection][GCC]] - Gnu C/C++ Compiler (g++) (Stard Compiler of many Linux distributions)

   + [[https://en.wikipedia.org/wiki/MinGW][Mingw]] - GCC compiler (g++) ported to Windows operating system.

   + [[https://en.wikipedia.org/wiki/Microsoft_Visual_C++][Microsoft Visual C++]] - C/C++ compiler - MSVC, aka VC++ (cl.exe)

   + [[https://en.wikipedia.org/wiki/Clang][LLVM/Clang]] (Clang++)

   + [[https://en.wikipedia.org/wiki/Intel_C++_Compiler][Intel C++ Compiler]]

   + PGI Compiler (Portland Group)

   + Proprietary compilers for embedded Devices:
     + Many embedded devices such as microcontrollers, embedded
       processors and DSPs have proprietary compilers provided by
       device manufactures. Example: [[https://en.wikipedia.org/wiki/MPLAB][MPLAB]]

     + *IAR Embedded Workbench* (Compilers + IDE) (IAR Systems) =>
       Targets: ARM Cortex, 8051 MCU, Texas Instruments MSP430

 + Building Tools
   + Cmake
   + MSBuild
   + Ninja
   + Make 
     + NMake => Windows implementation
     + GNU Make (GMake) => GNU/Linux implementation of Make
     + BSD Make => BSD Implementation of Make
