Hello world/Newbie

From Rosetta Code
Task
Hello world/Newbie
You are encouraged to solve this task according to the task description, using any language you may know.
Task

Guide a new user of a language through the steps necessary to install the programming language and selection of a text editor if needed, to run the languages' example in the Hello world/Text task.

  • Assume the language-newbie is a programmer in another language.
  • Assume the language-newbie is competent in installing software for the platform.
  • Assume the language-newbie can use one simple text editor for the OS/platform, (but that may not necessarily be a particular one if the installation needs a particular editor).
  • Refer to, (and link to), already existing documentation as much as possible (but provide a summary here).
  • Remember to state where to view the output.
  • If particular IDE's or editors are required that are not standard, then point to/explain their installation too.


Note:
  • If it is more natural for a language to give output via a GUI or to a file etc, then use that method of output rather than as text to a terminal/command-line, but remember to give instructions on how to view the output generated.
  • You may use sub-headings if giving instructions for multiple platforms.



11l

1. Open your favorite text editor and create text file hello_world.11l containing the following line:

print("Hello world!")

2. Install eldf Python package (via pip install eldf on Windows or pip3 install eldf on Linux).

3. Open 11l website.

4. Expand ‘Download’ section.

5. Download 11l.tar.xz.

6. Unpack that archive to whatever directory you want.

7. Open Terminal/cmd.

8. Run command:

<path_to_unpacked_archive_files>\11l hello_world.11l on Windows, or

<path_to_unpacked_archive_files>/11l hello_world.11l on Linux.

9. Run compiled executable:

hello_world.exe on Windows, or

./hello_world on Linux.


8080 Assembly

Template:Works with CPM-80

   download simh with CPM disk from: http://cpmarchives.classiccmp.org/cpm/mirrors/www.schorn.ch/cpm/intro.php
   write hello.asm with any text editor. !!!MAKE SURE ALL ASM FILES HAVE A TRAILING NEWLINE!!!
   open cp/m in simh by CD'ing to director, running altairz80.exe, then 'do cpm2'
   load hello.asm into image by running command 'r hello.asm'
   assemble by running command 'asm hello'
   load by running command 'load hello'
   run by executing command 'hello'
; Hello World!
; Prints Hello, World! to stdout
BDOS    equ    5                     ; BDOS call entry
PRINT   equ    9                     ; BDOS string stdout subroutine

        org    100h                  ; (mostly) All CP/M programs start at 100h

start   lxi    d,message             ; load message pointer to DE register pair
        mvi    c,PRINT               ; set up BDOS call to do string print
        call   BDOS                  ; call BDOS routine
        ret                          ; pop back out into CP/M

message db     'Hello, World!','$'   ; message string, all CP/M strings have an EOL of '$'


AArch64 Assembly

Works with: as version Raspberry Pi 3B version Buster 64 bits
  
   create file helloword64.s   
   compile it with : as -o helloword64.o helloword.s
   link  it with   : ld -o helloword64 helloword64.o -e main
   execute it      :  helloword64
/* ARM assembly Raspberry PI  */
/*  program helloword64.s   */
.data
szMessage:      .asciz "Hello world. \n"   
.equ LGMESSAGE, . -  szMessage  // compute length of message
.text
.global main 
main:
    mov x0,1                   // output std linux
    ldr x1,qAdrMessage         // adresse of message
    mov x2,LGMESSAGE           // sizeof(message) 
    mov x8,64                  // select system call 'write' 
    svc 0                      // perform the system call 
 
    mov x0, 0                  // return code
    mov x8,93                  // select system call 'exit'
    svc 0                      // perform the system call 
qAdrMessage:      .quad szMessage

Ada

A set of tutorials to learn the Ada programming language are found at [1]. The learn.adacore.com site also contains a tutorial on the use of the GNAT toolchain downloaded with the GNAT compiler.

The GNAT Community Edition Ada development tools can be downloaded from [2]. The README.txt file contains the following information concerning installation of the GNAT tools:

GNAT Community                                                                  
--------------                                                                  
                                                                                
This contains the GNAT Community edition.                                       
                                                                                
The packages for the native platforms contain:                                  
                                                                                
  - the GNAT compiler toolchain                                                 
  - the SPARK Ada verification and prover toolset                               
  - the Libadalang library                                                      
  - the GNAT Studio IDE                                                         
                                                                                
The packages for the embedded platforms (ARM and RISC-V) only contain the       
GNAT compiler toolchain for that target, so we recommend installing the         
native package as well.                                                         
                                                                                
Installing                                                                      
----------                                                                      
                                                                                
On Windows:                                                                     
                                                                                
  Simply run the .exe and follow the instructions.                              
                                                                                
On Linux:                                                                       
                                                                                
  You will need to make the package executable before running it. In a command  
  prompt, execute                                                               
                                                                                
     chmod +x path_to_the_package-bin                                           
                                                                                
  then execute the package.                                                     
                                                                                
Automated installation                                                          
----------------------                                                          
                                                                                
To automate the installation, use the scripts provided here:                    
                                                                                
  https://github.com/AdaCore/gnat_community_install_script                      
                                                                                
Using                                                                           
-----                                                                           
                                                                                                                                            1,14          
To start using the tools in command-line mode, you will need to add             
                                                                                
   <install_prefix>/bin                                                         
                                                                                
to your PATH environment variable. Alternatively, you can simply launch         
                                                                                
   <install_prefix>/bin/gnatstudio                                              
                                                                                
and GNAT Studio will automatically add itself to the PATH - it will also        
find the cross compiler, if you have installed everything in the default        
locations. Note that GNAT Studio will add this at the *end* of the PATH,        
meaning that it will find first any other GNAT installations that you           
have in your PATH.                                                              
                                                                                
Platform-specific notes                                                         
-----------------------                                                         
                                                                                
== OpenSUSE: use the system ld ==                                               
                                                                                
On OpenSUSE, the ld shipped with GNAT Community is not compatible               
with the system libraries: use the system-provided ld instead, by               
removing the file                                                               
                                                                                
   libexec/gcc/x86_64-pc-linux-gnu/8.3.1/ld                                     
                                                                                
from your installation.                                                         
                                                                                
== Fedora ==                                                                    
                                                                                
If developer packages are not yet installed, you might need to                  
install extra packages, by executing the following in a terminal:               
                                                                                
  sudo dnf install make                                                         
  sudo dnf install ncurses-compat-libs                                          
                                                                                
== Flashing to boards on Linux ==   

To flash boards (such as the BBC micro:bit board) using the pyocd integration   
in GNAT Studio under Linux, you might need privileges to access the USB ports,  
without which the flash program will say "No connected boards".                 
                                                                                
To do this on Ubuntu, you can do it by creating (as administrator) the file     
/etc/udev/rules.d/mbed.rules and add the line:                                  
                                                                                
   SUBSYSTEM=="usb",MODE:="666"                                                 
                                                                                
then restarting the service by doing                                            
                                                                                
   sudo udevadm control --reload                                                
   sudo udevadm trigger 

An Ada program can be stored anywhere your file system permits, but it is useful to use the GNAT Studio IDE which is part of the installation. This IDE interacts seamlessly with the compiler, providing necessary error messages as well as automated support for compiling programs employing multiple Ada packages.

Upon starting GNAT Studio you will be presented with a window allowing you to automate the creation of a new Ada project. Choose the "+ Create New Project" option.

A new window will be presented asking for the directory in which the project will be created and the name of the project. Fill in those fields in the window. GNAT Studio will then create the directories "src" and "obj" within the directory you specified. There will also be a file named using the project name you specified. This filename will end with ".gpr". This is the GNAT Project file which keeps track of your file dependencies and facilitates automatic compilation of your program without needing a makefile.

The IDE window will open. Within the list of files in the SRC directory you will find one file already created named "main.adb". This file will already be tagged as a compilation main file. The contents of the initial main.adb file will be:

procedure Main is

begin
   --  Insert code here.
   null;
end Main;

Simply edit this file for simple programs or add additional files if you are creating your own Ada packages. This file can be edited to create the Ada hello-world program:

with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
   Put_Line("Hello World!");
end Main;

ALGOL 68

For information on installing and using algol68g, read Learning ALGOL 68 Genie by Marcel van der Veer.

While algol68g is available for Mac OS X, this example currently does not provide instructions on running the "Hello, World" program on OS X.

1. Download algol68g.

2. Install algol68g on Linux, or unzip it to a convenient location on Windows.

3. Use your favorite text editor.

3. Open the text editor and type the following:
main: (
  printf($"Goodbye, World!"l$)
)

4. Save the file with the extension .a68.

5. Open a command prompt/terminal. Execute "a68g path/to/file/filename.a68" on Linux, or "path/to/a68g/a68g.exe path/to/file/filename.a68" on Windows.

Replace the paths above with their corresponding paths on your system.

The output will appear in the command prompt/terminal.

Agda

This tutorial is to install Agda-2.6.3, the most recent version as of May 2023, and run the "Hello world" program. The snippet is based on the Hello world example given in the Agda documentation. More detailed explanations can be found in the installation instructions.

  1. Install Cabal. On Linux run:
    sudo apt install cabal-install
    
  2. From the command line, execute:
    cabal update
    
    which outputs Downloading the latest package list from hackage.haskell.org
  3. Install Agda with:
    cabal install Agda
    
    This downloads the packages and then outputs Building Agda-2.6.3. The building process can take several minutes.
  4. After that, Cabal creates two binaries. On Linux these are
    ~/.cabal/bin/agda
    and
    ~/.cabal/bin/agda-mode
    Make those binaries reachable by the PATH variable.
  5. Create the file HelloWorld.agda with any editor and paste this snippet:
    module HelloWorld where
    
    open import Agda.Builtin.IO using (IO)
    open import Agda.Builtin.Unit renaming ( to Unit)
    open import Agda.Builtin.String using (String)
    
    postulate putStrLn : String -> IO Unit
    {-# FOREIGN GHC import qualified Data.Text as T #-}
    {-# COMPILE GHC putStrLn = putStrLn . T.unpack #-}
    
    main : IO Unit
    main = putStrLn "Hello world!"
    
    (Note that "⊤" is not a capital T, but the top symbol).
  6. Run
    agda --compile HelloWorld.agda
    
    This creates the binary HelloWorld
  7. Execute the binary. For example, on Linux run
    ./HelloWorld
    
    The execution outputs Hello world!

Agda requires an editor that allows entering Unicode characters, like the online editor Agdapad. It is possible to have Emacs configured for Agda. Its use is explained in the documentation of Emacs mode. To configure Emacs, the steps are the following:

  1. Install Emacs. On Linux run:
    sudo apt install emacs
    
  2. Run:
    agda-mode setup
    
  3. Run:
    agda-mode compile
    

Applesoft BASIC

Installation and text editors are not needed. https://rosettacode.org/wiki/Interactive_programming_(repl)#Applesoft_BASIC

With no drives attached, turn on the Apple II+ or later model and you will instantly be at the prompt:

]

Start coding ...

? "HELLO, WORLD!"

https://archive.org/details/The_Applesoft_Tutorial_HQ_color/

ARM Assembly

Works with: as version Raspberry Pi
Works with: qemu version Emulating a Raspberry Pi on Windows/x86
  
   create file helloword.s   
   compile it with : as -o helloword.o helloword.s
   link  it with   : ld -o helloword helloword.o -e main
   execute it      :  helloword
/* ARM assembly Raspberry PI  */
/*  program helloword.s   */
.data
szMessage: .asciz "Hello world. \n"   
.equ LGMESSAGE, . -  szMessage  @ compute length of message
.text
.global main 
main:	
    mov r0, #1                  @ output std linux
    ldr r1, iAdrMessage         @ adresse of message
    mov r2, #LGMESSAGE          @ sizeof(message) 
    mov r7, #4                  @ select system call 'write' 
    swi #0                      @ perform the system call 
 
    mov r0, #0                  @ return code
    mov r7, #1                  @ request to exit program
    swi 0 
iAdrMessage: .int szMessage

Arturo

1. Install Arturo: Download the appropriate pre-built binary for your operating system from the official website - or build it from scratch yourself.

2. Use your favorite text editor. Arturo comes with support for many popular ones.

3. Open the text editor and type the following:
  print "Hello World!!"

4. Save the file as hello.art

5. Open a command prompt/terminal.

6. Execute arturo hello.art.

7. You've made it! The output you're going to see is:

Hello World!!

AutoHotkey

The Tutorial and Overview, which is part of the AutoHotkey Documentation, covers the basics of AutoHotkey. The documentation is available online and is included as a .chm help file with installation. Installation and "Hello World" are summarized here.

1) Download and install AutoHotkey.

2) Download and install the SciTE4AutoHotkey editor (recommended), or use your favorite texteditor.

3) Open the text editor and type the following:
MsgBox, Hello World!

4) Save the file with the extension .ahk.

5) Double-click the file to launch it. A message box appears displaying "Hello World!" and an icon appears in the taskbar notification area.

6) To exit or edit the script, right-click the green "H" icon in the taskbar notification area. Closing the message box will also exit this particular script.

AWK

AWK on Linux

AWK is a standard tool in Unix / most Linux-distributions. So, it should be already installed.
To run awk, either provide code on shell (using single quotes).

$ awk 'BEGIN{print "Goodbye, World!"}'

Or put code to file and load it from file.

$ awk -f hello-world.awk

AWK on Windows

Select one of the awk-implementations to download.

E.g. gnuwin32.sourceforge.net provides gawk, mawk and nawk.
The most current gawk is at gnu.org, but only as source.
To get a ready-made executable, look at code.google.com - gawk v4.1.0 currently.

Download, extract the executable file and "install" it.

In most cases, installation can be done by just moving that exe-file to a convincent place, e.g. a directory that is already in the PATH.

Otherwise, the PATH can be changed in the Windows-Systemsettings, under environment-variables.

Alternatively, keep the awk-program in the same directory as the scripts you are going to write / run.

Try to run it, from a commandline:

 awk -V

or

 mawk -W version

or

 gawk --version

to display its version-number.

To do a simple calculation, try a one-liner like this:

 awk "BEGIN{ print 17/4 }"

Note the use of double-quotes, and curly-braces.
Using the windows-commandline, single-quotes cannot be used.

That means one-liners using strings need awkward quoting:

 awk "BEGIN{print \"Hello\"}"

As a workaround, you can assign variables just before the script:

 awk  -v x="Hello"  "BEGIN{print x}"

So in most cases, running scripts from files is easier.

 awk -f hello.awk

Where hello.awk contains

BEGIN {
  print "Hello" 3-1 "U", sprintf("%c",33)
}
Output:
 Hello2U !

To edit awk-scripts use a texteditor.

Now, look at some example-programs from category AWK, for example: Read a file line by line

Axe

Besides the built-in program editor on the TI-83/84, Axe requires a compiler app to be installed on the calculator. This is for development only, and is not required on user's calculators.

To install Axe, download the latest version and transfer it to the calculator.

Next, follow the instructions below in the TI-83 BASIC section to create a sample program named MYPROGRM. The contents of the program should be:

PROGRAM:MYPROGRM
:.HELLO
:Disp "HELLO, WORLD!",i

Note that the first line contains the name of the program to be compiled. Also note that the i is the imaginary symbol, not the lowercase letter.

Then quit the program editor and press APPS. Go to the newly installed Axe app and select Options. Use the arrow keys to select the correct shell for your setup, then press Clear to go back.

Go to Compile, select MYPROGRM, and press Enter. Your program should compile without errors and will be saved in prgmHELLO. You can run this program from whichever shell you selected in the options (or from the home screen if you selected "no shell"). Run it as you would an assembly program.

BASIC256

Installation

Download BASIC256 here: http://sourceforge.net/projects/kidbasic/

Interface

BASIC256 is an Integrated Development Environment (IDE). The code editor, the text output section, and the graphics output section are displayed at the same time.

HelloWorld Program (Text Output)

To display the "HelloWorld!" in the Text Output, copy this code and paste to the code editor:

Print "HelloWorld!"

Then press F5 or click the play button.

HelloWorld Program (Graphics Output)

To display the "HelloWorld!" in the Graphics Output, copy this code and paste to the code editor:

clg			# Clear the graphics screen
font "Arial",10,100	# Set the font style, size, and weight respectively
color black		# Set the color...
text 0,0,"HelloWorld!"	# Display in (x,y) the text HelloWorld!

Then press F5 or click the play button.

Documentation

Press F1 or click the Help menu for language help/documentations.

Befunge

Befunge is a two-dimensional fungeoidal (in fact, the original fungeoid) esoteric programming language invented in 1993 by Chris Pressey with the goal of being as difficult to compile as possible. A Befunge program consists of a two-dimensional playfield of fixed size. The playfield is initially loaded with the instructions of the program. It also doubles as an updateable storage unit. Execution proceeds by the means of a program counter (-93) or instruction pointer (-98). The instruction pointer begins at a set location (the upper-left corner of the playfield) and is initially travelling in a set direction (right). As it encounters instructions, they are executed. The instructions may have an effect on the instruction pointer's direction and position (-98 only). Instructions may also affect the contents of a stack. See Befunge on Esolang for more information and examples.

To start, you will need a Befunge interpreter. You can find one online, or download one.

What the end product will look like:

"!dlrow olleH">:#,_@

Explanation

"!dlrow olleH"

You might be wondering why the text is backwards. The quotation marks (") toggle 'stringmode'. While in stringmode, all character's ASCII values are pushed onto the stack until the next quote. When the program deals with the stack, it starts with the right most value, therefor going through out message from right to left. The result after the second quotation mark should look something like this:

33,100,108,114,111,119,32,111,108,108,101,72

>:#,_@

The last portion of code prints our message. The underscore (_) works as a horizontal 'if' statement that pops the rightmost value off of the stack and checks if it is zero or not. If it is, the direction of the pointer is set to the right, ending the program with an 'at' sign (@) in this case. Otherwise, the pointer heads to the left.

Because of the way the 'if' statement works, there are some things we have to add to get our message out. Since the 'if' statement pops a value off of the stack, we need to copy what is currently there to make sure that we can still print it. That is what the colon (:) and the comma (,) do in our program. The colon duplicates the last value of the stack and the comma pops the last value and outputs it as an ASCII character. The pound sign (#) skips over the next command in the current direction. If the pointer is going to the right, we would skip the comma, to the left, the colon. We use this to control the flow of the program. Here is what the pointer would look like for one iteration of the program.

>:#,_@      Pointer goes to the right
^

>:#,_@      Duplicate
 ^

>:#,_@      Skip
  ^

>:#,_@      Pop and Check (72!=0), go to the left
    ^

>:#,_@      Print (72)
   ^

>:#,_@      Skip
  ^

>:#,_@      Pointer to the right (repeat until finished)
^

Once the program finishes, you should have:

Hello World!

Binary Lambda Calculus

Although https://www.ioccc.org/2012/tromp/hint.html explains how to compile the obfuscated C code at https://www.ioccc.org/2012/tromp/tromp.c to run

echo " Hello, world" | ./tromp

I find that the modern clang compiler cannot compile tromp.c

Luckily https://github.com/tromp/AIT offers alternative implementations of the lambda universal machine in many languages:

  • C: uni.c
  • Perl: uni.pl
  • Python: uni.py
  • Javascript: uni.js
  • Ruby: uni.rb

For example, one can run

wget https://github.com/tromp/AIT/uni.pl
echo " Hello, world" | ./uni.pl

More implementations may be found at https://rosettacode.org/wiki/Universal_Lambda_Machine

BQN

To use BQN, you need an input method, and a BQN interpreter. This can be solved using the online playground at Try BQN, but if you'd like a local installation, you can check out working with the character set and compile CBQN from source.

If you're using Try BQN you can skip this step: once you have an environment set up, you need to type

rlwrap ./BQN

which will set up a repl.

Then type

"Hello, World!"

and press Enter (Shift-Enter if you're using Try BQN)

C

This example is incomplete. No Windows install instructions Please ensure that it meets all task requirements and remove this message.

Using gcc

Debian Based Systems

Install gcc

$ sudo apt-get install gcc

Red Hat Based Systems

Install gcc

$ su
# yum install gcc

All Distributions

After you have installed gcc using instructions above. Create helloworld.c. This uses HERE document and bash, the standard shell.

$ cat > helloworld.c <<HERE
#include <stdio.h>
int main( int argc, char *argv[] ) {
     puts( "Hello World!" );
     return 0;
}
HERE

Compile it using gcc.

$ gcc -o helloworld helloworld.c

Run it

$ ./helloworld

C#

C# is an ECMA-standardized language with open-source implementations, though development of the language is dominated by Microsoft. C# compilers and IDEs are available on most operating systems.

C# on Windows

Download the Visual Studio Community Edition, which is free for personal use. This is a standard Windows click-through installer.

Once installed (and after a restart), open Visual Studio.

Click on "New Project..." or do File > New > Project.

Select "Console Application." Make sure Visual C# / Windows is selected in the left pane (because Visual Studio handles multiple languages and platforms).

Type a name for your application in the "Name" field.

Click OK.

Enter the Hello World code from the Hello World task into Program.cs.

Press the "Start" button or hit F5 to compile and run.

C# on iOS

The Continuous App allows one to write, compile, and run C# code on an iOS device (iPad Pro recommended).

C# on Linux

Mono

Mono is the oldest effort to bring C# to Linux.

Install the mono-complete package. Installation instructions are here.

Use the text editor or IDE of your choice to enter the Hello World program, saving it as Hello.cs.

To compile:

$ mcs hello.cs

To run:

$ ./hello.exe

.NET Core

.NET Core is Microsoft's open-source implementation of C# and also part of the .NET libraries.

Microsoft's installation instructions for Linux walk through installing .NET Core on a Linux system and also compiling and running a simple "Hello, World!" console application.

It does not come with an IDE, but consider Visual Studio Code.

C# on macOS

Xamarin Studio

Xamarin Studio is an IDE combined with Mono as well as cross-platform development tools. Installation instructions are here.

.NET Core

.NET Core is Microsoft's open-source implementation of C# and also part of the .NET libraries.

Microsoft's installation instructions for macOS walk through installing .NET Core on macOS and also compiling and running a simple "Hello, World!" console application.

It does not come with an IDE, but consider Visual Studio Code.

C++

Install gcc as per C
Create text file helloworld.cpp

#include <iostream>
int main() {
    using namespace std;
    cout << "Hello, World!" << endl;
    return 0;
}

Compile it using gcc:

$ gcc -o helloworld helloworld.cpp

Run it:

./helloworld

Clojure

  1. Install Leiningen.
  2. Generate a hello world app:
    $ lein new app my-hello
    
  3. Run it:
    $ cd my-hello
    $ lein run
    Hello, World!
    
  4. Edit the generated src/my-hello/core.clj file with your favorite texteditor to make changes.
  5. You don't have to edit files. Run the REPL (interactive shell) to experiment:
    $ lein repl
    
  6. Suggested reading: Clojure's Getting Started Guide and Clojure for the Brave and True

COBOL

1) Install OpenCOBOL:

$ sudo apt-get install open-cobol

2) Open your texteditor, and write the following code:

program-id. hello-world.

procedure division.
  display "Hello, World!"

  goback
  .

3) Save the code to hello.cob, and compile it with OpenCOBOL. Note: if OpenCOBOL fails with the error 'unexpected end of file', add a trailing newline after the last period. Other likely errors may be caused by omitting the periods.

$ cobc -x -Wall -free ./hello.cob

4) Run the compiled program from the command line:

$ ./hello
Hello, World!

Commodore BASIC

This guide deals with using Commodore BASIC that is factory installed on Commodore computers. Versions of this BASIC may vary depending on the specific model used.

Requirements

The user will need to obtain or have available either actual Commodore hardware as specified below under "Legacy Hardware", or will need to install a Commodore emulator on a modern computer.

Legacy Hardware

At a minimum, a Commodore computer running any version of Commodore BASIC v1.0 through 7.0 with necessary cables to hook up to a TV screen or monitor, and a power supply. To experience the complete range of BASIC's capabilities, the following Commodore-compatible peripherals are also recommended:

  • Data storage device (e.g. floppy disk drive) to save BASIC programs and use other file access commands
  • Printer
  • Joystick(s) or other input devices
  • Other peripherals that might connect to the User or Expansion Ports (modems, other printers, RAM expansion, networking devices, etc.)


Setup

Minimum requirements: The computer itself, a power supply, and a connection to a working TV screen or monitor is all that is needed to get started in Commodore BASIC.

The detailed setup of a Commodore computer is outside the scope of this document; this should be covered by your computer's user guide. If, however, you have misplaced, destroyed, loaned out, or sold your computer's user guide, there are plenty of archived copies on the Internet. Please refer to the link below that best matches your computer model:

Emulation

A Commodore emulator running on a modern computer is an easy, convenient, and low-cost alternative for users who do not have access to actual hardware. The VersatIle Commodore Emulator (VICE) is a popular cross-platform choice for Windows, Mac, Linux, and many others. The VICE software package also has the ability to emulate many of the additional peripherals noted above as virtual devices.

Download VICE

The software can be downloaded from the VICE Download Page. Please choose the distribution appropriate for your computer system and follow the instructions there.

Running VICE

On current versions of VICE, running the VICE launcher on the common platforms will allow you to choose which of the Commodore computer variants you would like to use (Commodore 64, VIC-20, Commodore PET, etc.) simply pick the model that interests you and click OK.

Starting BASIC

Start by either switching on the power on your Commodore computer, or by launching your emulator. If the system is functioning normally, you should see a title screen followed by a READY. prompt and a flashing cursor. BASIC is already running as the default language of the operating system, so that is all there is to it!

Entering and Editing Commodore BASIC

Commodore BASIC is based on Microsoft BASIC. In all versions, a BASIC program is entered in memory by typing each line individually. Each line of code begins with a unique line number and is followed by one or more BASIC statements. Multiple statements can be added to a line as long as they are separated by a colon (":"), however, the built-in text editor allows a maximum of only 80 characters total for the line. On most Commodore systems that have 40 column screens, this results in a program line length of two visible lines. The Commodore 128 is an exception to this and allows up to 160 characters per line (which in 80 column mode, this translates to two visible lines of text.) Anything over the specific limits for a particular model results in an error and the parser will not store the line in memory.

Lines are automatically sorted by line number, no matter what order they were entered. The current program in memory can be displayed using the LIST command and pressing RETURN. The user can slow the speed at which the listing is presented by holding the CTRL (control) key, or can stop the listing anywhere in the middle by pressing the RUN STOP key (usually the ESC key on emulators.) Additionally, specific ranges of lines can be given, such as:

  • LIST 100-150 will list all lines from 100 to 150, inclusive.
  • LIST -250 will start listing from the start of the program, and continue until it reaches and displays line 250.
  • LIST 430- will start listing from line 430 and continue until stopped by the user, or until the end of the program.
  • LIST 1075 will display only line 1075.


Except in special circumstances, the screen editor allows for complete movement of the cursor anywhere on the screen by use of the cursor keys, however, program lines are not committed to memory until the RETURN key is pressed with the cursor positioned anywhere on the line being entered. Commodore BASIC also allows for immediate execution of most commands when no line number precedes them, so typing PRINT 4+2 on a new line will instantly display a result of 6, but will not commit the command to the program stored in memory.

More details about the use of BASIC and the screen editor on your particular model can be found in the user manuals referenced above.

Your First Program

1. Start up your Commodore computer or emulator.

2. Type the following program:

10 PRINT "HELLO, WORLD!"
20 END

3. Type "RUN" and press Enter/Return.

Output:

10 PRINT "HELLO, WORLD!"
20 END
RUN
HELLO, WORLD!

READY.
█

Common Lisp

Common Lisp is a dynamically-typed, garbage-collected language whose features have inspired dozens of other languages including Python, Perl, Ruby, Smalltalk, and even Java. Lisp is the second oldest programming language still in use today after Fortran. Lisp has AST macros, which are only just starting to be experimented with in other languages such as Nemerle and BOO. AST macros allow the programmer to define new language constructs that seamlessly integrate with the built-in ones.

Installation

Choosing an Implementation

As a standardized language, ANSI Common Lisp has multiple implementations. LispWorks and AllegroCL are well-known commercial implementations, while the list of free implementations is extensive. Among the free implementations, SBCL is the most popular. It includes a native compiler that generates fast code, supports threads, and has a C foreign function interface. Common Lisp programs compiled with SBCL are generally competitive with Java programs.

Choosing an Editor

The commercial implementations come with their own IDEs, while EMACS is the most popular editor to use for the free implementations. SLIME is an EMACS extension that provides integration between Lisp and EMACS. It enables you to evaluate the Lisp expression at the cursor, provides tooltips, debugging, and more. SLIMV is an extension for Vim that brings SLIME to that editor.

Editing Code

The preferred way to develop Lisp programs is interactively. Evaluate each function, macro, and variable definition in the REPL as soon as you type it into your source file. You can also evaluate subexpressions, and switch to the REPL window to play around with your code as if your functions were shell scripts. Lisp programs are typically written from the bottom up, the idea being to create a language that is perfectly tailored to writing your application, and then writing your application in that language. Output or errors are displayed immediately in the REPL window.

Hello World

hello.lisp

(format t "Hello world!~%")

Running It

Exactly how to run it from the command line depends on your Lisp implementation. Of course, from the REPL you can always run it by entering:

(load "hello.lisp")

...which is also how you load source files in order to add their definitions to your program. SBCL has the save-lisp-and-die function, which saves whatever has been defined in the REPL into a stand-alone executable that includes a copy of SBCL itself (because Lisp programs can generate, compile, and run additional Lisp code at runtime, and then reference functions and variables created by that generated code).

Coq

  1. Install Coq:
    • On Windows and MacOS, download the most recent release.
    • On Linux, run:
      sudo snap install coq-prover
      
  2. Open coqide, the Coq Integrated Development Environment (IDE). The large window on the left shows the current script buffer, the upper window on the right is the goal window, and below is the message window.
  3. Write in the script buffer:
    Require Import Coq.Strings.String.
    
    Eval compute in ("Hello world!"%string).
    
  4. Evaluate the buffer:
    • At the top of the IDE, the third icon from the left is a down arrow (↓). Press it twice to make the IDE evaluate the buffer.
    • Alternatively, press the seventh icon from the left, the underlined down arrow, to evaluate the buffer at once.
  5. After the evaluation, the message window returns:
    = "Hello world!"%string
    : string

Corescript

1) Visit [3]. 2) Type in your code in the left pane. 3) Click on right, pane, type "run", and enter.

D

There is detailed information in The Hello World Program chapter of the online book Programming in D.

Here is a summary:

1) Download and install the latest dmd at dmd download page.

2) Open your favorite texteditor, write the following source code

import std.stdio;

void main()
{
    writeln("Hello world!");
}

3) Save the source code under the name hello.d

4) Open a console window and compile the source code by entering the following command

dmd hello.d

5) Start the program on the console by entering the following commandz

hello

The program should produce the following output:

Hello world!


Delphi

Works with: Delphi version 6.0

The following instructions apply to any version of Delphi going back to the 1990's. They also apply to Lazurus, which is a Delphi-like programming environment based on Free Pascal.

1. You should install Delphi or Lazarus on your computer. Delphi installation disks will automatically install the program and all necessary libraries, editors and tools on your computer. Lazarus installation files can be downloaded from their web site. They will also install all necessary tools.

Lazarus Website

2. Once Delphi/Lazarus has been installed, choose the "File -> New" option from menu bar. Next choose "Application" or "VCL Forms Application" depending on which language or version you are using.

This will cause the program to display a blank window called a "Form", with a grid of dots. The dots indicate that the program is in "Design Mode" and it is ready for you to design a GUI interface for your program.

3. At the top of the IDE is a "Component Palette" that displays a bunch of icons. Each icon is an object that you can put on the form.

Select the "Memo" item by clicking on it once. (It is normally the sixth item from the left.) Now click on the form; a white box should appear. This is an object that allows you to display, enter and edit text. You can move and resize the memo, by dragging the control with the mouse or pulling on the tiny black boxes on the edges of object.

Next click on the "Button" object on the palette and drop it on the form next to the memo. It can also be moved or sized.

4. Double click on the button. This will automatically write a subroutine in the source code and bring up the Delphi/Lazarus source-code editor displaying the subroutine.

procedure TForm1.Button1Click(Sender: TObject);
begin
end;

Between "begin" and "end" statements, enter the following line of code:

Memo1.Lines.Add('Hello World');

The end result should look like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Add('Hello World');
end;

5. You've now completed the program. Press the "Run" button in the upper left portion of the IDE. (It is usually the button with green arrow on it.) The program will now display your form with the button and the memo on it. Press your button. This will cause the "Hello World" to be displayed in the memo.

Output:

EasyLang

EasyLang programs run in the browser. EasyLang code needs to be run using a special IDE.

  1. Open the EasyLang IDE at [4]
  2. Type in this program into the IDE:
    print "Hello world!"
  3. Click the run button at the top of the IDE, and you should see:
Output:
Hello world!

EchoLisp

Requirements and installation

You need a computer running an up-to-date browser, such as FireFox, Chrome, Opera, ... No installation needed. To run EchoLisp, follow this link : EchoLisp.

Hello World

;; This is a comment
;; Type in the following -uncommented- line in the input text area, and press [RETURN] 
;; or click onto the "Eval" button
;; Auto-completion : You will notice that after "(di" , EchoLisp proposes "(display" : 
;; Press the [TAB] key to accept

(display "Hello, World" "color:blue")

On-line help

The first thing to know are the "apropos", "usage", and "help" functions. Examples:

;; usage  give the syntax(es) for a function call
;; "usage" abbreviation is "us"
(us display)  📗 (display object css-style-string) (display object)

;; help opens the reference manual at the right place, in a browser tab
;; "help" abbreviation is "?"
(? display)  [http://www.echolalie.org/echolisp/help.html#display]

;;  searching
;; (apropos name) displays the list of functions about 'name'
;; "apropos" abbreviation is "ap"
;; 'special' forms (you will learn that later) are flagged with 👀
;; 1:2 is the number or arguments. min 1, max 2
(ap list)   #(👀 for*/list:2:n  👀 for/list:2:n  alist?:1  circular-list:1:n  list->stack:2 
 list->vector:1  list-index:2  list-ref:2  list-sort:2  list-tail:2  list:1:n  list?:1 
 maplist:2  set-plist!:2  stack->list:1  stream->list:1:2  string->list:1  sublist:3 
 symbol-plist:1  vector->list:1 )

;; Or you can press the "Help" button.
;; Lost in the reference manual ?
;; Just type-in a letter, and you will go to the alphabetical index.

Editing

Functions are provided to save data, functions definitions, in the browser local storage, without leaving the read-eval-print loop. However you can edit files, using any text file editor - UTF-8 compatible - and load/eval them with the "Load" button. TextWrangler is a good choice on Mac OS/X. It supports syntax hiliting for source lisp files. In any case, the EchoLisp team is ready to help you.

EDSAC order code

If the year is 1950, first write to Dr Wilkes at St John's College asking him whether you can submit a job to the electronic brain. Assuming he is agreeable, copy out your program—legibly!—and take it round to the keypunch operator at the Mathematical Laboratory.

If it is the present day, Nishio Hirokazu's browser-based simulator allows you to run EDSAC programs without installing anything. Navigate to this page and click the Source tab. Clear the text area (it will contain a 'Welcome' program) and type or paste your program. When you have finished, click the Machine tab and then the button marked Load source. You should see your program, stripped of comments, newlines, and whitespace, appear in the Input tape. Click Run. The machine will first execute the Initial Orders, loading your program into storage, and then run your program. The storage tanks are displayed down the left-hand side of the window: clicking on any tank allows you to watch that tank in a larger size.

Eiffel

Example

  1. Download and install Eiffel GPL on your Windows computer.
  2. Open Eiffel, creating a new Basic command line project (follow the wizard).

The resulting program will be a simple "Hello World!" program:

class 
   APPLICATION
create 
   make
feature
   make
      do
         print ("Hello World!")
      end
end

Where the following notes apply:

  • class APPLICATION ... end
    
    defines the simplest form of an Eiffel "class".
  • create make
    
    defines a "creation procedure" (i.e. constructor) for the class {APPLICATION}.
  • make do ... end
    
    is the implementation of the constructor specified with the `create' keyword (above).
  • print ( ... )
    
    is a feature inherited from class {ANY}—a class from which all Eiffel classes inherit (e.g. like {APPLICATION}). In the example the
    inherit ANY
    
    has been left out as it is implied by default.

Supported Platforms

Windows, Linux, Mac, and others.

Supporting Notes

See [Eiffel-org] for more information.

An example of "Hello World!" is on the home page. You can try Eiffel by clicking the "Play with Eiffel" button on the "Hello World!" example on the home page.

You can find plenty of YouTube videos on the Eiffel Software [Eiffel Videos] channel or [Eiffel Videos] channel.

Elena

ELENA on Windows

  1. Download ELENA from GitHub or AppVeyor Nightly builds
  2. You have to add a path to _BIN_ folder to the system environment *PATH* or copy elenavm.dll and elenart.dll to _Windows\System32_ folder. Alternatively you may use setup project
  3. To create a simple program in ELENA we have to create a source file (e.g. program1.l) and write the following code:
public program()
{
    console.writeLine("Hello world")
}
  1. Now it should be compiled (where elc is a command-line compiler):
elena-cli.exe program1.l
  1. It will create program1.exe file which you can execute:
program1

with the following result:

Output:
Hello world

Erlang

Erlang on Linux

Here is a summary:

1) To install Erlang in Linux, open a terminal and run the command:

sudo apt-get install erlang

2) Open your texteditor, write the following source code:

% Implemented by Arjun Sunel
-module(helloworld).
-export([main/0]).

main() ->
    io:fwrite("Hello world!\n").

3) Save the source code under the name helloworld.erl

4) Open a terminal, hit enter after typing the following command.

erl

5) Compile the source code by entering the following command

c(helloworld).

6) Run the code by calling the main() function using the command:

helloworld:main().

The program should produce the following output:

Hello world!
ok

Factor

  • download and install Factor from https://factorcode.org/
  • run the factor binary; this will bring up the listener — Factor's REPL
  • type "Hello world" print and press enter
  • it may be more illuminating to type "Hello world" <enter> print <enter> instead
  • press F1 or click the help button to bring up Factor's help browser
  • click Your first program to recieve step-by-step instructions on how to integrate an editor of your choice with the listener, create your own vocabularies, write tests, make scripts/binaries, and learn more about the language


FreeBASIC

Installation

FreeBASIC gives you the FreeBASIC compiler program (fbc or fbc.exe), plus the tools and libraries used by it. fbc is a command line program that takes FreeBASIC source code files (*.bas) and compiles them into executables. In the combined standalone packages for windows, the main executable is named fbc32.exe (for 32-bit) and fbc64.exe (for 64-bit)

fbc is typically invoked by Integrated Development Environments (IDE) or text editors, from a terminal or command prompt, or through build-systems such as makefiles. fbc itself is not a graphical code editor or IDE!

Download FreeBASIC here: https://sourceforge.net/projects/fbc/files

Interface

FB does not have 'default' IDE

Optionally, you can install a text editor or IDE which will invoke fbc.exe for you.

Windows

Linux

Unless you already have a text editor or IDE, you should install one too, as FreeBASIC itself does not include one. An IDE can be used to write and save .bas files and to launch the FreeBASIC Compiler to compile them. The following IDEs are known to explicitly support FreeBASIC:

HelloWorld Program (Text Output)

To display the "HelloWorld!" in the Text Output, copy this code and paste to the code editor:

Print "HelloWorld!"

Then press F5 or click the play button.
You have just created and run your first program.

HelloWorld Program (Graphics Output)

To display the "HelloWorld!" in the Graphics Output, copy this code and paste to the code editor:

Cls         'Clear the graphics screen
Screen 1    'Mode 320x200
Locate 12,15 
Print "Hello world!"
Sleep

Then press F5 or click the play button.

Documentation

Press F1 or click the Help menu for language help/documentations.
Or consult the online manual at: https://freebasic.net/wiki/DocToc


Fortran

Linux

  • install gfortran

For Debian-based GNU Linux OS:

sudo apt-get install gfortran

For RPM-based GNU Linux OS:

su -c "yum install gcc-gfortran"

or

sudo zypper in gcc-fortran

or

sudo rpm -ihv gcc-fortran

Note differences in package names that provide gfortran compiler in different Linux distros.

  • Create hello.f90 source code file. You can also use any text-editor (ed, joe, pico, nano) but here is shown how to create such file directly in terminal using "cat" command. Open terminal and hit enter after typing the following command.
cat > hello.f90
  • Type in the following Fortran source code
write(*,*) "Hello world!"
end

and finally hit Ctrl^D in terminal.

  • Compile hello.f90 source code into executable hello.x binary using gfortran compiler
gfortran hello.f90 -o hello.x
  • Run it
./hello.x

FutureBasic

Requirements

Macintosh OS X v10.4 or newer

Download FutureBasic (FB)

FutureBasic is freeware and is commonly called simply "FB" by its developers. The lastest version of FutureBasic can be downloaded from: http://4toc.com/fb/index.htm. The FB site also contains installation instructions, example files, older versions, and other helpful information.

FB Support Group

An active list group of developers who are knowledgable, friendly and helpful to both seasoned and newcomer coders can be found at: http://freegroups.net/groups/futurebasic/. Answers to any of a host of questions about FB are answered quickly by this small, but dedicated group of developers.

FB on Wikipedia

The FB Wikipedia page describing FB's journey from one of earliest commercial Macintosh compilers to its current freeware status can be visited at: https://en.wikipedia.org/wiki/FutureBASIC. This page may not have the latest information about FB, so the authoritative source for the latest information is the FB web site and list group listed above.

=== Your First Program ===

When you have downloaded and installed FB, you will want to compile your first program, the traditional "Hello, World!"

1. Launch FB and from the File menu select New File.

2. Name your file "Hello, World!" and save it to your Desktop.

3. In the window type the following:

window 1

print @"Hello, World!"

HandleEvents

4. From FB's Command menu, select Build and Run "Hello, World!"

Enjoy your first program!

Go

Currently supported platforms are FreeBSD, Linux, Mac OS X, and Windows. From the landing page http://golang.org click the blue box "Download Go" (under the big gopher drawing.) This takes you to Getting Started, a fairly concise page that is very close to satisfying this task.

The first section, Download, has a link to a downloads page but also mentions two other options, building from source and using GCC. I personally like building from source and have found it usually goes without a hitch. GCC isn't just C anymore and includes a number of language front ends. Go is one of them. There are links there to separate pages of instructions for building from source and using GCC.

Continuing with instructions for the precompiled binaries though, there is a section "System Requirements" and then a section "Install the Go tools", which means tools including the Go compiler. You need to follow some steps here. Follow the instructions for your operating system. (The steps are few, standard, and easy.) Pay attention to the paragraph "Installing to a custom location" if you are installing on a system where you do not have root or sudo access. Setting GOROOT as described is essential in this case. If you are installing to the standard location, you should not set this environment variable. (Setting it when it doesn't need to be set can lead to problems. Just don't.)

You're ready to test the installation with Hello World! The RC Task mentions texteditors. You will want an editor that can edit Unicode UTF-8. Go source is specified to be UTF-8 and before long you will want an editor that does this. This task is all ASCII however, and any editor that can save plain ASCII text will do for the moment. Actually you probably don't even need an editor. From a Linux command line for example, you can type

$ cat >hello.go

Cut and paste the code from Hello_world/Text#Go, press ^D, and you should have the program. To run it type

$ go run hello.go

This compiles to a temporary executable file and runs it, displaying output right there in the same window. If you want a copy to give to your friends,

$ go build hello.go

will create an executable called hello in the current directory.

This completes the RC task, but if at any point in the future you will use Go for more than Hello World, you really really should continue through the next section "Set up your work environment." This covers setting GOPATH, which is essential to standard workflow with Go.

Groovy

First you need to have a JRE or better a JDK 1.5+ installed on your machine. Install Groovy following the instructions at: Groovy Installation

In your repository Just type: (no class, no parentheses, no semicolon, no import)

println 'Hello to the Groovy world'

and save it in hello.groovy On the command line, just type

$> groovy hello.groovy

You will see the following message:

Hello to the Groovy world

Note you can also define a String to test the output message example, in your hello.groovy file replace previous code by:

String hello = 'Hello to the Groovy world'
println hello

And you can add some assertions, for instance:

assert hello.contains('Groovy')
assert hello.startsWith('Hello')

Haskell

Install GHC:

$ sudo apt-get install ghc

Create hello.hs:

$ touch hello.hs
$ cat > hello.hs << HERE
main = putStrLn "Hello, World!"
HERE

Compile it:

$ ghc hello.hs -o hello

And run the executable:

$ ./hello
Hello, World!

Non-Linux operating systems

If you are using another operating system (e. g. Mac OS X), the easiest way to get Haskell is to install the Haskell Platform.

J

Download J903

Install it, using the defaults.

Run the program, and bring up the IDE.

Type in:

'Hello, World!'

A quicker alternative might be an online version of J, if you are using a browser which supports wasm.

Jakt

The Jakt compiler must be built from source; check the bootstrapping documentation for the instructions. As of writing, clang 14 seems to be the recommended version for compiling.

In summary, install cmake and run the following commands to build:

cmake -B build -GNinja
cmake --build build

To compile hello world, save the following to hello.jakt:

fn main() {
    println("Hello world!")
}

To compile it, run the following command in the directory containing hello.jakt.

jakt hello.jakt

The built executable will be ./build/hello.

Specifying -cr will automatically run the program after building.

jakt -cr hello.jakt

Output will go to the terminal.

Java

Many people already have the Java SE runtime installed on their computer for use by various existing programs, but to develop Java programs, a JDK (Java Development Kit) must be installed too. A JDK consists of a few components: A JRE (Java Runtime Environment), which includes a JVM (Java Virtual Machine) and the JCL (Java Class Library) for running Java applications, and a Java compiler, which turns human-readable Java source code into byte code that is then executed by the virtual machine.

1. Various JDK implementations exist, the majority of which (including the reference implementation, OpenJDK) are free and open-source, and available for almost all popular operating systems and CPU architectures. Following are links to the latest (until 2023) official OpenJDK LTS binary release (version 17):


2. Java programs are often developed with one of various full-featured IDEs, but this is not a requirement. For simplicity, we will stick with using only pre-installed text editors. After the installation has completed, open a terminal window (Command prompt on Windows) and try running the command:
javac -version
If you see an output similar to javac <version_number>, the JDK was successfully installed. You are now prepared to develop and run Java applications.


3. Using a plain-text editor (vim, nano, emacs on UNIX-like operating systems, or notepad on Windows), re-type or copy and paste one of the following classes into the editor and save it as a file named HelloWorld.java. The file naming step is a very important, as a Java source code file must be named the same as it's (one and only) public class.

public class HelloWorld {
    public static void main(String[] args) {
        //Prints 'Hello world!' to terminal/console.
        System.out.println("Hello world!");
    }
}

Output: Hello world!

Printing Hello world! in a more object-oriented manner

public class HelloWorld {
    public static void main(String[]args){
        HelloWorld hw = new HelloWorld();
        hw.run();
    }

    void run(){
        //Print 'Hello world!' to console/terminal
        System.out.println("Hello world!");
    }
}

Output: Hello world!

4. The first class above is the minimum amount of code required to create the traditional "Hello world!" program in Java, it consists of:

  • A class definition using the language keywords public and class, which indicate that this class (a container of both state and functionality) is meant to be externally accessible by other packages (not important in this specific case).
  • A method definition named main using the language keywords public, static and void. These three keywords, respectively, indicate that: this method is externally invokable (in this case, by the JVM itself), this method can invoked without having to create an instance of the class (known as a class method in other languages), this method does not return any value to it's caller. The identifier name main is not a keyword, but is what the JVM expects to find when a normal Java application is executed. Additionally, the variable args holds any CLI arguments that were provided when the program was ran, it is optional.
  • Finally, the predefined method println of the System class's out field is invoked with the string literal "Hello world!", displaying it on the connected terminal's standard out stream.


5. From here, if you are interested in continuing to learn Java, many in-depth tutorials are available on for free, just a few of them are Oracle's official tutorials, Wikibook's Java programming book and W3School's Java tutorial. One of Java's main attractions is it's massive library of pre-defined classes, meant to assist in a wide variety of different programming tasks. The reference documentation for these classes and the modules and packages that encompass them can be found on Oracle's official site here, by choosing A JDK version and then selecting "API Documentation" under the "Specifications" category.

JavaScript

1. Go to the "Developer Console" part of your preferred web browser.

2. You can choose between the console.log() method or the alert() method (suggestion: try both).

console.log() method:

console.log("Hello, World!");

This will be printed on the Console tab part of your web browser.

Hello, World!

alert() method:

alert("Hello, World!");

This will appear in the shape of a 'pop-up' in your browser.

3. There is no number 3, Happy Coding!

jq

The official jq homepage at http://stedolan.github.io/jq has an introduction and pointers to instructions on downloading jq; a tutorial; a manual; an online jq interpreter called jqplay; and so on.

The website is well-organized and intended for newbies as described on this page, and so the following will avoid repeating the same information. Instead we will explore the "Hello world!" task in the context of both jqplay and the jq command. As will become evident, an editor is not always necessary. In practice, though, jq is typically used in conjunction with a text editor as discussed in the penultimate subsection of this article, which concludes with a note on programming style.

jqplay

jq is primarly intended for use as a command-line tool, but the online tool at jqplay.org can also be used for simple tasks. In fact, it is instructive to consider two approaches to the "Hello world!" task using jqplay:

1) "Hello world!" as data

"Hello world!" can be regarded as a JSON string, and it can be entered in the JSON input box. The program for printing it is just "." (without the quotes). That is, using jqplay, one simply enters . in the "Filter" box.

2) "Hello world!" as program

Since any JSON entity is a filter in jq, we can also enter "Hello world!" in the Filter box. In this case, no additional data is required, and so the "Null input" box can be checked.

The jq command

With jq installed, we can explore the two approaches mentioned above at the command prompt.

In the following we will use C:\ to signify the context is a Windows terminal, and $ to signify that the context is Linux/Unix/Mac/Cygwin or similar.

1) "Hello world!" as data

The data can come from stdin or from a file:

Data from stdin

$ echo '"Hello world!"' | jq .

C:\ echo "Hello world!" | jq .

If there were a web server somewhere that provides "Hello world!" as JSON, then we could also write something like:

curl -Ss http://hello.world.com | jq .

Data from a file

$ echo '"Hello world!"' > hello.txt
$ jq . hello.txt

C:\ echo "Hello world!" > hello.txt
C:\ jq . hello.txt

2) "Hello world!" as program

$ jq -n '"Hello world!"'

C:\ jq -n "Hello world!

We could also put the program into a file. In this particular instance, we could use the file hello.txt that was created above. In this particular case also, the command is the same in all the environments under consideration:

 jq -n -f hello.txt .

In practice, it is recommended that jq programs be placed in text files with names ending with the .jq suffix.

Editors

Any text editor can be used for JSON and jq programs.

An editor such as Emacs or Aquamacs is particularly helpful as these support shell windows. In addition, most distributions come with "js-mode" which can be used for editing JSON, and there is also a "json-mode" package available at https://github.com/joshwnj/json-mode.

A note on jq programming style

jq programs consist of definitions and pipelines. There is much to be said for a style illustrated by the following example:

def binary_digits:
  if . == 0 then 0
  else [recurse( if . == 0 then empty else ./2 | floor end ) % 2 | tostring]
    | reverse
    | .[1:] # remove the leading 0
    | join("")
  end ;

Julia

1. Use a web browser to go to http://juliabox.com. With email or Google signin, sign up for a free account.
    1a.(optional) JuliaBox has Julia tutorials. You will find them in the default file directories when JuliaBox first loads.
    1b. (optional) download and install Julia from https://julialang.org/

2. Start a JuliaBox session and choose "New" then "Julia 1.0 ."

3. Type in the box: println("Hello world")

4. Choose the |> symbol to run that line of Julia code.

K

Works with: ngn/k

git clone https://codeberg.org/ngn/k.git

make using the build: line in readme.txt

run using the use: line in readme.txt

Kotlin

In what follows I'm going to assume that you're using an x64 version of Windows.

First you need to download and install the Java SE Development Kit 8 from Oracle at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.

Secondly you need to download, unzip and install the Kotlin command line compiler version 1.1 from GitHub at https://github.com/JetBrains/kotlin/releases/tag/v1.1.

Next open up a Command Prompt session in Windows, type the following at the command line and press the Enter key:

notepad hello.kt

Now in Notepad, paste in the following and save it:

fun main(args: Array<String>) {
    println("Hello, World!")
}

Next type this at the command line to compile the program:

kotlinc hello.kt -include-runtime -d hello.jar

Finally, to run the program, you need to type in:

java -jar hello.jar

You should now see this cheery greeting printed to the console:

Output:
Hello, World!

Lambdatalk

The minimal installation is straightforward. Go to this URL:

   - http://lambdaway.free.fr/lambdaspeech/?view=download

 1) download the ~25kb archive,
 2) unzip the archive, you get a ~100kb folder named "archive",
 3) rename it for instance "my_wiki", avoiding spaces and esoteric characters,
 4) open your FTP tool and upload the folder to your web account.

Your wiki "my_wiki" is ready! Now:

 1) open any modern web browser and go to "my_wiki" in your web account,
 2) the start page displays "Hello World",
 3) click on the title "start" to open the edit menu,
 4) in the editor frame, under the first line containing 

  _h1 Hello World 

write for instance:

  _p This is my first sentence, a new paragraph has been added.

 5) then choose "save" in the menu.

Congratulations, your first web page is published.

Lean

These are the steps to install Lean 4:

  1. Have a look at the quickstart, which links to this video.
  2. Install VS Code, if it is not installed:
    • On Linux, run:
      sudo snap install --classic code
      
  3. Start code and search in "Extensions (Ctrl+Shift+X)", and write "lean4" in the text box.
  4. Select the "lean4" extension and install it.
  5. Select "File / New File... (Alt+Ctrl+N)" and create the file "HelloWorld.lean".
  6. A message may pop up saying "Failed to start 'lean' language server". If that happens, press the button "Install Lean using Elan".
  7. Write the following in "HelloWorld.lean":
def main : IO Unit :=
  IO.println ("Hello world!")

#eval main
  1. Place your cursor a at the end of #eval main, which updates the "Lean Infoview" showing the message Hello world!.

Locomotive Basic

Either use CPCBasic, a browser-based Locomotive Basic emulator (https://benchmarko.github.io/CPCBasic/cpcbasic.html) or download a full CPC emulator binary for your platform. A list of emulators is available at http://cpcwiki.eu/index.php/Emulators. JavaCPC (http://sourceforge.net/projects/javacpc/) or WinAPE (http://www.winape.net/) are particularly recommended.

In CPCBasic, type

10 print "Hello World!"

into the text box and click "Run". Output goes to the blue CPC screen below.

Lua

Without installing anything, lua-programs can be run online at the live demo.
It includes some demo-programs, such as

io.write("Hello world, from ",_VERSION,"!\n")

For installing Lua, there are extensive instructions for getting started on Linux, MacOS and Windows.

M2000 Interpreter

M2000 Interpreter run on M2000 Environment, a Windows 32bit application. Interpreter is an ActiveX component and can be loaded from other programs/languages which can use this type of object.

Installation on Windows (Xp to 10, 32 or 64bit):

We have to download run-time for Access 2007.

We can use [5] as a certificate as Trusted Root Certification Authorities, Or we have to block Defender or something like this, because they are suspicious for virus, and they predict whatever they figure from the code.

So now we can install the code downloading the setup executable from this link: [6]

This is the Wiki page on github [7]

Starting M2000 Environment

When start m2000.exe a console open at full screen. We can start m2000.exe without open console, making gsb files to open with m2000.exe. So we can use any text editor, and save to any format (UTF-8 by default, but can use ANSI, UTF-16LE, UTF-16BE), and by double clicking the file we get the program on M2000 environment, and we have to include a line at the end to execute a specific module.

Console can change using Form. Form 80, 50 make console 80 characters by 50 lines. Console can be used for graphics too. There is a split screen function, where the lower part of console can scroll, and upper part used as header. Using Cls , -10 we make 10 last lines as scrollable. We can use Settings to open a dialog for changing font name, size, line space, default colors.


From console we can execute command line statements (loops not allowed there), or we can make modules/functions (these are global), using Edit statement. Edit A open internal editor with syntax color, for module A. We can write Print "Hello World" and pressing Esc return to command line. We write A and pressing enter we execute this module. We can see with Modules the list of user modules (not modules inside modules) in memory and in disk (a M2000 user folder)

We can save all modules/functions using Save and a name like this: Save example1

We can load (merge) modules from a saved file using Load: Load example2

(file names: example1.gsb and example2.gsb)

We can edit a file on disk without merging using this: Edit "example1.gsb"

We can use New to erase any loaded module

We can use Start to make a Cold Reset to environment (this can be done with Break key)

We can stop execution using Esc or Ctrl+C

We can test execution using Test or Test nameofmodule

We can use Help All for a list of all statements or Help Print for help for print

To close interpreter, we have to write END in command line. We can start several interpreters. Also we can save programms and make them to start by double clicking.

Installation on Linux using Wine

Run this in a terminal for wine>1.8 do this first, and change prefix32 to .wine (use ctrl+H to see hidden folders in home folder).

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine wineboot

Now .wine is a 32bit prefix, so we can use art2kmin mdac28 which need 32 bit prefix

winetricks vb6run art2kmin mdac28

Latest installation on Wine version 3.0.2 Ubuntu 18.04, 64bit. and we have to use native oleaut32, and we get interpreter at ten times faster than with build in one. Without it in Wine 3.0 we get fault if we use this statement Print 1=1 because this produce a boolean type (Ole Variant), and only native Oleaut32 handle this.

Install Environment using M2000Interpreter.exe

Execute Settings statement first time to set default font, size of console

Use Edit module_name to edit (with syntax highlight) or copy code from this site, press Esc to return to console prompt.

Use Edit A as B to rename a module_name

Use Save name1 to save any module/function

Use New to erase all modules/functions

Use Load name1 to modules

Use Ctrl+A to save all changes to previous loaded file.

Use arrows to see previous commands

Use Edit without argument to edit commands in a screen editor with syntax highlight.

Execute End to close environment

Maple

Installation of Maple 2017 To start, make sure your computer meets the system requirements. Ensure you are connected to the internet and download the installation file. Install Maple. Once installed, find, and run the application. Once Maple is up and running, select the "File" button in the top left corner, and then select "New", and select either Document mode or Worksheet mode. Once in the selected mode, it becomes very easy to display "Hello World". Maple has multiple ways to display text on the screen, but the most simple way is to type the words you want printed, surrounded by double quotes, and followed by a semi-colon. Example:

"Hello World";
                        "Hello World"

Congratulations, you executed your first line of code!

Mathematica / Wolfram Language

Buy & Install the program from http://www.wolfram.com/mathematica/, e.g. "Home - For nonprofessional use by hobbyists and enthusiasts" --> €295

Start Mathematica either :

  • by calling math.exe(Windows) or math (Others)
  • by double clicking on the Mathematica icon.

Open a new notebook and type : Print[ "Goodbye, World!"]

MelonBasic

1. Go to https://scratch.mit.edu/projects/2600575/.

2. Click on the green flag, either above the thumbnail or on the thumbnail.

3. Click on the button that says "Add" on it.

4. Type the following text, then press the Enter key or click on the blue button with a white tick symbol on it: Say:Hello world!

4. Click on the icon that says "Run" on it. The program will run and you should see the following text: Hello world!

You've just created and run a hello world program in MelonScript.

MiniScript

Running in a Web Browser

The easiest way to get started is to use any desktop computer with a web browser, and point it to https://miniscript.org/tryit/. In the code editor that appears at top-left, delete any example code already there, then type in the following:

print "Hello World!"

Then click the Run Script button. The output will appear in the terminal-style (green text on a black background) box to the right or below the code editor (depending on the width of your browser window).

Running on the Command Line

For this you will need to download and install command-line MiniScript from https://miniscript.org/cmdline/. Select the download link for your platform (Windows, MacOS, or Linux). Unpack the archive using standard tools for your platform. The result will be a command-line executable. Install this somewhere in your standard search path (for example, on Mac and Linux, /usr/local/bin is a standard choice).

Then type miniscript on the command line to start the MiniScript interpreter. Type in the program above and press Enter; results appear immediately on the next line.

Running in Mini Micro (on the Web)

If you have a desktop WebGL-capable web browser, you can go to either https://miniscript.org/MiniMicro/ or https://joestrout.itch.io/mini-micro to run the Mini Micro virtual computer right within your browser. (In the latter case, click the big "Play" button to boot the machine; at miniscript.org, it does this automatically.)

Once Mini Micro is booted, you will note an orange blinking cursor. Type in the program above and press Enter; results appear immediately on the next line.

Running in Mini Micro (Locally Installed)

From either [8] or [9], download links are available for MacOS, Windows, and Linux. Select the appropriate link for your platform; download and unpack. The result is a standard GUI application named Mini Micro. Double-click it to launch. It should produce a window that looks just like the WebGL version above. Type in the program above and press Enter; results appear immediately on the next line.

Monte

Follow the directions at http://monte.readthedocs.org/en/latest/intro.html#where-do-i-start to set up your Monte environment.

Then

$ bin/monte monte/src/examples/hello.mt

The code in hello.mt simply defines a function and then calls it:

def sayHello():
    traceln("Hello World")
sayHello()

MontiLang

Download MontiLang binaries for windows or linux from http://montilang.ml, or from the releases page of https://github.com/lduck11007/MontiLang. Alternatively, you can easily build from source for easy customization with the instructions on Github.

To run MontiLang, open a shell by typing
monti
in the terminal, or run a program by specifying
monti file.mt
For documentation on the language, see file 'Documentation.mt' in /examples on github.

Here is a simple Hello World program in MontiLang

|Hello, World!| PRINT .

Nemerle

  1. Download Nemerle from Nemerle.org

Nemerle on Windows

The installer available on Nemerle.org includes Visual Studio integration. If you use Visual Studio, this gives syntax highlighting, name completion, etc. Otherwise, you can use your favorite texteditor or IDE.

In your text editor, type (or copy/paste):

 using System.Console;

 class Hello {
     static Main() : void {
         WriteLine("Goodbye, world.");
     }
 }

or, more concisely:

 System.Console.WriteLine("Goodbye, world.")

Save this file as "hello.n" (or whatever you like, but the example below assumes this name)

Now, either run it from within your IDE, or open a console window and type:

   c:\>ncc hello.n

(this assumes ncc.exe is in your path, where it should be if you used the installer)

The output file will be out.exe; run out.exe as so

   c:\>out

and be dazzled by the output:

   Goodbye, world.

Nim

A comprehensive introduction to the Nim language can be found at How I Start: Nim.

A brief summary of installing Nim and building a simple Hello world! program is as follows:

1) Install Nim by selecting the appropriate platform at Install Nim and follow the instructions.

2) Open a text editor and create a file named hello.nim with the following contents:

echo "Hello world!"

3) Open a terminal console, and run the following command:

nim c -r hello

The program should produce the following output:

Hello world!

The -r option causes the program to automatically run after it is successfully compiled.

Nix

Installation

Install Nix from the Nix download page.

“Hello world!” as a string

  1. Open your Editor and write the following line:
    "Hello world!"
    
  2. Save the file as hello.nix.
  3. Evaluate the file as input.
    nix-instantiate --eval hello.nix

“Hello world!” as a derivation

A derivation in Nix represents a single build step. The output of a derivation is a path in the Nix store.

  1. Open your Editor and write the following line:
    (import <nixpkgs> { }).writeText "hello" "Hello world!\n"
    
    This represents a derivation that uses writeText from nixpkgs as a builder to write an output in the Nix store with the suffix “hello” containing the contents “Hello World!”.
  2. Save the file as hello-derivation.nix
  3. Build the derivation.
    nix-build hello-derivation.nix
    The derivation result is a path in the Nix store. A symlink result is also created in the current directory pointing to the path of the result in the nix store.
  4. View the output of the derivation.
    cat result

NS-HUBASIC

Note: This guide is for Family BASIC V3 running on real hardware.

1. Plug the keyboard that says "FAMILY COMPUTER" and "HVC-007" on its face into the Famicom's expansion port.

2. Insert the cartridge that says "FAMILY BASIC V3" on it into the Famicom's cartridge port.

3. Switch the Famicom on. The following text should appear on the screen, and a flashing cursor on the line of text beneath that:

NS-HUBASIC V3.0

© NINTENDO/SHARP/HUDSON

4086 BYTES FREE

OK

4. Type the following line, then press the key that says RETURN on it:

10 PRINT "HELLO WORLD!"

5. Type the following line, then press the key that says RETURN on it to run the program:

RUN

The following text should appear on the screen below the previous line of text, and a flashing cursor on the line of text beneath that:

HELLO WORLD!

OK

You've just created and run a hello world program in NS-HUBASIC.

Nu

The Nu programming language is a part of Nushell. See the official installation guide for up to date instructions. If you are on Linux use your distribution's package manager (search for nushell).

Once installed, you can run nu through the command line to get a prompt. Type print "Hello world!" to run the hello program interactively.

Transcript (some content redacted for brevity):

~ $ nu
     __  ,
 .--()°'.' Welcome to Nushell,
'|, . ,'   based on the nu language,
 !_-(_\    where all data is structured!

[...]

~> print "Hello world!"
Hello world!

Alternatively, save the following text to the file `hello.nu`

print "Hello world!"

This can be done with any text editor, or via the command line.

tee hello.nu << EOF
print "Hello world!"
EOF

Run with nu hello.nu.

OCaml

Prerequisites: Ocaml Download: On Linux, Ocaml should be available in your package manager.

Create file: 'hello.ml'

Type in file:
print_string "Hello world!\n";;
Compile with:
ocamlc -o hello hello.ml
Run as:
./hello

Oforth

Select one of the Oforth implementation to download : http://www.oforth.com

Copy oforth directory at a location of your choice.

Set OFORTH_PATH environnement variable value to this directory. You can also add this directory to your PATH variable in order to be able to launch Oforth from everywhere.

Create file "hello.of"

Type in file:

"Hello world!" println
Run as:
oforth hello.of

Or you can use oforth command line directly :

oforth --P"\"Hello world!\n\" println"

Pare

Prerequisites: Perl

Download: https://bitbucket.org/parelang/pare/downloads/pare

Create file 'hello.l':
(print "hello world")
Run:
perl pare hello.l

PARI/GP

PARI's official site is http://pari.math.u-bordeaux.fr/ .

PARI/GP on Windows

Go to the download page of the PARI/GP website and download one of the following:

  • The latest self-installing binary distribution 2.4.2. This is the most full-featured but lacks some of the newer bugfixes and commands.
  • The basic GP binary 2.5.0. This lacks some features like high-resolution graphing but has newer features.
  • The SVN version 2.6.0. This has the bleeding-edge features but lacks many nicities and may contain bugs.

PARI/GP on the Mac

Install the latest available gp version on

or

PARI/GP on Linux

Install PARI/GP with an appropriate package manager: RPM, apt, etc. Alternately, install it from source.

Your first program

Open a texteditor of your choice and type

print("Hello, world!")

Save the file in your PARI working directory and start the program, either in a console (command: gp) or in the GUI in Windows (by double-clicking the shortcut). Type \r filename to read in the program. (If you saved the file with a .gp extension, you can leave it off here.) The program executes, displaying "Hello, world!".

PepsiScript

Note: The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.

1. Go to https://scratch.mit.edu/projects/97635357/.

2. Click on the green flag, either above the thumbnail or on the thumbnail.

3. Wait until you're asked what your name is, then type something in the text box (if you don't know what to type, you could type N/A), then press the Enter key or click on the blue button with a white tick symbol on it.

4. Wait until you're asked what you want to call the project, then type something in the text box (if you don't know what to type, you could type Hello world), then press the Enter key or click on the blue button with a white tick symbol on it.

5. Type the following line, then press the Enter key or click on the blue button with a white tick symbol on it:

function

6. Wait until you're asked what you want to call the function, then type something in the text box (if you don't know what to type, you could type Greeting), then press the Enter key or click on the blue button with a white tick symbol on it.

7. Type the following line, then press the Enter key or click on the blue button with a white tick symbol on it:

print

8. Type the following text, then press the Enter key or click on the blue button with a white tick symbol on it:

Hello world!

9. Type the following line, then press the Enter key or click on the blue button with a white tick symbol on it:

compile

10. Click the "compiled" code until it appears to be in a different color. The "compiled" code should look something like this: •dl◘N/A◙♦Greeting♪♣Hello_world!♠

11. Go to https://scratch.mit.edu/projects/97635357/.

12. Click on the green flag, either above the thumbnail or on the thumbnail.

13. Wait until you're asked to paste in compiled code, then paste the compiled code or type the compiled code. The program will run and you should see the following:

HELLO WORLD!

You've just created and run a hello world program in PepsiScript.

Perl

See Download Perl Distributions

=head1 Obtaining perl

On the majority of UNIX and UNIX-like operating systems 
(Linux, Solaris, AIX, HPUX, et cetera), perl will already be installed. 
Mac OS X also ships with perl. 
Note that "Perl" refers to the language 
while "perl" refers to the interpreter used to run Perl programs.

Windows does not ship with perl. Instead, you will have to install one of
the following perl distributions:

=over 4

=item Strawberry Perl

L<Strawberry Perl|http://strawberryperl.com/>: A 100% Open Source Perl for
Windows that is exactly the same as Perl everywhere else; this includes using
modules from CPAN, without the need for binary packages.

=item DWIM Perl for Windows

L<DWIM Perl for Windows|http://dwimperl.com/windows.html>: A 100% Open Source
Perl for Windows, based on Strawberry Perl. 
It aims to include as many useful CPAN modules as possible.

=item ActiveState Perl

L<http://www.activestate.com/activeperl/downloads>

=back

Links and further instructions on installation can be found on
L<http://www.perl.org/get.html>.

Once perl is installed, the task of printing "Hello, World!" is quite simple.
From the command line, first check if your environment's C<PATH> variable
knows where to find perl. 
On most systems, this can be achieved by entering C<which perl>; 
if it spits out something like F</usr/bin/perl>, you're good to go! 
If it tells you

    which: no perl in (...)

it means you need to add perl to your environment's C<PATH> variable. 
This is done on most systems by entering

    export PATH=$PATH:[...]

where [...] is the full path to your perl installation (usually /usr/bin/perl).

If you do not have the C<which> command, you can probably just type C<perl>
to see if it fires up the perl interpreter. 
If it does, press Ctrl+D to exit it and proceed. 
Otherwise, perform the steps above to add perl to your PATH variable.

Once perl is installed, one-liners can be executed from the command line 
by invoking perl with the C<-e> switch.
    $ perl -e 'print "Hello, World!\n";'
To create a script file that's more permanent, it can be put in a text file.
The name can be anything, but F<.pl> is encouraged. 
The #!/usr/bin/perl at the beginning is called the shebang line; 
if the operating system supports it, it tells where to find the perl interpreter. 
If the script is run with C<perl>, this line will be ignored--
this is for invoking the file as an executable.

=cut

#!/usr/bin/perl
print "Hello, World!\n";

Phix

Library: Phix/basics

Installing and running Phix is as just about as straightforward as it could possibly be.
Download Phix from http://phix.x10.mx/download.php (~30MB) - the installation instructions there may be more up-to-date than here.
Full documentation is available at http://phix.x10.mx/docs/html/phix.htm as well as being included in the download as a chm file, along with all the files that was originally generated from.

Windows

The Windows installer targets C:\Program Files[ (x86)]\Phix by default, and runs ppw.bat, which first creates a console version of phix and then allows PATH and other registry settings to be made.
The documentation is best viewed by opening docs\phix\phix.chm.
The easiest way to get started is to open a console window in the installation directory.
An editor/ide is provided, simply run "pw edita". The F1 key provides context-sensitive help.
(A cross platform editor is currently in progress, try "pw edix" to run that.)
Enter the following:

puts(1,"Hello world!")

Save as test.exw in the installation directory and run "p test".
The output will appear in the command prompt/terminal.
Note: you can also save the file anywhere and press F5 in edita/edix to run it, however unless you add wait_key() or similar, the output (window) will immediately disappear.

Linux

Extract from the plain zip to $HOME\phix, and open a terminal there.
Install a suitable program to view docs/phix/phix.chm, or run "./phix docs/phix/makephix" to populate docs/phix/html with the plain html files.
An (in-progress) editor/ide is provided, simply run "./phix edix" from that directory, though further steps may be required to install IUP, see demo/pGUI/lnx/installation.txt, otherwise any editor will do.
Enter the following:

puts(1,"Hello world!")

Save as test.exw in the installation directory and run "./phix test".
You can also save the file anywhere and press F5 in edix to run it.
The output will appear in the command prompt/terminal.

Browser

Once you have either of the above up and running, run pwa/p2js.exw then select an existing file or paste in

puts(1,"Hello world!")

and press F5, which will create/overwrite pwa/test.htm and open it in your browser. Alternatively you can use Ctrl W to show/overwrite only, and then refresh an already open browser tab. One day I hope to have that runnable in a browser and online, and probably have some command line packaging options.

GUI

If showing a little bit of text is one thing, the next has to be running a proper GUI application. The distribution includes

--
-- pwa\phix\hello_world.exw
-- ========================
--
with javascript_semantics
include pGUI.e

IupOpen()
Ihandle lbl = IupFlatLabel("World!","EXPAND=YES, ALIGNMENT=ACENTER")
Ihandln dlg = IupDialog(lbl,"TITLE=Hello, RASTERSIZE=215x85")
IupShow(dlg)
if platform()!=JS then
    IupMainLoop()
    dlg = IupDestroy(dlg)
    IupClose()
end if

and you can run that without any further ado, at least on Windows, or online here. A few improvements are probably warranted, as in changes to pGUI.js and/or pGUI.css, but at least the language/transpiler side of things is pretty much complete. On Linux you would have to install IUP, following their standard instructions, which any proper Linux person should find easy-peasy, right, though I usually struggle a bit, and some quite a lot.

PHP

PHP can be run either from the command line or via a web server such as Apache. If you are running Mac or Linux, PHP is likely already installed. If you are on Windows, you can set up your own web server locally by using XAMPP (https://www.apachefriends.org/index.html).

Create the file, hello.php, in your htdocs or public_html directory.

<?php
echo 'Hello, world!';
?>

If Apache is running on your local computer and you saved the file in htdocs, open a web browser and go to http://localhost/hello.php. You should see the phrase in a basic font displayed in the window.

From the command line, simply type

php ./hello.php

PicoLisp

Debian-based systems

Install

$ apt-get install picolisp

then run it

$ pil +
: (prinl "Goodbye, World!")

Other POSIX systems

Fetch and unpack the tarball

$ wget software-lab.de/picoLisp.tgz && tar xfz picoLisp.tgz

then build the executable (see http://software-lab.de/INSTALL file for 64-bit systems)

$ cd picoLisp
$ (cd src; make)

and run it locally

$ ./pil +
: (prinl "Goodbye, World!")

Non-POSIX systems

On non-POSIX systems only limited implementations of PicoLisp are available.

If Java 1.6 is installed, get and unpack either the tarball given in "Other POSIX systems", or just "software-lab.de/ersatz.tgz", and run

$ ersatz/pil
: (prinl "Goodbye, World!")

(see also http://software-lab.de/ersatz/README).

If no Java is available, you can compile "software-lab.de/miniPicoLisp.tgz" and run it

$ ./pil +
: (prinl "Goodbye, World!")

Pixilang

This guide covers both Windows versions, the 32-bit and 64-bit versions. Instructions for other versions may come later.

Go to https://www.warmplace.ru/soft/pixilang/ and download the Windows version. Extract the contents of the .zip file anywhere on your system.

Open a new file in any text editor, then type or copy and paste the following, then save the file anywhere:

fputs("Hello world!\n")

Open the folder pixilang was extracted to, then pixilang (twice if need be), then windows_x86 (the 32-bit version) or windows_x86_64 (the 64-bit version) if on 64-bit Windows (the 64-bit version is recommended for faster performance), or windows_x86 if on 32-bit Windows. As the Hello world program you created earlier is a console application, open pixilang_console.exe.

In Pixilang, navigate to where you saved the file earlier, then open the file, either by pressing the space or enter key, double clicking the area with the file name or clicking the OK button. If the console displays Hello world! and all goes well, you have successfully ran a Hello world program correctly in Pixilang.

Plain English

Download

Before anything else, you need to be using Windows XP or above (32-bit or 64-bit).

First of all, download the complete IDE+Compiler ZIP file here: http://www.osmosian.com/cal-4700.zip. Then extract the ZIP file to wherever you want. The extracted folder will now be called "IDE folder" throughout this tutorial.

Coding Environment

Before running the IDE, it is recommended to create a new folder to store your Plain English codes. This will now be called "Working folder" throughout this tutorial.

Now go to the IDE folder, and run cal-4700.exe. The IDE is full-screen, with the alphabetical menus at the top and the tabs at the bottom. Initially, you should also see all your drive letters like C:\, D:\, etc. From that, you may navigate to the files/folders like you do in File Explorer: double-click to open, using UP and DOWN arrow keys, etc. However, there are some differences from the File Explorer:

  • The backspace key means deletion, instead of going back to parent directory. To go back to parent directory (and to close the opened file), click on the tab at the bottom.
  • There is no scroll bar. To effectively scroll through the files & folders, just long-press your right mouse button, and drag up or down.

(Plain) Console HelloWorld

Now go to your Working folder. Click the letter 'N' at the top menu, then click on 'New Directory...' and name a new directory (say, "HelloWorld1") inside the Working folder. Open the new folder and press Ctrl+V. Regardless of what's in your clipboard, the IDE will place "the noodle" file in the folder. The "the noodle" file is another source code that acts like a "header file" in C, but is required for the codes to run. Click the letter 'N' again, but this time, click on 'New Text File...' and name a new text file to whatever you want, but make sure it doesn't have any file extensions! Open the new text file and copy the following code:

To run:   \This is a comment 
Start up.
Write "Hello World!" to the console.
wAIt fOr tHe eScApE kEY.   \Plain English is case-insensitive
Shut down.

To run the code, just press Ctrl+R. As the code says in Plain English, "Hello World!" should now be written, and you have to press the Escape key to shut it down. Upon running the code, it will be compiled automatically to a standalone EXE file in the same directory as the text file. Take note that the name of the directory in which the text file is created will be used as the name of the EXE file (so, "HelloWorld1.exe"). Like most text editors, you may press Ctrl+S to save the file. To quit the IDE, you may press Ctrl+Q or click the letter 'Q', then click 'Quit.'

Plain Graphical HelloWorld

Make another directory inside your Working folder (say, "HelloWorld2"), and do the steps as above in the console version. This time, the code is as follows:

To run:
Start up. 
Clear the screen.
Write "Hello World!".
Refresh the screen.
Wait for the escape key.
Shut down.

This time, the background is black, and the "Hello World!" text is green.

Documentation

Inside the IDE folder, you can find the documentation instructions.pdf inside the "documentation" folder. Happy coding commanding!

PowerShell

Windows PowerShell should be already installed in Windows 7 and Windows 8.

Accessing PowerShell

There are 2 ways to access Windows Powershell:

  • Open Command Prompt, then type "PowerShell".
  • Click the Start Button, then All Programs, then Accessories, then Windows PowerShell. From there you will find the PowerShell Console (a big blue one), and the Windows PowerShell ISE (Integrated Scripting Environment).

Executing the "HelloWorld" Code in Console

Now, to execute your first code in PowerShell, choose from the two options above to access the PowerShell console. If the console is already open, type any of these codes:

"Hello, World!" #This is a comment.

or,

wRiTe-HOsT "Hello, World!" #PowerShell is case-insensitive.

or,

Write-Host Hello`, World! #The backtick escapes the next character.

Your output should be:

Hello, World!

Writing and Executing Your First PowerShell Script

These are the ways to write/edit a PowerShell script:

Using a Simple Text Editor:
To make the "HelloWorld" code in a script file, copypaste the code (select one) above, and then save it as "<filename>.ps1". To execute the script, open the PowerShell console, go to the directory of the script file, then type ./<filename>.

Using the Windows PowerShell ISE:
It is recommended to use the PowerShell ISE if you are new to PowerShell. Copypaste the code (select one) above, then run the code by clicking the play button or by pressing F5.

Exploring PowerShell

To learn the basic syntaxes and details of PowerShell, Open the PowerShell ISE, then press F1 to open the Windows PowerShell "Getting Started" Guide.

Processing

Installing Processing

Everything Processing related lives here! -> https://processing.org/

To install Processing on Windows visit this link -> https://processing.org/download/

Then choose your OS and processor architecture type (32 or 64 bit).

You can find out your processor's architecture type on windows by navigating to the file explorer, then right-click on 'This PC' and select 'Properties' from the menu. Under 'System type' you'll find your processor's architecture type.

Click download on the appropriate link. A zip file will begin downloading, once downloaded, open the file.

Drag and drop the folder labeled "Processing-(version number)" anywhere on your computer, the location is not important, but the folder must be removed from the .zip file.

Then open the "Processing-(version number)" folder and run 'Processing.exe', processing is now installed!

Writing your first program

To create a new file in processing, navigate to the toolbar at the top of the window, select file, and new.

A new window will pop out, note that when you start processing from the .exe file, not by opening a sketch, it presents you with a new file anyway.

To print 'Hello World' to the console, we type;

print("Hello World!");

We can also replace hello world, with any string, providing its between two quotation marks (").

A fun development of this would be to create a variable of type string, and pump that into the print command!

String x = "What up!";

print(x);

Enjoy!

Python

Pythons official home site is http://www.python.org/. It will point you to everything Python.

Python version 3

print is now a function.

>>> print('hello world')

Python on Windows

(Tested on Windows 7 but should be similar for XP & Vista ).

You need to download and install Python. Use the latest Windows installer for Windows (64bit if you have a 64bit Windows installation). It is a standard Windows click-through installer with an Open-source compatable license.

Once installed, use the new start-menu entry to open the "Idle (Python GUI)" application, which opens a GUI window with a command line and cursor at the bottom. This window displays program output and is a REPL for Python.

Use the File->New window item of the GUI to bring up new blank window and copy the text from Hello world/Text#Python into it,

i.e.
print "Goodbye, World!"

use the File menu to save the file with a name hello.py, (remember the .py extension). Use the "Run -> Run module" menu item from the hello.py Idle editor window to pop the Idle Python shell window to the front whilst executing the program. The output of the program appears in this shell window as the line:

Goodbye, World!

(Followed by a prompt that is part of the REPL of the IDE rather than programmed by the hello.py file).

Python on OS X

Assuming you didn't delete them by accident, Python 2.x and Python 3.x are already installed. To get started, open the Terminal in your applications folder, and type:

$ echo 'print "Goodbye, World!"' > hello.py

You now have a Python script in your home directory, which you can run with the following command:

$ python hello.py

Alternatively, you can work with Python's IDE, IDLE, the same way as described above for Windows, by typing:

$ idle

You can also execute scripts by including a shebang and using the chmod command as described below for GNU/Linux.

Python on GNU/Linux

On most Linux distribution, just install the package named python with the package manager.

If you are using a mainstream Linux distribution, installing Idle along with Python gives you a GUI and two ways of working with your code. The easiest is through Idle, see the Windows instructions above for details. The other is outlined below:

A script can be executed with the command:

python my_script.py

or adding a shebang at the first line of the script:

$ head -n 1 my_script.py
#!/usr/bin/env python
$ chmod a+x my_script.py
$ ./my_script.py

Library: VPython

  1. install Python, as above
  2. install VPython: at vpython.org, select the download for your system:
  3. To edit/run programs from the IDE, instead of IDLE use VIDLE (it loads the vpython-extensions, and helptexts)
    • Look at some example programs -- for example, bounce.py
    • (on Windows, they should be located at C:\Python27\Lib\site-packages\visual\examples)
    • Try some programs from RC -- for example, Draw a cuboid

QB64

Installation

QB64 is available for Linux, MacOS, and Windows (32 and 64-bit, versions from XP to 10). The project is available at QB64 Team and QB64 GitHub. Source code is available for all three OSs and compiled binaries are available for Windows. To install, you can use git or download a compressed file which will contain either the source or the binaries, as you selected.

Editor, Targets, and Output

QB64 targets the same OSs on which the editor/compiler runs. In a GUI environment (Windows, MacOS, X11), a window will appear with your program. In a CLI (Linux/MacOS), the resulting program will be displayed on the same screen on which the editor was visible, assuming the program does not explicitly direct output else where, such as to a printer. Without any additional software, QB64 targets CLI environments, so the windows that appear in a GUI environment will reflect that. GUI targets are possible, if the user in addition to using QB64 also uses the InForm add-on.

Alternatively, you could use any text editor in which to write your programs and compile them with QB64 from the CLI with various switches. More information on this aspect, as well as other topics, can be found at the project's wiki.

More Information

More information can be found in addition to the wiki at the project's forums. The project's compiler privacy statement is also available for review.

Quackery

Before installing Quackery you should know if it is a language for you. If you are looking for blazing speed of execution, then it is not. It is fair to say that Quackery does not so much run as waddle.

If, on the other hand, you are looking for the easiest possible introduction to the world of stack based/concatenative programming, and can set your expectations to those of the retro-computing enthusiast, you will find that on a modern platform it exceeds the expectations you might have had some three decades ago.

Be warned that not everyone can wrap their head around stack based programming languages, but if they do fit the way you think, you might just feel an urge to evangelise the paradigm. As far as I know there is no cure for that.

You will need to have either Python 3 or PyPy 3 installed (the latter will give it a worthwhile speed boost).

Download Quackery from https://github.com/GordonCharlton/Quackery by clicking on the green "Code" button and selecting "Download ZIP" from the dropdown menu. Once you have unzipped the quackery folder, navigate to it in your terminal emulator app and run the Quackery shell (REPL) by typing python3 quackery.py (or whatever incantation your OS requires to run a Python 3 program) to confirm that it works.

You will be presented with a "Welcome to Quackery" message, a reminder of how to leave the shell, and the duck's head prompt: /O> . Type say "Hello, world!" at the prompt and press the enter key twice. Quackery will respond with

Hello, world!
Stack empty.

/O>

Hurrah! It worked. Now you can leave the shell and start reading The Book of Quackery, your pdf introduction to Quackery and comprehensive Quackery manual, which is in the folder you downloaded, along with a few other things.

Ra

Requirements

  • Cobra
  • All Cobra requirements

Download

Download the latest version of Ra from GitHub

Installation for Windows

  • Unzip the download
  • Open a command prompt window as an administrator in the unzipped folder
  • Enter the following command: install.exe
  • You should see the word "Success"
  • Add "C:\Ra" to your PATH variable

Installation for Mac/Unix/Linux/Ubuntu

  • Unzip the download
  • Open a terminal in the unzipped folder
  • Enter the following command: sudo ./install
  • Enter your password if prompted to by the terminal
  • You should see the word "Success"

Writing Ra Code

Create a plain text file and enter the following text:

class HelloWorld
	**Prints "Goodbye, World!"**
	
	on start
		
		print "Goodbye, World!"

Save the plain text file as "HelloWorld.racode" (all Ra files must end with the .racode extension).

Running Ra Code

Open a terminal and navigate to the directory where "HelloWorld.racode" is saved. Enter the following command:

ra HelloWorld

You should see "Goodbye, World!" printed to the terminal.

You can optionally include the file extension when running Ra code:

ra HelloWorld.racode

Links

Installation instructions

Learn Ra

Racket

Installation

Install Racket from the Racket home page.

On Windows and OS X when you have a 64 bit platform, you can install either the 64 bit Racket or the 32 bit one, the installer page will not try to detect this, since both options can be used. The choice will usually not make much difference; a quick summary is that with the 64 bit version you can use much more space (in 32 bit mode there's a 4gb limit), but things are going to run a bit slower due to Racket shuffling more memory around. (This is not Racket-specific, of course.)

On Linux, you can often find a Racket package for your distribution flavor. From the Racket web page you can find a few installers built on different Linux distros, and one of them might fit you even if you're on a different one. The Racket installers come in shell-script form, which you can just run in a terminal (sh installer.sh would do it). The first question that the installer will ask you is whether you want a unix-style distribution, with files spread across standard directories -- the recommendation is to not do this, and instead install Racket in a single directory. This choice makes it much easier to try Racket quickly -- you can just remove the directory when you're done, you can easily have multiple versions installed, and you don't need write permission to system directories.

Developing Racket Code

Racket comes with DrRacket, an IDE that is specifically designed to make Racket work easy (and implemented in Racket). However, you can use your own text editor if you're used to one. See the Racket Guide section on working with different editors, and running Racket from the command line.

As with Common Lisp, EMACS is a good editor to use for Racket code. Its inferior-lisp mode allows you to evaluate Racket expressions from within EMACS, however it doesn't provide debugging, symbol lookup, or other features that are available when editing Common Lisp code with EMACS.

Learning Racket

One of Racket's main points is coming with thorough documentation, which you get with the installation and but you can also view it on-line. Specifically, pay attention to the Getting Started page that will help with a few convenient entry points.

Hello World

Save it as "hello.rkt":

#lang racket
(displayln "Hello world!")

Running it

From BASH

$ racket hello.rkt

On Windows

Click the icon for hello.rkt in Explorer, or click the Run button within DrRacket.

Raku

(formerly Perl 6)

Raku is a language spec and test suite, not an implementation. Any implementation which implements the spec and passes the test suite can call itself Raku. Philosophically, there is no official "Raku distribution". Practically, at this point (early 2020), Rakudo Raku is the only realistic option. There are others, but they are either not currently being developed or far behind Rakudo in functionality.

There are several ways to get and install Rakudo Raku depending on your operating system and the balance between your technical familiarity and tolerance of outdated code. Rakudo Raku is still in heavy development and the code base still has features being added, refined and optimized on a daily basis; a few weeks can make a big difference.

For ease of installation, there are MSI files for Windows, Homebrew packages for OSX and pre-built Linux packages for apt and yum based packaging systems. They will get you a working compiler most easily, but may be weeks or months behind a blead source build.

All of these options are detailed in the Downloads section of the Rakuko.org website.

If you do run into problems installing Rakudo, (or any Raku compiler, or have any Raku questions,) the #raku IRC channel on freenode.net nearly always has people willing to help out.

Once you have your compiler installed, open a terminal window and type:

 raku -e'say "Hello World!"'
 

or, under Windows cmd.exe,

 raku -e"say 'Hello World!'"

and press enter.

Alternately, type

 echo say 'Hello World!' > hw.raku

then type

 raku hw.raku

to execute it.

Note that the file name may have any extension or none at all.

REXX

installation

Each REXX interpreter for a particular operating system has their own requirements, but most involve just copying (usually) two files:

  • the REXX interpreter,
  • the REXX run-time library (the built-in functions and REXX statement executors).


Note that some operating systems have REXX "built-in", so there isn't any installation necessary.
The "MVS" and "VM/CMS" IBM mainframe operating systems have REXX installed (indeed, built-into the operating system) as well does OS/2 and AS/400.
Note that MVS and VM/CMS are more-or-less generic terms in the IBM world.

program creation

<><>Next, create a REXX program. Most users use their favorite texteditor (for "plain text").
Note that some operating systems require the first statement to be a REXX-type comment,
another requires the first word in the comment to be the word REXX (in any case, upper/lower/mixed).
Most REXX interpreters enforce the first of these two rules.
The reason for this is that some operating systems have more than one scripting language,
and this first record is used to invoke the appropriate interpreter.
So, a Hello world! REXX program (two lines) could look like:

/*REXX program to greet the world enthusiastically. */
say "Hello world!"

The above program could be made into one statement (since REXX comments are treated like whitespace).

output

The output (for the SAY instruction) will be shown on the terminal screen (or window).

Hello world!

execution


To execute the program depends on the operating system. Just placing the program in a special library (or folder) and invoking the name of the REXX program will execute it.
You could also invoke the name of the REXX interpreter followed by the name of the REXX program.

For any CMS system, just place the "HELLO EXEC" file on any disk that is accessed (normally the 'A' minidisk is used).
For Windows (in a DOS window), place the file "HELLO.REX" in the current directory (folder) or place the file in the folder that is specified for the REXX interpreter to use when the program can't be found in the current directory (CD). Windows class of NT operating systems (NT, XP, and later) can be set up so that whenever a program (file) that has an extension of (say) REX, it will be executed (interpreted) by the REXX interpreter (EXE program). It's possible to have a REXX program without a file extension (filetype), but that would make it not obvious to what the file's purpose is and also it'll make it harder to invoke easily.

Ring

This example is incomplete. No installation instructions Please ensure that it meets all task requirements and remove this message.
sayHello()

func sayHello
     see "Hello World" + nl

Robotic

Note

This language runs exclusively on MegaZeux. If you are unfamilar with how to use MegaZeux, I would suggest reading into the online manual provided on their website. Alternatively, MegaZeux has the same manual built in to the program itself and can be accessed any time by pressing F1.

This "Hello World" tutorial will only cover the very basics of the user interface and Robotic coding.

Short Summary

Robotic is a programming language used in the game creation system titled MegaZeux. It provides simple things like counters and arithmetic expressions, as well as more complex functions like file reading/writing. A short summary of this language can be found here.

Download

To get started in programming with Robotic, you must download MegaZeux first. The top of the page will show symbols corresponding to the OS you want to download it on (currently supports Windows, Ubuntu, Mac OS X, and MS-DOS).

After downloading the program, make sure to extract the contents of the .zip in a directory of your choosing.

Running Megazeux

When running MegaZeux, it will always request to load a world file (represented as .mzx). For the purpose of this tutorial, we want to get past that screen. Simply hit ESC and then press E. This will bring you to the World Editor.

Take your time to explore the editor. You are able to click on the tabs below to show the controls that are available to you.

When you are ready, move the cursor to an empty spot (using the arrow keys), then press F10 and select "Robot" (name and character is optional).

The Code

The code is as simple as it looks:

* "Hello world!"
end

After typing the code down, hit ESC and press Alt+T to test it out. If done properly, you will see "Hello World" flashing at the bottom of the screen.

Breakdown

  • The asterisk is the symbol that tells it to display the given string on the bottom of the screen (positions of the text can be changed, but this is the default).
  • The keyword 'end' stops the code from executing any further. It is not needed for this simple program, but it is recommended that you end your code so that it will not continue to reach other parts of code you may end up writing below.

Final note

Remember: This is just a bare-bones tutorial on how to program Robotic. Please refer to the manual (stated above) if you want to learn more about Robotic and MegaZeux itself.

RPL

1. Switch your RPL calculator on. You shall see an empty stack. The number appearing at the left of the line is the stack level.

1:

2. Push the string you want to display in the data stack.

1: "Hello world"

3. Push the line number where you wish to display the text, 1 being at the top of the screen

2: "Hello world"
1: 1

4. Hit the Catalog key to see all the available instructions documented and select the DISP function - or type it directly - and hit Enter. Et voilà !

Ruby

1. Install Ruby For windows you can download Ruby from [10] for Linux try [11]

2. Use your favorite text editor.

3. Open the text editor and type the following:
  puts "Hello World!!"

4. Save the file with the extension .rb

5. Open a command prompt/terminal. Execute "ruby filename.rb" on Windows. Output

Hello World!!

Rust

A complete description of how to install the language can be found on the Install page of the Rust web site. However, for the purposes of trying out code examples, use the online REPL which allows you to enter code, compile it and run it within a single browser window.

fn main() {
    println!("Hello world!");
}

Scala

Library: Scala

A complete and actual description can be found on the Getting started guide on the Scala site.

Run a program using Windows PowerShell:

scala -e 'println(\"Hello_world\")'

The double quotes have to be escaped.

ScratchScript

1. Go to https://scratch.mit.edu/projects/325836628/.

2. Click on the green flag, either above the thumbnail or on the thumbnail.

3. Press the space bar. This will bring up a text box that will allow you to type whatever you choose, except for a blank line (if nothing is entered in, the code entry will be cancelled). However, for the purposes of this tutorial, type in the following, then press the Enter key or click on the blue button with a white tick symbol on it:

print "Hello world!"

4. Now a text box that will allow you to choose which line to insert the line of code in will appear. This time, however, you can enter a blank line, as it would add the code to the last line, and there are no other lines in the program. However, entering in 1 also works. Once either choice has been entered into the text box, press the Enter key or click on the blue button with a white tick symbol on it to type in the code.

5. Press the down arrow key. This will run the code, and it should display the following:

Hello world!

However, as soon as the text has finished rendering, the program's execution ends. As such, the text may finish rendering too fast for you to see it long enough, or at all. If you consider this to be a problem for yourself, there's a solution to this you can use: repeat steps 3 to 5, except type in delayOnClick (this stops the program from ending until it's clicked) instead of print "Hello world!", and you can enter in 2 as the line number, but not 1.

You've just created and run a hello world program in ScratchScript.

SETL

Get the suitable precompiled executable for your platform from the SETL Website. The 'setl' command works in conjunction with 'setlcpp' and 'setltran' so you may want to copy them all over to /usr/bin/ (or equivalent).

Run in-line commands

setl 'print("Hello, world!");'

or create a file 'myscript.setl'

print("Hello, world!");

and run it

setl myscript.setl

Documentation on the setl command can be found here and a paper on the SETL language can be found here.

SimpleCode

Note: The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.

1. Go to https://scratch.mit.edu/projects/16815343/.

2. Click on the green flag, either above the thumbnail or on the thumbnail.

3. Type the following line, then press the Enter key or click on the blue button with a white tick symbol on it: dtxt

4. Type the following text, then press the Enter key or click on the blue button with a white tick symbol on it: Hello world!

4. Click on the icon that says "RUN" on it. The program will run and you should see the following: HELLO WORLD!

You've just created and run a hello world program in SimpleCode.

Smalltalk

Pharo Smalltalk

Installation

Currently supported platforms are Linux, Mac OS X, and Windows. From the landing page http://pharo.org click the "Download" button. You should see a new page with options for downloading a ZIP file for your operating system. Unzip the downloaded file and open Pharo. You may see some windows open. You can read through them and then close them.

Coding Environment

Pharo is a live coding environment. You can inspect the entire system at any time using the tools provided. One such tool is called a Playground. To open a Playground, click anywhere in the background of Pharo and select Tools > Playground from the pop-up menu. A window titled "Playground" will appear and that window should be empty. To log output, you use the Transcript (console). You can open the Transcript by executing click, then selecting Tools > Transcript from the pop-up menu. Because Pharo is a live programming environment, you can also open the Transcript programmatically, which we will do in the next section.

Code

Copy the following text into the "Playground" window:

Transcript open.
Transcript show: 'Hello world'.

This code will, when executed, open a new Transcript window and then output "Hello world" to the Transcript.

Execution

To execute the code in the Playground, select both lines, then right-click in the Playground and select "Do it" from the pop-up menu. A new Transcript window should open and you should see "Hello world" in the Transcript.

smart BASIC

Installation

smart BASIC is an Apple iOS application for iPhones and iPads. It must be installed from the Apple App Store.

Programming

Code Editor

The textual code editor is built into the application. To write your own program, do the following:

  1. Press the smart BASIC icon to run the program. A file list will be displayed.
  2. In the upper left corner, press the "+" symbol to create a new file. A New File name dialog box will appear.
  3. Enter a filename and press 'OK'. Filenames are automatically saved with the extension ".txt" The editor will then display a blank page for code entry.
  4. Your code is automatically saved when you run or exit the editor.

Output

Standard output is displayed upon running the application. To run your code, press the triangle icon in the upper right corner.

Xcode (Optional, but so cool)

Optionally, an amazing feature of Smart BASIC is the ability to write your code in Apple's free Xcode IDE and compile the code to run in a simulator on your Mac computer or on your own iOS devices. The procedure for this is beyond the scope of this entry but details and code can be found in the Forum section titled "BASIC SDK for Xcode". It might sound complicated, but it's actually very easy and only takes a few simple steps to setup. You can download detailed, step-by-step instructions here.

Documentation

smart BASIC has very detailed documentation installed within the application. There is also an excellent (free) PDF manual that may be downloaded directly from here that includes current information from the smart BASIC Forum (When registering at the Support Forum, the anti-spambot password is: "iOS").

SQL PL

Works with: Db2 LUW

In order to make a Hello World! example run in Db2, you need:

  • Get a binaries.
  • Extract the binaries.
  • Install the binaries.
  • Create an instance.
  • Create a database.
  • Connect to a database.
  • Execute Hello World! example.

The easies way is to install all of this in a Linux environment (Red Hat, Suse, Ubuntu).

You can download the Express-c edition of the most recent Db2 version at: https://www.ibm.com/developerworks/downloads/im/db2express/.

Once you get the binaries in the server, you can extract them by issuing

tar -xvf v11.1_linuxx64_expc.tar.gz

You go to the directory where the installer is

cd expc

and then execute the installer

./db2_install

It is highly probable that you need to install extra libraries in your OS in order to install Db2. Once you have installed Db2, you go to the instance directory

cd /opt/ibm/db2/V11.1/instance

And you create the instance associated with an existant user

./db2icrt -u db2inst1 db2inst

Now, you have an instance, you change to that user

su - db2inst1

And create a database

db2 create database test

When the process has finished, you can connect to it

db2 connect to test

And finally, you can execute the Hello World! example

db2 "select 'Hello World!' from sysibm.sysdummy1"

Swift

Installation

If you haven't installed Xcode already, then please go to the App Store for Mac and install the Xcode program. This will allow for Swift development on both OSX and IOS.

Use the playground

For most code examples, as from this site, you are able to enter them directly in a playground. That is start up Xcode, and either choose the playground from the default startup menu, or select File > New > Playground.

Within this window you are able to write code on the left hand side of the window, and the output is shown on the right hand side. If you have errors in your code, this might prevent the output, but in this case the window displays error icons and some explanations.

Swift Tutorial and Example Playground

Downloading GuidedTour.playground from the book "The Swift Programming Language" available for free from Apple book store, can be opened and this has a lot of examples of the basic structures and how to do different stuff in Swift.

Tcl

Installation

Many operating systems come with a distribution of Tcl, though it is often of an old version (Tcl 8.4 or occasionally before). Some also provide Tcl 8.5; it is not normally a problem to have both on your system at once, provided software is not coded to use a version-less executable name. As of the time of writing, nothing comes with Tcl 8.6.

Installing Tcl 8.5 on Linux

Your distribution will probably include a package for 8.5 in its distribution, often named something like “tcl8.5”. Many of the tasks here on Rosetta Code also require Tcllib, a collection of scripted Tcl packages; some distributions provide this as well.

Installing Tcl 8.5 on Windows and OSX

You are recommended to use ActiveState's Tcl distribution, which is of very high quality.

Installing Tcl 8.6

As of the time of writing, ActiveTcl is the only “full service” distribution of Tcl 8.6.

Running your first Tcl code

Going to a command prompt and typing:

tclsh8.5

(or tclsh85 on Windows) will start an interactive Tcl shell. At the prompt, you can just type in Tcl commands and have them executed immediately. For example, if you type in this little program:

puts "Hello World"

You will get this message printed out:

Hello World

before another prompt symbol. Congratulations! You've just run your first Tcl code.

If you're using ActiveTcl, you can also try typing these examples into the Tkcon prompt. Tkcon's very slightly different, but for most Tcl programs it works just the same.

When running Tcl 8.6, change the tclsh8.5/tclsh85 to be tclsh8.6/tclsh86. If you want the Tk package as well because you're working on writing a GUI, it is often easier to use wish instead of tclsh (with appropriate version number suffix), though it's still the same language. It just has some extra commands.

Running your first Tcl program

Now save that same command in a text file called hello.tcl. Any simple texteditor will do (but not a word processor!); your author often uses Emacs for this, and it comes with automatic syntax highlighting for Tcl code.

To run that saved code, type one of these:

tclsh8.5 hello.tcl                On Linux/OSX
tclsh85 hello.tcl                 On Windows

The code in the file will be executed (printing the message to the screen) and then it the Tcl interpreter will exit. There you go, your first full Tcl program.

Going Further

If you're writing a larger program, you might want to use an IDE. The main two IDEs for Tcl are ActiveState's Komodo (commercial) and Eclipse with the appropriate DLTK module (free to use).

For a range of interesting Tcl programs and techniques beyond what is here on Rosetta Code, check out The Tcler's Wiki.

Documentation for many versions of Tcl is also online, which can be a handy supplement to your system docs.

TI-83 BASIC

The TI-8x series calculators have a built-in BASIC scripter. To access this, press the "PRGM" key. You can create a new program by selecting the "NEW" tab and pressing "ENTER". You will be prompted to enter 8 alphanumeric characters for the name, but it must start with a letter. Most programming functions can be accessed by pressing the "PRGM" key, and all functions can be viewed in alphabetical order by pressing "2nd" then "0".

Type in code so your screen looks like this (where MYPROGRM is the name of your program):

PROGRAM:MYPROGRM
:Disp "HELLO, WORLD!"

Disp is found under the "I/O" tab of the menu from the "PRGM" key, the "!" symbol can be found under the "PRB" tab of the menu from the "MATH" button, and quotations are "ALPHA" then "+".

When writing programs, it is much faster to know the shortcuts for certain common functions. Any list in the TI OS can be selected from using the number keys, so "Disp" for instance is "PRGM" then "3".

to exit the editor, press "2nd" then "MODE", and to run the program press "PRGM" and select your program from under the "RUN" tab.

TI-83 Hex Assembly

  • You must have a TI-8x series calculator (or an emulator) to program in TI-83 Hex Assembly.
  • On the calculator, press the "PRGM" key, then select the "NEW" tab and press the "ENTER" key.
  • Choose a program name, like "HELLO".
  • Start your program with the "AsmPrgm" (0x6dbb) token, which can be found in the Catalog (press the "2nd" key then the "0" key) going down to the 9th entry and pressing "ENTER".
  • Now you need to enter the actual program code: We want to call the PutS system call (also known as B_CALL) with its argument "HL" being a pointer to the string "Hello, World!", then we want to exit. Note that there should be no spaces in the program at all. Newlines are allowed, but only after an even number of hex digits per line (0, 2, 4, ... are OK, but not 1, 3, 5, ...). There is no way to write comments in the program.
  • First, we'll load the memory location of our string to HL, so write "21XXXX". We'll replace "XXXX" with the actual memory location later because we haven't added the data section yet.
  • Next, make the PutS system call by typing "EF0A45". Here "EF" denotes a syscall and "0A45" represents the system call with address 0x450a, or _PUTS. The bytes are reversed because the TI-83 uses a Z80 processor which is little-endian. (You can find all known syscalls here: [12])
  • Next, make the NewLine (0x452e) system call by typing "EF2E45".
  • Next, write an exit instruction in the program by typing "C9".
  • Now, after the "C9", we'll start our data section. Now that we know where we're starting the data we should update our "21XXXX" line above. To get the "XXXX" number, simply count forward in hexadecimal from the beginning starting at 0x9d93, where the "AsmPrgm" token counts as two bytes and every other string of two consecutive hex characters/digits counts as one byte (there should always be an even number of hex characters/digits in the program). If you counted correctly, you should have gotten 0x9d9f, which after reversing the bytes for little-endian representation becomes 9F9D. So replace "XXXX" with "9F9D".
  • Finally, write the ASCII representation of the string "Hello, World!" at the very end of your program with a "00" at the end to terminate the string. This is "48656C6C6F2C20576F726C642100".
  • Exit the editor by pressing "QUIT" ("2nd" then "MODE").
  • Execute the program by going back to the catalog ("2nd" "0") and selecting the 7th entry, "Asm(", then pressing "PRGM" and selecting your program name, then closing the parens, so you should get (for example) "Asm(prgmHELLO)".

The program should look like this when it's done:

PROGRAM:HELLO
:AsmPrgm
:219F9D
:EF0A45
:EF2E45
:C9
:48656C6C6F2C20576F726C642100

Transd

For Windows

  • Download the Transd shell called FREND here: Transd site.
  • Create a file named "hello.td" with the following content:
#lang transd

mainModule: {
  _start: (lambda (textout "Hello, World!"))
}
  • Start FREND shell and type at the command prompt the following:


run <the_full_pathname_of_hello.td>


and press <Return>.


Ultimate++

Visit https://www.ultimatepp.org/www$uppweb$download$en-us.html. From the website choose download that represents your operating system. The website has detailed instructions for installations. The graphical Hello World is in the examples section of the GUI package manager. It is as simple as double-clicking the HelloWorld module or selecting it and clicking the OK button.

#include <CtrlLib/CtrlLib.h>
// submitted by Aykayayciti (Earl Lamont Montgomery)

using namespace Upp;

class GoodbyeWorld : public TopWindow {
	MenuBar menu;
	StatusBar status;

	void FileMenu(Bar& bar);
	void MainMenu(Bar& bar);
	void About();	

public:
	typedef GoodbyeWorld CLASSNAME;

	GoodbyeWorld();
};

void GoodbyeWorld::About()
{
	PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Goodbye World sample}}");
}

void GoodbyeWorld::FileMenu(Bar& bar)
{
	bar.Add("About..", THISBACK(About));
	bar.Separator();
	bar.Add("Exit", THISBACK(Close));
}

void GoodbyeWorld::MainMenu(Bar& bar)
{
	menu.Add("File", THISBACK(FileMenu));
}

GoodbyeWorld::GoodbyeWorld()
{
	AddFrame(menu);
	AddFrame(status);
	menu.Set(THISBACK(MainMenu));
	status = "So long from the Ultimate++ !";
}

GUI_APP_MAIN
{
	SetLanguage(LNG_ENGLISH);
	GoodbyeWorld().Run();
}

Wren

Although Wren is primarily used as an embedded scripting language, there is a standalone version called Wren-CLI which can be run directly from the command line. This is available as a pre-built 64 bit executable for Linux, MacOS and Windows and can be downloaded from here.

Having downloaded and unzipped Wren-CLI, the next job is to create a script. Any text editor can be used for this including simple general purpose ones such as gedit, TextEdit and notepad for the operating systems referred to above.

So open the text editor, paste in the following script (yes, it's only one line), and save it to a file called Hello_world.wren in the same directory as wren-cli itself:

System.print("Hello world!")

Now type at the command line (omit ./ if using Windows):

./wren-cli Hello_world.wren

to compile and run the script and you should see the archetypal greeting :)

TIP: On Windows you may have more luck with cd path then wren-cli as opposed to running path\wren-cli.

X86-64 Assembly

UASM

UASM is a MASM-compatible assembler based on JWASM. More info can be found here or at github.

Install

Arch Linux : $ yay -S uasm 
   or        $ sudo pamac install uasm
Other Distros: Use your package manager
Windows: [http://www.terraspace.co.uk/uasm.html]

Example

option casemap:none
option literals:on

;; OS related crap
WIN64   equ 1
LIN64   equ 3

if @Platform eq WIN64
    option dllimport:<kernel32>
        ExitProcess proto uexit:dword 
    option dllimport:<msvcrt>
        printf      proto fmt:qword, args:VARARG
    option dllimport:none
        exit        equ ExitProcess
    option dllimport:none 
        exit equ ExitProcess
elseif @Platform eq LIN64
    printf      proto SYSTEMV fmt:qword, args:VARARG
    exit        proto SYSTEMV ucode:dword
endif

.code
main proc
    invoke printf, CSTR("Hello, World!",13,10)
    invoke exit, 0
    ret
main endp
end

Assemble & Link

Linux:
$ uasm -elf64 hello.asm
$ gcc -o hello hello.o -no-pie
With MUSL libc
$ musl-gcc -o hello hello.o -e main -nostartfiles -no-pie
Windows:
$ uasm64 -win64 hello.asm
$ link /machine:x64 /subsystem:console /release hello.obj kernel32.lib msvcrt.lib

The choice of linker is really upto you.

NASM

The netwide assembler, Need I say more?

Install

Arch Linux: $ sudo pacman -S nasm
   or     : $ sudo pamac install nasm
Void Linux: xbps-install -Rs nasm
Other Distros: Same deal, use your Distros package manager.
Windows: [https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/]

Example

Using stdc, and the windows ABI

global main

extern printf
extern ExitProcess

section .data
msg     db "Hello, World!",0xa 

section .text
    main: 
        mov rcx, msg
        call printf
        mov rcx, 0
        call ExitProcess
        ret

Assemble & Link

$ nasm -f win64 -o hello.obj hello.asm
$ link /machine:x64 /subsystem:console /release hello.obj kernel32.lib msvcrt.lib

Again, Choice of linker is entirely upto you.
Using NASM on Linux. libc PIE example..

extern printf
extern exit

section .rodata
msg   db "Goodbye, World!",10,0
section .text
   global main

   main:
      lea rdi, [rel msg]
      call [rel printf wrt ..got]
      pop rbp
      call [rel exit wrt ..got]
      ret

Using Linux syscalls..

; ------------------------------------------------------------------------------
; To assemble:
;     nasm -Wall -f elf64 -o hello.o hello.asm
;     ld -o hello hello.o
; ------------------------------------------------------------------------------

        global  _start

	section .data
message db      "Hello, World!", 10     ; newline at the end
length  equ     $ - message		; length of message

        section .text
_start:
        mov     rsi, message    ; address of string to output
        mov     rdx, length     ; number of bytes
	mov	rax, 1		; system call 1 = write
	mov	rdi, 1		; stdout
	syscall

	;; exit program
        mov     rax, 60         ; system call 60 = exit
        xor     rdi, rdi        ; exit code 0
        syscall

Editors and IDEs

Linux

Linux doesn't have much in the way of IDE's designed for assembler. But any old programmers notepad will do. Nano, Neovim, vim, emacs, Atom, Geanie are all good choices, It's really about personal preference. Be aware that some may not have syntax highlighting built in by default.

Windows

The same thing applies to Windows. However, we have a few other choices other than the usual suspects in the form of EasyCode and RADasm.
links:
RADasm @ masm32.com
RADasm github
EasyCode homepage

Zig

Debug output to stderr

// - Install zig from https://ziglang.org/download/.
// - Extract into your path
// - `zig run newbie.zig`
const std = @import("std");

pub fn main() void {
    // If you only want to quickly debug things and panic on failure,
    // you can use `debug.print` to print to standard error
    // Do not use debug code in production.
    std.debug.print("Hello, World!\n");
}

Using standard streams

const std = @import("std");

pub fn main() !void {
    const stdout = std.io.getStdOut();
    // `try` is a shorthand for `fn_call() catch |err| return err;`.
    // See also documentation for `catch`, `defer` and `errdefer`
    // for code flow adjustments
    try stdout.writer().writeAll("Hello world!\n");
}

zkl

Download/install Ubuntu (or other Ubuntu flavor, Windows 10, PC-BSD, FreeBSD) on a Intel/AMD box (other CPUs have not been tested). You want cores and memory.

I'll use Ubuntu/64 as my example.

Visit http://www.zenkinetic.com/zklDownloads.html and download zkl_vm_src.zip: http://www.zenkinetic.com/Documents/zkl_vm_src.zip. Other links of interest are zkl_tests.zip and the manual (zklManual.pdf).

Extract to ~ 
Open a termninal
Install clang (I do not like GCC) and ncurses (native on PC-BSD).
(See the Makefile if you insist on GCC).
sudo apt-get install clang
sudo apt-get install libncurses5-dev
$ cd ZKL/VM
$ make zkl
  ...
  mv zkl ../Bin
  Stand alone executable built
$ cd ..
$ Bin/zkl
# and you are off and running:
zkl 1.12.34, released 2016-11-01
zkl: "Hello World!" 
Hello World!
zkl: <control D>
$
$ echo 'println("Hello World!")' > foo.zkl
  Or edit foo.zkl with a text editor (emacs, vi, gedit, notepad, whatever)
$ zkl foo.zkl
Hello World!
$

Zoomscript

1. Go to https://scratch.mit.edu/projects/349785253/.

2. Click on the green flag, either above the thumbnail or on the thumbnail.

3. Type the following line:

print "Hello world!"

4. Click on the icon that says "Compiler" on it.

5. Click on the icon that says "Recompile" on it.

6. Click on the icon that has a green triangle facing to the right on it. The program will run and you should see the following: Hello world!

You've just created and run a hello world program in Zoomscript.

ZX Spectrum Basic

The computer has a basic interpreter build into rom, so there is no need to install an software before entering a program. Switch on the computer. You should see a message as follows:

(C) 1982 Sinclair Research Limited.

Press the number 1 key followed by the number 0 key. (Note this is not the same as the letter O). Now press the P key. This should cause the keyword PRINT will appear in full. The computer knows that a keyword is required, and behaves accordingly. The flashing K cursor indicates that a keyword is expected. You should now see:

10 PRINT

followed by a flashing L cursor. The computer is now in letter entry mode, and is no longer expecting a keyword. Hold down the symbol shift key, and press the P key again. This time you should get a doublequote symbol. Let go of the symbol shift key.The screen should look as follows:

10 PRINT "

Now let go of the symbol shift key, and hold down the Caps Shift key. Press the letter H key. You should now get a capital H. Let go of the Caps Shift key and type the letters ELLO. Now press symbol shift again and press the P key, to produce another doublequote symbol.

You have now typed the first line of the program. Press the ENTER key. The program line will now appear at the top of the screen as follows:

10 PRINT "Hello"

The cursor returns to a flashing K indicating that a keyword is expected again. Press the letter R. We now get the keyword RUN followed by a flashing L cursor. This time we have not entered a line number, because we want the command to be executed immediately. Press ENTER. The program will run and you should see the following:

Hello

0 OK 10:1

You have just created and run your first program.