
This is a journey through the programming world of computers.
For many people, whenever they learn a new programming language, the first line of code they write is often “Hello, World!” Therefore, “Hello, World!” has become a classic program.
Throughout their careers, all programmers have written at least one “Hello, World!” program. As they grow, programmers often use multiple programming languages, with many even having implemented dozens of different versions of “Hello, World!”.
There is even a metric called TTHW, which measures the time it takes for programmers to implement and successfully run a “Hello, World!” program in a new programming language.
But now, if I ask you how many different programming languages you can write “Hello, World!” in, what would your answer be? To help you recall, I will show you how to write “Hello, World!” in 50 different programming languages. This will also allow you to see the historical evolution of computer programming languages over the years.
1. Assembly Language – 1949
Assembly language was created in 1949. In this article, I will show you a classic assembly program written for the Intel 8080 platform, an 8-bit processor released in late April 1974.
bdos equ 0005H ; BDOS entry pointstart: mvi c,9 ; BDOS function: output string lxi d,msg$ ; address of msg call bdos ret ; return to CCP
msg$: db 'Hello, world!$'end start
2. Fortran – 1957
The Fortran programming language is derived from Formula Translation. It is a compiled general-purpose imperative programming language, particularly suited for numerical and scientific computing. Fortran was created in 1957, and here is the “Hello, World!” program written in the first version of this language:
PROGRAM Hello
WRITE (*,*) 'Hello, World!'
STOP
END
In Fortran 90 or 95, the “Hello, World!” program can be written as follows:
PROGRAM Hello
WRITE (*,*) 'Hello, World!'
END PROGRAM Hello
3. Lisp – 1958
Lisp is the oldest programming language family, being both imperative and functional. Lisp was originally created in 1958 as a practical model for demonstrating programs. In the 1970s and 1980s, the Lisp family became very popular in the field of artificial intelligence.
Here is the “Hello, World!” program written in Lisp:
(write-line "Hello, World!")
4. Cobol – 1959
Cobol was officially created in 1959, so the Cobol programming language just celebrated its 60th anniversary in 2019. Cobol stands for COmmon Business Oriented Language, invented with the hope of making it a universal language for business programming. In 2019, Cobol is still widely used in banking and insurance industries.
Here is the “Hello, World!” program written in Cobol:
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY "Hello, World!"
STOP RUN.
5. BASIC – 1964
BASIC stands for Beginner’s All-purpose Symbolic Instruction Code, and it is a high-level programming language aimed at ease of use, as confirmed by the following “Hello, World!” program:
PRINT "Hello, World!"
END
6. Logo – 1968
The Logo language is similar to Lisp but is easier to use, which is why it was invented; people often refer to Logo as “Lisp without parentheses”.
print [Hello World !]
7. B – 1969
The B language was invented in 1969 and is now obsolete, but it played an important role in the development of the C language, which is widely used today.
main(){ putstr("Hello world!*n"); return(0);}
8. Pascal – 1970
Pascal is an imperative programming language created in 1970, designed for teaching, characterized by clear and rigorous syntax that helps generate good program structures.
begin writeln('Hello, World!')
end.
Turbo Pascal was created in 1983 and is an integrated development environment for the Pascal programming language. Turbo Pascal achieved great success in the 1980s and 1990s.
Here is the “Hello, World!” program in Turbo Pascal:
program HelloWorld(output);
begin writeln('Hello, World!'); readln;
end.
9. Forth – 1970
Forth is a stack-based imperative programming language created by Charles H. Moore in the 1960s, but its first major version was released in 1970. This language was standardized by ANSI in 1994 and adopted by ISO in 1997. Here’s to Forth, which even welcomed a new version in 2014, known as Forth 2012.
Here is the “Hello, World!” program in the 1970 version of Forth:
: HELLO ( -- ) ." Hello, World!" CR ; HELLO
10. C – 1972
The C programming language was developed by Dennis Ritchie and Ken Thompson at Bell Labs in 1972 while creating UNIX. Ken Thompson had previously invented the B language. Dennis Ritchie, inspired by the B language, decided to invent a new language, C, introducing the concept of types.
#include <stdio.h>
int main(void) { printf("Hello, World!\n"); return 0;}
11. Smalltalk – 1972
Smalltalk is an object-oriented programming language with reflexivity and dynamic typing, invented in 1972, primarily inspired by Lisp. Smalltalk is one of the earliest programming languages to have an integrated development environment.
Transcript show: 'Hello, world!'; cr.
12. Prolog – 1972
Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Prolog was created in 1972.
:- write('Hello, World!'),nl.
13. ML – 1973
ML stands for Meta Language, a functional programming language based on Lisp. ML is often regarded as a typed version of Lisp.
print "Hello, World!\n";
14. Scheme – 1975
Scheme was created in 1975; it is a multi-paradigm programming language that supports both functional and imperative styles. It is one of the three major variants of Lisp, with the other two, Common Lisp and Clojure, being developed much later.
(display "Hello, World!") (newline)
15. SQL – 1978
SQL stands for Structured Query Language, a standardized computer language for operating relational databases. Although it is not typically used to create simple “Hello, World!” programs, it is interesting to create an SQL program as shown below.
CREATE TABLE message (text char(15));
INSERT INTO message (text) VALUES ('Hello, World!');
SELECT text FROM message;
DROP TABLE message;
16. C++ – 1980
C++ was initially created by Bjarne Stroustrup in 1980, named after the C language but including the concept of classes. The language was officially named C++ in 1983.
This programming language is now standardized by ISO and is widely used in industry and other fields.
#include <iostream>
using namespace std;
int main() { cout << "Hello, World!" << endl; return 0;}
17. Ada – 1983
Ada is an object-oriented programming language that began development in the early 1980s, officially released in 1983 as Ada 1983. The name “Ada” commemorates Ada Lovelace, who is often regarded as the first female computer scientist in history.
Ada is typically used in real-time and embedded systems that require high reliability and safety.
with Ada.Text_IO;
procedure Hello is
begin Ada.Text_IO.Put_Line ("Hello, World!");
end Hello;
18. Common Lisp – 1984
Common Lisp, often abbreviated as CL, is the standardized Lisp language specification by ANSI.
(princ "Hello, World!")
19. MATLAB – 1984
MATLAB stands for “Matrix Laboratory”; it is a scripting language used for numerical computation. MATLAB is written in its namesake development environment.
disp('Hello, World!')
20. Eiffel – 1985
Eiffel is an object-oriented programming language designed around a design methodology. Eiffel is based on popular concepts today, such as contract programming and reuse.
class HELLO_WORLD
create make
feature make do print ("Hello, world!%N") end
end
21. Objective-C – 1986
Objective-C is a reflective object-oriented programming language. It is an extension of the C programming language, similar to C++, but differs significantly from C++ in aspects like dynamic message dispatch and dynamic loading.
Today, it is primarily used in Apple’s operating systems: macOS and its derivative iOS systems.
#import <Foundation/Foundation.h>
int main() { @autoreleasepool { NSLog(@"Hello, World!"); }}
22. Erlang – 1986
Erlang is a programming language that supports multiple paradigms: concurrent, real-time, and distributed. Its unique layer is based on the actor model, with fault tolerance and hot code swapping capabilities, allowing the development of applications with extremely high availability.
io:format("Hello world!~n").
23. Perl – 1987
The Perl programming language was created by Larry Wall in 1987 to make it easier to process text-based information. Perl is an interpreted language influenced by the control structures and print structures of C, as well as shell scripting languages.
print "Hello, World!\n";
24. Caml – 1987
Caml stands for Categorical Abstract Machine Language, a general-purpose programming language focused on program safety and reliability. Caml supports functional, imperative, and object-oriented programming styles. It is also a very unique language.
print_string "Hello, World!\n";;
25. Tcl – 1988
Tcl stands for Tool Command Language, a scripting language developed by John Ousterhout in 1988. This dynamically typed language is cross-platform, extensible, easy to learn, and based on 12 syntax rules. Tcl is easy to interact with the C programming language.
In 1990, John Ousterhout developed an extension to Tcl called Tk, a library for creating portable graphical interfaces. Today, when we talk about Tcl, we are more often referring to the Tcl/Tk combination.
puts "Hello, World!"
26. Haskell – 1990
Haskell is a functional programming language based on lambda calculus and combinatory logic.
main = putStrLn "Hello, World!"
27. Python – 1991
Python is an interpreted programming language with multi-paradigm and multi-platform characteristics. Python supports structured, functional, and object-oriented imperative programming.
Over the years, Python has become very popular, even becoming one of the most popular languages in 2019.
Here is the “Hello, World!” program written in Python 3.0 or higher:
print("Hello, World!")
28. Visual Basic – 1991
Visual Basic, abbreviated as VB, is a third-generation event-driven programming language and an integrated development environment created by Microsoft for its COM programming model.
Public Sub Main() Debug.Print "Hello, World!"End Sub
29. Lua – 1993
Lua was created in 1993 and is a reflective, imperative scripting language used to embed functionality in other applications.
print("Hello, World!")
30. Ruby – 1995
Disappointed with the development experiences of Smalltalk and Lisp, Yukihiro Matsumoto began designing Ruby using Emacs in 1993.
He released the first version of the language in 1995. Ruby is an interpreted, object-oriented multi-paradigm language.
puts 'Hello, World!'
31. Java – 1995
Java is an object-oriented programming language created by James Gosling in 1995, and it remains one of the most popular and widely used languages in industry today.
You can do anything with Java, from client-side to web applications; moreover, Google chose Java as the development language for applications on the Android operating system, further expanding Java’s capabilities.
class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); }}
32. JavaScript – 1995
JavaScript is a scripting language primarily used for web development, but it can now also be used server-side, like with Node.js. JavaScript is a prototype-based programming language where functions are first-class objects.
document.write('Hello, World!');
33. PHP – 1995
1995 was undoubtedly a significant year for programming languages, as PHP was also invented that year, following Java and JavaScript. PHP is mainly used for the web; it is an object-oriented imperative language capable of running locally like any other interpreted language.
<? echo "Hello, World!" ?>
34. Rebol – 1997
Rebol is an advanced scripting programming language built on referential semantics, self-described as a “messaging language.” Here is the “Hello, World!” program written in Rebol:
print "Hello, World!"
35. ActionScript – 1998
ActionScript is a programming language used for client applications (such as Adobe Flash and Adobe Flex) and servers (Flash Media Server, JRun, and Macromedia Generator). ActionScript is now used as a scripting language within the Unity graphics engine.
package { public class HelloWorld { public function HelloWorld() { trace("Hello World !"); } }}
36. D – 1999
D is an imperative, object-oriented multi-paradigm programming language used for system programming. The invention of D was inspired by many languages, including C++, Java, and Eiffel. Despite its many advantages, D has never achieved the success its inventors hoped for.
import std.stdio;
void main () { writefln("Hello, World!");}
37. C# – 2000
C# was created by Microsoft in 2000 after a dispute with Sun over the Java language. C# is an object-oriented programming language used for development on the Microsoft .Net platform. The language is derived from C++ and Java, borrowing some of their common syntax and many other concepts.
C# can also be used to develop web applications on the ASP.Net platform.
using System;
internal static class HelloWorld {private static void Main() { Console.WriteLine("Hello, World!"); }}
38. Groovy – 2003
Groovy is an object-oriented programming language running on the Java platform. Groovy is a substitute for Java on this platform, influenced by Python, Ruby, or Smalltalk.
println "Hello, World!"
39. Scala – 2003
Scala is a multi-paradigm programming language designed to express general programming models concisely and elegantly. Scala adopts static typing and integrates object-oriented and functional programming paradigms.
object HelloWorld extends App { println("Hello, World!")}
40. F# – 2005
F# is a functional, imperative, and object-oriented programming language developed by Microsoft for its .NET platform. F# is derived from the OCaml programming language and is highly compatible with it. Both languages belong to the same family as ML.
printfn "Hello, World!"
41. Windows PowerShell – 2006
Windows PowerShell is a set of software developed by Microsoft, which includes a command-line interface, a scripting language called PowerShell, and a development kit. Since Windows 7, PowerShell has been a standard feature of Microsoft operating systems.
echo "Hello, World!"
42. Clojure – 2007
Clojure is a compiled, cross-platform functional programming language designed to create safe and easily distributed programs. Clojure is one of the three major variants of Lisp. Clojure can be converted into Java bytecode, JavaScript code, and .NET bytecode. Thus, Clojure can be used on JVM, CLR, browsers, and Node.js.
(println "Hello, World!")
43. Go – 2009
Go is a compiled, concurrent programming language invented with inspiration from C and Pascal. This language was developed by Google, evolving from concepts initially proposed by Robert Griesemer, Rob Pike, and Ken Thompson. This Ken Thompson is the same one who created the B language in 1969!
package main
import "fmt"
func main() { fmt.Println("Hello, World!")}
44. Rust – 2010
Rust is a multi-paradigm, compiled programming language developed by Mozilla. Rust is designed to be a “safe, concurrent, practical language” while supporting pure functional programming style, actor models, procedural programming, and object-oriented programming in certain aspects. Rust is often described as a potential successor to C++.
fn main() { println("Hello, World!");}
45. Dart – 2011
Dart is a web programming language developed by Google. Its initial goal was to replace JavaScript. Currently, Dart has not achieved its goal, and developers prefer to convert Dart to JavaScript code compatible with all modern browsers; Dart can also be used for server-side programming.
Dart is the language used by Flutter for developing mobile applications.
main() { print('Hello, World!');}
46. Kotlin – 2011
Kotlin is an object-oriented, functional programming language with static typing, allowing compilation for various platforms including the Java Virtual Machine, JavaScript, and native (thanks to LLVM). In 2017, Google made Kotlin the second officially supported programming language for Android after Java.
fun main(args: Array<String>) { println("Hello, World!")}
47. Ceylon – 2011
Ceylon is a high-level open-source programming language created by Red Hat, featuring strong typing and static typing. Its syntax is very similar to Java. It can compile to Java bytecode or JavaScript.
void hello() { print("Hello, World!");}
48. TypeScript – 2012
TypeScript is a free and open-source programming language developed by Microsoft, designed to improve the development efficiency of JavaScript code and ensure its safety. TypeScript is a superset of JavaScript, which is converted into JavaScript, so any web browser or JavaScript engine can interpret it.
console.log("Hello, World!");
49. Julia – 2012
Julia is a high-level, powerful, and dynamic programming language used for scientific computing. Users familiar with other development environments (like MATLAB, R, or Python) should find Julia’s syntax quite familiar.
println("Hello, World!")
50. Swift – 2014
Swift is a compiled, multi-paradigm object-oriented programming language designed to be simple, high-performance, and safe. It is an open-source project developed by Apple, making it a solution for developing mobile iOS applications alongside Objective-C.
print("Hello, World!")
Source: InfoQ
Author: Sylvain Saurel
Translator: Xia Ye
(End)
More Exciting:
Yan Shi│Reflections and Suggestions on the “Predicament” of Young Teachers in Colleges and Universities
【Directory】Computer Education, 2022, Issue 8
【Directory】Computer Education, 2022, Issue 7
【Directory】Computer Education, 2022, Issue 6
【Directory】Computer Education, 2022, Issue 5
【Editorial Message】Professor Li Xiaoming from Peking University: Thoughts from the “Year of Classroom Teaching Improvement”…
Professor Chen Daoxu from Nanjing University: Teaching students to ask questions and teaching students to answer questions, which is more important?
【Yan Shi Series】: Trends in Computer Science Development and Their Impact on Computer Education
Professor Li Xiaoming from Peking University: From Interesting Mathematics to Interesting Algorithms to Interesting Programming—A Path for Non-specialist Learners to Experience Computational Thinking?
Reflections on Several Issues in Building First-class Computer Disciplines
New Engineering and Big Data Major Construction
Other Stones Can Polish Jade—Compilation of Research Articles on Computer Education at Home and Abroad

