Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
266 changes: 266 additions & 0 deletions helloworld.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
# Helloworld Programs

![helloworld](helloworld.png)

We list below Helloworld programs for different programming languages, i.e. programs that print "Hello, World!".
The specified compiler or interpreter is required for each programming languages.
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: “for each programming languages” should be singular (“for each programming language”).

Suggested change
The specified compiler or interpreter is required for each programming languages.
The specified compiler or interpreter is required for each programming language.

Copilot uses AI. Check for mistakes.

The table below summarizes the programs:

| Language | Language (Spec) Site | Section | Build / Run Toolchain | Debian / Ubuntu Packages |
|----------|----------------------|---------|-----------------------|--------------------------|
| C | [The Standard - C](https://www.iso-9899.info/wiki/The_Standard) | [C](#c) | GCC | `build-essential` |
| C++ | [The Standard - C++](https://isocpp.org/std/the-standard) | [C++](#c++) | GCC / G++ | `build-essential`, `g++` |
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table link [C++](#c++) won’t resolve to the ## C++ header on GitHub (the generated header slug strips + and de-duplicates against ## C). Update the anchor to the actual generated slug for this header so the table link works.

Suggested change
| C++ | [The Standard - C++](https://isocpp.org/std/the-standard) | [C++](#c++) | GCC / G++ | `build-essential`, `g++` |
| C++ | [The Standard - C++](https://isocpp.org/std/the-standard) | [C++](#c-1) | GCC / G++ | `build-essential`, `g++` |

Copilot uses AI. Check for mistakes.
| Dlang | [D Programming Language: Home](https://dlang.org/) | [Dlang](#dlang) | GCC / GDC | `build-essential`, `gdc` |
| Go | [The Go Programming Language](https://go.dev/) | [Go](#go) | Go | `golang` |
| Rust | [Rust Programming Language](https://www.rust-lang.org/) | [Rust](#rust) | Rust (Crate) | `rustlang` |
| Java | [Java Programming Language](https://docs.oracle.com/javase/8/docs/technotes/guides/language/) | [Java](#java) | JDK | `openjdk-17-jdk` |
| x86_64 assembly | [x86 and amd64 instruction reference](https://www.felixcloutier.com/x86/) | [x86_64 Assembly](#x86_64-assembly) | GCC / GAS | `build-essential` |
| ARM64 assembly | [Arm A64 Instruction Set Architecture](https://developer.arm.com/documentation/ddi0596/latest/) | [ARM64 Assembly](#arm64-assembly) | GCC / GAS (AArch64) | `build-essential` |
| Bash | [Bash Reference Manual](https://www.gnu.org/s/bash/manual/bash.html) | [Bash](#bash) | Bash | `bash` |
| Python | [Welcome to Python.org](https://www.python.org/) | [Python](#python) | Python | `python` |
| Ruby | [Ruby Programming Language](https://www.ruby-lang.org/en/) | [Ruby](#ruby) | Ruby | `ruby` |
| PHP | [PHP: Hypertext Preprocessor](https://www.php.net/) | [PHP](#php) | PHP | `php` |
| Perl | [The Perl Programming Language](https://www.perl.org/) | [Perl](#perl) | Perl | `perl` |
| Lua | [The Programming Language Lua](https://www.lua.org/) | [Lua](#lua) | Lua | `lua` |

## C

```c
#include <stdio.h>

int main(void)
{
puts("Hello, World!");
return 0;
}
```

Build with:

```console
gcc -Wall -o helloworld helloworld.c
```

Run with:

```console
./helloworld
```

## C++

```cpp
#include <iostream>

int main()
{
std::cout << "Hello, World!" << std::endl;
return 0;
}
```

Build with:

```console
g++ -Wall -o helloworld helloworld.cpp
```

Run with:

```console
./helloworld
```

## Dlang

```dlang
import std.stdio;

void main()
{
writeln("Hello, World!");
}
```

Build with:

```console
gdc -Wall -o helloworld helloworld.cpp
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The D build command is compiling helloworld.cpp, but the D example (and the repo’s sample file) is .d. This command won’t work as written; update it to compile the D source file name consistently.

Suggested change
gdc -Wall -o helloworld helloworld.cpp
gdc -Wall -o helloworld helloworld.d

Copilot uses AI. Check for mistakes.
```

Run with:

```console
./helloworld
```

## Go

```go
package main

import "fmt"

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

Build and run with:

```console
go run helloworld.go
```

## Rust

```rs
fn main() {
println!("Hello, World");
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust snippet prints "Hello, World" (missing !) even though the doc intro says programs print "Hello, World!". If Rust is intended to match the others, update the string to include the exclamation mark.

Suggested change
println!("Hello, World");
println!("Hello, World!");

Copilot uses AI. Check for mistakes.
}
```

Build with:

```console
rustc hello.rs
```

Run with:

```console
./helloworld
```
Comment on lines +126 to +134
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rust build/run commands are inconsistent: rustc hello.rs doesn’t match the section’s helloworld naming, and running ./helloworld won’t work unless the output binary is explicitly named that way. Make the source filename and output name consistent with the run command.

Copilot uses AI. Check for mistakes.

## Java

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

Build with:

```console
javac HelloWorld.java
```

Run with:

```console
java HelloWorld
```

## x86_64 Assembly

```as
```

Build with:

```console
TODO
```
Comment on lines +158 to +167
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x86_64 Assembly section has an empty code block and TODO for the build command, so it doesn’t currently provide a runnable “Hello, World!” example. Either fill in the assembly source + toolchain commands or remove it from the summary table until it’s implemented.

Copilot uses AI. Check for mistakes.

Run with:

```console
./helloworld
```

TODO

## ARM64 Assembly

```as
```

Build with:

```console
TODO
```
Comment on lines +177 to +186
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ARM64 Assembly section is also empty and has TODO for the build command. As written it can’t be followed to produce output; please add the actual example + commands or drop it from the table for now.

Copilot uses AI. Check for mistakes.

Run with:

```console
./helloworld
```

## Bash

```bash
echo "Hello, World!"
```

Run with:

```console
bash helloworld.sh
```

## Python

```py
print("Hello, World!")
```

Run with:

```console
python helloworld.py
```

## Ruby

```rb
puts "Hello, World!"
```

Run with:

```console
ruby helloworld.rb
```

## PHP

```php
<?php
echo "Hello, World!"
?>
```

Run with:

```console
./helloworld
```
Comment on lines +232 to +242
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHP example as written won’t run: echo "Hello, World!" is missing a terminating semicolon, and the run command ./helloworld doesn’t invoke PHP (unless you add a shebang and make the script executable). Update the snippet and run instructions so they work together.

Copilot uses AI. Check for mistakes.

## Perl

```pl
print("Hello, World!\n")
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Perl snippet is missing a trailing semicolon after the print(...) statement, which will cause a syntax error when run with perl. Add the semicolon so the example is valid.

Suggested change
print("Hello, World!\n")
print("Hello, World!\n");

Copilot uses AI. Check for mistakes.
```

Run with:

```console
perl helloworld.pl
```

## Lua

```lua
print("Hello, World!")
```

Run with:

```console
lua helloworld.lua
```
Loading