Big explosion! Write Hello, World in 50 languages

When we learn a new language, "Hello, World!" Is usually the first program we write. I believe that as a programmer, you have completed at least one "Hello, World!" Program in your career. Programmers generally use multiple languages, and most people even use more than a dozen languages.

There is even an indicator called TTHW to measure the time it takes for a programmer to successfully write "Hello, World!" And run it when he is exposed to a new programming language.

However, if I ask you, how many programming languages ​​would you write "Hello, World!"? What is your answer?

In order to refresh your memory, I will take you through a time and space journey in the field of computer programming. To this end, I will show you 50 different programming languages

"Hello, World!" How to write the program. You will also understand how computer languages ​​have changed over time.

  1. Assembly language-1949
    assembly language was born in 1949. In this article, I show you the 8-bit processor for the Intel 8080, the classic assembly language code released in April 1974.

     bdos    equ    0005H    ; BDOS entry point
     start:  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
    Fortran is a derivative of Formula Translation, which is a universal interactive programming language, especially suitable for numerical and scientific calculations. Fortran was created in 1957. Here is its first "Hello, World!" Program:

     PROGRAM Hello
     WRITE (*,*) 'Hello, World!'
     STOP
     END
    

Fortran 90 or 95 is written differently:

PROGRAM Hello
WRITE (*,*) 'Hello, World!'
END PROGRAM Hello
  1. Lisp-1958
    Lisp is the oldest programming language series, it is both interactive and functional. In 1958, Lisp was created as a practical demonstration program model, but it was not until the 1970s and 1980s that Lisp became a very popular language in the artificial intelligence world.

The following is Lisp's "Hello, World!" Program:

(write-line "Hello, World!")
  1. Cobol-1959 The
    Cobol language was officially founded in 1959, and in 2019 just celebrated its 60th anniversary. Cobol stands for COmmon Business Oriented Language, with the goal of becoming a common language for programming business applications. In 2019, Cobol is still widely used in banking and insurance related systems.

The following is Cobol's "Hello, World!" Program:

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
    DISPLAY "Hello, World!"
    STOP RUN.
  1. BASIC-1964
    BASIC is the abbreviation of Beginner's All-purpose Symbolic Instruction Code. It is a high-level programming language whose main goal is ease of use. Its "Hello, World!" Program is as follows:

     PRINT "Hello, World!"
     END
    
  2. Logo-1968
    Logo is designed to be an easy-to-use Lisp, often referred to as "Lisp without brackets". Logs is not an object-oriented programming language, but it can help you get started with computer programming.

     print [Hello World !]
    
  3. B-1969 The
    B language was created in 1969. It is now obsolete, but it has played an important role in the development history of its computer programming language. Because it is the B language that inspired the widely used C language.

     main()
     {
       putstr("Hello world!*n");
       return(0);
     }
    

Is it grammatical level is very similar to C language.

  1. Pascal-1970
    Pascal is an interactive programming language, it was created in 1970. It was designed primarily for teaching purposes, because the language is characterized by clarity, and strict grammar contributes to a good program structure.

     begin
       writeln('Hello, World!')
     end.
    

Turbo Pascal is an integrated development environment for the Pascal language. It was created in 1983 and achieved great success in the 1980s and 1990s.

Turbo Pascal's "Hello, World!" Program is as follows:

program HelloWorld(output);
begin
  writeln('Hello, World!');
  readln;
end.
  1. Forth-1970
    Forth is a stack-based interactive programming language, invented by Charles H. Moore in the 1960s. But its first major version was released in 1970. It was standardized by ANSI in 1994 and adopted by ISO in 1997. Forth2012 in 2014 brought new life to the development of language.

The following is the "Hello, World!" Program from the 1970 version of Forth:

HELLO  ( -- )  ." Hello, World!" CR ;
HELLO
  1. C-1972
    At Bell Labs in 1972, Dennis Ritchie and Ken Thompson, two big brothers, invented the C language for the development of UNIX. Ken Thompson had developed the B language, and Dennis Ritchie decided to create the C language by adding types to the B language. So B language provides inspiration for C language.

    #include <stdio.h>
    
    int main(void) {
      printf("Hello, World!\n");
      return 0;
    }
    
  2. Smalltalk-1972
    Smalltalk was inspired by Lisp. It is an object-oriented, dynamically typed programming language. It was invented in 1972. Smalltalk is one of the earliest programming languages ​​with an integrated development environment.

    Transcript show: 'Hello, world!'; cr.
    
  3. Prolog-1972
    Prolog is a logic programming language related to artificial intelligence and computational linguistics. It was created in 1972.

    :- write('Hello, World!'),nl.
    
  4. ML-1973
    ML is short for Meta Language and is a functional programming language based on Lisp. ML is usually characterized by Lisp and has types.

    print "Hello, World!\n";
    
  5. Scheme-1975
    Scheme was founded in 1975. It is a multi-paradigm programming language that supports functional and interactive programming. It is one of three important variants of Lisp and was jointly developed by Common Lisp and Clojure.

    (display "Hello, World!") (newline)
    
  6. SQL-1978
    SQL stands for Structured Query Language and is a standard computer programming language for operating relational databases. Although it is impossible to create a simple "Hello, World!" Program at design time, I think it should be an interesting program. If you want to learn SQL, here are some recommended courses.

    CREATE TABLE message (text char(15));
    INSERT INTO message (text) VALUES ('Hello, World!');
    SELECT text FROM message;
    DROP TABLE message;
    
  7. C ++-1980
    C ++ was created by Bjarne Stroustrup in 1980. He added classes to the C language and was named C ++ in 1983. Now C ++ has passed ISO standardization and is widely used in industry and other fields. If you want to learn C ++, here are some recommended courses.

    #include <iostream>
    using namespace std;
    
    int main() {
      cout << "Hello, World!" << endl;
      return 0;
    }
    
  8. Ada-1983
    Ada is an object-oriented programming language. Its development began in early 1980 and was released in 1983. The reason why it is called Ada is to commemorate Ada Lovelace, which may be the first female computer scientist in history.

Ada is usually used in real-time systems and embedded systems that require high reliability and security.

	with Ada.Text_IO;
	procedure Hello is
	begin
	   Ada.Text_IO.Put_Line ("Hello, World!");
	end Hello;
  1. Common Lisp-1984
    Common Lisp, usually abbreviated as CL, is the ANSI standardized Lisp language specification.

    (princ "Hello, World!")
    
  2. MATLAB-1984
    MATLAB is a scripting language for numerical calculations and is used in "Matrix Laboratory". MATLAB is simulated by the development environment of the same name.

    disp('Hello, World!')
    
  3. Eiffel-1985
    Eiffel is an object-oriented programming language designed around design methods. It has very popular concepts such as "programming by convention" or reuse.

    class
        HELLO_WORLD
    create
        make
    feature
        make
            do
                print ("Hello, world!%N")
            end
    end
    
  4. Objective-C-1986
    Objective-C is an object-oriented programming language. Like C ++, it is an extension of the C language. The difference from C ++ is its dynamic message distribution or dynamic loading.

Now, it is mainly used for Apple operating systems: macOS and iOS derivatives.

#import <Foundation/Foundation.h>
 
int main() {
    @autoreleasepool {
        NSLog(@"Hello, World!");
    }
}
  1. Erlang-1986
    Erlang is a programming language that supports multiple paradigms: concurrent, real-time, and distributed. It is based on the Actor Model, with fault tolerance and hot code update capabilities, so the availability of applications developed by Erlang is usually very high.

    io:format("Hello world!~n").
    
  2. Perl-1987
    Perl is a programming language created by Larry Wall in 1987. It can easily handle text-based messages. Perl is an interpreted language, which is inspired by the control and printing structure of C language and shell scripts.

    print "Hello, World!\n";
    
  3. Caml-1987
    Caml stands for Categorical Abstract Machine Language, which is a general-purpose programming language designed to improve the safety and reliability of programs. Caml is a functional, interactive and object-oriented style, which is also a very unique language.

    print_string "Hello, World!\n";;
    
  4. Tcl-1988
    Tool Command Language (Tool Command Language) is a scripting language developed by John Ousterhout in 1988. It is a dynamically typed language with the characteristics of cross-platform, extensible and easy to learn. And can easily interact with C language.

In 1990, John Ousterhout developed the Tcl extension-Tk, which is a portable library for creating graphical interfaces. Most of the Tcl we discuss today refers to the combination of Tcl and Tk.

puts "Hello, World!"
  1. Haskell-1990
    Haskell is a functional programming language based on lambda calculation and combinational logic.

    main = putStrLn "Hello, World!"
    
  2. Python-1991 I
    believe that everyone is familiar with Python, even if I haven't, I have basically heard of it. It is an interpreted language that can be cross-platform. Python supports structure, function and object-oriented interactive programming. With the development of AI, the popularity of Python has continued to rise in recent years.

If you want to learn Python, you can refer to this course recommendation.

The following is the writing method of the "Hello, World" program after Python3.0.

print("Hello, World!")
  1. Visual Basic-1991
    Visual Basic, commonly referred to as VB, is the third generation event programming language. Microsoft has also created an integrated development environment for it.

    Public Sub Main()
        Debug.Print "Hello, World!"
    End Sub
    
  2. Lua-1993
    Lua was founded in 1993 as an interactive programming language. It focuses on embedding other applications to extend it.

Translator's Note: We have introduced the application of Lua in Redis before, I don't know if you remember.

print("Hello, World!")
  1. Ruby-1995
    Due to frustration with the development of Smalltalk and Lisp, Yukihiro Matsumoto has been designing the Ruby language on Emacs since 1993, and the first version was released in 1995. Ruby is an interpreted, object-oriented, multi-paradigm programming language. If you are interested, you can take a look at these courses.

    puts 'Hello, World!'
    
  2. Java-1995
    Java is an object-oriented programming language created by James Gosling (the high commander we often say) in 1995. So far, Java is still the most popular and widely used language in the industry. Java can be used to develop applications from the client to the server to various applications. Google's choice of Java as the Android development language has led to further development of Java. If you want to learn Java, you can pay attention to these courses.

    class HelloWorld {
      public static void main(String[] args) {
        System.out.println("Hello, World!");
      }
    }
    
  3. JavaScript-1995
    JavaScript is a scripting language mainly used to develop Web pages, but it can also be used for server-side development, such as Nodejs. JS is a process-oriented language, and the recommended courses are here.

    document.write('Hello, World!');
    
  4. PHP-1995
    1995 was definitely a very important year for programming languages. After Java and JavaScript, PHP was born in the same year. PHP is an interpreted object-oriented programming language.

    <? echo "Hello, World!" ?>
    
  5. Rebol-1997
    Rebol is a high-level scripting language, calling itself "messaging language".

    print "Hello, World!"
    
  6. ActionScript — 1998
    ActionScript can be used to develop client applications, such as Adobe Flash and Adobe Flex; it can also be used for server-side development (Flash media server, JRun, Macromedia Generator). Now, ActionScript is used as a scripting language in the Unity graphics engine.

    package {
      public class HelloWorld {
        public function HelloWorld() {
          trace("Hello World !");
        }
      }
    }
    
  7. D-1999
    D language is an object-oriented programming language, its design is borrowed from many languages, including C ++, Java and Eiffel. D is an excellent language, but it has not been as successful as its creators expected.

    import std.stdio;
    
    void main () {
      writefln("Hello, World!");
    }
    
  8. C #-2000 In
    2000, Microsoft disputed Java with Sun, and later created C #. C # is an object-oriented programming language designed to be developed on the Microsoft.NET platform. It is derived from C ++ and Java In the past, many of their common features and concepts were used. C # can also be used to develop Web applications on the ASP.NET platform. C # course self-fetching.

    using System;
    
    internal static class HelloWorld {
      private static void Main() {
        Console.WriteLine("Hello, World!");
      }
    }
    
  9. Groovy-2003
    Groovy is an object-oriented programming language running on the Java virtual machine. It is a superset of Java, and its design was inspired by Python, Ruby, and Smalltalk. Here are some learning books for reference.

    println "Hello, World!"
    
  10. Scala-2003
    Scala is a multi-paradigm programming language designed to express common programming models in a concise and elegant form. Scala integrates object-oriented and functional programming paradigms through static typing. Scala courses.

    object HelloWorld extends App {
      println("Hello, World!")
    }
    
  11. F #-2005
    F # is a functional, object-oriented programming language developed on the .NET platform. F # is derived from OCaml, which is highly compatible with it. They all belong to the ML language series.

    printfn "Hello, World!"
    
  12. Windows PowerShell-2006
    Windows PowerShell is a software suite developed by Microsoft, including a command line interface, a scripting language and development kit called PowerShell. Starting with Windows 7, PowerShell has been provided as a standard configuration.

    echo "Hello, World!"
    
  13. Clojure-2007
    Clojure is a compiled, cross-platform functional programming language that can develop distributed systems safely and simply. Clojure is one of the three main dialects of Lisp. Clojure can be compiled into Java bytecode, JavaScript code or .NET bytecode, so it can run on the JVM, CLR and browser.

    (println "Hello, World!")
    
  14. Go-2009
    Go is a compiled programming language that supports concurrency. Its design was inspired by C and Pascal. The language was developed by Google from the original concepts of Robert Griesemer, Rob Pike, and Ken Thompson. That's right, this Ken Thompson was the one who designed the B language in 1969!

    package main
    
    import "fmt"
    
    func main() {
      fmt.Println("Hello, World!")
    }
    
  15. Rust-2010
    Rust is a multi-paradigm compiled programming language designed and developed by Mozilla. Rust is designed as a "safe, concurrent, and practical language" that supports functional programming styles and object-oriented programming in some ways. Rust is expected to replace C ++.

    fn main() {
        println("Hello, World!");
    }
    
  16. Dart-2011
    Dart is a programming language developed by Google for web applications. Its original goal was to replace JavaScript. At present, Dart's goal has not been achieved. The first task for developers is to convert Dart into JavaScript code that is compatible with all modern browsers. Dart can also be used for server-side development.

Dart's recent momentum is fierce, mainly because it is the development language of Flutter, a popular framework for mobile phones.

main() {
  print('Hello, World!');
}
  1. Kotlin — 2011
    Kotlin is an object-oriented programming language that supports static typing and can be compiled into bytecode and run on a Java virtual machine. It can also be compiled into JavaScript language, or a language that runs on multiple other platforms. (Thanks to LLVM) In 2017, Google made Kotlin the second language officially supported by Android after Java. If you want to learn Kotlin, you can refer to these courses.

    fun main(args: Array<String>) {
        println("Hello, World!")
    }
    
  2. Ceylon-2011
    Ceylon is an open source strongly typed and statically typed high-level programming language created by "Red Hat". Its syntax is similar to Java. It can be compiled into Java bytecode and JavaScript.

    void hello() {
        print("Hello, World!");
    }
    
  3. TypeScript-2012
    TypeScript is a free, open source programming language developed by Microsoft. Used to improve and protect the production of JavaScript code. TypeScript is a superset of JavaScript and can be converted to JavaScript for interpretation by any web browser or JavaScript engine.

    console.log("Hello, World!");
    
  4. Julia-2012
    Julia is an advanced, powerful, and dynamic programming language for scientific computing, using syntax familiar to users of other similar development environments (such as MATLAB, R, or Python).

    println("Hello, World!")
    
  5. Swift-2014
    Swift is a compiled, multi-paradigm programming language that is simple, efficient, and safe. It was developed by Apple and open source. Make it a solution for developing iOS mobile applications like Objective-C.

    print("Hello, World!")
    

Conclusion
Our journey is coming to an end. I think you have introduced the writing of the "Hello, World!" Program in 50 languages. The list of programming languages ​​provided in this article is far from exhaustive. Hope you can share with me the "Hello, World!" Program in your favorite language.

Published 12 original articles · Liked5 · Visit 1559

Guess you like

Origin blog.csdn.net/qq_43562926/article/details/105001169