Questions involving the design and structure of programming languages.

learn more… | top users | synonyms

5
votes
6answers
914 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
546 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
199 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 ...
10
votes
3answers
3k views

Appropriate programming language to design music software [closed]

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 ...
37
votes
22answers
3k views

Has whitespace in identifiers ever been idiomatic? [closed]

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
466 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
243 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
401 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
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 ...
5
votes
5answers
3k 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
222 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
727 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
2k 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
422 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
985 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 ...
15
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
397 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
352 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
376 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 ...
10
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 ...
0
votes
6answers
1k views

Syntax for goto labels

In C, C++ and some dialects of BASIC, goto labels are declared with the syntax label:. I'm working on a language that uses name: type as the syntax for variable declarations, so I'd prefer if possible ...
6
votes
4answers
444 views

Backquoted symbols, good or bad?

I'm designing a programming language which has three kinds of quoted entities: strings and characters as in C, and symbols (interned strings intended for use as lookup keys and such) which I consider ...
12
votes
5answers
2k views

Is there a specific purpose for heterogeneous lists?

Coming from a C# and Java background, I'm used to my lists being homogeneous, and that makes sense to me. When I started picking up Lisp, I noticed that the lists can be heterogeneous. When I started ...
10
votes
4answers
682 views

Literate programming, good/bad design methodology

I have recently found the concept of literate programming. And I found it rather intriguing. Yet I have not been encountered with claims that it is a bad way to structure a program. It seems not ...
10
votes
7answers
2k views

What are the features required for Object Orientation?

I am just wondering, what exactly are the features a language or a library must provide in order for it to be defined as 'Object Oriented'. Is Object Orientation something that can, more or less, be ...
0
votes
4answers
564 views

Why doesn't the DART language use a special character to identify variables?

I come from a PHP background and I have been considering looking at DART in more detail. DART is an, open source, front-end/back-end, language for web development. PHP has a special $ (dollar) ...
2
votes
2answers
784 views

What is the reason behind the if syntax of CoffeeScript?

In most other languages the condition comes before the statement to be executed when the condition is met. However, in CoffeeScript (and maybe some other languages) the syntax is: number = -42 if ...
32
votes
2answers
6k views

Why is 'void' not allowed as a generic type in C#

What were the design decisions that argued in favour of void not being constructable and not being allowed as a generic type? After all it is just a special empty struct and would have avoided the ...
13
votes
2answers
2k views

Why does a Java source file bear the name of the public class it contains?

I am a newbie learning Java. In Java every source file must contain a public class and that source file should have the same name as that public class. Moreover, no source file can contain two public ...
5
votes
8answers
464 views

One-use variables - has any language ever had them?

A principle that I follow is that, when an identifier is established, it should be a signal to the reader that the value referred to is indeed an abstraction which will be used more than once. That ...
1
vote
3answers
386 views

Inc/dec vs +=/-=

I'm looking at a programming language design decision that's difficult to make precisely because there seems to be no objective basis for choosing one option over the other. The question is, given ...
26
votes
8answers
1k views

Why is there such limited support for Design by Contract in most modern programming languages?

I recently discovered Design by Contract (DbC) and I find it an extremely interesting way to write code. Among other things, it would seem to offer: Better documentation. Since the contract is the ...
9
votes
6answers
2k views

How to verify/prove orthogonality of a programming language?

I know the concept of orthogonality, but from a programming language point of view, is there a way to verify/prove it? For instance in C#, one can use public or static for a method signature. You can ...
5
votes
2answers
301 views

C++ users proposals

I believe I have some good suggestions to improve the C++ language. Who should I contact to discuss this? Do I have the chance to be heard, especially if I'm not a renowned expert?
0
votes
2answers
1k views

Are there any languages that have both high- and low-level facilities? [closed]

Are there any languages that have both high- and low-level facilities? If not, is it feasible to create one? Why or why not? In theory, it would be very helpful to have a programming language that ...
6
votes
3answers
790 views

Why is scanf called scanf? (Same for printf.)

I am just curious why in the C programming language the function to read formatted input was called "scanf" as opposed to "readf". I assume it is derived from an earlier language, so in that case why ...
3
votes
6answers
453 views

Is there a language that allows this syntax: add(elements)at(index); [duplicate]

Possible Duplicate: Is there a language out there in which parameters are placed inside method name? Does a language exist with such a syntax? If not, what are some of the ...
52
votes
12answers
5k views

Did the developers of Java consciously abandon RAII?

As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom: using (var ...
5
votes
2answers
2k views

Do any languages use =/= for the inequality operator?

Wikipedia says: Not equal The symbol used to denote inequation — when items are not equal — is a slashed equals sign "≠" (Unicode 2260). Most programming languages, limiting themselves ...
15
votes
1answer
362 views

Does Groovy follow Tennent's Correspondence Principle?

Here's an interesting discussion of Tennent's Correspondence Principle, and a brief description from Neal Gafter: The principle dictates that an expression or statement, when wrapped in a closure ...
13
votes
7answers
1k views

Why don't more languages support recursive/nested comments? [duplicate]

Possible Duplicate: Why do most programming languages not nest block comments? Most languages I've worked with don't have support for recursive/nested comments. Is there any reason why ...
6
votes
3answers
493 views

Where are programming languages published? [closed]

I have read that a number of new programming languages are created each year, however I have never seen a single one. Where exactly are these things published? Is there some site out there that keeps ...
13
votes
4answers
3k views

What's wrong with JavaScript [closed]

There is a lot of buzz around Dart recently, often questioning Google motivations and utility of Dart as replacement for JavaScript. I was searching for rationale of creating Dart rather than ...
21
votes
4answers
8k views

Why do iterators in Python raise an exception?

Here's the syntax for iterators in Java (somewhat similar syntax in C#): Iterator it = sequence.iterator(); while (it.hasNext()) { System.out.println(it.next()); } Which makes sense. Here's ...
15
votes
3answers
1k views

Java and .NET: Why different sorting algorithms are used by default?

Just wondering why Java and .NET Framework uses different sorting algorithm by default. In Java Array.Sort() uses Merge Sort algorithm by default and as Wikipedia.com says: In Java, the ...
10
votes
3answers
1k views

How should I specify a grammar for a parser?

I have been programming for many years, but one task that still takes me inordinately long is to specify a grammar for a parser, and even after this excessive effort, I'm never sure that the grammar ...
4
votes
2answers
162 views

Standards to constraint HTML renderer in only US-EN

Does W3C or any other organisation has standard or protocol to constraint all developers to make sure they must use american english while they develop any sort of interpreter? To avoid something ...
4
votes
2answers
408 views

What has been learned about making variance part of the type?

In Java, the variance of parameterized types is indicated depending on how it's used: <A extends B,B> void store(ArrayList<B> list, A elem) { list.add(elem); } Whereas in Scala it ...