Empty program: Difference between revisions
m
→{{header|Binary Lambda Calculus}}
No edit summary |
|||
(15 intermediate revisions by 9 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:
<syntaxhighlight>main [0]</syntaxhighlight>
=={{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 449 ⟶ 470:
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module EmptyProgram {
void run() {
}
}
</syntaxhighlight>
Line 663 ⟶ 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 696 ⟶ 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 1,044 ⟶ 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,091 ⟶ 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,207 ⟶ 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,738 ⟶ 1,779:
=={{header|Wren}}==
<syntaxhighlight lang="
=={{header|X86 Assembly}}==
Line 1,758 ⟶ 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}}==
|