Self-hosting compiler: Difference between revisions

Added FreeBASIC
(Added FreeBASIC)
 
(4 intermediate revisions by 4 users not shown)
Line 12:
=={{header|ALGOL 68}}==
 
The Algol 68 to C compiler available here: [httphttps://wwwgithub.poenikatu.co.ukcom/srcsdolim/] or here:algol68toc [https://github.com/NevilleDNZsdolim/algol68toc] is written in ALGOL 68 and compiles itself. It is derived from the ALGOL 68RS compiler.
 
=={{header|ATS}}==
Line 24:
 
The older Mono C# compiler, currently backed by the .NET Foundation, can be found at [https://github.com/mono/mono]. There is also a (much newer) Mono VB compiler.
 
=={{header|FreeBASIC}}==
Essentially, FreeBASIC consists of two parts:
 
1. The FreeBASIC compiler, written in FreeBASIC (self-hosting). Compiling this requires a working FreeBASIC installation.
2. The FreeBASIC runtime libraries, written in C. Compiling this requires a C compiler such as gcc, the GNU C compiler (Native gcc on Linux, MinGW on Windows, DJGPP for DOS).
 
FreeBASIC is a self-hosting compiler, being roughly 120,000 lines of code (compiler core only, not including libraries).
 
Source code can be downloaded from [https://freebasic.net/wiki/DevBuild https://freebasic.net/wiki/DevBuild].
 
=={{header|Go}}==
Line 34 ⟶ 44:
=={{header|J}}==
 
<langsyntaxhighlight Jlang="j">do =: ".
STDIN =: 1
do read STDIN
Line 41 ⟶ 51:
".1!:1[1
((,~}:)~|.)'Go hang a salami '
Go hang a salami imalas a gnah oG</langsyntaxhighlight>
 
{{omit from|Julia}}
Line 52 ⟶ 62:
=={{header|Lingo}}==
Propably not how the task was meant by the OP, but if "compiling code at runtime" counts, here Lingo's capabilities to do this:
<langsyntaxhighlight lang="lingo">m = new(#script)
 
-- automatically triggers compilation to byte code
Line 69 ⟶ 79:
-- for direct execution of simple code there is also the do() function
do("put _system.milliseconds")
-- 22476580</langsyntaxhighlight>
 
=={{header|Nim}}==
Line 76 ⟶ 86:
=={{header|Phix}}==
Phix is self hosted. Run "p -c p" and it rebuilds itself in about 15 seconds. One of my favourite parlour tricks is to then run "p p p p p p p p -cp" which stacks seven interpreted copies of itself on top of each other with the last recompiling itself, and apart from a slightly longer startup time, no slower than the shorter command.
 
=={{header|Plain English}}==
Plain English is self-hosted. The Osmosian Order of Plain English Programmers claim that Plain English can recompile itself in 3 seconds. Instructions for recompiling Plain English can be found in the instructions.pdf.
 
=={{header|Python}}==
Line 101 ⟶ 114:
(formerly Perl 6)
 
<syntaxhighlight lang="raku" perl6line>use MONKEY-SEE-NO-EVAL;
EVAL slurp</langsyntaxhighlight>
 
=={{header|Rust}}==
Line 123 ⟶ 136:
 
The VM (which includes the bytecode compiler) and the command line interpreter (which enables Wren scripts to be run independently) are written in C. Most of the core library is also written in C though parts of it are written in Wren itself. Frankly, in the interests of speed and because Wren is primarily intended as an embedded scripting language, self-hosting is never going to happen.
 
Note, however, that Wren can compile Wren source code ''at runtime'' using the Meta.compile method.
 
=={{header|ZED}}==
Source ->
Compiled -> http://ideone.com/UHMQco
<langsyntaxhighlight lang="zed">(*) number1 number2
comment:
#true
Line 1,397 ⟶ 1,412:
comment:
#true
(zed->scheme!) "value" nil</langsyntaxhighlight>
 
=={{header|zkl}}==
2,130

edits