Skip to main content

Command Palette

Search for a command to run...

Writing hello world in 10 languages

Published
Writing hello world in 10 languages
V

developer

Hi, VatsaDev here, today we're going to write hello world in 10 languages!

the ten languages

the 10 languages are

  • Vyper
  • Solidity
  • Python
  • Ruby
  • Java
  • JavaScript
  • html
  • C#
  • C++
  • bat script

Vyper

the vyper code is

# @version ^0.2.0

greet: public(String[100])

@external
def __init__():
    self.greet = "Hello World"

Solidity

the Solidity code is

pragma solidity >=0.5.0 <0.7.0;
contract HelloWorld {
    function get()public pure returns (string memory){
        return 'Hello Contracts';
    }
}

Python

the Python code is

print("hello world")

Ruby

the Ruby code is

puts("hello world")

Java

the Java code is

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

Javascript

the JS code is

console.log("hello world");

Html

the Html code is

<p>hello world!</p>

C

the C# code is

Console.WriteLine("Hello World!");

C++

the C++ code is

#include <iostream>

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

BAT

the BAT code is

echo hello World

email me more languages at vatsapandey123@gmail.com!

art by kurzgesagt

D

Another three programming languages:

BASIC

PRINT "Hello World"

Pascal (FPC)

begin
     WriteLn('Hello World');
end.

Assembly Language (FASM)

format PE console
entry start

include 'win32a.inc'

section '.data' data readable writable
    msg     db 'Hello World',13,10,0
    len = $-msg
    dummy   dd ?

section '.code' readable writable executable

 start:

push STD_OUTPUT_HANDLE
call [GetStdHandle]         ;STD_OUTPUT_HANDLE (DWORD)-11

push 0         ;LPVOID  lpReserved
push dummy         ;LPDWORD lpNumberOfCharsWritten
push len         ;DWORD   nNumberOfCharsToWrite
push msg         ;VOID    *lpBuffer;
push eax         ;HANDLE  hConsoleOutput
call [WriteConsole]

push 0
call [ExitProcess]

section '.idata' data import readable writable

library kernel32, 'KERNEL32.DLL'
include 'api\kernel32.inc'

Cheers!

V
VatsaDev4y ago

Nice!

More from this blog

V

Vatsadev's Blog

15 posts

web development, game design, and anything I find interesting!