6
голосов
4ответов
946 просмотров

How is (==) defined in Haskell?

I'm writing a small functional programming language in Haskell, but I can't find a definition of how (==) is implemented, as this seems to be quite tricky?

0
голосов
2ответов
696 просмотров

Issue with recursion writing a tiny parser in Haskell. Check variables

I'm still working on a tiny parser for a tiny language defined in a task at school. The parser that generates an AST(Abstract syntax tree) is working. What I want is to check the defined variables, they must be bounded by the let expression. First the method that is defined in the task(suggestion...

14
голосов
5ответов
25399 просмотров

exit from ipython

I like IPython a lot for working with the python interpreter. However, I continually find myself typing exit to exit, and get prompted "Type exit() to exit." I know I can type Ctrl-D to exit, but is there a way I can type exit without parentheses and get IPython to exit? Update: Thanks to nos...

2
голосов
5ответов
1517 просмотров

Examples of interpreters embedded in iPhone Applications?

I'm trying to find examples of interpreted languages ported to the iPhone, with source code available to show how to embed it, without Jailbreaking the device: I've found: Ruby: http://www.cocos2d-iphone.org/forum/topic/1163 Lua: http://www.mobileorchard.com/announcing-iphone-wax-native-uikit...

8
голосов
11ответов
3062 просмотров

What is the shortest way to write parser for my language?

PS.Where to read about parsing theory?

15
голосов
10ответов
6843 просмотров

Learning how programming languages work

I've been programming for years (mainly Python), but I don't understand what happens behind the scenes when I compile or execute my code. In the vein of a question I asked earlier about operating systems, I am looking for a gentle introduction to programming language engineering. I want to be ab...

23
голосов
3ответов
36128 просмотров

How can I implement my own basic unix shell in C?

I'm a newbie to process and thread management. My Shell should understand PATH environment variable. It can be set and modified. It runs in two ways -interactive & batch mode. Shell is capable of taking more than one job like ls;ps;wc file;cal. I want to get my hands dirty on signals too. So ...

2
голосов
1ответов
714 просмотров

Function Table in Scheme using Association List

I am attempting to build a rudimentary interpreter in Scheme, and I want to use an association list to map to arithmetic functions. This is what i have so far: ; A data type defining an abstract binary operation (define binoptable '(("+" . (+ x y))) ("-" . (- x y)) ("*" . (* x y)) ...

18
голосов
2ответов
72850 просмотров

In Python interpreter, return without " ' "

In Python, how do you return a variable like: function(x): return x Without the 'x' (') being around the x?

18
голосов
4ответов
4742 просмотров

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?

5
голосов
13ответов
1278 просмотров

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 ...

90
голосов
15ответов
13925 просмотров

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 eng...

2
голосов
7ответов
638 просмотров

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...

6
голосов
2ответов
933 просмотров

Interpreting and/or receiving dotNet code at run-time

Html can contain little bits of Javascript embedded in it (e.g. defined in onclick event handlers). If I were writing an Html browser using a dotNet language like C#, what technologies or APIs could I use to run such Javascript fragments, given that I don't receive it until run-time (and receiv...

1
голосов
3ответов
1460 просмотров

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 ...

6
голосов
7ответов
4488 просмотров

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 Interprete...

32
голосов
6ответов
31681 просмотров

/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 before—in fact, this is the first time that I can remember getting an error when tryi...

19
голосов
4ответов
7747 просмотров

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)

4
голосов
7ответов
1732 просмотров

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 per...

3
голосов
3ответов
266 просмотров

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...

9
голосов
5ответов
837 просмотров

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 tech...

3
голосов
2ответов
648 просмотров

Functional programming and equation solvers

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 writi...

28
голосов
10ответов
3826 просмотров

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 in...

6
голосов
7ответов
1516 просмотров

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.)

0
голосов
3ответов
347 просмотров

Read Something After a Word in C++

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 ...

7
голосов
6ответов
4700 просмотров

C++ interpreter / console / snippet compiler

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...

14
голосов
5ответов
12725 просмотров

Persistent Python Command-Line History

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 p...

2
голосов
7ответов
774 просмотров

Interpret text input as PHP

I want to let users test out a PHP class of mine, that among other things crops and resizes images. I want them to write PHP code in a text field, send the form, and then their code will be run. How can I do this? Or is it other safe ways to let users (anyone) demo a PHP class?

1
голосов
1ответов
205 просмотров

The Interpreter used by django application

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. Bu...

6
голосов
2ответов
3232 просмотров

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 whethe...