Hello, world

This is an example post for irresponsible.dev. A place for programming notes, small experiments, and things I’d otherwise forget.

The site is deliberately small: Markdown files go in, static HTML comes out. Fonts, styles, and any scripts are bundled with the site rather than loaded from third-party services.

One greeting, eight languages

Each example below comes from a source file bundled with this post. A line range selects the function, and the file link opens the complete source.

Elixir

  def hello(name, site) do
    "Hello, #{name}. Welcome to #{site}!"
  end
greeting.ex · lines 3–5

Go

func Greet(name string) string {
	return "Hello, " + name + "!"
}
greeting.go · lines 3–5

Python

def greet(name: str) -> str:
    return f"Hello, {name}!"
greeting.py · lines 1–2

TypeScript

export function greet(name: string): string {
  return `Hello, ${name}!`;
}
greeting.ts · lines 1–3

PHP

function greet(string $name): string {
    return "Hello, " . $name . "!";
}
greeting.php · lines 3–5

Rust

pub fn greet(name: &str) -> String {
    format!("Hello, {name}!")
}
greeting.rs · lines 1–3

Bash

greet() {
  printf 'Hello, %s!\n' "$1"
}
greeting.sh · lines 3–5

Odin

greet :: proc(name: string) -> string {
    return fmt.aprintf("Hello, %s!", name)
}
greeting.odin · lines 5–7

Plain fences still work

For a short example that doesn’t need a separate file, a language-tagged fence is enough:

["write something", "keep it small", "publish"]
|> Enum.each(&IO.puts/1)