Questions involving the design and structure of programming languages.

learn more… | top users | synonyms

1
vote
2answers
190 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 ...
1
vote
3answers
320 views

Programming language features that help to catch bugs early [closed]

Do you know any programming language features that help to detect bugs early in the software development process - ideally at compile-time or else as early as possible at run-time? Examples of ...
2
votes
2answers
218 views

Which numeral systems are useful in computer science?

I am wondering which numeral system different programmers are using, or would use if their language has support for them. As an example, in C++ we can use: Octal by prefixing with 0 (e.g. 0377) ...
43
votes
5answers
5k views

Why do old programming languages continue to be revised?

This question is not, "Why do people still use old programming languages?" I understand that quite well. In fact the two programming languages I know best are C and Scheme, both of which date back to ...
4
votes
1answer
384 views

Why Does F# Contain Both Modules and Namespaces?

I've been assuming that F# includes the module keyword in addition to the namespace keyword due to backwards compatibility with OCaml. Is this the only reason for the inclusion of the module keyword ...
3
votes
2answers
558 views

Simplifying C++11 optimal parameter passing when a copy is needed

It seems to me that in C++11 lots of attention was made to simplify returning values from functions and methods, i.e.: with move semantics it's possible to simply return heavy-to-copy but ...
4
votes
1answer
694 views

Why doesn't Java's BigInteger class have a constructor capable of taking a numeric literal? [closed]

Why doesn't Java's BigInteger class have a constructor capable of taking a numeric literal? Every single time I use BigIntegers, and many times I merely think about them, I wonder this. What reason ...
7
votes
5answers
969 views

Language Design: Are languages like Python and CoffeeScript really more comprehensible?

The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested ...
2
votes
4answers
527 views

Are programming languages pretty much “stable” for now? [closed]

Recently i have looked at the "timeline" of Programming Languages and while a lot has changed in the past 5-10 years, there are a lot of languages that have pretty much "stayed" the same in their ...
18
votes
3answers
773 views

Why is the rec keyword needed in F#?

In F# it is necessary to use the rec keyword. In Haskell there is no need to explicitly tell if a given function is recursive or not. Given the role of recursion in functional programming, the F# ...
4
votes
3answers
719 views

Is it easier to write robust code in compiled, strictly-typed languages? [closed]

I'd like to read the opinion of experts on whether compiled, strictly-typed languages help programmers write robust code easier, having their backs, checking for type mismatches, and in general, ...
6
votes
3answers
333 views

Use cases for “private” interfaces?

I was wondering if there was a valid use case for being able to properly define the specific internal properties and functions of a class in a way similar to how an interface defines the public ...
6
votes
2answers
821 views

I want to create a new language [duplicate]

Possible Duplicate: How do I create my own programming language and a compiler for it I want to create a new general purpose language that will compile to JavaScript and I'd like to be able ...
14
votes
3answers
2k views

Why null pointer instead of class cast?

In Java: int count = (Integer) null; throws a java.lang.NullPointerException. Why doesn't this throw a Class Cast Exception for ease in programmer understanding? Why was this exception chosen ...
37
votes
14answers
10k views

How have languages influenced CPU design?

We are often told that the hardware doesn't care what language a program is written in as it only sees the compiled binary code, however this is not the whole truth. For example, consider the humble ...
2
votes
3answers
349 views

Why are the arguments for substring functions mismatched?

In many languages, the substring function works like this: substring(startIndex, endIndex) returns the substring from startIndex until endIndex-1 (if you view startIndex and endIndex as 0-based) / ...
4
votes
2answers
887 views

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

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 ...
10
votes
8answers
1k views

Why aren't design patterns added to the languages constructs?

Recently I was talking with a colleague who mentioned that his company was working on adding the MVC design pattern as a PHP extension. He explained that they wrote C code for adding Controllers, ...
2
votes
4answers
501 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 ...
2
votes
3answers
251 views

Implementing `let` without using a macro

I'm learning Lisp, and I've just gotten to let, which I don't quite understand (the implementation of). A common definition for it is given in terms of lambda as a macro. However, nowhere have I ...
24
votes
7answers
2k views

Why are so many languages passed by value?

Even languages where you have explicit pointer manipulation like C it's always passed by value (you can pass them by reference but that's not the default behavior). What is the benefit of this, why ...
9
votes
5answers
2k views

Benefits of classic OOP over Go-like language

I've been thinking a lot about language design and what elements would be necessary for an "ideal" programming language, and studying Google's Go has led me to question a lot of otherwise common ...
14
votes
8answers
3k views

Why is x=x++ undefined?

It's undefined because the it modifies x twice between sequence points. The standard says it's undefined, therefore it's undefined. That much I know. But why? My understanding is that forbidding ...
1
vote
2answers
159 views

What are/would be the characterists and applications of a programming paradigm where functions can't have statements?

Suppose there is a language where, instead of statements, functions could only be defined in relation to other functions and operators such as partial application and composition. What would be the ...
6
votes
3answers
389 views

Is there a language where collections can be used as objects without altering the behavior?

Is there a language where collections can be used as objects without altering the behavior? As an example, first, imagine those functions work: function capitalize(str) //suppose this ...
8
votes
3answers
1k views

Why do .NET modules separate module file names from namespaces?

In implementations of the Scheme programming language (R6RS standard) I can import a module as follows: (import (abc def xyz)) The system will try to look for a file $DIR/abc/def/xyz.sls where $DIR ...
5
votes
1answer
153 views

Pythonesque global variable assignment

I'm designing a language with Pythonesque syntax, including casual creation of variables by assignment. I'm wondering at the moment exactly how to deal with assignment to global variables (and ...
13
votes
5answers
11k views

Why is Python slower than Java but faster than PHP [closed]

I have many times seen various benchmarks that show how a bunch of languages perform on a given task. Always these benchmarks reveal that Python is slower then Java and faster than PHP. And I wonder ...
5
votes
6answers
844 views

why are both index[array] and array[index] valid in C?

For example consider: int index = 3; int array[4] = {0, 1, 2, 3}; then both index[array] and array[index] are valid expressions, much like *(index + array) and *(array + index). In C arrays why is ...
7
votes
2answers
521 views

Programming languages, positional languages and natural languages

Some programming languages are modeled on machine code, like assembly languages. Other languages are modeled on a natural language, the English language. Others are not modeled on either machine code ...
4
votes
1answer
196 views

Querying types in a co- or contravariant way

I posted a c# feature request here; however, I do not get a lot of attention there. Therefore I am asking you here, what you think of it. The in and out keywords in generic type declarations are ...
11
votes
3answers
2k views

Appropriate programming language to design music software

I want to design a software for my musical instrument which is a rhythmic one (there is no melody). All I want these software to do is : make the user able to compose music play what user has ...
36
votes
21answers
2k views

Has whitespace in identifiers ever been idiomatic?

C# style suggests using CamelCase in identifiers to delimit words. Lisp tradition suggests using-dashes-instead. Has there ever existed a programming language where using spaces in identifiers was ...
0
votes
2answers
411 views

Procedure or Event Driven Language For Education [closed]

I am here to ask a question that has been asked many times before. What programming language should I learn to become a intelligent conceptual programmer? Many people agree, you do not have to ...
3
votes
3answers
230 views

Eliminating tab characters in a new language

I'm working on a new programming language, which determines structure with indentation instead of braces in the manner of Python and CoffeeScript. Obviously placing lines indented with spaces next to ...
0
votes
3answers
362 views

Why do different languages use different Code Line Delimiters? [duplicate]

Possible Duplicate: Why are statements in many programming languages terminated by semicolons? I just found out that R Programming Language, which is somewhat belong to the C family (I'm ...
62
votes
8answers
14k views

How were some language communities (eg, Ruby and Python) able to prevent fragmentation while others (eg, Lisp or ML) were not?

The term "Lisp" (or "Lisp-like") is an umbrella for lots of different languages, such as Common Lisp, Scheme, and Arc. There is similar fragmentation in other language communities, like in ML. ...
0
votes
3answers
237 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 ...
5
votes
5answers
2k views

False friends? Keyword “static” in C compared to C++, C# and Java

To me, the use of the keyword static in C and languages like C# and Java are "false friends" like "to become" in English and "bekommen" in German (= "to get" in English), because they mean different ...
4
votes
2answers
216 views

Good resources for language design

There are lots of books about good web design, UI design, etc. With the advent of Xtext, it's very simple to write your own language. What are good books and resources about language design? I'm not ...
11
votes
7answers
709 views

Are operators clearer to read than keywords or functions? [closed]

It's a bit subjective, but I'm hoping to get a clearer understanding of what factors make an operator clear to use vs obtuse and difficult. I've been considering language designs recently, and one ...
12
votes
4answers
1k views

What did Ruby do right (or was it Rails)? [closed]

Most programming languages have some design decisions that influence their usage and applicability. For example: Python focused on maintainability/readability of code and had indentation be a part ...
3
votes
1answer
377 views

Giving variables default values vs. treating accessing an undefined variable as an error

Having messed around with several scripting languages and being a bit of a linguist, there seems to be a way to divide dynamically typed languages into two groups: languages that give variables a ...
7
votes
6answers
881 views

Please explain the benefit(s) of using an XML-based syntax (e.g. XAML) instead of normal source code (e.g. WinForms)?

First off, please note that this question is not about WPF vs. WinForms. What are the highest-ranking benefits that led Microsoft to invent XAML in favour of the “old” approach of generating ...
15
votes
2answers
2k views

In hindsight, is basing XAML on XML a mistake or a good approach?

XAML is essentially a subset of XML. One of the main benefits of basing XAML on XML is said to be that it can be parsed with existing tools. And it can, to a large degree, although the (syntactically ...
14
votes
8answers
2k views

Why is C++ still “hybrid”

On a related question, it has been clarified why C++ is not compatible with C in many aspects. However C++ is still a "hybrid"* language. And unfortunately, many programmers still consider C++ as a "C ...
10
votes
7answers
382 views

What is a good alternative to the name variable for a language that only has immutable references or labels?

For example, in functional languages, variables are single assignment and their values are immutable once assigned. So they have two states unbound and bound, once bound they can't be changed. Is ...
3
votes
6answers
349 views

Would the concept of source code layers be of any use?

I'm talking about something like layers in photoshop, except they apply directly to the source code. For example, in pseudo-code... inventing what some project might look like - say a computational ...
9
votes
2answers
351 views

Developing a dynamic language

I have created several hand written compilers for very simple languages but now I want to try my hand at developing a dynamic language, similar to a simplified Python or Ruby. However, it was easy ...
11
votes
10answers
2k views

Greenspun's Tenth Rule, does every large project include a Lisp interpreter? [closed]

Greenspun's tenth rule (actually the only rule) states that: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of ...