Empty program: Difference between revisions

m
 
(10 intermediate revisions by 6 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 434 ⟶ 447:
This is equivalent to:
<syntaxhighlight lang="e">null</syntaxhighlight>
 
=={{header|EasyLang}}==
<syntaxhighlight>
#
</syntaxhighlight>
 
=={{header|eC}}==
Line 452 ⟶ 470:
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module EmptyProgram {
void run() {
void run()
{
}
}
}
</syntaxhighlight>
 
Line 667 ⟶ 683:
 
{{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 1,755 ⟶ 1,779:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren"></syntaxhighlight>
 
=={{header|X86 Assembly}}==
56

edits