DEV Community

Cover image for "Hello World" in 10 Languages

"Hello World" in 10 Languages

Rakesh KR on December 05, 2022

Hello World πŸ‘‹πŸŒ Let's go through the "Hello World" syntax in 10 languages πŸ±β€πŸ’». Feel free to comment ✍️ your first πŸ₯‡ "Hello World" language. 1. Ja...
Collapse
 
szabgab profile image
Gabor Szabo

Rust

fn main() {
    println!("Hello World")
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
lexlohr profile image
Alex Lohr

x86 asm (DOS .com executable)

org 0x100
mov dx, msg
mov ah, 9
int 0x21
int 0x20
msg db 'Hello World!', 0x0d, 0x0a, '$'
Enter fullscreen mode Exit fullscreen mode

x86 asm (Linux compatible)

; to build an ELF executable:
; nasm -f elf hello.asm && ld -s -o hello hello.o
section .text
  global _start
section .data
  msg db 'Hello World!, 0xa
  len equ $ - msg
section .text
_start:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 0x80
mov ebx, 0
mov eax, 1
int 0x80
Enter fullscreen mode Exit fullscreen mode

AWK

BEGIN {
  print "Hello World!"
}
Enter fullscreen mode Exit fullscreen mode

and last, not least:

CSS

document.body:before { content: "Hello, World!"; }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
szabgab profile image
Gabor Szabo

Bash

echo Hello World
Enter fullscreen mode Exit fullscreen mode
Collapse
 
thomasbnt profile image
Thomas Bnt

Hello ! Cool post to learn a little more about syntax of others languages with an example! πŸ‘πŸΌ

Don't hesitate to put colors on your codeblock like this example for have to have a better understanding of your code 😎

console.log('Hello world!');
Enter fullscreen mode Exit fullscreen mode

Example of how to add colors and syntax in codeblocks

Collapse
 
alexkapustin profile image
Oleksandr

Brainfuck:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Enter fullscreen mode Exit fullscreen mode

en.wikipedia.org/wiki/Brainfuck

Collapse
 
sherrydays profile image
Sherry Day

ChatGPT

Hello, my name is world.
Enter fullscreen mode Exit fullscreen mode
Collapse
 
lum1nat profile image
Lum1naT

This reply makes me happy while making my blood boil.

Collapse
 
ben profile image
Ben Halpern

Ruby

puts "Hello world!"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
gramian profile image
Christian Himpe

Scheme

(display "Hello World!")
Enter fullscreen mode Exit fullscreen mode
Collapse
 
artydev profile image
artydev

Nice presentation :-)
You could be interested by Rosetta Code

Regards

Collapse
 
szabgab profile image
Gabor Szabo

Groovy:

println "Hello World"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
aungmyatmoe profile image
Aung Myat Moe • Edited

Php

echo "Hello world!"
Enter fullscreen mode Exit fullscreen mode

Lua

print "Hello Lua!"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
szabgab profile image
Gabor Szabo

Perl:

print "Hello World\n";
Enter fullscreen mode Exit fullscreen mode

or

use feature 'say';
say "Hello World";
Enter fullscreen mode Exit fullscreen mode
Collapse
 
draganclappcreator profile image
Dragan

Nice.
Here is one you probably don't know yet (since it comes from a language I created and nobody knows):
youtube.com/watch?v=ZnLQs6a5uy0

Collapse
 
murphylee1408 profile image
Murphylee1408

<?php
$greeting = "Hello World";
echo $greeting;
?>