Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

How to Write Hello World in Every Programming Language

Ghost

Platinum Coder
I want to share this great resource that shares how to write Hello, World code in any programming language. The site has been around for a long time and is a pretty cool way to explore other languages that you may have never tried before, or maybe never even heard of. In fact, there is a high chance that you have never heard of many of these languages.

Check out the Hello World Collection to learn how to program a Hello, World program/app/script in any programming language.

PHP programming is a very popular choice and programming a Hello World PHP script is extremely simple. You can literally just use <?php echo "hello world"; ?> in a PHP file and your page will say "hello world" or whatever other value you use with echo. I think it is great how programming languages have progressed throughout the years. This PHP tutorial for beginners is a great example of how you can create a Hello World PHP script in so many different ways. From a standard PHP echo to the less ideal print() function/language construct, there is much to learn with PHP string concatenation, array key values, and HTML/PHP views. Honestly, you can really learn a lot just by exploring the various different things you can do with the very basics of a beginner PHP tutorial.

Did you know that many foreign programmers end up learning English because so much of the core code is written in English? Of course, there are translations of many popular programming languages so people from all over the world can get started, but this is not the case for all languages. In fact, many schools, teachers, mentors, and online classes actually encourage non-English speakers to learn the bare minimum English (or more) so that their code is compatible with English speaking/writing companies overseas.

The Korean Aheui programming language is interesting because it's written in a totally different language (Korean) unlike many programming languages that are in English! There are of course other languages that were started in foreign languages, and many of these have never been translated to English even though they can run on any computer set up to interpret them.
Aheui Hello, World Code:
Code:
밤밣따빠밣밟따뿌
빠맣파빨받밤뚜뭏
돋밬탕빠맣붏두붇
볻뫃박발뚷투뭏붖
뫃도뫃희멓뭏뭏붘
뫃봌토범더벌뿌뚜
뽑뽀멓멓더벓뻐뚠
뽀덩벐멓뻐덕더벅

This is an example of a really long code block. This programming language is designed for Data General Nova, a series of 16-bit computers back in the 1970's. I would love to think that if I was simply born earlier that I could have made one of the first computers or operating systems... Perhaps many of you have thought the same. Let this be an example of how much more complicated programming can be when you don't have an interpreter to handle your code.
Code:
                        .TITL HELLO
02                      ; "HELLO, WORLD" FOR NOVA RUNNING RDOS
03                      ; USES PCHAR SYSTEM CALL
04                      .NREL
05                      .ENT START
06
07              START:
08 00000'022424 DOCHAR: LDA 0,@PMSG     ; LOAD AC0 WITH NEXT CHARACTER,
09 00001'101015         MOV# 0,0,SNR    ; TEST AC0;
10 00002'000412          JMP DONE ; SKIPPED IF NONZERO
11 00003'006017         .SYSTM
12 00004'010000         .PCHAR          ; PRINT FIRST
13 00005'000413          JMP ER ; SKIPPED IF OK
14 00006'101300         MOVS 0,0        ; SWAP BYTES
15 00007'006017         .SYSTM
16 00010'010000         .PCHAR          ; PRINT SECOND
17 00011'000407          JMP ER ; SKIPPED IF OK
18 00012'010412         ISZ PMSG        ; POINT TO NEXT WORD
19 00013'000765         JMP DOCHAR      ; GO AROUND AGAIN
20
21 00014'006017 DONE:   .SYSTM          ; NORMAL EXIT
22 00015'004400         .RTN
23 00016'000402          JMP ER
24 00017'063077         HALT
25 00020'006017 ER:     .SYSTM          ; ERROR EXIT
26 00021'006400         .ERTN
27 00022'063077          HALT
28 00023'063077         HALT
29
30 00024'000025'PMSG:   .+1     ; ADDRESS OF FIRST WORD OF TEXT
31                      ; NOTE BYTES ARE PACKED RIGHT-TO-LEFT BY DEFAULT
32 00025'042510         .TXT /HELLO, WORLD!<15><12>/ ; THAT'S CR LF
33       046114
34       026117
35       053440
36       051117
37       042114
38       006441
39       000012
40 00035'000000         0 ; FLAG WORD TO END STRING
41
42                      .END START


Feel free to share any interesting Hello World code you see on the site or discuss in general :) !
 
Last edited:
You know, I never actually knew that there were more than 300-500+ programming-languages. Makes you wonder how many more languages will show up. Then we'll have more Hello Worlds go to by.
 
In C# it would be:
C#:
Console.WriteLine("Hello World");
And in Python i think it would be:
Python:
print("Hello World")
Im pretty sure Lua would also be almost identical to the Python example too.
 
And in Python i think it would be:
Python:
print("Hello World")

This is the new Python print() function. There is also an older print "statement" that is used in older version of the Python language. It does not require the parenthesis, but requires 1 space between the print statement and the value. This means that the new print() function only uses 1 extra character (the closing parenthesis) and this is almost always automatically closed and auto-filled by IDEs and other scripting GUIs (you type in a function like print( and your programming software will add the closing ) parenthesis). This is often brought up when people complain about having to use parenthesis in the print() function with new versions of Python not using the older print statement.

Here is an example of a Python Hello World print statement in older Python versions:
Python:
print "string here."
variableblob = "Hello"
print variableblob
 
GameZee said:
Im pretty sure Lua would also be almost identical to the Python example too.
You are correct, the syntax for writing "Hello world!" in Lua, is the exact same as Python(Python V3.X+).

Ghost said:
This is the new Python print() function. There is also an older print "statement" that is used in older version of the Python language. It does not require the parenthesis, but requires 1 space between the print statement and the value.
You know, until I read this post, I never actually wondered why Python switched from having no parentheses to now having parentheses. The only possible reason could be to make the transition from a language with near-identical syntax a lot easier. That's it really.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom