Questions involving the design and structure of programming languages.

learn more… | top users | synonyms

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
570 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
439 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 ...
48
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 ...
16
votes
1answer
358 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
467 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 ...
14
votes
4answers
2k 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 ...
20
votes
4answers
5k 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 ...
11
votes
3answers
973 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
155 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
375 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 ...
2
votes
1answer
257 views

Is a partially familiar scripting language desirable?

Given that a program (under development) needs a scripting language, and that for various reasons it's not possible to use an off-the-shelf one as is, I'm considering basing it on the syntax and some ...
24
votes
15answers
2k views

Is there a language out there in which parameters are placed inside method name?

in JavaScript: function getTopCustomersOfTheYear(howManyCustomers, whichYear) { // Some code here. } getTopCustomersOfTheYear(50, 2010); in C#: public List<Customer> ...
6
votes
2answers
264 views

Which books or references cover design of domain specific languages?

There are a lot of books on domain specific languages (DSLs). Such books talk about compilers, interpreters, parsing, lexing, semantic analysis, and other various bits someone needs to implement a ...
4
votes
3answers
141 views

Synonyms for operators

In the case of a newly designed functional language, consider e.g. the not equals operator, spelled /= as is common among functional languages. Of course this operator is also known as != in C family ...
6
votes
4answers
897 views

What exactly undefined means in JavaScript? Why it's there? What usages it has? How it could be useful?

In JavaScript, we have something called undefined. I said something, because I really don't know if it's a base class, or a built-in variable, or a keyword, or anything else. I just know that it's ...
6
votes
5answers
426 views

Java without implementation inheritance

In a recent video on Java, Joshua Bloch states at 4 minutes 20 seconds into the video: And then there's inheritance, and that was a marketing necessity. You know, we can argue whether you really ...
6
votes
5answers
689 views

Help me deal with higher level languages [closed]

I'm trying to learn Scala (I have previously glanced at Erlang, Haskell, Ruby and had similar issues). I do enjoy it, but I feel bad about some things it does and I wonder if that's just due to all ...
7
votes
11answers
718 views

Why do interfaces require methods over members?

...As this forces us to create getters and setters, which in practice are often totally extraneous? Is there any good language-design reason why interfaces in most (all?) languages do not allow member ...
36
votes
12answers
3k views

Why does the assignment operator assign to the left-hand side?

I began teaching a friend programming just recently (we're using Python), and when we began discussing variable creation and the assignment operator, she asked why the value on the right is assigned ...
11
votes
2answers
498 views

How easy should a language development framework be to use?

This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. Another ...
4
votes
6answers
385 views

Why isn't there a Boolean for x values of a variable? [duplicate]

Possible Duplicate: Would you see any use of a Trilean (True, False, ??) Well first and foremost, I'm not a programmer, I am a civil engineer that does some programming and quite enjoy it. ...
6
votes
3answers
432 views

Is structural typing in a hierarchical model necessary?

This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. Another ...
4
votes
5answers
1k views

Scalability and Programming languages

What makes a language scalable ? I believe scalability is more about system design. It sounds really odd to me, to say that one language is more scalable than the another.
1
vote
6answers
721 views

why no hasLock/testLock on mutexes

looking through the docs of posix' pthread_mutex_t and window's mutex and CRITICAL_SECTION I noticed there is no easy way of checking whether the current thread holds a specific mutex posix' ...
11
votes
3answers
635 views

How does a static type system affect the design of a prototype-based language?

The Wikipedia article on prototype-based languages contains the following paragraph: Almost all prototype-based systems are based on interpreted and dynamically typed languages. Systems based on ...
22
votes
3answers
6k views

How fast can Go go?

Go is one of the few languages that are supposed to run 'close to the metal', i. e. it's compiled, statically typed and executes code natively, without a VM. This should give it a speed advantage over ...
2
votes
9answers
710 views

The New Programming Language & BCL for the Cloud

Let's say you need to implement a new programming language and BCL designed specifically for operating in the cloud (it won't be used on client machines ever). It should be optimized for cloud ...
3
votes
3answers
440 views

Readability vs minimalism/compactness/conciseness in language design: are they antagonistic?

Currently, there is a discussion in the PHP-Internals mailing list regarding the implementation of a short syntax for arrays and objects, mainly [1, 2, ...] for standard arrays, ['one'=>1, ...
7
votes
10answers
998 views

A better way of doing Regex? [duplicate]

I really dislike regular expressions, each time I come back to it I seem to have to relearn it. It's also incredibly hard to maintain, modify and at a glance understand what it is doing. Has anyone ...
6
votes
6answers
467 views

How permissive should a language be about identifiers?

This is a sister question to: Is it bad to use Unicode characters in variable names? As is my wont, I'm working on a language project. The thought came to me that allowing multi-token identifiers ...
4
votes
7answers
571 views

Is it wrong to copy ideas from other languages?

In the making of a programming language, is it wrong to copy features and ideas from other programming languages? If it is not a problem, why not? Is it possible to license and copyright these things? ...
33
votes
9answers
27k views

Why use partial classes?

In my understanding, the partial keyword does nothing but allow a class to be split between several source files. Is there any reason to do this other than for code organization? I've seen it used for ...
4
votes
2answers
471 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 ...
6
votes
1answer
4k views

A combined if/switch statement syntax with exception handling for a C#-inspired language

It is sometimes necessary to try/catch exceptions inside the "if" condition, but not the body that follows. In C#, this is really rather cumbersome, requiring locals and code that isn't entirely ...
16
votes
12answers
795 views

Should data structures be integrated into the language (as in Python) or be provided in the standard library (as in Java)?

In Python, and most likely many other programming languages, common data structures can be found as an integrated part of the core language with their own dedicated syntax. If we put LISP's integrated ...
15
votes
16answers
5k views

What can be done to programming languages to avoid floating point pitfalls?

The misunderstanding of floating point arithmetic and its short-comings is a major cause of surprise and confusion in programming (consider the number of questions on Stack Overflow pertaining to ...
10
votes
5answers
825 views

First Class Functions

I started seriously taking a look at Lisp this weekend (by which I mean I have only been learning Lisp and not reverting back to projects in C#) and must say I love it. I have dabbled with other ...
14
votes
18answers
2k views

What do you think was a poor design choice in Java? [closed]

Java has been one of the most (the most?) popular programming languages till this day, but this also brought controversy as well. A lot of people now like to bash Java simply because "it's slow", or ...
5
votes
1answer
394 views

Why are Javascript for/in loops so verbose?

I'm trying to understand the reasoning behind why the language designers would make the for (.. in ..) loops so verbose. For example: for (var x in Drupal.settings.module.stuff) { alert("Index: " ...
14
votes
9answers
2k views

Career advice: PhD in theory of programming languages [closed]

I'm very interested in the theories of programming languages and going to apply a PhD in this topic, but I want to know more about the career after the graduate education. besides being a professor, ...
6
votes
5answers
279 views

Is it relevant to warn about truncating real constants to 32 bits?

I'm toying around with LLVM and looking at what it would take to make yet another strongly-typed language, and now that I'm around the syntax, I've noticed that it seems to be a pet peeve of strongly ...
3
votes
1answer
152 views

feature request in language design?

How do language designers decide when a feature should go in a library as an extension or when it needs to have support from the core language?
3
votes
2answers
230 views

Greater than or identical to?

While browsing my code in a weakly-typed language I was seeing that I've trained myself to use identity (===) where logical. Then I came across a greater (or less) than or equal to (>=), and it ...
7
votes
4answers
1k views

Building a DSL: Scripted atop a general-purpose language or stand-alone?

I'm debating designing a domain specific language to simplify a given, obscure programming model. Part of the debate is whether to build it (as a script) atop an existing language/runtime (e.g. Java) ...
10
votes
8answers
517 views

Is it possible to design a language that doesn't have syntax errors? [closed]

In other words, a language where every possible string is valid syntax? EDIT: This is a theoretical question. I have no interest in using such a language; I'm just asking whether it's possible.
4
votes
6answers
2k views

C++: calling non-member functions with the same syntax of member ones

One thing I'd like to do in C++ is to call non-member functions with the same syntax you call member functions: class A { }; void f( A & this ) { /* ... */ } // ... A a; a.f(); // this is the ...