Questions involving the design and structure of programming languages.
Questions tagged [language-design]
486 questions
70
votes
9 answers
Why don't languages include implication as a logical operator?
It might be a strange question, but why there is no implication as a logical operator in many languages (Java, C, C++, Python Haskell - although as last one have user defined operators its trivial to add it)? I find logical implication much clearer…

Maja Piechotka
- 2,475
46
votes
5 answers
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 the 70s.
Recently I was reading about the changes…
user71599
34
votes
16 answers
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 "numbers not adding correctly"). Considering many…

Adam Paynter
- 349
21
votes
10 answers
Function overloading? Yes or no
I'm developing a statically- and strongly-typed, compiled language, and I'm revisiting the idea of whether to include function overloading as a language feature. I realized that I'm a little bit biased, coming mainly from a C[++|#] background.
What…
11
votes
4 answers
What do language designers do to decide or prove that a particular feature works correctly?
I'm interested in language design and in general I can reason easily about widely known features (e.g. inheritance, polymorphism, delegates, lambdas, captures, garbage collection, exceptions, generics, variance, reflection, and so on), their…
11
votes
2 answers
Type system for performance
Do (static) type systems exist which attempt to formalize the performance characteristics of programs? I cannot find seem to find such attempts.
Since type systems are (one of) the most powerful tools in the programmer's arsenal to make statements…
4
votes
7 answers
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?

Abbafei
- 821
4
votes
5 answers
Implicit value vs. reference type semantics
This question has kind of been asked before here Why are structs and classes separate concepts in C#? but I'm interested in a specific aspect of this that wasn't really answered.
I'm trying to understand why the language designers for C# and Swift…

Dragonspell
- 215
4
votes
4 answers
Why are cases in a switch statement not isolated?
As far as I can tell in all C-like languages something like this:
switch(variable) {
case 'a':
printf("Hello ");
case 'b':
printf("World!");
case 'c':
printf("\n");
}
Will print "Hello World!" if variable == 'a'.…

Bartvbl
- 159
- 4
4
votes
1 answer
How do I implement classes in my scripting language?
Let's suppose I have a code file that reads (I'll use Java-ish syntax) and it is being interpreted. Kind of like a ruby script.
class A{
int fieldName = 4;
A(){...}
void doSomething(){...}
}
A instanceOfA = new A();
A.fieldName =…

Jeffrey Guenther
- 143
4
votes
8 answers
Is true multithreading really necessary?
So yeah, I'm creating a programming language. And the language allows multiple threads. But, all threads are synchronized with a global interpreter lock, which means only one thread is allowed to execute at a time. The only way to get the threads to…

Jonathan Graef
- 229
3
votes
2 answers
Definition of intrinsic in language design
I just started looking into programming language design and came across the term intrinsic but could not find any good definition of this anywhere.
I hope that someone here can help me with a good definition to broaden my understanding.
The…

Damian
- 141
- 5
3
votes
2 answers
"every statement and declaration an expression that yields a value" why?
At the end of the answer to "Can I do ++x and x++ in Python?" on this page: http://norvig.com/python-iaq.html, you can read:
[...] I'm with my fellow Dane, Bjarne Stroustrup, on this one. He said in The Design and Evolution of C++ ``If I were to…

user1358
- 341
2
votes
10 answers
Do you find languages with indentation requirements cumbersome?
Thoughts on these? Python is one example, and no this is not a stab against Python I like the language.
What languages have a indentation requirement?

Chris
- 5,653
1
vote
2 answers
Is it possible to bootstrap a transpiled language?
There're multiple topics about bootstrapping a compiled language, languages that are compiled into machine code directly; However, I can't find good explanation about bootstrapping a transpiled language. First, The difference between a transpiler…

Ricky Spanish
- 163