language-theory

Learning Resources on Parsers, Interpreters, and Compilers

I've been wanting to play around with writing my own language for a while now (ostensibly for the learning experience) and as such need to be relatively grounded in the construction of Parsers, Interpreters, and Compilers. So: Does anyone know of any good resources on constructing Parsers, Interpreters, and Compilers? EDIT: I'm not l...

What is the general complexity of building a canonical language representation?

It is often handy to have a canonical representation of a language (in my case they are usually domain specific languages); however, I believe there are strict limits on the expressiveness of the languages involved that determine whether a canonical form can be determined and/or created for an arbitrary program in that language. Unfortu...

Computer Science for the elderly

I learned C++ when it was C with classes. I find myself increasingly disliking new technologies like XML and Garbage collection. On the other hand, I have discovered scripting languages like Lua and Python. And I find myself rather liking a hybrid environment of C++, with deterministic memory control, with an embedded script language, wi...

What is the exact problem with multiple inheritance?

I can see people asking all the time whether multiple inheritance should be included into the next version of C# or Java. C++ folks, who are fortunate enough to have this ability, say that this is like giving someone a rope to eventually hang themselves. What’s the matter with multiple inheritance? Are there any concrete samples? ...

The while language

For my theory of computing languages class, we got a homework assignment to implement a piece of code in a language that only has while statements for flow control (no if statements). This is mainly to prove that you can write a Turing-complete language with only a while loop. For those of you who can understand language grammars, here...

often used seldom defined terms: lvalue

What is an lvalue? ...

Why in C# does order matter for static initialization?

This code has the well defined behavior in C# of not working: class Foo { static List<int> to = new List<int>( from ); // from is still null static IEnumerable<int> from = Something(); } Note: I'm not asking how to fix that code as I already known how to do that What is the justification for this? C# already does run time che...

Can a language be turing complete but incomplete in other ways?

For example, are there certain things when writing an operating system that cannot be accomplished in a turing complete language? ...

What is the best book for Programming Language Theory?

What is a good book that covers the topics of grammars (context-free and context-sensitive) and their notations (EBNF, BNF, etc), syntax, type and programming language theory, etc? I'm not really digging the textbook we used at my school for our "Programming Languages" class and I'm looking to supplement some of the topics we covered wi...

What is the advantage of having this/self pointer mandatory explicit?

What is the advantage of having this/self/me pointer mandatory explicit? According to OOP theory a method is supposed to operate mainly (only?) on member variables and method's arguments. Following this, it should be easier to refer to member variables than to external (from the object's side of view) variables... Explicit this makes it...

How do I design the transition functions for this pushdown automaton?

I'm studying for a test on PDA, and I want to know how to design a pushdown automaton that recognizes the following language: L = {a^max(0,n-m)b^n a^m| n,m >=0} How can I design a transition function to recognize if n-m is greater than 0? And please, if you have some course materials with exercises of this level solved, put a link, m...

Language Evaluation question: Eager Vs. Lazy

I was reading Shriram's PLAI and this I got stuck in these questions: Can you prove that the eager and lazy regimes will always produce the same answer? (Shriram asks to look at the language he developed but is there another way to prove this and how?) Will eager evaluation always reduce with fewer steps? Here is the Code of Substitu...

Textual Protocol which is not a regular language ?

Hi, The usual way to represent way the grammar associated with a textual network protocol is using ABNF. Just like any EBNF-related meta-syntax, ABNF enables to describe context-free grammars. These context-free grammars can represent a non-regular language, right ? The usual way to implement a network stack is developing a state ma...

Is computing theory useful for programmers?

Can learning subjects such as abstract machines and formal languages make you a better programmer? ...

Besides Logo and Emacs Lisp, what are other pure dynamically scoped languages?

What are some examples of a dynamically scoped language? And what are the reasons for choosing that design? Is it because it is easy to implement? ...

what exactly is a "register machine" ?

From http://code.google.com/p/unladen-swallow/wiki/ProjectPlan I quote: "Using a JIT will also allow us to move Python from a stack-based machine to a register machine, which has been shown to improve performance in other similar languages (Ierusalimschy et al, 2005; Shi et al, 2005)." In college I built a simple compiler for a languag...

Good information about type systems based on contracts/constraints?

Hello! Problem: I am looking for good introduction about type systems, which are based on contracts/constraints (sorry, I don't remember which term one is appropriate for a type system). I need that information to be able to implement an experimental type system of such kind. As far as I know, such type system is used in XSD (Xml Sch...

Exactly what is the difference between a "closure" and a "block"?

I've found that lots of people use the words closure and block interchangeably. Most of these people can't explain what they're talking about. Some Java programmers (even ones from really expensive consultancies) talk about anonymous inner classes as "blocks" and "closures" - but I know this isn't true. (You can't pass mutable variables...

datatype programming

I know of "imperative" and "functional" programming but there was little I could find on "datatype" programming. Is there such a thing and how is it related to the other paradigms? ...

Can all iterative algorithms be expressed recursively?

If not, is there a good counter example that shows an iterative algorithm for which there exists no recursive counterpart? If it is the case that all iterative algorithms can be expressed recursively, are there cases in which this is more difficult to do? Also, what role does the programming language play in all this? I can imagine tha...