interpreter

Difference between "inspect" and "interactive" command line flags in Python

What is the difference between "inspect" and "interactive" flags? The sys.flags function prints both of them. How can they both have "-i" flag according to the documentation of sys.flags? How can I set them separately? If I use "python -i", both of them will be set to 1. Related: tell whether python is in -i mode ...

The Interpreter used by django application

Hi, I have hosted my django application with apache and mod_python. When i was going through the mod_python documentation, I found that there is a way to know under which interpreter my application is running (By using req.interpreter). I tried to check that in django, by checking request object. But I couldn't figure out(request.inter...

Persistant Python Command-Line History

Hello, I'd like to be able to "up-arrow" to commands that I input in a previous Python interpreter. I have found the readline module which offers functions like: read_history_file, write_history_file, and set_startup_hook. I'm not quite savvy enough to put this into practice though, so could someone please help? My thoughts on the so...

C++ interpreter / console / snippet compiler

Hi, I am looking for a program where I can enter a C++ code snippet in one window, press a button, and get output in another window. Compilation should somehow be hidden behind the button. On a per-snippet basis would be fine, full interactive probably asking too much. It should run under Linux/Unix. Main use case would be learning/tes...

Read Something After a Word in C++

Hello, I'm building a simple interpreter of a language that i'm developing, but how i can do a cout of something that is after a word and in rounded by "", like this: #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main( int argc, char* argv[] ) { if(argc != 2) { cout << "Err...

What real programming languages are easy to write interpreters for?

What real programming languages are easy to write interpreters for? "Real" languages for me, are languages you can actually write a small project with, not one of the easy Esoteric programming languages. (I'm asking because I want to do some hobby project.) ...

Can a compiled language be homoiconic?

By definition the word homoiconic means: Same representation of code and data In LISP this means that you could have a quoted list and evaluate it, so (car list) would be the function and (cdr list) the arguments. This can either happen at compile- or at run-time, however it requires an interpreter. Is it possible that compiled l...

Language w/ the smallest interpreter written in itself

What is the smallest (code-golf) interpreter that is written in the language it interprets. I think overall this would be a good indicator as to the balance of how robust a language is. Extremely simple (turing tarpits) languages are difficult to write large programs like interpreters in. More 'sugary' languages are simpler to write i...

Functional programming and equation solvers

Hi all, Just as a personal experiment, in order to try to learn better about programming and formal language theory and the like, I'm trying to write a language that basically takes in a bunch of equations and solves for unknowns more or less automatically or heuristically. I'm trying to do this by writing an interpreter in C. All that...

Can Perl be "statically" parsed?

An article called "Perl cannot be parsed, a formal proof" is doing the rounds. So, does Perl decide the meaning of its parsed code at "run-time" or "compile-time"? In some discussions I've read, I get the impression the arguments stem from imprecise terminology, so please try to define your technical terms in your answer. I have deliber...

Java; Runtime Interpretation; Strategies To Add Plugins

I'm beginning to start on my first large project. It will be a program very similar to Rosetta Stone. It will be a program, used for learning a foreign language, written in Java using Swing. In my program I plan on the user being able to select downloaded courses to learn from. I will be able to create an English course since I am a ...

Writing Interpreters in Python. Is isinstance considered harmful?

I'm porting over the interpreter for a domain specific language I created from Scala to Python. In the process I tried to find a way that way pythonic to emulate the case class feature of Scala that I used extensively. In the end I resorted to using isinstance, but was left feeling that I was perhaps missing something. Articles such as ...

can we implement a java interpreter in hardware that executes Java bytecodes natively?

if we implement java interpreter in hardware then how we can achieve architecture neutrality of java bytecode... does java uses JIT(just in time interpreter) ? and how all this is related to Virtual Machine concept of operating system and java virtual machine(JVM) ...

/usr/bin/perl: bad interpreter: Text file busy

This is a new one for me: What does this error indicate? /usr/bin/perl: bad interpreter: Text file busy There were a couple of disk-intensive processes running at the time, but I've never seen that message beforein fact, this is the first time that I can remember getting an error when trying to run a Perl script. After a few secon...

Forth Interpreter in Java

Here I found a Simple Forth Interpreter implemented in Java. However I don't understand the significance of it if I want to use it? What could be the advantage of the Forth Interpreter: If the final compiled code to be executed by the JVM is still "Byte code" what would we the Forth Interpreter be doing? Will it help in writing effici...

how to use Tcl's (interp) bgerror

I'm trying to run tclhttpd in a slave interpreter but slightly modified so as to run within a tclkit. The code below "runs" (I can hit http://localhost:8015) but never reaches the puts line at the bottom because "the server does not return, it enters [vwait forever]". But when I try "the after 0 trick", e.g. prepending "after 0 " to th...

Which ingame scripting language should I support?

The ingame script will control NPC/AI logic. If I were to implement ingame scripting feature which language should it support? JavaScript (builtin browser support) TCL (interpreter in java) Lua (popular) Squirrel CSI Other Keep in mind my implementation will run on multiple platforms like .net, flash, javascript and java. What...

Write a Haskell interpreter in Haskell

A classic programming exercise is to write a Lisp/Scheme interpreter in Lisp/Scheme. The power of the full language can be leveraged to produce an interpreter for a subset of the language. Is there a similar exercise for Haskell? I'd like to implement a subset of Haskell using Haskell as the engine. Of course it can be done, but are the...

What language can a junior programmer implement an interpreter for it?

My college is going to start soon, but I want to do something in the remaining weeks :) I've taken a course last semester about programming languages and I want to bring my knowledge into reality. What simple, elegant language can a junior programmer implement an interpreter for? I don't mind if the language is very small or experimen...

What is the exact definition of a Metacircular Interpreter?

Is it legal to call a C compiler written in C or a PHP interpreter written in PHP metacircular? Is this definition valid only for languages of a specific type, like Lisp? In short, what are the conditions that an interpreter should satisfy for being called Metacircular? ...