Talk:Interpreter (computing)
![]() | Computing Unassessed | |||||||||
|
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? Truetyper 03:40, 18 May 2007 (UTC)
- Done. (I had the same problem with it.) -- algocu 15:03, 23 May 2007 (UTC)
should this be at Interpreter (computing), to match with the many other computer-related entries? Catherine, your friendly neighborhood not-quite-that-computer-literate disambiguator
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. CGS 11:40, 24 Aug 2003 (UTC).
- A lot of the mathematical pages contain definitions which are too long and technical for the average readers and don't really convey anything to them either, but that's not a reason for removing them, so it shouldn't be a reason for removing this code. Remember that "average" covers a range and therefore some average readers will be able to understand the code just as some average readers will be able to understand the mathematical pages.
- In any case 93 lines (including blank ones) isn't particularly long for a minimal interpreter. And in my opinion, including an example of an interpreter conveys the idea that interpreters can be short, simple programs like any other and can be written in any language, even one as "nasty" as BASIC. The "nasty language" thing is a matter of opinion, of course. All programming languages are nasty to the average reader, after all. This particular nasty language is at least a widespread one.
- If you want to replace the example code by a shorter, more comprehensible equivalent written in your own favourite nasty language, feel free but don't just delete the existing code without producing some replacement. When it comes to technical articles, examples are goood for the average reader. -- Derek Ross 16:42, 24 Aug 2003 (UTC)
Second vote for removal/replacement. The source code for an interpreter is not an interpreter, and while BASIC is (err) basic, it is still technical, I wouldn't consider it readable by your "average" joe.
I would suggest a better example would be illustrate what an interpreter does rather than how an interpreter is implemented. For this it is ok to use BASIC as a sample interpreter, but more along the lines of (excuse my BASIC - very rusty 8-)
Source file to be interpreted | Output from BASIC interpreter |
---|---|
FOR i = 1 TO 3 PRINT i; " is a number" NEXT i | 1 is a number 2 is a number 3 is a number |
If necessary, this example (or similar) could be beefed up by describing the action of the interpreter as it processes the source file, maybe in contrast to a compiled (object) version of the same code.
I would also remove the corresponding section from Literate programming. The example given is not literate programming. Maybe a simple example from a 20-line Java class? -- AndrewKepert 04:32, 25 Aug 2003 (UTC)
The example is nasty, weird, and has little to do with Literate programming, do as discussed. -- Anon reader
Well don't just whine about it. It's supposed to be a minimal piece of code, not a thing of beauty. If you don't like it, fix it. This is a wiki after all. -- Derek Ross | Talk
Lisp is an "interpreter". The basic definition is quite elegant, written in Lisp, and about half a page in length. How about using it? --AJim 05:30, 15 Dec 2004 (UTC)
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. -- Derek Ross | Talk 06:01, 2004 Dec 15 (UTC)
Why is an interpreter defined as a computer program?
I always thought that the primary example of an interpreter was a computer processor - reading machine language and interpreting it. Machine language is always in the imperative tense - do this, next do that, next... In my mind, an interpreter is something that does what the language says to do, as opposed to a translator, whose purpose is to convert the (imperative) meaning into another form that is, most commonly, easier to interpret. Many "machine languages", in fact, are interpreted by another machine, running "microcode", and so they have a quite formal equality with other interpreted languages. So, I would like to take "computer program" out of the definition. AJim 01:12, 25 Jun 2004 (UTC)
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. -- Derek Ross | Talk 02:04, 2004 Jun 25 (UTC)
JIT
I'm not convinced of JIT being "several decades" old, at least with regard to Smalltalk. "several decades" presumably is at least two. I'm pretty sure that in December of 1984, Smalltalk did not do any JIT. The bytecodes were strictly interpreted in all Smalltalk implementations of that day of which I've heard. I'm not sure if or when JIT was introduced in the Smalltalk world, but it seems unlikely that it would have been deployed before the 1990s (or very late 1980s). --Brouhaha 18:51, 1 Dec 2004 (UTC)
I'm currently doing my thesis at an OO programming language engineering lab at my university, I'll talk to some people and ask about it.--wlievens
- Incremental compilation (pretty much the same thing as JIT) was used in Maclisp in the '70s. --FOo (talk) 20:56, 5 October 2008 (UTC)
The Example
Wouldn't a scaled-down version of the Scheme meta-circular interpreter from SICP be more interesting as an example? Wouter Lievens 09:10, 24 Apr 2005 (UTC)
... or the Lispkit Lisp meta-circular interpreter from Functional Programming: Application and Implementation which also contains a Lispkit meta-circular compiler. Yes, either of these would be more interesting but it is more important for the example to be easy to understand than for it to be interesting. Recursively specified interpreters may be interesting but they are not so easy to understand. -- Derek Ross | Talk 13:14, Apr 24, 2005 (UTC)
- I myself find recursion a lot more readable than loops, but I guess that doesn't necessarily count for people who haven't been taught Scheme :-) Wouter Lievens 11:48, 20 March 2006 (UTC)
Attribution
The beginning of this article is copied from the FOLDOC entry of the same name. Is there some policy on attribution? If not, there should be. --BK 207.96.29.129 12:37, 8 September 2005 (UTC)
- Where we use FOLDOC material we generally attribute it. I'm not sure why that hasn't been done in this article but it should have been. -- Derek Ross | Talk 14:09, 8 September 2005 (UTC)
- I've assumed that the above claim is true and added the attribution and the cat.
Bytecode interpreter
"...the source language is compiled into "F code" (a bytecode) which is then interpreted by an architecture-independent virtual machine." Shouldn't it say "architecture-dependent"? The bytecode is architecture-independent, the interpreter must be architecture-dependent... --Arny 21:08, 16 November 2006 (UTC)
- Why? Interpreters can be run in interpreters. --Gwern (contribs) 21:17 16 November 2006 (GMT) 21:17, 16 November 2006 (UTC)
- They CAN be, but the way the sentence is worded now, it says that all virtual machines are architecture-independent. That is obviously not true. I suggest that you just drop the qualifier and say "... which is then interpreted by a virtual machine." 66.32.88.47 21:23, 13 August 2007 (UTC)
- Right, since nobody seems to object, I'm going to change it. 66.32.15.77 00:28, 17 August 2007 (UTC)
Evaluate
This has nothing to do with Evaluate yet theres a redirect! Jamhaw 20:04, 31 January 2007 (UTC)jamhaw
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. —Preceding unsigned comment added by 75.33.235.210 (talk) 17:17, 24 December 2008 (UTC)