We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

print("Hello, World!")

From Esolang
Jump to navigation Jump to search
Note that print("Hello, World!") is typically lowercased.


A print("Hello, World!") program is a program that prints the source code for a Hello, world! program in its own language.

For example, in Python, it would be print("print(\"Hello, World!\")"). You could take it a step further and do print("print(\"print(\\"Hello, World!\\")\")"), but that would be a print("print(\"Hello, World!\")") program. Note that this changes from programming language to programming language, so the JavaScript print("Hello, World!") program would have to print console.log('Hello, World!');, and brainfuck would have to print ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++..

Oh, yeah, I'm User:5anz, forgot to mention that. This is actually my first page that's neither an Esolang or my user page, so... idk how to do this.

Implementations

Please add more languages here.

№15‎‎

Hello, world!₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢Ⓓ₢ⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹⒹ

1nteger

PNT 609405906361962024721765196896447782698668464597427933545008837628210146069084911673

///

This one is also a "Hello, world!" program and a cheating quine.

Hello, world!

Type 15

print("print(\"Hello, world!\")")

Type 28

Same as brainfuck.

Type 32

Same as C++.

Type 40, 42

Same as Java.

Type 43

Same as Lua, Python, Ruby, and Julia.

Ada

with Ada.Text_IO; use Ada.Text_IO;
procedure PrintHelloWorldAda is
begin
    Put_Line("with Ada.Text_IO; use Ada.Text_IO;");
    Put_Line("procedure HelloWorld is");
    Put_Line("begin");
    Put_Line("    Put_Line(""Hello, world!"");");
    Put_Line("end;");
end;

Assembly

This program and the program it outputs are written in NASM assembly and target x86-64 Windows.

section .text
    extern GetStdHandle, WriteConsoleA
    global _main
_main:
    push rbp
    mov rbp, rsp
    sub rsp, 48
    mov rcx, 4294967285; STD_OUTPUT_HANDLE
    call GetStdHandle
    mov rcx, rax ; console output handle
    lea rdx, [rel msg] ; buffer
    mov r8, msg_end - msg ; number of chars
    mov r9, 0 ; number of characters writen (optional, NULL)
    mov [rsp + 32], 0 ; reserved (must be NULL)
    call WriteConsoleA
    add rsp, 48
    pop rbp
    xor rax, rax
    ret
section .rodata
msg:
    db "section .text", 10
    db 9, "extern GetStdHandle, WriteConsoleA", 10
    db 9, "global _main", 10
    db "_main:", 10
    db 9, "push rbp", 10
    db 9, "mov rbp, rsp", 10
    db 9, "sub rsp, 48", 10
    db 9, "mov rcx, 4294967285", 10
    db 9, "call GetStdHandle", 10
    db 9, "mov rcx, rax", 10
    db 9, "lea rdx, [rel msg]", 10
    db 9, "mov r8, msg_end - msg", 10
    db 9, "mov r9, 0", 10
    db 9, "mov [rsp + 32], 0", 10
    db 9, "call WriteConsoleA", 10
    db 9, "add rsp, 48", 10
    db 9, "pop rbp", 10
    db 9, "xor rax, rax", 10
    db 9, "ret", 10
    db "section .rodata", 10
    db "msg:", 10
    db 9, "db ", 34, "Hello, world!", 34, ", 10", 10
    db "msg_end:", 10
msg_end:

Bash or Batch

echo echo Hello, world!

Bimo roasting language

Bimo rolls out
Bimo spins "Bimo rolls out\nBimo spins \"Hello, World!\""

Befunge

"@_,#:>"75*1-"Hello, World!"75*1->:#,_@

brainfuck

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

Bussin

Also works in Bussin X.

println(strcon("println(", charat(bson.stringify({x: "hello"}), 1), "Hello, world!", charat(bson.stringify({x: "hello"}), 1), ")"))

Bussin X

waffle(strcon("waffle(", charat(bson.stringify({x: "hello"}), 1), "Hello, world!", charat(bson.stringify({x: "hello"}), 1), ")"))

C/C++

#include <stdio.h>
main() {
    puts("#include <stdio.h>");
    puts("main() {puts('Hello, world!');}");
}

C++23

import std;
int main() {
    std::println("import std;");
    std::println("int main() {std::println(\"Hello, world!\");}");
}

C = theNextIntegerThatComesAfterAnotherIntegerWithTheValueOf(C)

numberThatCanBeFullyRepresentedWithoutTheNeedForADecimalPointAndCanBePositiveOrNegative main() {
    theStandardLibrary::printAStringToTheConsole("numberThatCanBeFullyRepresentedWithoutTheNeedForADecimalPointAndCanBePositiveOrNegative main() {\n");
    theStandardLibrary::printAStringToTheConsole("    theStandardLibrary::printAStringToTheConsole(\"Hello, world!\\n\");\n");
    theStandardLibrary::printAStringToTheConsole("}\n");
    }\n");
}

CMake

Remember that CMake is a build system so the message is not the only thing printed.

cmake_minimum_required(VERSION 3.16)
project(PrintHelloWorld)
message(STATUS "cmake_minimum_required(VERSION 3.16)")
message(STATUS "project(HelloWorld)")
message(STATUS "message(STATUS \"Hello, world!\")")

COBOL

IDENTIFICATION DIVISION.
PROGRAM-ID. PRINT-HELLO-WORLD.
PROCEDURE DIVISION.
MAIN.
    DISPLAY "IDENTIFICATION DIVISION.".
    DISPLAY "PROGRAM-ID. HELLO-WORLD.".
    DISPLAY "PROCEDURE DIVISION.".
    DISPLAY "MAIN.".
    DISPLAY "    DISPLAY 'HELLO, WORLD!'.".
    DISPLAY "    STOP RUN.".
    STOP RUN.

D

import std.stdio;
void main() {
    writeln("import std.stdio;");
    writeln("void main() {");
    writeln("    writeln(\"Hello, world!\");");
    writeln("}");
}

Dango

serve (----)(41)(#)(Hello, world!)(40)(#)(serve )----

deadfish

Remember that deadfish only outputs numbers, so this outputs the ASCII codes for the "Hello, world!" program which only outputs the ASCII codes for "Hello, world!".

iiisdsiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioooiiiiiiiiiioddddddddddd
ddddoiiiiiiiiiiiiiiioddddddddddooooooooiiiiiioddddddoooooooooooooooooooo
oooooooooiiiiiioddddddoooooooiiiiiiooddddddoooiiiiiiodddddddddddoooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooiiiiiiiiiiiod
ddddddddddooooooooooooiiiiiiiiiiioddddddoooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooiiiiiiodddddddddd
dooooooooiiiiiiiiiiioddddddoooiiiiiiodddddddddddooooooiiiiiiiiiiiodddddd
dddddooooooooiiiiiiiiiiiodddddddddddoooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooiiiiiiiiiiio

Entropy

Note: Due to the language's nature, this program does not always exactly output the hello world program.
Program PrintHelloWorld PrintHelloWorldEntropy [
    print "Program HelloWorld HelloWorldEntropy [";
    print "    print \"Hello, World!\";";
    print "]";
]

Eviledon

This one is quite long, so... here it is.

Free2Edit

pppHpppeppplppplpppoppp,ppp pppWpppoppprppplpppdppp!

Or, with the quotes:

<<<<Hello, World!>\>>>

G#

make main[print["make main[print[\"Hello, World!\"]]"]]

GDScript

Either attach this script to a node in the scene tree, or register it as an autoload.

extends Node
func _ready() -> void:
    print("extends Node")
    print("func _ready() -> void:")
    print("\tprint('Hello, world!')")

GNU make

.PHONY: all
all:
    @printf ".PHONY: all\n"
    @printf "all:\n"
    @printf "\t@echo \"Hello, world!\"\n"

HTML

This also works in XHTML.

<!DOCTYPE html>
 <html>
   <body>
     <pre><!DOCTYPE html>
 <html>
   <body>
     <p>Hello, world!</p>
   </body>
 </html></pre>
   </body>
 </html>

Java

This also works in Javagony.

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

JavaScript/TypeScript

console.log("console.log(\"Hello, world!\")")

Labubu

labubu("labubu('Hello, world!')")

LOLCODE

HAI 1.3
VISIBLE "HAI 1.3"
VISIBLE "VISIBLE :"Hello, World!:""
VISIBLE "KTHXBYE"
KTHXBYE

Lua

print'print"Hello, world!"'

Markdown

Works in CommonMark, GitHub Flavored Markdown, Codeberg Flavored Markdown (unofficial name), and is also a quine and a polyglot with Text.

Hello, world!

Nonstraightforward

~/dev/stdout/write/ln("~/dev/stdout/write/ln(\"Hello, world!\")");

Python 2

This also works in Ruby, but it just doesn't print any newlines.

print "print \"Hello, World!\""

Would work in Lox if only Lox had string escape sequences.

Python 3

This also works in Ruby, but it just doesn't print any newlines.

print("print(\"Hello, World!\")")

Ruby

puts "puts \"Hello, world!\""

The Python 2/3 programs both work, they just don't output newlines.

Rust

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

Scratch

Scratch does not have image output which is unfortunate as Scratch programs are visual, so this program instead outputs text for scratchblocks.github.io into a list.

In text form, for scratchblocks.github.io

when flag clicked
delete all of [output v]
add [when flag clicked] to [output v]
add [say \[Hello, world!\]] to [output v]

Text

Hello, World!

Usernames

User:I am islptng "[[User:I am islptng]] " User:PrySigneToFry
User:I am islptng 34 User:cleverxia User:PrySigneToFry
User:I am islptng "Hello, world!" User:PrySigneToFry
User:I am islptng 34 User:cleverxia User:PrySigneToFry
User:I am islptng " [[User:PrySigneToFry]]" User:PrySigneToFry

Vague

This one requires a strictly compliant implementation.

+++>-=(++_---=)_!*(****)

So does this one.

++----(_+!=-=)_--!++!--_!++=!*!*!*!*!

Yappacino

C:\Standard\System\io\format\print\ln(`C:\\Standard\\System\\io\\format\\print\\ln("Hello, world!")`)

Zig

const std = @import("std");
pub fn main(init: std.process.Init) !void {
    try std.Io.File.stdout().writeStreamingAll(init.io, "const std = @import(\"std\");\n");
    try std.Io.File.stdout().writeStreamingAll(init.io, "pub fn main(init: std.process.Init) !void {\n");
    try std.Io.File.stdout().writeStreamingAll(init.io, "    try std.Io.File.stdout().writeStreamingAll(init.io, \"Hello, world!\");");
    try std.Io.File.stdout().writeStreamingAll(init.io, "}");
}

See also