Hello world/Newbie: Difference between revisions

m
m (On Processing)
 
(8 intermediate revisions by 4 users not shown)
Line 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}}==
Line 967 ⟶ 988:
</syntaxhighlight>
# Now it should be compiled (where elc is a command-line compiler):
<syntaxhighlight lang="elena">elcelena-cli.exe program1.l</syntaxhighlight>
# It will create program1.exe file which you can execute:
<syntaxhighlight lang="elena">program1</syntaxhighlight>
Line 1,830 ⟶ 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 2,961 ⟶ 3,016:
 
=={{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:
<syntaxhighlight lang="ecmascriptwren">System.print("Hello world!")</syntaxhighlight>
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 :)
56

edits