&. |

A software developer’s musings on software development

You Won't Believe How Many Hello World Programs Can Fit On A T-Shirt!

Warning: I wrote this blog in 2016. That is a long time ago, especially on the internet. My opinions may have changed since then. Technological progress may have made this information completely obsolete. Proceed with caution.

I’ve designed a t-shirt that is especially for programmers. It contains the simple hello world application, written in forty-seven different programming languages.

Click or Tap or Otherwise Activate This Hyperlink to Buy!

T-Shirt with Hello World in Forty-Seven Languages

Below is the “key”, for anyone interested. A few of these aren’t technically programming languages (like binary, QR), and a few are just frameworks within another language (like Angular, Swing). I’ve ordered one of the shirts myself and it looks pretty nice—I had to make sure of that before I offered it for sale. I’ll probably work on a version that works against a dark background, when I get the time.

Binary

  1. 0110100001100101011011000110110001101111001000000111011101101111011100100110110001100100

Java

  1. public class Main {
  2. public static void main(String[] args) {
  3. System.out.print("hello world");
  4. }
  5. }

AngularJS

  1. <input type="text" ng-model="sometext" />
  2. <h1>hello {{ sometext }}</h1>

Scala

  1. object HelloWorld extends App {
  2. println("hello world")
  3. }

XSLT

  1. <?xml version="1.0"?>
  2. <greeting>hello world</greeting>

Fortran

  1. program hello
  2. print *, "hello world"
  3. end program hello

Haskell

  1. main = putStrLn "hello world"

8086 Assembler

  1. .model small
  2. .stack 100h
  3. .data
  4. msg db 'hello world$'
  5. .code
  6. start:
  7. mov ah, 09h
  8. lea dx, msg
  9. int 21h
  10. mov ax, 4C00h
  11. int 21h
  12. end start

php

  1. <?php echo 'hello world' ?>

Go

  1. package main
  2. import "fmt"
  3. func main() {
  4. fmt.Println("hello world")
  5. }

Lisp

  1. (print "hello world")

Flex (MXML)

  1. <?xml version="1.0"?>
  2. <Application xmlns="http://www.adobe.com/2006/mxml">
  3. <Label text="hello world" />
  4. </Application>

Hex

  1. 68 65 6c 6c 6f 20 77 6f 72 6c 64

ActionScript

  1. createTextField("hello", 0, 0, 0, 100, 100);
  2. hello.text = "hello world"

.bat

  1. @echo off
  2. echo hello world

Perl/Python/Swift

  1. print "hello world";

Cobol

  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID. HELLO-WORLD.
  3. PROCEDURE DIVISION.
  4. DISPLAY 'hello world'.
  5. STOP RUN.

Visual Basic

  1. Imports System
  2. Public Module modmain
  3. Sub Main()
  4. Console.WriteLine ("hello world")
  5. End Sub
  6. End Module

Prolog

  1. write('hello world'),nl.

HTML

  1. <html><body>
  2. hello world
  3. </body></html>

R

  1. state start:
  2. pstr("hello world\n");
  3. halt;

lolcode

  1. HAI
  2. CAN HAS STDIO?
  3. VISIBLE "HAI WORLD!"
  4. KTHXBYE

SQL

  1. SELECT 'hello world' AS hello

Java (Swing)

  1. javax.swing.JOptionPane.showMessageDialog(null, "hello world");

Scheme

  1. (let ((hello-world (lambda() (display "hello world")(newline))))
  2. (hello-world))

C

  1. #include <cstdio>
  2. int main() {
  3. puts("hello world");
  4. }

Ruby

  1. puts 'hello world'

Pascal

  1. program HelloWorld;
  2. begin
  3. writeln('hello world');
  4. end.

Mathematica

  1. Print["hello world"]

Basic

  1. 10 PRINT "hello world"

ColdFusion

  1. <cfoutput>hello world</cfoutput>

jQuery

  1. $(function(){$('body').text('hello world');});

Brainf***

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

Whitespace

  1. ···→··→ ···↲
  2. ·····→ ··→ ·→
  3. ·····→ ·→ ··↲
  4. ·····→ ·→ ··↲
  5. ·····→ ·→
  6. ·····→ ·→ ··↲
  7. ·····→ ·····↲
  8. ·····→ ·→
  9. ·····→ ·→
  10. ·····→ ··→ ·↲
  11. ·····→ ·→ ··↲
  12. ·····→ ··→ ··↲
  13. ·····→ ····→
  14. ··↲

Smalltalk

  1. Transcript show: 'hello world'.

C Sharp

  1. public class Hello {
  2. public static void Main() {
  3. System.Console.WriteLine("hello world");
  4. }
  5. }

Lua

  1. #!/usr/bin/lua
  2. print("hello world")

Javascript

  1. document.write('hello world');

ASP.net

  1. <% HelloWorldLabel.Text = "hello world"; %>
  2. <html><body>
  3. <asp:Label runat="server" id="HelloWorldLabel"></asp:Label>
  4. </body></html>

Piet

Hello World program in Piet

Objective C

  1. #import <Foundation/Foundation.h>
  2. int main (int argc, const char * argv[])
  3. {
  4. NSLog (@"hello world");
  5. return 0;
  6. }

Ada

  1. with Ada.Text_IO; use Ada.Text_IO;
  2. procedure Hello is
  3. begin
  4. Put_Line("hello world");
  5. end Hello;

QR

QR Code encoding the text Hello World

c++

  1. #include <iostream>
  2. int main() {
  3. cout << "hello world" << endl;
  4. }

MATLAB

  1. disp('hello world');