Content deleted Content added
m Reverted edits by 59.97.248.118 (talk) to last version by Derek Ross |
Stevebroshar (talk | contribs) →Hardware interpreter: new section |
||
(42 intermediate revisions by 22 users not shown) | |||
Line 1:
{{WikiProject
{{WikiProject Computing|importance=High}}
}}
{{merged-from|Self-interpreter|April 2, 2014}}
{{FOLDOC}}
== This page does not explain what in interpreter IS ==
This page does not explain what in interpreter IS but rather discusses all the technical minutia which is uninteresting to an average reader like me. I just want to know what an interpreted language is. Could someone please someone make this page simpler?
[[User:Truetyper|Truetyper]] 03:40, 18 May 2007 (UTC)
: Done. (I had the same problem with it.) -- [[User:Algocu|algocu]] 15:03, 23 May 2007 (UTC)
==Untitled==
I think we should remove that code. It's too long and technical for the average reader, and it doesn't really convey anything. Plus it's in a nasty language. [[User:Cgs|CGS]] 11:40, 24 Aug 2003 (UTC).
Line 47:
:The main problem with Lisp is that you would also need to supply a lisp-machine of some sort to run the Lisp interpreter on. I have implemented a version of the SECD machine in BASIC which could be used but the combination of QBASIC, SECD machine, SECD Lisp interpreter and Lisp Lisp interpreter is quite complex to load and wouldn't really be any easier to understand than the current interpreter since the "elegant" interpretive top layer relies on a rather "uncouth" compiled substrate. Looking on the bright side of course, it would be more general since it would be able to interpret user defined functions and lambda expressions. -- [[User:Derek Ross|Derek Ross]] | [[User talk:Derek Ross | Talk]] 06:01, 2004 Dec 15 (UTC)
In the first paragraph, it states that "the first interpreted high-level language was probably Lisp." It seems like the "probably" can be nailed down. I don't know where this could be researched, however. Having "probably" seems a little mealy-mouthed. [[User:Cvanhasselt|Chris van Hasselt]] ([[User talk:Cvanhasselt|talk]]) 15:30, 2 January 2013 (UTC)
== Why is an interpreter defined as a computer program? ==
Line 54 ⟶ 56:
:I think that that is a perfectly reasonable view and worth adding to the article. Please do so. However the article does capture the more commonly used meaning of ''interpreter'' which is normally applied to computer programs which translate in a particular repetitive way. I think that it would be going too far to remove the discussion of that meaning. Both are important. -- [[User:Derek Ross|Derek Ross]] | [[User talk:Derek Ross | Talk]] 02:04, 2004 Jun 25 (UTC)
: Also, microcode is out of sight in most architectures except x86, and even then it's only used for particular operations.--[[User:Blaisorblade|Blaisorblade]] ([[User talk:Blaisorblade|talk]]) 03:16, 6 August 2010 (UTC)
: Yeah, so many articles assume something has to be a program when in fact it doesn't. I just edited the intro heavily and one thing I did was to say an interpreter is software ... which means it could be a program, but need not be.[[User:Stevebroshar|Stevebroshar]] ([[User talk:Stevebroshar|talk]]) 12:16, 9 August 2025 (UTC)
== JIT ==
Line 63 ⟶ 67:
:Incremental compilation (pretty much the same thing as JIT) was used in [[Maclisp]] in the '70s. --[[User:Fubar Obfusco|FOo]] ([[User talk:Fubar Obfusco|talk]]) 20:56, 5 October 2008 (UTC)
:"Efficient implementation of the Smalltalk-80 system" is a paper published in 1984 which describes JIT compilation and a whole lot of other techniques introduced back then and which form the basis of every modern Virtual Machine (inline caching comes to mind). --[[User:Blaisorblade|Blaisorblade]] ([[User talk:Blaisorblade|talk]]) 03:25, 6 August 2010 (UTC)
== The Example ==
Line 99 ⟶ 104:
== AST Interpreter ==
This and surrounding sentences seem to imply that an AST is better than bytecode: "Thus, AST has been proposed as a better intermediate format for Just-in-time compilers than bytecode". The reference is for a thesis and returns a 404. I would humbly suggest that an AST is not better than all bytecode, but rather an AST might be better than some bytecodes for certain optimizations. Surely, this argument can only be made if you weren't to improve the bytecode to include the missing information that is necessary for the optimizations in question. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/75.33.235.210|75.33.235.210]] ([[User talk:75.33.235.210|talk]]) 17:17, 24 December 2008 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
: As a somewhat expert of the field, I removed the section on advantages of AST-based interpreters, by providing a much better reference proving the opposite. Here's the removed text:
:: An AST-based [[Java (programming language)|Java]] interpreter, written in Java and reusing this, has been proved to be faster than a similar bytecode-based interpreter,<ref>[http://central.kaserver5.org/Kasoft/Typeset/JavaTree/index.html Trees Versus Bytes], BComp Honours thesis by Kade Hansson</ref> due to the more powerful optimizations allowed by having the complete structure of the program, as well as higher level typing, available during execution.
: I read the thesis, and the comparison is completely invalid; moreover the thesis does not talk at all about optimizations allowed by AST over bytecode (that's done only in Franz's paper). The interpreter is written in Java and is not optimized (as acknowledged in the thesis in some places, like intro of Sec. 3.3 and 3.1.1) and this already invalidates the comparison (unlike what is argued there). Variable lookup is performed through a symbol table in both interpreters (even the one for bytecode); the interpreter for ASTs is a meta-interpreter, i.e. it reimplements features of the interpreted Java through features of the host Java system, which gives it an unfair advantage which would disappear in a realistic implementation. Stacks used (including the operand stack) are based on the synchronized java.util.Stack - that alone is completely crazy. Optimizations described in SquirrelFish only work for bytecode, but their impact would be irrelevant in such a slow implementation, and very relevant for a real one.
: I'm leaving the reference to Franz's paper (A Tree-Based Alternative to Java Byte-Codes) there, even if I believe it is irrelevant, too, in contemporary practice. Still, the proposal makes sense. However, benchmark results of that paper are invalid, if only because of the usage of arithmetic rather than geometric average in Table 2 (using the correct average actually gives different results when I compare IE and Juicy). There are probably better papers from him on using ASTs, but I've no time to search for them, and he abandoned the field anyway. --[[User:Blaisorblade|Blaisorblade]] ([[User talk:Blaisorblade|talk]]) 03:08, 6 August 2010 (UTC)
==Advantages vs. disadvantages==
i've incuded a article of advaantages/disadvantages of intrpreter which is simple for '''average user''' to understand and relevant to waht people expect to find b/w interpreter and compiler...<br />
But this article is not fully complete ...<br />
So kindly add new items to this article ...
regards<br />
--gursimar singh mohar 20:06, 26 December 2009 (UTC) <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Simar mohar|Simar mohar]] ([[User talk:Simar mohar|talk]] • [[Special:Contributions/Simar mohar|contribs]]) </span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
: I believe this section, that was added by a single user (albeit somewhat cleaned up by another well-meaning user) should be deleted. It is unsourced and somewhat arbitrary, and amounts to essentially [[WP:OR|original research]] and [[WP:SYNTHESIS|synthesis]]. [[User:WikiDan61|<span style="color:green;">WikiDan61</span>]]<sup>[[User talk:WikiDan61|ChatMe!]]</sup><sub>[[Special:Contributions/WikiDan61|ReadMe!!]]</sub> 17:07, 4 January 2010 (UTC)
:: This is surely not true currently - at least it is not original research but folklore (I wouldn't reference it if I were writing a paper). I didn't look (yet) at the history to see if there's any relation with what you discuss. --[[User:Blaisorblade|Blaisorblade]] ([[User talk:Blaisorblade|talk]]) 03:14, 6 August 2010 (UTC)
An anonymous user (68.197.139.156) added a paragraph (compare [https://en.wikipedia.org/w/index.php?title=Interpreter_(computing)&diff=522863651&oldid=519912762 the delta]) on Nov. 13, 2012. I considered fixing the grammar, but decided to delete it. '''Reasons:'''
<ol><li> The intent and role of this paragraph are not clear (to me).</li>
<li> There are some minor factual errors. At the very least, some sentences are misleading.</li>
<li> The paragraph duplicates other parts of the article:
<ul><li> It redefines an ''interpreter'' (orig. def. in 1st paragraph of article).</li>
<li> Efficiency is covered in the ''Efficiency'' subsection.</li>
<li> Portability is covered in the ''Distribution'' subsection.</li>
<li> The Java example is covered in the introduction.</li></ul>
This leaves no real content to this paragraph.</li>
<li> Some sentences are copied almost word by word from the referenced book (''Computer Science Illuminated'', accessible via [http://books.google.de/books?id=3ls6K2cJW_0C&pg=PA295&redir_esc=y#v=onepage&q&f=false Google Books]). This book does not seem to be under a free license. The quotes are not clearly delimited and marked as quotes. Examples<ref name="Computer Science Illuminated at Google Books">{{cite book|last=Dale & Lewis|title=Computer Science Illuminated|year=2012|pages=295-297|url=http://books.google.de/books?id=3ls6K2cJW_0C&pg=PA295&redir_esc=y#v=onepage&q&f=false}}</ref>:
<ul><li> Article: ''“An Interpreter is a program which translates the source […] and executes it statement by statement.”''
<br> Book: ''“An interpreter is a program that translates and executes the statements in sequence.”''</li>
<li> Article: ''“Translation […] is followed by immediate execution.”''
<br> Book: ''“[The] interpreter translates […] and then immediately executes the statement.”''</li>
<li> Article: ''“This process is more complex which makes interpreted programming languages to run slower compared to languages that are compiled”''
<br> Book: ''“Because of the complexity of the software interpreters, programs in interpreted languages usually ran much more slowly than compiled programs.”''</li>
<li> Article: ''“compiled high level language can run on computer that has appropriate compiler for that specific high level language.”''
<br>Book: ''“A program written in a high-level language can run on any computer that has an appropriate compiler for this language.”''</li>
<li> Article: ''“Java […] is compiled into standard machine language Bytecode”''
<br>Book: ''“Java is compiled into a standard machine language called Bytecode.”''</li></ul></ol>
— [[User:Latk|Latk]] ([[User talk:Latk|talk]]) 01:46, 31 December 2012 (UTC)
== information missing ==
Isn't some kind of interpreter also used when dealing with natural language input to computer programs? This aspect does not seem to be discussed in the article. <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Skysong263|Skysong263]] ([[User talk:Skysong263|talk]] • [[Special:Contributions/Skysong263|contribs]]) 18:01, 22 March 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
:I think that natural language interpretation is a different kettle of fish. [[User:Stevebroshar|Stevebroshar]] ([[User talk:Stevebroshar|talk]]) 12:18, 9 August 2025 (UTC)
== Needs a lot of fixing ==
There's a number of problems I can see with the article:
*It hasn't got a clear distinction between compiling and translating to a bytecode. The big difference is that compilatrion does overall semantic analysis not just syntactic analysis.
*There are no proper inline citations for most of what is said, it seems more like peoples thoughts.
In particular sections
*In the leader 'executes source code directly' gives no clear picture of what that is supposed to mean. Does it mean reads the text and does actions based on what iut reads immediately?
*It talks about 'some translation work like compilers' which blurs the distinction.
*In 'Bytecode interpreters' Forth is just translated, it is not compiled.
*Bit about control tables is stuck in for no good reason and confuses things.
*In 'Bytecode interpreters' Forth is just translated, it is not compiled.
*'Efficiency' and 'Advantages and disadvantages' just talks about slower execution and faster debug cycle. With a compiler many of the bugs are caught at compilation time rather than one at a time by debug. That is why it takes longer before it starts executing the first time.
*In distribution things like pcode, Java, .Net and others produce a bytecode that can then be interpreted or translated into machine code for any computer.
*The 'Execution environment' bit is rather confused or wrong.
*I haven't the foggiest what the bit about 'Abstract Syntax Tree' is about. I think it is confused with compilation.
*In the 'Just in time compilation' .Net translates whole modules to machine code and caches the result, it does not typically go in for JIT as it is used in Java though it is not compiled to machine code in advance and the bytecode is not interpreted.
*There should be a disambiguation page for interpreter pointing to language interpretation, this article, the punched card and any bands etc with the name and any extra info about punched card interpreters moved to the appropriate article.
*There is a second meaning of interpretation section stuck for no good reason at the bottom.
[[User:Dmcq|Dmcq]] ([[User talk:Dmcq|talk]]) 10:00, 11 May 2010 (UTC)
:I see now That there are Forths that do optimised compiles rather than just producing threaded code, why anyone would want to do that for a write only like that I don't know. It is not though a good example of compiling for the article I believe. [[User:Dmcq|Dmcq]] ([[User talk:Dmcq|talk]]) 10:05, 11 May 2010 (UTC)
== Citation and Non Sequitir ==
At present this article does a rather inadequate job of inline citation (see other users above me). It also has other issues with citation in a more practical sense. Even when a source is included at times it is included without contextual information and so the information presented is less then useful. A very important example of this occurs when the article gets to the LISP section and mentions "McCarthy". The first time the name is reference it is done without any context who McCarthy is or why one should care what he has to say. I could add "Donges" says to various articles and the rightful response would be "Who is Donges? Why do I care what he has to say. Now it may be that McCarthy is a well known expert in some field. That material still needs to be there to suddenly start referencing him as this is an Encylopedia article not a 1specialty manual. By way of a parallel example, I would not include a statement in an article about the C program attributed to [[Dennis Ritchie|Ritchie]] without at least at first indication of whom he was. To read at present an individual without computer background reading the article may think that McCarthy refers to former U.S. [[Joseph McCarthy|Senator Joseph McCarthy]] and honestly I do not really care what suprises Senator McCarthy about LISP. <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/98.237.41.200|98.237.41.200]] ([[User talk:98.237.41.200|talk]]) 07:31, 27 November 2011 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
<references />
== Merger proposal ==
Although I prodded [[Self-interpreter]] as OR, [[User:Loadmaster|Loadmaster]] suggests merging it here (which IMO is an acceptable alternate to deletion). Thoughts? All the best, [[User:Miniapolis|'''''<span style="color:navy">Mini</span>''''']][[User_talk:Miniapolis|'''''<span style="color:#8B4513">apolis</span>''''']] 00:23, 25 February 2014 (UTC)
== Dead link in one of the reference ==
In notes and references, the 7th reference, "Terence Parr, Johannes Luber, The Difference Between Compilers and Interpreters" no longer works. It results 404 error. <!-- Template:Unsigned IP --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/36.72.217.31|36.72.217.31]] ([[User talk:36.72.217.31#top|talk]]) 13:24, 7 November 2019 (UTC)</small> <!--Autosigned by SineBot-->
== Not satisfied with first sentence ==
The first sentence makes it sound as if the CPU is executing instructions that haven't been compiled into machine language, and that's impossible. The CPU is only executing the interpreter. The interpreter process, running in the CPU, reads and maps the code to compiled routines within the interpreter, thus calling/executing machine code. The script or code here acts like data, and just triggers the execution of compiled code. [[Special:Contributions/2A00:23C4:B49E:CB01:605C:7BC9:D409:E883|2A00:23C4:B49E:CB01:605C:7BC9:D409:E883]] ([[User talk:2A00:23C4:B49E:CB01:605C:7BC9:D409:E883|talk]]) 17:34, 14 November 2023 (UTC)
:First, you should include text rather than saying something like "the first sentence" bc the first sentence changes over time. That said, I think whatever you were talking about is no longer the case. [[User:Stevebroshar|Stevebroshar]] ([[User talk:Stevebroshar|talk]]) 12:12, 9 August 2025 (UTC)
==Wiki Education assignment: Linguistics in the Digital Age==
{{dashboard.wikiedu.org assignment | course = Wikipedia:Wiki_Ed/University_of_Arizona/Linguistics_in_the_Digital_Age_(Spring_2024) | assignments = [[User:Kamrynley|Kamrynley]] | start_date = 2024-01-15 | end_date = 2024-05-08 }}
<span class="wikied-assignment" style="font-size:85%;">— Assignment last updated by [[User:Kamrynley|Kamrynley]] ([[User talk:Kamrynley|talk]]) 17:04, 20 February 2024 (UTC)</span>
== Hardware interpreter ==
This article is all about software interpreter, but... you can build an interpreter in hardware. In fact, a CPU is a hardware interpreter! But, we don't think of a CPU as interpreter. We generally think of 'interpreter' as meaning software. None-the-less, I'd say the current article name [[Interpreter (computing)]] does not match the content. Either the article should mention hardware interpreter or should be renamed to [[Interpreter (software)]]. [[User:Stevebroshar|Stevebroshar]] ([[User talk:Stevebroshar|talk]]) 14:02, 11 August 2025 (UTC)
|