The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
73 views

Enumerated types and their interpretation by compilers

It seems to me that a lot, if not most, compilers treat enumerated types as int underneath. In C/gcc, enums are compiled to int. In C#/Visual C#, you can change the underlying data type with something ...
62
votes
10answers
9k views

Why was the first compiler written before the first interpreter?

The first compiler was written by Grace Hopper in 1952 while the Lisp interpreter was written in 1958 by John McCarthy's student Steve Russell. Writing a compiler seems like a much harder problem than ...
1
vote
4answers
162 views

Can every language be compiled? And can every language be interpreted? [duplicate]

I was wondering whether every interpreted language can be compiled? And can every compiled language be interpreted?
1
vote
2answers
826 views

Why isn't there a python compiler to native machine code?

As I understand, the cause of the speed difference between compiled languages and python is, that the first compiles code all way to the native machine's code, whereas python compiles to python ...
1
vote
2answers
148 views

Why does a bytecode VM use stack or registers opposed to direct operations? [duplicate]

I'm working on a simple bytecode interpreter to learn how virtual machines work. I've read about VMs and it seems that all of them are either stack based or register based. At the time it made sense, ...
6
votes
1answer
3k views
0
votes
1answer
208 views

Static typing vs. dynamic typing [closed]

I'm developing my own programming language in my spare time as a hobby. It's an interpreted language. Currently the syntax for variables is this: %<variable> = <value> Here are some ...
1
vote
2answers
163 views

Is a book that teaches how to build compilers good for learning to implement interpreters? [closed]

I'm looking for a book to learn how to implement interpreters for programming languages. Thing is there are much more 'compiler books' than 'interpreter books'. So my question is: can I read a book ...
20
votes
4answers
21k views

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language, since source code is compiled by an interpreter at the point of ...
0
votes
0answers
213 views

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes ...
-2
votes
2answers
256 views

Implementing a basic interpreter - should I learn regular expressions? [closed]

For fun and for practice, I'm thinking of maybe implementing a very basic programming language to run on a simple interpreter written in Java. My question is this: Is it a 'must' to know regular ...
16
votes
5answers
2k views

Why is studying an lisp interpreter in lisp so important?

I have seen many CS curriculums and learning suggestions for new programmers that call for the aspiring programmer to study a lisp interpreter that is specifically written in lisp. All these sites ...
0
votes
2answers
126 views

Implementing a first basic interpreter: what should I learn first? [duplicate]

I'm about to implement my own very simple programming language, and an interpreter to execute code in that language. The language will be very basic. Example code: var x = 3 if x > 2 print x if x ...
3
votes
3answers
298 views

When an interpreter executes code: Is there a “chain of interpretations” down to the lowest level?

After doing some research and with the help of people on this site, I finally came to an understanding of what interpretation actually is. Essentially, what interpretation means is (correct me if I'm ...
2
votes
6answers
1k views

Is Java Bytecode interpreted? [closed]

The definition of interpretation (correct me if I'm wrong) is parsing code like so: 1- Translate currently parsed line to some intermediate language. 2- Run the translated line. 3- Move to the next ...
1
vote
5answers
301 views

How to alter the code at runtime in an interpreter?

While reading the difference between Compiler and interpreter , I found the following differences fromt he internet. Advantages of using compiler: Since compiler converts the program to native code ...
-2
votes
3answers
135 views

Why don't interpreters interpret bytecode (like VMs) - instead of source code? [closed]

Edited the question to be more clear: It is known that interpreting bytecode is much faster than interpreting source code or some IL version of the source code. The interpreter has a much easier time ...
-2
votes
3answers
305 views

Are there programming languages that their programs don't run on a VM or natively, but rather on an interpreter? [closed]

In this question I presented an idea I have for a simple programming language. The way programs written in this language will be run, is inside an interpreter written in Java, which will interpret the ...
0
votes
3answers
113 views

Would this interpreter be considered a Virtual Machine? [closed]

(I reworded my question to make it more specific). Consider a programming language, that it's programs may only be run inside a specific program that serves as an interpreter. The interpreter scans ...
-1
votes
2answers
202 views

Regarding interpreters

I understand that an interpreter could do one of the following things (and probably more): Execute programming-language source code directly. First translate the source code to some intermediate ...
8
votes
3answers
203 views

How does BASIC locate an out-of-order NEXT statement when the loop body is skipped

Set the WABAC machine, Sherman. This question is about BASIC in general, and Microsoft's BASIC-80 in particular. Old school basic. With line numbers. How do (or, rather, did) old-school BASIC ...
3
votes
2answers
771 views

Are all scripting languages dynamically typed? [closed]

Are all scripting languages dynamically typed? I am using TCL. It is a scripting language and it does not enforce or allow type delaration of variables. It is instead a dynamically-typed language ...
2
votes
3answers
446 views

Interpreter or virtual machine that does not execute bytecode

The developers of the Dart language tell that there is a virtual machine that executes statements written in Dart language. What is the difference between an interpreter and a virtual machine that ...
6
votes
3answers
413 views

From an execution perspective is an interpreter the same as the JVM / or the .net Framework

I've recently started two introductory level courses - one using Python, the other Java. I've read the answers to this Question but still have difficulty understanding how each ends up with machine ...
0
votes
3answers
212 views

What process do typical (the majority) of high level language compilers use when changing a source-code's variable name to a machine code name?

Do long (very long) variable names slow down the compilation of source code? I'm aware that the length of variables has 0% impact on interpretation as the compiler changes them to machine code which ...
8
votes
2answers
454 views

What is the current state of SECD and SKI machine use and research? [closed]

I'm doing some independent research/study with a professor who's a very functional guy. The goal is to examine more of what's happening behind the scenes with functional languages than we normally ...
27
votes
10answers
3k views

Can compilers and interpreters have bugs, and what can we (as users) do to deal with them? [closed]

If a compiler's work is essentially translating source code into machine level code, can there be any glitch in a compiler, i.e. a faulty "translation?" The same goes for an interpreter: can it fail ...
2
votes
1answer
198 views

Representing floating-point numbers in bytecode

How do interpreted languages typically go about representing floating-point numbers in their bytecode? For example, suppose I've got a Java program with the line double a = 3.0; What does 3.0 look ...
3
votes
1answer
267 views

When writing an interpreter, how should the type inference algorithm change the parsed AST? Should it?

When writing an interpreter, how should the type inference algorithm chance the parsed AST? Should it? Or parsing and inference are done necessarily simultaneously? I have implemented a strongly ...
0
votes
2answers
238 views

Is it useful to use encapsulation in dynamic typed, interpreted programming language?

For what I know, encapsulation is useful because: if you use directly an attribute and change its type in a static typed language you have to change all the code that uses the class. On the ...
10
votes
3answers
615 views

How to implement lazy evaluation of if()

I am currently implementing an expression evaluator (single line expressions, like formulas) based on the following: the entered expression is tokenized to separate literal booleans, integers, ...
1
vote
2answers
212 views

Requiring multithreading/concurrency for implementation of scripting language

Here's the deal: I'm looking at designing my own scripting/interpreted language for fun. I'm only in the planning stages right now; I want to make sure I have a very strong hold on exactly how I will ...
-2
votes
2answers
336 views

Have javac call automatically run java [closed]

I want to be able to call javac <class file name>, and then automatically run java on the compiled .class file. I thought initially to use a x86 disassembler to hack it (javac.exe) but bumped ...
4
votes
2answers
1k views

Whats the difference between an interpreted language and one compiled to a VM? [duplicate]

It occurs to me that there's not a heck of a lot of difference between $>python module.py And: $>javac module.java $>java module.class The former compiles to an intermediate language ...
2
votes
4answers
585 views

how can python interpreter recognize code block

The most unusual aspect of Python is that whitespace is significant instead of block delimiters (braces → "{}" in the C family of languages), indentation is used to indicate where blocks begin and ...
0
votes
3answers
240 views

Making money from a custom built interpreter? [closed]

I have been making considerable progress lately on building an interpreter. I am building it from NASM assembly code (for the core engine) and C (cl.exe the Microsoft compiler for the parser). I ...
7
votes
4answers
647 views

Is there a performance benefit to using immutable objects in a scripting language?

As I understand it, writing your objects in an immutable style can help the performance of your program for compiled languages, as the compiler tends to rewrite your code in single static assignment ...
16
votes
5answers
4k views

Interpreted vs Compiled: A useful distinction?

A lot of questions get asked here about interpreted vs compiled language implements. I'm wondering whether the distinction actually makes any sense. (Actually the questions are usually about ...
7
votes
6answers
648 views

What is the industry definition of an interpreter (as opposed to a compiler)?

In my compiler design courses, I have learned about and worked with a clear academic definition of an interpreter and a compiler, with an interpreter being a program Pi from a language M capable ...
9
votes
5answers
556 views

Basic features for a basic language? DSL suggestions?

I've finally begun to understand the complexity behind creating an interpreter and a compiler. I've built several versions of TinyBasic, 1964 (Dartmouth) Basic, and my own expansions on those ...
7
votes
4answers
941 views

Understand scripting language

Quoted from Wikipedia: A scripting language, script language or extension language is a programming language that allows control of one or more applications and makes the compiler of the ...
6
votes
1answer
301 views

Why atoms/symbols?

Why do programming languages like Ruby use symbols? I understand that String manipulation is much slower than using a lookup table as well as the idea that Strings are reallocated in memory no matter ...
4
votes
2answers
571 views

What do you think of an interpreter written in Java? [closed]

I am currently working on the implementation of a new programming language, for fun. I realize that most languages never become popular, but I still want the language to have a high-quality ...
3
votes
4answers
181 views

Is it possible to build all features of functional language with only closure?

I'm trying to make a new functional language and it's interpreter for practice. As I know most basic building block is only a lambda function, and it's just a closure. I'm not understanding them well, ...
1
vote
1answer
333 views

Could you blend java and javascript? [closed]

As a developer who spends most of my time in either Java or Javascript these days, I have this fantasy about a language that blends the two of them together. I'm always missing something from one or ...