'Hello, World!' in 25 Programming Languages: Proposal, Docs and Links.

  14 mins read  

Hello World in 25 Programming Languages: Proposal, Docs and Links.

I have selected the most used languages ​​in the market with data that can make you study or know better to make your choice, whether for the job market or for building personal or business projects:

  • A brief description and/or curiosity of each;
  • the extent to which each one uses;
  • Hello World! ;
  • how to run, compile and/or interpret;
  • dependencies;
  • link with example;

Follow:


Assembly

01. Assembly

https://curlie.org/Computers/Programming/Languages/Assembly/

File: vim hello-world.asm

Assembly or assembly language is a human readable notation for machine code that a specific computer architecture uses, used to program code understood by computational devices such as microprocessors and microcontrollers.

section     .text
global      _start

_start:

    mov     edx,len
    mov     ecx,msg
    mov     ebx,1
    mov     eax,4
    int     0x80

    mov     eax,1
    int     0x80

section     .data

msg     db  'Hello, World!',0xa 
len     equ $ - msg

Must have compiler and linker: ld .

Run: nasm -f elf64 -o hello-world.o hello-world.asm && ld hello-world.o -o hello-world && ./hello-world
Example: http://asm.sourceforge.net/intro/hello.html


C

02. C

https://www.iso.org/standard/74528.html

File: vim hello-world.c

C is a general purpose, structured, imperative, procedural compiled programming language, standardized by the International Organization for Standardization (ISO), created in 1972 by Dennis Ritchie at AT&T Bell Labs for Unix operating system development (originally written in Assembly) .

#include <stdio.h>
int main() {
 printf("Hello, World!\n");
 return 0;
}

You must have a compiler installed, eg gcc .

Run: gcc hello-world.c -o hello-world.o && ./hello-world.o

Example: https://terminalroot.com.br/2011/10/ola-mundo.html


C++

03. C++

https://isocpp.org/

File: I vim hello-world.cpp , I vim hello-world.c++ or I vim hello-world.cc

C++ (reads see plus plus) is a compiled multi-paradigm programming language (its support includes imperative, object oriented and generic language) and commonly used.

#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}

You must have a compiler installed, eg gcc .

Run: g++ hello-world.cpp -o hello-world.o && ./hello-world.o

Example: https://en.cppreference.com/book/intro/hello_world


Go

04. Go

https://golang.org/

File: vim hello-world.go

Go is a programming language created by Google and released in open source in November 2009. It is a compiled language.

package main

import "fmt"

func main() {
    fmt.Printf("Hello, World!\n")
}

You must have go installed.

Run: go build hello-world.go && ./hello-world

Example: https://tour.golang.org/welcome/1


Bash

05. Bash

https://www.gnu.org/software/bash/ File: vim hello-world.sh or vim hello-world.bash
Bash is a script language or command interpreter, one of several translators.

#!/bin/bash
echo 'Hello, World!'

Run: bash hello-world.sh , sh hello-world.sh , source hello-world.sh , chmod +x ./hello-world.sh && ./hello-world.sh

Example: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-2.html


Awk

06. Awk

https://www.gnu.org/software/gawk/

File: vim hello-world.awk

The AWK programming language was created in 1977 by scientists Alfred Aho, Peter J. Weinberger and Brian Kernighan in the Bell Labs lab.

#!/usr/bin/env awk
BEGIN {print "Hello, World!"}

There are several variants of Awk: Learn more here .

Run: awk -f hello-world.awk

Example: https://www.gnu.org/software/gawk/manual/gawk.html#BEGIN_002fEND


Vim

07. VimScript

https://www.vim.org/

File: vim hello-world.vim

Vim’s scripting language, known as Vimscript, is a typical dynamic imperative language that offers most common language features.

:echo "Hello, World!"

Must have vim installed.

Run: vim -u hello-world.vim +qall

Vim and VimScript Course: https://terminalroot.com.br/vim


SQL

08. SQL

https://sigmod.org/#standards

File: vim hello-world.sql

Structured Query Language, or Structured Query Language or SQL, is the standard declarative query language for relational database (relational database).

SELECT "Hello, World!"

You must have MySQL for this example: MySQL .

Run: mysql -u root -p < hello-world.sql or directly: mysql -u root -p -e "SELECT 'Hello, World'"

Uses: https://terminalroot.com.br/2011/10/curso-certificacao-linux-lpi-102.html


Moon

09. Lua

https://www.lua.org/

File: vim hello-world.lua

Lua is a small, reflective, lightweight multiparadigm scripting language designed to expand general applications by being an extensible language (which joins parts of a program made into more than one language), for prototyping, and for software embedding. complex, like games. It resembles Python, Ruby and others.

#!/usr/bin/env lua
print "Hello, World!"

Must have Lua installed.

Run: lua hello-world.lua or chmod +x hello-world.lua && ./hello-world.lua

Example: https://terminalroot.com.br/2016/11/blog-linux-lua.html


Perl

10. Perl

https://www.perl.org/

File: vim hello-world.pl

Perl is a family of two multiplatform programming languages, Perl 5 and Perl 6.

#!/usr/bin/env perl
print "Hello, World!\n";

Must have Perl installed.

Run: perl hello-world.pl or chmod +x hello-world.pl && ./hello-world.pl

Example: https://metacpan.org/pod/Perl::Tutorial::HelloWorld


PHP

11. PHP

https://www.php.net/

File: vim hello-world.php

PHP (a recursive acronym for “PHP: Hypertext Preprocessor”, originally Personal Home Page) is a free interpreted language, originally used only for the development of server-side applications that are capable of generating dynamic content on the World Wide Web.

#!/usr/bin/env php
<?="Hello, World!\n"?>

You must have PHP installed.

Run: php hello-world.php or chmod +x hello-world.php && ./hello-world.php

Example: https://terminalroot.com.br/2011/12/como-crea-chat-com-sockets-em-php-no.html


Python

12. Python

https://www.python.org/

File: vim hello-world.py

Python is a high-level, interpreted, scripted, imperative, object-oriented, functional, dynamic typing, and strong programming language.

#!/usr/bin/env python
print("Hello, World!")

You can run Python directly at the prompt: python .

Run: python hello-world.py or chmod +x hello-world.py && ./hello-world.py

Example: https://terminalroot.com.br/2016/12/script-basico-de-python-para-learning.html


JavaScript

13. JavaScript

http://www.ecma-international.org/publications/standards/Ecma-262.htm

File: vim hello-world.js

JavaScript, often abbreviated as JS, is a high-level interpreted programming language, also characterized as dynamic, poorly typed, prototype-based, and multi-paradigm.

console.log("Hello, World!");

You must have Nodejs installed.

Run: node hello-world.js

Example: https://terminalroot.com.br/2011/11/some-codigos-simples-de-javascript.html


Java

14. Java

https://www.java.com/

File: vim hello-world.java

Java is a programming language developed by engineers at Sun Microsystems. It is an object-oriented language designed to run on multiple platforms without the need to recompile the code on each platform.

  • JDK - Java D evelopment K it is required to develop java applications. JRE is smaller than JDK, so it needs less disk space.

OpenJDK is a free and free implementation of the Java platform, Standard Edition.

class OlaMundo {
    public static void main(String args[]) {
        System.out.println("Hello, World!");
    }
}

Must have compiler and linker: JDK .

Run: javac hello-world.java && java OlaMundo , javac creates a file with the class name (inside the same directory where you ran it), in this case HelloMundo with the extension .class ( OlaMundo.class ), but to run does not report the .class .

OpenJDK: https://openjdk.java.net/


Rust

15. Rust

https://www.rust-lang.org

File: vim hello-world.rs

Rust is a compiled multiparadigm programming language developed by Mozilla Research. It is designed to be “safe, concurrent and practical”, supporting the purely functional, procedural, and object-oriented styles. It has native WebAssembly support.

fn main() {
    println!("Hello, World!");
}

Must have compiler: rustc .

Run: rustc hello-world.rs && ./hello-world

Example: https://doc.rust-lang.org/stable/rust-by-example/hello.html


Swift

16. Swift

https://swift.org/

File: vim hello-world.swift

Swift is a programming language developed by Apple for development on iOS, macOS, watchOS, tvOS and Linux.

print("Hello, World!")

Must have swift .

Run: swift build && .build/debug/hello-world , this inside a directory with Sources

Example: https://swift.org/getting-started/#installing-swift


Dart

17. Dart

https://dart.dev/

File: vim hello-world.dart

Dart (originally called Dash) is a web-based scripting language developed by Google.

main() {
  print('Hello, World!');
}

Need dependencies .

Run: dart hello-world.dart

Example: https://dart.dev/#try-dart


Kotlin

18. Kotlin

https://kotlinlang.org/

File: vim hello-world.kt

Kotlin is a multiplatform programming language that compiles for the Java Virtual Machine and can also be translated into JavaScript and compiled into native code.

#!/usr/bin/env kotlins
package hello

fun main() {
    println("Hello, World!")
}

Must have dependencies .

Run: kotlinc hello-world.kt -include-runtime -d hello-world.jar && java -jar hello-world.jar

Example: https://kotlinlang.org/docs/tutorials/kotlin-for-py/compiling-and-running.html


R

19. R

https://www.r-project.org/

File: vim hello-world.r

R is a computational environment and a programming language that has been progressively specializing in data manipulation, analysis and visualization.

#!/usr/bin/env Rscript
OlaMundo <- function(){
   print('Hello, World!')
}

OlaMundo()

Must have R installed.

Run: Rscript hello-world.r

Example: https://cran.r-project.org/doc/manuals/r-release/R-intro.html


Julia

20. Julia

https://julialang.org/

File: vim hello-world.jl

Julia is a high-level dynamic programming language designed to meet the requirements of scientific and numerical high performance computing and is also effective for general purpose programming.

#!/usr/bin/env julia
println("Hello, World!")

To use the compiled form you need the JIT compiler.

Run: julia hello-world.jl

Example: https://docs.julialang.org/en/v1/manual/getting-started/


Ruby

21. Ruby

https://www.ruby-lang.org/

File: vim hello-world.rb

Ruby is a powerful, dynamic typing, self-managing multi-paradigm interpreted programming language originally designed and developed in Japan in 1995 by Yukihiro “Matz” Matsumoto for use as a scripting language.

#!/usr/bin/env ruby
puts "Hello, World!"

You need to have Ruby installed.

Run: ruby hello-world.rb

Example: https://www.ruby-lang.org/en/documentation/


Elixir

22. Elixir

https://elixir-lang.org/

File: vim hello-world.exs

Elixir is a concurrent, general purpose functional programming language that runs on the Erlang virtual machine (BEAM).

IO.puts "Hello world from Elixir"

You must have Elixir installed.

Run: elixir hello-world.exs

Example: https://elixir-lang.org/getting-started/introduction.html


Ditch

23. Vala

https://wiki.gnome.org/Projects/Vala

Extension: vim hello-world.vala

Vala is an object-oriented programming language.

class Sample : Object {
    static void main (string[] args) {
        stdout.printf ("Hello, World!\n");
    }
}

You must have Vala installed.

Run: valac hello-world.vala -o hello-world](https://wiki.gnome.org/Projects/Vala/ValaForCSharpProgrammers)

Example: https://www.vala-project.org/doc/vala/Overview.html#Getting_started


C#

24. C#

http://msdn.microsoft.com/en-us/vcsharp/default.aspx

File: vim hello-world.cs

C# is a strongly typed, multi-paradigm programming language developed by Microsoft as part of the .NET platform.

using System; 
namespace HelloWorldApp { 
    class Geeks { 
	    static void Main(string[] args) {
           Console.WriteLine("Hello, World!"); 
	       Console.ReadKey(); 
	    } 
    } 
} 

Must own Gentoo : layman dotnet && emerge mono monodevelop .

Example: https://docs.microsoft.com/en-us/dotnet/csharp/


Gambas

25. Gambas (Visual Basic for Linux)

http://gambas.sourceforge.net/

File: vim hello-world.gambas

Gambas is an integrated development environment (IDE) for Linux an Open Source alternative to Microsoft Basic Visual Basic.

Message.Info("Hello, World!")

Must have Gambas, eg sudo apt install gambas3 https://www.youtube.com/watch?v=xezNqM2zrbY .

Run: gambas hello-world.gambas

Example: https://terminalroot.com.br/2016/10/gambas-o-visual-basic-open-source-para.html


Thanks for reading!

Add our feed: https://en.terminalroot.com.br/feed to:

Feedly