Hello world/Newbie: Difference between revisions

m
(Java: add installation instructions, explanation of how to get started and what the keywords in the example mean and where to go for further reading.)
 
(45 intermediate revisions by 23 users not shown)
Line 47:
 
<code>./hello_world</code> on Linux.
 
 
=={{header|8080 Assembly}}==
{{Works with CPM-80}}
<pre>
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'
</pre>
<syntaxhighlight lang="8080 assembly">
; 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 '$'
 
 
</syntaxhighlight>
 
 
=={{header|AArch64 Assembly}}==
Line 56 ⟶ 87:
execute it : helloword64
</pre>
<syntaxhighlight lang="aarch64 assembly">
<lang AArch64 Assembly>
/* ARM assembly Raspberry PI */
/* program helloword64.s */
Line 76 ⟶ 107:
qAdrMessage: .quad szMessage
 
</syntaxhighlight>
</lang>
 
=={{header|Ada}}==
A set of tutorials to learn the Ada programming language are found at [https://learn.adacore.com/]. 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 [https://www.adacore.com/download].
The README.txt file contains the following information concerning installation of the GNAT tools:
<pre>
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
</pre>
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:
 
<syntaxhighlight lang="ada">procedure Main is
 
begin
-- Insert code here.
null;
end Main;</syntaxhighlight>
 
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:
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
Put_Line("Hello World!");
end Main;</syntaxhighlight>
 
=={{header|ALGOL 68}}==
Line 89 ⟶ 242:
3. Use your favorite [[Editor|text editor]].
 
3. Open the text editor and type the following: <langsyntaxhighlight lang="algol68">main: (
printf($"Goodbye, World!"l$)
)</langsyntaxhighlight>
 
4. Save the file with the extension .a68.
Line 100 ⟶ 253:
 
The output will appear in the command prompt/terminal.
 
 
=={{header|Agda}}==
This tutorial is to install Agda-2.6.23, the most recent version as of OctoberMay 20212023, and run the "Hello world" program. The snippet is based on the [https://agda.readthedocs.io/en/v2.6.23/getting-started/hello-world.html Hello world example] given in the Agda documentation, although using less Unicode symbols. More detailed explanations can be found in the [https://agda.readthedocs.io/en/v2.6.23/getting-started/installation.html installation instructions].
 
Although Agda developers suggest using [https://en.wikipedia.org/wiki/Emacs Emacs], this tutorial does not assume having Emacs installed.
 
# Install [https://en.wikipedia.org/wiki/Cabal_(software) Cabal]. On Linux run: <syntaxhighlight lang ="bash">sudo apt install cabal-install</langsyntaxhighlight>
# From the command line, execute: <syntaxhighlight lang ="bash">cabal update</langsyntaxhighlight> which outputs ''Downloading the latest package list from hackage.haskell.org''
# Install Agda with: <langsyntaxhighlight lang="bash">cabal install Agda</langsyntaxhighlight> This downloads the packages and then outputs ''Building Agda-2.6.23''. The building process can take several minutes.
# After that, Cabal creates two binaries. On Linux these are <pre>~/.cabal/bin/agda</pre> and <pre>~/.cabal/bin/agda-mode</pre> Make those binaries reachable by the ''PATH'' variable.
# Create the file ''helloworldHelloWorld.agda'' with any editor and paste this snippet: <langsyntaxhighlight lang="agda">module helloworldHelloWorld where
 
open import Agda.Builtin.IO using (IO)
Line 123 ⟶ 273:
main : IO Unit
main = putStrLn "Hello world!"
</langsyntaxhighlight> (Note that "⊤" is not a capital T, but the [https://en.wikipedia.org/wiki/Tee_(symbol) top symbol]).
# Run <syntaxhighlight lang ="bash">agda --compile helloworldHelloWorld.agda</langsyntaxhighlight> This creates the binary ''helloworldHelloWorld''
# Execute the binary. For example, on Linux run <syntaxhighlight lang ="bash">./helloworldHelloWorld</langsyntaxhighlight> The execution outputs ''Hello world!''
 
Agda requires an editor that allows entering Unicode characters, like the online editor [https://agdapad.quasicoherent.io Agdapad].
It is possible to have [https://en.wikipedia.org/wiki/Emacs Emacs] configured for Agda. Its use is explained in the [https://agda.readthedocs.io/en/v2.6.3/tools/emacs-mode.html documentation of Emacs mode]. To configure Emacs, the steps are the following:
# Install Emacs. On Linux run: <syntaxhighlight lang="bash">sudo apt install emacs</syntaxhighlight>
# Run: <syntaxhighlight lang="bash">agda-mode setup</syntaxhighlight>
# Run: <syntaxhighlight lang="bash">agda-mode compile</syntaxhighlight>
 
=={{header|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:
<pre>
]
</pre>
Start coding ...
<syntaxhighlight lang="gwbasic">? "HELLO, WORLD!"</syntaxhighlight>
https://archive.org/details/The_Applesoft_Tutorial_HQ_color/
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi}}
{{works with|qemu|Emulating a Raspberry Pi on Windows/x86}}
<pre>
create file helloword.s
Line 136 ⟶ 303:
</pre>
 
<syntaxhighlight lang="arm assembly">
<lang ARM Assembly>
/* ARM assembly Raspberry PI */
/* program helloword.s */
Line 155 ⟶ 322:
swi 0
iAdrMessage: .int szMessage
</syntaxhighlight>
</lang>
 
=={{header|Arturo}}==
Line 163 ⟶ 330:
2. Use your favorite [[Editor|text editor]]. Arturo comes with [https://github.com/arturo-lang/arturo#editors--ides support for many popular ones].
 
3. Open the text editor and type the following: <langsyntaxhighlight lang="rebol">
print "Hello World!!"
</syntaxhighlight>
</lang>
 
4. Save the file as <code>hello.art</code>
Line 189 ⟶ 356:
2) Download and install the [http://fincs.ahk4.net/scite4ahk/ SciTE4AutoHotkey] editor (recommended), or use your favorite [[Editor|texteditor]].
 
3) Open the text editor and type the following: <syntaxhighlight lang AutoHotkey="autohotkey">MsgBox, Hello World!</langsyntaxhighlight>
 
4) Save the file with the extension .ahk.
Line 251 ⟶ 418:
 
Where hello.awk contains
<langsyntaxhighlight lang="awk">BEGIN {
print "Hello" 3-1 "U", sprintf("%c",33)
} </langsyntaxhighlight>
{{Out}}
Hello2U !
Line 269 ⟶ 436:
Next, follow the instructions below in the [[#TI-83_BASIC|TI-83 BASIC]] section to create a sample program named MYPROGRM. The contents of the program should be:
 
<langsyntaxhighlight lang="axe">PROGRAM:MYPROGRM
:.HELLO
:Disp "HELLO, WORLD!",i</langsyntaxhighlight>
 
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.
Line 286 ⟶ 453:
<h3>HelloWorld Program (Text Output)</h3>
To display the "HelloWorld!" in the Text Output, copy this code and paste to the code editor:
<langsyntaxhighlight lang="basic256">Print "HelloWorld!"</langsyntaxhighlight>
Then press F5 or click the play button.<br>
<h3>HelloWorld Program (Graphics Output)</h3>
To display the "HelloWorld!" in the Graphics Output, copy this code and paste to the code editor:
<langsyntaxhighlight lang="basic256">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!</langsyntaxhighlight>
Then press F5 or click the play button.<br>
<h3>Documentation</h3>
Line 304 ⟶ 471:
 
What the end product will look like:
<langsyntaxhighlight Befungelang="befunge">"!dlrow olleH">:#,_@</langsyntaxhighlight>
===Explanation===
 
Line 336 ⟶ 503:
Once the program finishes, you should have:
<pre>Hello World!</pre>
 
=={{header|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
<pre>echo " Hello, world" | ./tromp</pre>
 
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
 
<syntaxhighlight lang="bash">wget https://github.com/tromp/AIT/uni.pl
echo " Hello, world" | ./uni.pl</syntaxhighlight>
 
More implementations may be found at https://rosettacode.org/wiki/Universal_Lambda_Machine
 
=={{header|BQN}}==
 
To use BQN, you need an input method, and a BQN interpreter. This can be solved using the online playground at [https://mlochbaum.github.io/BQN/try.html Try BQN], but if you'd like a local installation, you can check out
[https://mlochbaum.github.io/BQN/#how-do-i-work-with-the-character-set working with the character set] and [https://github.com/dzaima/CBQN/ 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
<syntaxhighlight lang="text">rlwrap ./BQN</syntaxhighlight>
which will set up a repl.
 
Then type
<syntaxhighlight lang="bqn">"Hello, World!"</syntaxhighlight>
and press Enter (Shift-Enter if you're using Try BQN)
 
=={{header|C}}==
Line 434 ⟶ 635:
Install gcc as per C<br>
Create text file <code>helloworld.cpp</code>
<langsyntaxhighlight lang="cpp">#include <iostream>
int main() {
using namespace std;
cout << "Hello, World!" << endl;
return 0;
}</langsyntaxhighlight>
Compile it using <code>gcc</code>:
 
Line 450 ⟶ 651:
=={{header|Clojure}}==
# Install [http://leiningen.org/#install Leiningen].
# Generate a hello world app: <syntaxhighlight lang="text">$ lein new app my-hello</langsyntaxhighlight>
# Run it: <syntaxhighlight lang="text">$ cd my-hello
$ lein run
Hello, World!</langsyntaxhighlight>
# Edit the generated <tt>src/my-hello/core.clj</tt> file with your favorite [[Editor|texteditor]] to make changes.
# You don't have to edit files. Run the REPL (interactive shell) to experiment: <syntaxhighlight lang="text">$ lein repl</langsyntaxhighlight>
# Suggested reading: [http://dev.clojure.org/display/doc/Getting+Started Clojure's Getting Started Guide] and [http://www.braveclojure.com/ Clojure for the Brave and True]
 
=={{header|COBOL}}==
1) Install OpenCOBOL:
<syntaxhighlight lang="text">$ sudo apt-get install open-cobol</langsyntaxhighlight>
2) Open your [[Editor|texteditor]], and write the following code:
<langsyntaxhighlight lang="cobol">program-id. hello-world.
 
procedure division.
Line 468 ⟶ 669:
 
goback
.</langsyntaxhighlight>
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.
<syntaxhighlight lang="text">$ cobc -x -Wall -free ./hello.cob</langsyntaxhighlight>
4) Run the compiled program from the command line:
<syntaxhighlight lang="text">$ ./hello
Hello, World!</langsyntaxhighlight>
 
=={{header|Commodore BASIC}}==
Line 536 ⟶ 737:
2. Type the following program:
 
<syntaxhighlight lang="commodorebasicv2">
<lang CommodoreBASICv2>
10 PRINT "HELLO, WORLD!"
20 END
</syntaxhighlight>
</lang>
 
3. Type "RUN" and press Enter/Return.
Line 565 ⟶ 766:
===Hello World===
'''hello.lisp'''
<syntaxhighlight lang=""common lisp"">
<lang "Common Lisp">
(format t "Hello world!~%")
</syntaxhighlight>
</lang>
===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:
<syntaxhighlight lang=""common lisp"">
<lang "Common Lisp">
(load "hello.lisp")
</syntaxhighlight>
</lang>
...which is also how you load source files in order to add their definitions to your program.
SBCL has the <code>save-lisp-and-die</code> 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).
Line 580 ⟶ 781:
# Install [https://coq.inria.fr/download Coq]:
#* On Windows and MacOS, download the [https://github.com/coq/platform/releases most recent release].
#* On Linux, run: <syntaxhighlight lang ="bash">sudo snap install coq-prover</langsyntaxhighlight>
# Open '''coqide''', the [https://coq.inria.fr/refman/practical-tools/coqide.html 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''.
# Write in the script buffer: <langsyntaxhighlight lang="coq">
Require Import Coq.Strings.String.
 
Eval compute in ("Hello world!"%string).
</syntaxhighlight>
</lang>
# 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.
Line 608 ⟶ 809:
2) Open your favorite [[Editor|texteditor]], write the following source code
 
<langsyntaxhighlight lang="d">import std.stdio;
 
void main()
{
writeln("Hello world!");
}</langsyntaxhighlight>
 
3) Save the source code under the name hello.d
Line 630 ⟶ 831:
 
The program should produce the following output:
<pre>Hello world!</pre>
 
 
=={{header|Delphi}}==
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
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.
 
[https://www.lazarus-ide.org/ 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.
 
[[File:DelphiDesignMode.png|frame|none]]
 
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.
 
[[File:DelphiComponentPalette.png|frame|none]]
 
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.
 
<syntaxhighlight lang="Delphi">
procedure TForm1.Button1Click(Sender: TObject);
begin
end;
</syntaxhighlight>
 
Between "begin" and "end" statements, enter the following line of code:
 
<syntaxhighlight lang="Delphi">
Memo1.Lines.Add('Hello World');
</syntaxhighlight>
 
The end result should look like this:
 
<syntaxhighlight lang="Delphi">
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Add('Hello World');
end;
</syntaxhighlight>
 
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.
 
{{out}}
<pre>
 
</pre>
 
=={{header|EasyLang}}==
EasyLang programs run in the browser. EasyLang code needs to be run using a special IDE.
# Open the EasyLang IDE at [https://easylang.dev/ide/]
# Type in this program into the IDE: <syntaxhighlight lang="easylang">print "Hello world!"</syntaxhighlight>
# Click the run button at the top of the IDE, and you should see:
{{out}}
<pre>Hello world!</pre>
 
Line 637 ⟶ 900:
No installation needed. To run EchoLisp, follow this link : [http://www.echolalie.org/echolisp EchoLisp].
=== Hello World ===
<langsyntaxhighlight lang="lisp">
;; This is a comment
;; Type in the following -uncommented- line in the input text area, and press [RETURN]
Line 645 ⟶ 908:
 
(display "Hello, World" "color:blue")
</syntaxhighlight>
</lang>
=== On-line help ===
The first thing to know are the "apropos", "usage", and "help" functions. Examples:
<langsyntaxhighlight lang="lisp">
;; usage give the syntax(es) for a function call
;; "usage" abbreviation is "us"
Line 671 ⟶ 934:
;; Just type-in a letter, and you will go to the alphabetical index.
 
</syntaxhighlight>
</lang>
=== 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.
Line 687 ⟶ 950:
The resulting program will be a simple "Hello World!" program:
 
<langsyntaxhighlight lang="eiffel">
class
APPLICATION
Line 698 ⟶ 961:
end
end
</syntaxhighlight>
</lang>
 
Where the following notes apply:
 
* <syntaxhighlight lang ="eiffel">class APPLICATION ... end</langsyntaxhighlight> defines the simplest form of an Eiffel "class".
* <syntaxhighlight lang ="eiffel">create make</langsyntaxhighlight> defines a "creation procedure" (i.e. constructor) for the class <b>{APPLICATION}</b>.
* <syntaxhighlight lang ="eiffel">make do ... end</langsyntaxhighlight> is the implementation of the constructor specified with the <b>`create'</b> keyword (above).
* <langsyntaxhighlight lang="eiffel">print ( ... )</langsyntaxhighlight> is a feature inherited from class <b>{ANY}</b>—a class from which all Eiffel classes inherit (e.g. like {APPLICATION}). In the example the <syntaxhighlight lang ="eiffel">inherit ANY</langsyntaxhighlight> has been left out as it is implied by default.
 
=== Supported Platforms ===
Line 719 ⟶ 982:
# 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
# To create a simple program in ELENA we have to create a source file (e.g. program1.l) and write the following code:
<langsyntaxhighlight lang="elena">public program()
{
console.writeLine("Hello world")
}
</langsyntaxhighlight>
# Now it should be compiled (where elc is a command-line compiler):
<langsyntaxhighlight lang="elena">elcelena-cli.exe program1.l</langsyntaxhighlight>
# It will create program1.exe file which you can execute:
<syntaxhighlight lang ="elena">program1</langsyntaxhighlight>
with the following result:
{{out}}
Line 746 ⟶ 1,009:
2) Open your [[Editor|texteditor]], write the following source code:
 
<langsyntaxhighlight lang="erlang">% Implemented by Arjun Sunel
-module(helloworld).
-export([main/0]).
 
main() ->
io:fwrite("Hello world!\n").</langsyntaxhighlight>
 
3) Save the source code under the name helloworld.erl
Line 782 ⟶ 1,045:
* press <code>F1</code> or click the <code>help</code> button to bring up Factor's help browser
* click <code>Your first program</code> 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
 
 
=={{header|FreeBASIC}}==
<h3>Installation</h3>
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
[[Editor|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
 
<h3>Interface</h3>
FB does not have 'default' IDE
Optionally, you can install a [[Editor|text editor]] or [[IDE]] which will invoke fbc.exe for you.
<h4>[[Windows]]</h4>
* WinFBE Editor: https://github.com/PaulSquires/WinFBE
* FBIde: https://fbide.freebasic.net/
* VisualFBEditor: https://github.com/XusinboyBekchanov/VisualFBEditor
* PoseidonFB: https://bitbucket.org/KuanHsu/poseidonfb/
* Geany: https://www.geany.org/
 
<h4>[[Linux]]</h4>
Unless you already have a [[Editor|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:
* Geany: https://www.geany.org/
 
<h3>HelloWorld Program (Text Output)</h3>
To display the "HelloWorld!" in the Text Output, copy this code and paste to the code editor:
<syntaxhighlight lang="gwbasic">Print "HelloWorld!"</syntaxhighlight>
Then press F5 or click the play button. <br>
You have just created and run your first program. <br>
<h3>HelloWorld Program (Graphics Output)</h3>
To display the "HelloWorld!" in the Graphics Output, copy this code and paste to the code editor:
<syntaxhighlight lang="gwbasic">Cls 'Clear the graphics screen
Screen 1 'Mode 320x200
Locate 12,15
Print "Hello world!"
Sleep</syntaxhighlight>
Then press F5 or click the play button.<br>
 
<h3>Documentation</h3>
Press F1 or click the ''Help'' menu for language help/documentations.<br>
Or consult the online manual at: https://freebasic.net/wiki/DocToc
 
 
 
=={{header|Fortran}}==
Line 847 ⟶ 1,160:
3. In the window type the following:
 
<langsyntaxhighlight lang="futurebasic">window 1
include "ConsoleWindow
 
print @"GoodbyeHello, World!"
 
</lang>
HandleEvents</syntaxhighlight>
 
4. From FB's Command menu, select Build and Run "Hello, World!"
Line 916 ⟶ 1,229:
In your repository
Just type: (no class, no parentheses, no semicolon, no import)
<langsyntaxhighlight lang=""groovy"Groovy">println 'Hello to the Groovy world'</langsyntaxhighlight>
and save it in hello.groovy
On the command line, just type
Line 924 ⟶ 1,237:
Note you can also define a String to test the output message
example, in your hello.groovy file replace previous code by:
<langsyntaxhighlight lang=""groovy"Groovy">String hello = 'Hello to the Groovy world'
println hello</langsyntaxhighlight>
And you can add some assertions, for instance:
<langsyntaxhighlight lang=""groovy"Groovy">assert hello.contains('Groovy')
assert hello.startsWith('Hello')</langsyntaxhighlight>
 
=={{header|Haskell}}==
Install GHC:
<syntaxhighlight lang="text">$ sudo apt-get install ghc</langsyntaxhighlight>
Create hello.hs:
<syntaxhighlight lang="text">$ touch hello.hs
$ cat > hello.hs << HERE
main = putStrLn "Hello, World!"
HERE</langsyntaxhighlight>
Compile it:
<syntaxhighlight lang="text">$ ghc hello.hs -o hello</langsyntaxhighlight>
And run the executable:
<syntaxhighlight lang="text">$ ./hello
Hello, World!</langsyntaxhighlight>
 
===Non-Linux operating systems===
Line 950 ⟶ 1,263:
 
=={{header|J}}==
Download [[j:System/Installation/J903|J903]]
Download J804 from http://jsoftware.com/stable.htm
 
Install it, using the defaults.
Line 957 ⟶ 1,270:
 
Type in:
<syntaxhighlight lang ="j">'GoodbyeHello, World!'</langsyntaxhighlight>
 
A quicker alternative might be an [https://jsoftware.github.io/j-playground/bin/html2/ online version of J], if you are using a browser which supports [https://webassembly.org/ wasm].
 
=={{header|Jakt}}==
The Jakt compiler must be built from source; check [https://github.com/SerenityOS/jakt/blob/main/documentation/cmake-bootstrap.md 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:
<syntaxhighlight lang="sh">
cmake -B build -GNinja
cmake --build build
</syntaxhighlight>
 
To compile hello world, save the following to hello.jakt:
<syntaxhighlight lang="jakt">
fn main() {
println("Hello world!")
}
</syntaxhighlight>
 
To compile it, run the following command in the directory containing hello.jakt.
<syntaxhighlight lang="sh">
jakt hello.jakt
</syntaxhighlight>
 
The built executable will be ./build/hello.
 
Specifying -cr will automatically run the program after building.
<syntaxhighlight lang="sh">
jakt -cr hello.jakt
</syntaxhighlight>
 
Output will go to the terminal.
 
=={{header|Java}}==
Line 971 ⟶ 1,317:
 
 
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: <syntaxhighlight lang ="shell">javac -version</langsyntaxhighlight> If you see an output similar to <code>javac <version_number></code>, 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 <code>HelloWorld.java</code>. 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.
 
<syntaxhighlight lang="java">
<lang Java>
public class HelloWorld {
public static void main(String[] args) {
Line 983 ⟶ 1,329:
}
}
</syntaxhighlight>
</lang>
'''Output: Hello world!'''
 
'''Printing Hello world! in a more object-oriented manner'''
<syntaxhighlight lang="java">
<lang Java>
public class HelloWorld {
public static void main(String[]args){
Line 999 ⟶ 1,345:
}
}
</syntaxhighlight>
</lang>
'''Output: Hello world!'''
 
Line 1,016 ⟶ 1,362:
 
<code>console.log()</code> method:
<syntaxhighlight lang="text">console.log("Hello, World!");</langsyntaxhighlight>
 
This will be printed on the Console tab part of your web browser.
Line 1,022 ⟶ 1,368:
 
<code>alert()</code> method:
<syntaxhighlight lang="text">alert("Hello, World!");</langsyntaxhighlight>
 
This will appear in the shape of a 'pop-up' in your browser.
Line 1,071 ⟶ 1,417:
 
'''Data from stdin'''
<langsyntaxhighlight lang="sh">$ echo '"Hello world!"' | jq .
 
C:\ echo "Hello world!" | jq .</langsyntaxhighlight>
If there were a web server somewhere that provides "Hello world!" as JSON,
then we could also write something like:
<langsyntaxhighlight lang="sh">curl -Ss http://hello.world.com | jq .</langsyntaxhighlight>
 
'''Data from a file'''
<langsyntaxhighlight lang="sh">$ echo '"Hello world!"' > hello.txt
$ jq . hello.txt
 
C:\ echo "Hello world!" > hello.txt
C:\ jq . hello.txt</langsyntaxhighlight>
'''2) "Hello world!" as program'''
<langsyntaxhighlight lang="sh">$ jq -n '"Hello world!"'
 
C:\ jq -n "Hello world!</langsyntaxhighlight>
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:
<langsyntaxhighlight lang="sh"> jq -n -f hello.txt .</langsyntaxhighlight>
In practice, it is recommended that jq programs be placed in text files with names
ending with the .jq suffix.
Line 1,106 ⟶ 1,452:
jq programs consist of definitions and pipelines. There is much to be said
for a style illustrated by the following example:
<langsyntaxhighlight lang="jq">def binary_digits:
if . == 0 then 0
else [recurse( if . == 0 then empty else ./2 | floor end ) % 2 | tostring]
Line 1,112 ⟶ 1,458:
| .[1:] # remove the leading 0
| join("")
end ;</langsyntaxhighlight>
 
=={{header|Julia}}==
Line 1,125 ⟶ 1,471:
 
4. Choose the |> symbol to run that line of Julia code.</pre>
 
=={{header|K}}==
{{works with|ngn/k}}
<code class="plainlinks">git clone https://codeberg.org/ngn/k.git</code>
 
make using the <b>build:</b> line in <i class="plainlinks">[https://codeberg.org/ngn/k/raw/branch/master/readme.txt readme.txt]</i>
 
run using the <b>use:</b> line in <i class="plainlinks">[https://codeberg.org/ngn/k/raw/branch/master/readme.txt readme.txt]</i>
 
=={{header|Kotlin}}==
Line 1,138 ⟶ 1,492:
</pre>
Now in Notepad, paste in the following and save it:
<langsyntaxhighlight lang="scala">fun main(args: Array<String>) {
println("Hello, World!")
}</langsyntaxhighlight>
 
Next type this at the command line to compile the program:
Line 1,158 ⟶ 1,512:
 
=={{header|Lambdatalk}}==
<langsyntaxhighlight lang="scheme">
The minimal installation is straightforward. Go to this URL:
 
Line 1,184 ⟶ 1,538:
 
Congratulations, your first web page is published.
</syntaxhighlight>
</lang>
 
=={{header|Lean}}==
These are the steps to install Lean 4:
# Have a look at the [https://leanprover.github.io/lean4/doc/quickstart.html quickstart], which links to [https://www.youtube.com/watch?v=yZo6k48L0VY this video].
# Install [https://code.visualstudio.com/ VS Code], if it is not installed:
#* On Linux, run: <syntaxhighlight lang="bash">sudo snap install --classic code</syntaxhighlight>
# Start '''code''' and search in "Extensions (Ctrl+Shift+X)", and write "lean4" in the text box.
# Select the "lean4" extension and install it.
# Select "File / New File... (Alt+Ctrl+N)" and create the file "HelloWorld.lean".
# A message may pop up saying "Failed to start 'lean' language server". If that happens, press the button "Install Lean using Elan".
# Write the following in "HelloWorld.lean":
<syntaxhighlight lang="lean">
def main : IO Unit :=
IO.println ("Hello world!")
 
#eval main
</syntaxhighlight>
# Place your cursor a at the end of <code>#eval main</code>, which updates the "Lean Infoview" showing the message <code>Hello world!</code>.
 
=={{header|Locomotive Basic}}==
Line 1,193 ⟶ 1,565:
 
In CPCBasic, type
<langsyntaxhighlight lang="locobasic">10 print "Hello World!"</langsyntaxhighlight>
into the text box and click "Run". Output goes to the blue CPC screen below.
 
Line 1,199 ⟶ 1,571:
Without installing anything, lua-programs can be run online at the [http://www.lua.org/demo.html live demo]. <br>
It includes some demo-programs, such as
<langsyntaxhighlight lang="lua">io.write("Hello world, from ",_VERSION,"!\n")</langsyntaxhighlight>
 
For installing Lua, there are extensive instructions for [http://www.lua.org/start.html getting started] on Linux, MacOS and Windows.
Line 1,293 ⟶ 1,665:
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:
<langsyntaxhighlight Maplelang="maple">"Hello World";</langsyntaxhighlight>
"Hello World"
Congratulations, you executed your first line of code!
Line 1,324 ⟶ 1,696:
 
=={{header|MiniScript}}==
=== Running in a Web Browser ===
{{incomplete|MiniScript|No installation instructions}}
The easiest way to get started is to use any desktop computer with a web browser, and point it to [https://miniscript.org/tryit/ https://miniscript.org/tryit/]. In the code editor that appears at top-left, delete any example code already there, then type in the following:
<lang MiniScript>print "Hello World!"
 
</lang>
<syntaxhighlight lang="miniscript">print "Hello World!"</syntaxhighlight>
 
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/ 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/ https://miniscript.org/MiniMicro/] or [https://joestrout.itch.io/mini-micro 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 [https://miniscript.org/MiniMicro/] or [https://joestrout.itch.io/mini-micro], 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.
 
=={{header|Monte}}==
Line 1,338 ⟶ 1,728:
The code in hello.mt simply defines a function and then calls it:
 
<langsyntaxhighlight lang="monte">
def sayHello():
traceln("Hello World")
sayHello()
</syntaxhighlight>
</lang>
 
=={{header|MontiLang}}==
Line 1,348 ⟶ 1,738:
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 <langsyntaxhighlight MontiLanglang="montilang">monti</langsyntaxhighlight> in the terminal, or run a program by specifying <syntaxhighlight lang MontiLang="montilang">monti file.mt</langsyntaxhighlight> For documentation on the language, see file 'Documentation.mt' in /examples on github.
 
Here is a simple Hello World program in MontiLang
 
<syntaxhighlight lang MontiLang="montilang">|Hello, World!| PRINT .</langsyntaxhighlight>
 
=={{header|Nemerle}}==
Line 1,397 ⟶ 1,787:
2) Open a text editor and create a file named ''hello.nim'' with the following contents:
 
<langsyntaxhighlight lang="nim">echo "Hello world!"</langsyntaxhighlight>
 
3) Open a terminal console, and run the following command:
Line 1,416 ⟶ 1,806:
=== “Hello world!” as a string ===
 
# Open your [[Editor]] and write the following line: <langsyntaxhighlight lang="nix">"Hello world!"</langsyntaxhighlight>
# Save the file as <code>hello.nix</code>.
# Evaluate the file as input. <pre>nix-instantiate --eval hello.nix</pre>
Line 1,424 ⟶ 1,814:
A derivation in Nix represents a single build step. The output of a derivation is a path in the Nix store.
 
# Open your [[Editor]] and write the following line: <langsyntaxhighlight lang="nix">(import <nixpkgs> { }).writeText "hello" "Hello world!\n"</langsyntaxhighlight> This represents a derivation that uses <code>writeText</code> from <code>nixpkgs</code> as a builder to write an output in the Nix store with the suffix “hello” containing the contents “Hello World!”.
# Save the file as <code>hello-derivation.nix</code>
# Build the derivation. <pre>nix-build hello-derivation.nix</pre> The derivation result is a path in the Nix store. A symlink <code>result</code> is also created in the current directory pointing to the path of the result in the nix store.
Line 1,461 ⟶ 1,851:
 
You've just created and run a hello world program in NS-HUBASIC.
 
=={{header|Nu}}==
The Nu programming language is a part of Nushell. See the [https://www.nushell.sh/#get-nu 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 <code>nu</code> through the command line to get a prompt. Type <code>print "Hello world!"</code> to run the hello program interactively.
 
Transcript (some content redacted for brevity):
 
<pre>
~ $ nu
__ ,
.--()°'.' Welcome to Nushell,
'|, . ,' based on the nu language,
!_-(_\ where all data is structured!
 
[...]
 
~> print "Hello world!"
Hello world!
</pre>
 
Alternatively, save the following text to the file `hello.nu`
<pre>
print "Hello world!"
</pre>
 
This can be done with any text editor, or via the command line.
<pre>
tee hello.nu << EOF
print "Hello world!"
EOF
</pre>
 
Run with <code>nu hello.nu</code>.
 
=={{header|OCaml}}==
Line 1,469 ⟶ 1,893:
Create file: 'hello.ml'
 
Type in file: <langsyntaxhighlight lang="ocaml">print_string "Hello world!\n";;</langsyntaxhighlight>
 
Compile with: <syntaxhighlight lang Shell="shell">ocamlc -o hello hello.ml</langsyntaxhighlight>
 
Run as: <syntaxhighlight lang Shell="shell">./hello</langsyntaxhighlight>
 
=={{header|Oforth}}==
Line 1,487 ⟶ 1,911:
Type in file:
 
<langsyntaxhighlight Oforthlang="oforth">"Hello world!" println</langsyntaxhighlight>
 
Run as: <syntaxhighlight lang Shell="shell">oforth hello.of</langsyntaxhighlight>
 
Or you can use oforth command line directly :
 
<langsyntaxhighlight Shelllang="shell">oforth --P"\"Hello world!\n\" println"</langsyntaxhighlight>
 
=={{header|Pare}}==
Line 1,501 ⟶ 1,925:
Download: https://bitbucket.org/parelang/pare/downloads/pare
 
Create file 'hello.l': <langsyntaxhighlight Parelang="pare">(print "hello world")</langsyntaxhighlight>
Run: <syntaxhighlight lang Shell="shell">perl pare hello.l</langsyntaxhighlight>
 
=={{header|PARI/GP}}==
Line 1,526 ⟶ 1,950:
===Your first program===
Open a [[Editor|texteditor]] of your choice and type
<langsyntaxhighlight lang="parigp">print("Hello, world!")</langsyntaxhighlight>
Save the file in your PARI working directory and start the program, either in a console (command: <code>gp</code>) or in the GUI in Windows (by double-clicking the shortcut). Type <code>\r filename</code> 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!".
Line 1,574 ⟶ 1,998:
=={{header|Perl}}==
See [http://www.perl.org/get.html Download Perl Distributions]
<langsyntaxhighlight lang="perl">=head1 Obtaining perl
 
On the majority of UNIX and UNIX-like operating systems
Line 1,642 ⟶ 2,066:
 
#!/usr/bin/perl
print "Hello, World!\n";</langsyntaxhighlight>
 
=={{header|Phix}}==
Line 1,660 ⟶ 2,084:
(A cross platform editor is currently in progress, try "pw edix" to run that.)<br>
Enter the following:
<!--<langsyntaxhighlight Phixlang="phix">-->
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Hello world!"</span><span style="color: #0000FF;">)</span>
<!--</langsyntaxhighlight>-->
Save as test.exw in the installation directory and run "p test".<br>
The output will appear in the command prompt/terminal.<br>
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'''
Line 1,676 ⟶ 2,100:
steps may be required to install IUP, see demo/pGUI/lnx/installation.txt, otherwise any editor will do.<br>
Enter the following:
<!--<langsyntaxhighlight Phixlang="phix">-->
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Hello world!"</span><span style="color: #0000FF;">)</span>
<!--</langsyntaxhighlight>-->
Save as test.exw in the installation directory and run "./phix test".<br>
You can also save the file anywhere and press F5 in edix to run it.<br>
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
<!--<syntaxhighlight lang="phix">-->
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Hello world!"</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
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
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
-- pwa\phix\hello_world.exw
-- ========================
--</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">include</span> <span style="color: #000000;">pGUI</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
<span style="color: #7060A8;">IupOpen</span><span style="color: #0000FF;">()</span>
<span style="color: #004080;">Ihandle</span> <span style="color: #000000;">lbl</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupFlatLabel</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"World!"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"EXPAND=YES, ALIGNMENT=ACENTER"</span><span style="color: #0000FF;">)</span>
<span style="color: #004080;">Ihandln</span> <span style="color: #000000;">dlg</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupDialog</span><span style="color: #0000FF;">(</span><span style="color: #000000;">lbl</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"TITLE=Hello, RASTERSIZE=215x85"</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">IupShow</span><span style="color: #0000FF;">(</span><span style="color: #000000;">dlg</span><span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">platform</span><span style="color: #0000FF;">()!=</span><span style="color: #004600;">JS</span> <span style="color: #008080;">then</span>
<span style="color: #7060A8;">IupMainLoop</span><span style="color: #0000FF;">()</span>
<span style="color: #000000;">dlg</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupDestroy</span><span style="color: #0000FF;">(</span><span style="color: #000000;">dlg</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">IupClose</span><span style="color: #0000FF;">()</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<!--</syntaxhighlight>-->
and you can run that without any further ado, at least on Windows, or online [http://phix.x10.mx/p2js/hello_world.htm 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.
 
=={{header|PHP}}==
Line 1,761 ⟶ 2,217:
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 <b>Ctrl+V</b>. 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 <i>required</i> 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, <b>but make sure it doesn't have any file extensions!</b> Open the new text file and copy the following code:
<langsyntaxhighlight lang="plainenglish">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.</langsyntaxhighlight>
To run the code, just press <b>Ctrl+R</b>. As the code says in <i>Plain English</i>, "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 <i>directory</i> 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 <b>Ctrl+S</b> to save the file. To quit the IDE, you may press <b>Ctrl+Q</b> or click the letter 'Q', then click 'Quit.'
Line 1,771 ⟶ 2,227:
=== 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:
<langsyntaxhighlight lang="plainenglish">To run:
Start up.
Clear the screen.
Line 1,777 ⟶ 2,233:
Refresh the screen.
Wait for the escape key.
Shut down.</langsyntaxhighlight>
This time, the background is black, and the "Hello World!" text is green.
=== Documentation ===
Line 1,790 ⟶ 2,246:
===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:
<langsyntaxhighlight lang="powershell">"Hello, World!" #This is a comment.</langsyntaxhighlight>
or,
<langsyntaxhighlight lang="powershell">wRiTe-HOsT "Hello, World!" #PowerShell is case-insensitive.</langsyntaxhighlight>
or,
<langsyntaxhighlight lang="powershell">Write-Host Hello`, World! #The backtick escapes the next character.</langsyntaxhighlight>
Your output should be:
<pre>Hello, World!</pre>
Line 1,809 ⟶ 2,265:
 
=={{header|Processing}}==
=== Installing Processing ===
 
== Installing Processing ==
Everything Processing related lives here! -> https://processing.org/
 
Line 1,826 ⟶ 2,281:
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.
 
Line 1,833 ⟶ 2,288:
To print 'Hello World' to the console, we type;
 
<langsyntaxhighlight Processinglang="processing">print("Hello World!");</langsyntaxhighlight>
 
We can also replace hello world, with any string, providing its between two quotation marks (").
Line 1,839 ⟶ 2,294:
A fun development of this would be to create a variable of type string, and pump that into the print command!
 
<langsyntaxhighlight Processinglang="processing">String x = "What up!";
 
print(x); </langsyntaxhighlight>
 
Enjoy!
Line 1,865 ⟶ 2,320:
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. <langsyntaxhighlight lang="python">print "Goodbye, World!"</langsyntaxhighlight>
use the File menu to save the file with a name hello.py,
(remember the .py extension).
Line 1,971 ⟶ 2,426:
===Writing Ra Code===
Create a plain text file and enter the following text:
<syntaxhighlight lang="ra">
<lang Ra>
class HelloWorld
**Prints "Goodbye, World!"**
Line 1,978 ⟶ 2,433:
print "Goodbye, World!"
</syntaxhighlight>
</lang>
Save the plain text file as "HelloWorld.racode" (all Ra files must end with the .racode extension).
 
Line 2,020 ⟶ 2,475:
===Hello World===
Save it as "hello.rkt":
<syntaxhighlight lang="racket">
<lang "Racket">
#lang racket
(displayln "Hello world!")
</syntaxhighlight>
</lang>
 
===Running it===
Line 2,094 ⟶ 2,549:
to invoke the appropriate interpreter.
<br>So, a <tt> Hello world! </tt> REXX program (two lines) could look like:
<langsyntaxhighlight lang="rexx">/*REXX program to greet the world enthusiastically. */
say "Hello world!"</langsyntaxhighlight>
The above program could be made into one statement
(since REXX comments are treated like whitespace).
Line 2,128 ⟶ 2,583:
=={{header|Ring}}==
{{incomplete|Ring|No installation instructions}}
<langsyntaxhighlight lang="ring">
sayHello()
 
func sayHello
see "Hello World" + nl
</syntaxhighlight>
</lang>
 
=={{header|Robotic}}==
Line 2,158 ⟶ 2,613:
===The Code===
The code is as simple as it looks:
<langsyntaxhighlight lang="robotic">
* "Hello world!"
end
</syntaxhighlight>
</lang>
 
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.
Line 2,172 ⟶ 2,627:
'''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.
 
=={{header|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 <code>Catalog</code> key to see all the available instructions documented and select the <code>DISP</code> function - or type it directly - and hit <code>Enter</code>. ''Et voilà !''
=={{header|Ruby}}==
 
Line 2,179 ⟶ 2,643:
2. Use your favorite [[Editor|text editor]].
 
3. Open the text editor and type the following: <langsyntaxhighlight Rubylang="ruby">
puts "Hello World!!"
</syntaxhighlight>
</lang>
 
4. Save the file with the extension .rb
Line 2,194 ⟶ 2,658:
A complete description of how to install the language can be found on the [http://www.rust-lang.org/install.html Install page] of the [http://www.rust-lang.org Rust web site]. However, for the purposes of trying out code examples, use the [http://play.rust-lang.org online REPL] which allows you to enter code, compile it and run it within a single browser window.
 
<langsyntaxhighlight lang="rust">fn main() {
println!("Hello world!");
}</langsyntaxhighlight>
 
=={{header|Scala}}==
Line 2,203 ⟶ 2,667:
 
Run a program using '''Windows PowerShell''':
<langsyntaxhighlight Scalalang="scala">scala -e 'println(\"Hello_world\")'</langsyntaxhighlight>
The double quotes have to be escaped.
 
Line 2,229 ⟶ 2,693:
 
Run in-line commands
<langsyntaxhighlight Bashlang="bash">setl 'print("Hello, world!");'</langsyntaxhighlight>
or create a file 'myscript.setl'
<langsyntaxhighlight SETLlang="setl">print("Hello, world!");</langsyntaxhighlight>
and run it
<syntaxhighlight lang Bash="bash">setl myscript.setl</langsyntaxhighlight>
 
Documentation on the setl command can be found [http://setl.org/doc/setl-user.html here] and a paper on the SETL language can be found [https://www.researchgate.net/publication/238739905_An_introduction_to_the_set_theoretical_language_SETL here].
Line 2,387 ⟶ 2,851:
At the prompt, you can just type in Tcl commands and have them executed immediately.
For example, if you type in this little program:
<langsyntaxhighlight lang="tcl">puts "Hello World"</langsyntaxhighlight>
You will get this message printed out:
<pre>Hello World</pre>
Line 2,436 ⟶ 2,900:
 
Type in code so your screen looks like this (where MYPROGRM is the name of your program):
<langsyntaxhighlight lang="ti83b">PROGRAM:MYPROGRM
:Disp "HELLO, WORLD!"</langsyntaxhighlight>
 
Disp is found under the "I/O" tab of the menu from the "PRGM" key,
Line 2,467 ⟶ 2,931:
The program should look like this when it's done:
 
<langsyntaxhighlight lang="ti83b">PROGRAM:HELLO
:AsmPrgm
:219F9D
Line 2,473 ⟶ 2,937:
:EF2E45
:C9
:48656C6C6F2C20576F726C642100</langsyntaxhighlight>
 
=={{header|Transd}}==
Line 2,480 ⟶ 2,944:
* Create a file named "hello.td" with the following content:
 
<langsyntaxhighlight lang="scheme">
#lang transd
 
Line 2,486 ⟶ 2,950:
_start: (lambda (textout "Hello, World!"))
}
</syntaxhighlight>
</lang>
 
* Start FREND shell and type at the command prompt the following:
Line 2,499 ⟶ 2,963:
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.
 
<syntaxhighlight lang="cpp">
<lang Cpp>
#include <CtrlLib/CtrlLib.h>
// submitted by Aykayayciti (Earl Lamont Montgomery)
Line 2,549 ⟶ 3,013:
GoodbyeWorld().Run();
}
</syntaxhighlight>
</lang>
 
=={{header|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 [https://github.com/wren-lang/wren-cli/releases/tag/0.34.0 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 ''helloHello_world.wren'' in the same directory as wren-cli itself:
<langsyntaxhighlight ecmascriptlang="wren">System.print("Hello world!")</langsyntaxhighlight>
Now type at the command line (omit ./ if using Windows):
<pre>
./wren-cli helloHello_world.wren
</pre>
to compile and run the script and you should see the archetypal greeting :)
Line 2,577 ⟶ 3,041:
</pre>
====Example====
<langsyntaxhighlight lang="asm">
option casemap:none
option literals:on
Line 2,606 ⟶ 3,070:
main endp
end
</syntaxhighlight>
</lang>
Assemble & Link
<pre>
Line 2,626 ⟶ 3,090:
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/]
Line 2,631 ⟶ 3,096:
====Example====
Using stdc, and the [https://docs.microsoft.com/en-us/cpp/build/x64-software-conventions?redirectedfrom=MSDN&view=msvc-160 windows ABI]
<langsyntaxhighlight lang="asm">
global main
 
Line 2,647 ⟶ 3,112:
call ExitProcess
ret
</syntaxhighlight>
</lang>
Assemble & Link
<pre>
Line 2,655 ⟶ 3,120:
Again, Choice of linker is entirely upto you. <br>
Using NASM on Linux.
libc PIE example..
<lang asm>
<syntaxhighlight lang="asm">
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
</syntaxhighlight>
Using Linux syscalls..
<syntaxhighlight lang="asm">
; ------------------------------------------------------------------------------
; To assemble:
Line 2,680 ⟶ 3,163:
xor rdi, rdi ; exit code 0
syscall
</syntaxhighlight>
</lang>
 
===Editors and IDEs===
====Linux====
Line 2,694 ⟶ 3,178:
=={{header|Zig}}==
 
===SafeDebug output usingto debug loggingstderr===
<syntaxhighlight lang="zig">// - Install zig from https://ziglang.org/download/.
 
<lang zig>
// - Install zig from https://ziglang.org/download/.
// - Extract into your path
// - `zig run Newbienewbie.zig`
 
const std = @import("std");
 
pub fn main() void {
// If you only want to quickly debug things and panic on failure,
std.debug.warn("Hello, World!\n");
// you can use `debug.print` to print to standard error
}
// Do not use debug code in production.
</lang>
std.debug.print("Hello, World!\n");
}</syntaxhighlight>
 
===Using standard streams===
<syntaxhighlight lang="zig">const std = @import("std");
 
<lang zig>
// Save the file as `hello_world.zig`
// Run the program using the command - `zig run hello_world.zig`
 
const std = @import("std");
 
pub fn main() !void {
const stdout = std.io.getStdOut().outStream();
// `try` is a shorthand for `fn_call() catch |err| return err;`.
try stdout.print("Hello, {}\n", .{"world"});
// See also documentation for `catch`, `defer` and `errdefer`
}
// for code flow adjustments
</lang>
try stdout.writer().writeAll("Hello world!\n");
}</syntaxhighlight>
 
=={{header|zkl}}==
Line 2,798 ⟶ 3,278:
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:
 
<langsyntaxhighlight lang="zxbasic">10 PRINT "Hello"</langsyntaxhighlight>
 
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:
56

edits