Empty program: Difference between revisions

m
(Added Chipmunk Basic, GW-BASIC and MSX Basic)
 
(12 intermediate revisions by 7 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 666 ⟶ 682:
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Empty_program}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
'''Solution'''
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
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:
In '''[https://formulae.org/?example=Empty_program this]''' page you can see the program(s) related to this task and their results.
 
[[File:Fōrmulæ - Empty program 01.png]]
 
[[File:Fōrmulæ - Empty program 02.png]]
 
=={{header|Gambas}}==
Line 1,759 ⟶ 1,779:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren"></syntaxhighlight>
 
=={{header|X86 Assembly}}==
Line 1,779 ⟶ 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}}==
56

edits