Here are some quick and dirty notes on the basics of compiling and running programs in different languages on a Mac with OS X.
Mac OS X 10.11 (El Capitan) includes C, C++, Objective-C, Java, Ruby, Python, PHP, Perl, shell and JavaScript compilers. Most of them were available on earlier versions of the Mac OS also.

I hope it gives a beginner enough information that with a little experimentation you can run one of the examples.
If you get the bug, get a book on a language (Python is a good starting language) and try something more sophisticated. Who knows, you may write the next killer app.


Run the java compiler by typing "javac Hello.java". The default output for javac is a .class file
To run the java bytecode you just type "java Hello". You don't enter .class.
Note: The java bytecode Hello.class can be copied to any computer with a java virtual machine (JVM). (The Java Runtime Environment (JRE) contains the JVM).
This is often referred to as "write once, run anywhere" (WORA).


The default output for gcc (The C compiler is a.out)
Run "gcc Hello.c -o Hello" to create machine code output in Hello
To run it type "./Hello" to run it in the current directory.
Languages like C and C++, are compiled to machine code which will only run on the computer they are compiled for.

Compilers are in /usr/bin. I added "PATH=$PATH:$HOME/bin:/usr/bin" to my .profile in the terminal app to run them without specifying the full path.


Type "python Hello.py" to run it.

For Mac OS X
Lang Source file Compiler
C x.c gcc
C++ x.cpp g++
Java x.java javac
Python x.py python
Objective-C x.m clang


LLVM:
The C, C++, and Objective-C compilers on the Mac seem to come form LLVM.

The LLVM Compiler Infrastructure Project says,
"The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. The name "LLVM" itself is not an acronym; it is the full name of the project.
LLVM began as a research project at the University of Illinois, with the goal of providing a modern, SSA (static single assignment form)-based compilation strategy."
It supports Linux, FreeBSD MacOS X, and Windows.
See Getting Started with the LLVM System -- LLVM 3.9 documentation

You will find clang, gcc and g++ in /usr/bin in the BSD UNIX system underlying the MAC OS X operating system. The man page says,
"clang is a C, C++, and Objective-C compiler which encompasses preprocessing, parsing, optimization, code generation, assembly, and linking."

I haven't figure out if gcc and g++ are special cases of clang or what.


Objective-C and Xcode: for iPhone, iPad, Apple Watch, Apple TV
Objective-C is a programming language from Apple for creating apps for the iPhone, iPad, Apple Watch, Apple TV and OS X.
Xcode is a a complete developer toolset for creating apps

The Swift Programming Language has replaced Objective-C.

Compile:
You can compile from Xcode or the terminal as follows:
clang -framework Foundation hello.m -o hello See:
Installing Xcode and Compiling Objective-C on Mac OS X - Techotopia
Xcode - Support - Apple Developer
Xcode - Downloads - Apple Developer


Android

Download Android Studio and SDK (Software Development Kit) Tools | Android Developers

The Eclipse IDE (Integrated development environment) for Java and the JDK (Java Development Kit) was used in the past, but is no longer supported.


Links:
Flowcharting Symbols
Download Android Studio and SDK Tools | Android Developers for creating Android apps.

last updated 4 Mar 2016