With the switch to Hugo, I wanted a place to test the syntax highlighting that comes with Chroma. This is that place, and we’ll use the classic “Hello, World!” example in various computer languages I have used in one way or another, past or present. Of course, let’s over-engineer it by having some pipelines do the output.

Origin

The phrase “Hello, World!” was popularized by “The C Programming Language” by Brian Kernighan and Dennis Ritchie in 1978, which featured a simple C program printing the message to the screen. However, its first known use was in an internal Bell Labs tutorial by Kernighan in 1974. Over time, this phrase became the universal starting point for programmers learning a new language, representing the excitement of writing and executing their first successful program.

- ChatGPT 4o, 2025

Languages

Ansible

- hosts: localhost
  tasks:
    - debug:
        msg: "Hello, World!"

Bash

#!/bin/env bash

echo "Hello, World!"

Batch

@echo off
echo Hello, World!

C

#include <stdio.h>

int main(void) {
  printf("Hello, World!\n");
}

C++

#include <iostream>

int main() {
  std::cout << "Hello, World!\n";
}

C#

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Hello, World!");
    }
}

CSS

body::before {
    content: 'Hello, World!';
    display: block;
}

Dockerfile

FROM alpine
CMD ["/bin/sh", "-c", "echo Hello, World!"]

HTML

<!DOCTYPE html>
Hello, World!

Go

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

Java

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

JavaScript

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

PHP

<?php
echo 'Hello, World!';

PowerShell

Write-Host "Hello, World!"

Python

print('Hello, World!')

SQL

SELECT 'Hello, World!';

TypeScript

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

Terraform

output "greeting" {
  description = "Prints 'Hello, World!'"
  value = "Hello, World!"
}