"Hello, world!" in (at least) 8 languages!

I can print “Hello, world!” in 8 languages. If you know any languages that are not on this list, feel free to comment with the “Hello, world!” statement in that language.

  1. Python
    This is the first language I learned, just a little over half a year ago. (I’ve somehow gone all the way from inexperienced to professional since then.)
print("Hello, world!")
  1. NodeJS
    Idk how I learned this. I only learned JS from HTML-CSS-JS which didn’t use console.
console.log("Hello, world!")
// or if you want to be mean to the user
console.error("Hello, world!")
  1. C
    Every programming language is in some way based on C, so it’s very important!
#include <stdio.h>

int main() {
  return printf("Hello, world!");
}
  1. C++
    Fun fact: All C code is valid C++ code but not the other way around. This is because C++ is a superset of C.
#include <iostream>
using namespace std;
/*
if you dont use the line above,
"std::cout" should be used instead of "cout"
*/

int main() {
  cout << "Hello, world!";
  return 0; // return 0 because any other number will raise an exception
}
  1. HTML-CSS-JS
    I wanted to learn this language as my third programming language, but I didn’t perfect it until very recently. This is how (I hope) you “print” Hello, world!
<!DOCTYPE html>
<html>
  <head>
    <title>Hello, world!</title>
    <style>
      body {
        line-break: anywhere;
        color: #000;
        font: 24pt "Comic Sans";
      }
      /*
         i apologize to any comic sans haters out there,
         i'm just trying to use the easiest font for me to read.
      */
    </style>
  </head>
  <body>
    Hello, world!
  </body>
</html>

This can be run in a web browser, so it’s very important to know.

  1. Bash/Shell Script
    Just say echo 'Hello, world!', it’s that simple, plus it can be run in the shell in Replit/GitHub.
  2. Swift
    This is the best programming language in the world in my opinion. Anything on the App Store must use this language.
print("Hello, world!");
// Never confuse Swift with Python or JavaScript, it's totally different!
  1. TypeScript
    This is similar to JavaScript.
console.log("Hello, world!");

I know for sure that I skipped many popular languages like Ruby, C#, Java, etc. Remember to comment any other version of “Hello, world!” you know, and I might actually add it!


These are all languages that you have added in the comments and some I learned a while ago and then forgot about until now:

  • C#
Console.WriteLine("Hello, world!");

I never actually wanted to learn C# because it is basically a copy of Java and it was originally made for the windows DOTNET framework, which I don’t like or use.

  • Applescript
tell application "System Events" to keystroke "Hello, world!"

I know Macs use Applescript but I don’t have a Mac and therefore don’t have any intentions to learn Applescript.

  • Shortcuts
    This is a block language so it can’t really be converted into text but it should look similar to this:
Alert "Hello, world!"

I developed a way to convert Shortcuts to text at some point, but I never created an official saved method and just slowly forgot everything :frowning: .

  • Java
    I never learned Java because when I first saw Java code (this was when I only knew Python) I freaked out over how complex it was.
System.out.println("Hello, world!");
  • WHENEVER
    I hate WHENEVER because it requires line numbers, and it also runs the lines in a random order. But I guess that’s what pretty much every esolang looks like…
1 print("Hello, world!");
  • Ruby
    I never learned Ruby but I hear it’s pretty simple and has a good package manager.
puts "Hello, world!"
4 Likes

For javascript there a lot of other methods for the console object to print things. Ex:

console.warn("Hello, world!")
console.assert(false, "Hello, world")
console.table(["Hello, world"])

I think there are other ways to do it but not sure

4 Likes

CC TL4: MakeWiki? (perhaps?)

2 Likes

Applescript:

tell application "System Events" to keystroke "Hello, world!"
1 Like

With @30stu225’s permission, I’ll make it one.

1 Like

by the way, EMScript has console in the form of inspect element.

1 Like

console.debug and console.info also exist, and you could probably also do something with timers.

4 Likes

this is BrainF

++++++++[->>++++<<]
><++++++++[->+++++++++<]>.+<++++[->+++++++<]>.+++++++..+++.>.<<++++[->------<]>.<++++[->++++++<]>.+++.------.--------.---<++++++++[->--------<]>.
<[-]>[-]>[-]>[-]

might be weird a bit bc this is made by my custom brainf compiler, it’s made for optimising long msg but make chunky short msg lol

1 Like

and this is go

package main
import "fmt"
func main() {
    fmt.Println("hello world")
}
2 Likes

OP mentioned that earlier?

1 Like

@NateDhaliwal oops, my mistake.

1 Like

I believe Java looks like this from memory:

System.out.println("Hello, world!");
4 Likes

C# is:

Console.WriteLine("Hello, world!");

I think Ruby is something like puts from memory, but I never wrote Ruby so that could be completely wrong.

4 Likes
puts "Hello, world!"

i think

1 Like

It’s funny because console doesn’t really exist in Node JS. console is from the browser. In Node JS, console.log is really just a call to process.stdout.write, which writes directly to the terminal/console.

4 Likes

HTML is not a programming language, rather it’s a “markup language.” JS on the other hand is a scripting language (i.e. a programming language) and can be used within HTML to … well, script.

3 Likes

Oh, it’s even more complicated than that.

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

This is why I can’t stand Java

2 Likes

I’m going to do some more languages:

Bash

echo "Hello, world!" # You don't technically have to do the quotes, but I like to

Nim

echo "Hello, world!"

Rust

fn main() {
     print!("Hello, world!");
}

Mojo

print("Hello, world!")

Vlang

fn main() {
     print("Hello, world!")
}

Arturo

print "Hello, world!"

More languages here if you’re curious

I don’t think you need semicolons after the braces

I put them there for consistency, not necessity