Empty program: Difference between revisions
m
→{{header|Binary Lambda Calculus}}
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
|||
(23 intermediate revisions by 15 users not shown) | |||
Line 257:
=={{header|bc}}==
An empty file is a valid program.
=={{header|Binary Lambda Calculus}}==
At 4 bits, or half a byte, the smallest BLC program is `cat' :
<pre>00 10</pre>
corresponding to the smallest valid lambda term, the identity function \x.x
=={{header|Beef}}==
Line 330 ⟶ 338:
Pressing enter from the mged prompt, just returns another prompt, so I suppose that is the smallest possible program. However, before we can draw anything we at least need to open a database:
<syntaxhighlight lang="mged">opendb empty.g y</syntaxhighlight>
=={{header|Bruijn}}==
The smallest program in bruijn is the identity function (\x.x) and returns its input:
=={{header|C}}==
Line 358 ⟶ 371:
Start world = world</syntaxhighlight>
Compile the project with ''No Console'' or ''No Return Type'' to suppress printing of the value of the world.
==={{header|Chipmunk Basic}}===
An empty text file is a correct Chipmunk Basic program that does nothing.
=={{header|Clojure}}==
Line 431 ⟶ 447:
This is equivalent to:
<syntaxhighlight lang="e">null</syntaxhighlight>
=={{header|EasyLang}}==
<syntaxhighlight>
#
</syntaxhighlight>
=={{header|eC}}==
Line 445 ⟶ 466:
=={{header|EchoLisp}}==
<syntaxhighlight lang="scheme">
</syntaxhighlight>
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module EmptyProgram {
void run() {
}
}
</syntaxhighlight>
Line 514 ⟶ 543:
Html.text"empty"
</syntaxhighlight>
=={{header|EMal}}==
The empty script is valid and does nothing.
=={{header|Erlang}}==
Line 650 ⟶ 682:
=={{header|Fōrmulæ}}==
{{FormulaeEntry|page=https://formulae.org/?script=examples/Empty_program}}
'''Solution'''
The following is the simplest expression: the Null expression. When it is run, it does not reduce to anything else, because there should not be rewriting rules for a null expression:
[[File:Fōrmulæ - Empty program 01.png]]
[[File:Fōrmulæ - Empty program 02.png]]
=={{header|Gambas}}==
Line 683 ⟶ 719:
=={{header|Groovy}}==
<syntaxhighlight lang="groovy"></syntaxhighlight>
==={{header|GW-BASIC}}===
An empty text file is a correct GW-BASIC program that does nothing.
=={{header|Hare}}==
Line 814 ⟶ 853:
=={{header|Kotlin}}==
<syntaxhighlight lang="
=={{header|Lambdatalk}}==
An empty string is a valid program.
<syntaxhighlight lang="scheme"></syntaxhighlight>
=={{header|Lang}}==
The empty file is a valid program.
<pre></pre>
=={{header|Lang5}}==
Line 1,027 ⟶ 1,070:
The empty file is a valid program.
<pre></pre>
==={{header|MSX Basic}}===
<syntaxhighlight lang="basic">10 rem</syntaxhighlight>
=={{header|N/t/roff}}==
Line 1,074 ⟶ 1,120:
=={{header|NS-HUBASIC}}==
<syntaxhighlight lang="ns-hubasic"></syntaxhighlight>
=={{header|Oberon-2}}==
<syntaxhighlight lang="oberon2">MODULE Main;
BEGIN
END Main.
</syntaxhighlight>
=={{header|Objeck}}==
Line 1,190 ⟶ 1,243:
•dl◘.◙
=={{header|Peri}}==
In the Peri language, a text file with a length of zero bytes is a correct program, but it does nothing.
Similarly, a text file that consists of all whitespace characters is also a correct program that does nothing.
=={{header|Perl}}==
Line 1,254 ⟶ 1,312:
=={{header|Plain English}}==
<syntaxhighlight lang="
▲Shut down.</syntaxhighlight>
=={{header|plainTeX}}==
Line 1,409 ⟶ 1,465:
=={{header|Robotic}}==
<syntaxhighlight lang="robotic"></syntaxhighlight>
=={{header|RPL}}==
≪ ≫
=={{header|Ruby}}==
Line 1,421 ⟶ 1,480:
=={{header|Scala}}==
===Scala 2===
<syntaxhighlight lang="scala">object emptyProgram extends App {}</syntaxhighlight>
===Scala 3===
<syntaxhighlight lang="scala">@main def a = ()</syntaxhighlight>
=={{header|Scheme}}==
Line 1,432 ⟶ 1,494:
An empty program is invalid because it gives an [Err: Undefined] error. This behaviour still applies when the program isn't running. Due to this error, a program containing only an empty comment is the smallest possible valid program.
<syntaxhighlight lang="scratchscript">//</syntaxhighlight>
=={{header|sed}}==
A totally empty program is valid, and just copies the input unmodified. The same effect can be achieved with a single ''b'' command (which might be more convenient when called from the command line).
<syntaxhighlight lang="sh">sed "" input.txt
# vs
sed b input.txt</syntaxhighlight>
=={{header|Seed7}}==
Line 1,711 ⟶ 1,779:
=={{header|Wren}}==
<syntaxhighlight lang="
=={{header|X86 Assembly}}==
Line 1,731 ⟶ 1,799:
ret
end start</syntaxhighlight>
=={{header|XBasic}}==
{{works with|Windows XBasic}}
{{works with|Linux XBasic}}
<syntaxhighlight lang="qbasic">PROGRAM "Empty program"
DECLARE FUNCTION Entry ()
FUNCTION Entry ()
END FUNCTION
END PROGRAM</syntaxhighlight>
=={{header|XPL0}}==
|