Questions involving the design and structure of programming languages.

learn more… | top users | synonyms

4
votes
3answers
143 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
1k 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
483 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
731 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 ...
8
votes
11answers
748 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 ...
37
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
512 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
431 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
533 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
855 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
679 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 ...
25
votes
3answers
7k 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 ...
1
vote
9answers
800 views

The New Programming Language & BCL for the Cloud [closed]

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
453 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, ...
8
votes
10answers
1k 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
486 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
583 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? ...
45
votes
9answers
35k 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
563 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
6k 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 ...
18
votes
13answers
1k 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 ...
16
votes
16answers
6k 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
973 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 ...
13
votes
18answers
3k 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
446 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
3k 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
283 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
163 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
235 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
671 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 ...
3
votes
2answers
289 views

Comparison of languages by usage type? [closed]

Does anyone know of a good place to go find comparisons of programming languages by the intended platform/usage? Basically, what I want to know, is of the more popular languages, which ones are meant ...
6
votes
6answers
512 views

Preferred lambda syntax?

I'm playing around a bit with my own C like DSL grammar and would like some oppinions. I've reserved the use of "(...)" for invocations. eg: foo(1,2); My grammar supports "trailing closures" , ...
10
votes
5answers
12k views

What to do if I hate C++ header files?

I was always confused about header files. They are so strange: you include .h file which doesn't include .cpp but .cpp are somehow compiled too. Recently I joined a team project, and of course, ...
2
votes
1answer
870 views

What source code organization approach helps improve modularity and API/Implementation separation?

Few languages are as restrictive as Java with file naming standards and project structure. In that language, the file name must match the public class declared in the file, and the file must live in ...
35
votes
26answers
2k views

What do you wish language designers paid attention to? [closed]

The purpose of this question is not to assemble a laundry list of programming language features that you can't live without, or wish was in your main language of choice. The purpose of this question ...
4
votes
8answers
1k views

How common are circular references? Would reference-counting GC work just fine?

How common are circular references? The less common they are, the fewer hard cases you have if you are writing in a language with only reference counting-GC. Are there any cases where it wouldn't ...
13
votes
4answers
1k views

Why exactly can't PHP have full unicode support?

Everybody knows, that PHP has problems with Unicode. Version 6 is effectively abandoned, because of Unicode implementation difficulties. But I wonder if anyone knows what are the exact reasons? ...
5
votes
3answers
886 views

Is macros support in a programming language considered harmful?

The first abuse that comes to my mind in C is: #define if while But at the same time it is extremely handy and powerful when used correctly. Something similar happens with Common Lisp macros. ...
17
votes
10answers
8k views

What do Java developers think of Scala? [closed]

I've noted that IDE support is nowhere near as good, but the language itself supports functional programming idioms much more cleanly.
5
votes
7answers
516 views

Long Keywords like `function` and `namespace`

In many English-based programming languages like C++ and JavaScript, there exist long keywords like function, namespace, exception (in OCaml languages) and such. Do you think shorter keywords like ...
18
votes
16answers
2k views

Why aren't databases integrated as a language feature?

Are there any programming languages that have a built-in database as a first-class language feature rather than connecting to an external SQL (or other) database? What would be the drawbacks and ...
11
votes
9answers
1k views

XAML - Like/Dislike? [closed]

After bashing my head against the brick wall that is XAML, I've decided to come here and ask other people if they are as frustrated as I am. So, Do you like XAML? Please justify. Is XAML the ...
1
vote
1answer
333 views

Could you blend java and javascript? [closed]

As a developer who spends most of my time in either Java or Javascript these days, I have this fantasy about a language that blends the two of them together. I'm always missing something from one or ...
38
votes
12answers
9k views

Should I use a parser generator or should I roll my own custom lexer and parser code?

What specific advantages and disadvantages of each way to working on a programming language grammar? Why/When should I roll my own? Why/When should I use a generator?
6
votes
3answers
571 views

Practical Meta Programming System (MPS)

This is in regards to Meta Programming System or MPS by JetBrains. Thus far, from my efforts to learn how to use MPS, I have only learned its basic purpose and that it is very complex. Is MPS worth ...
75
votes
20answers
11k views

Are null references really a bad thing?

I've heard it said that the inclusion of null references in programming languages is the "billion dollar mistake". But why? Sure, they can cause NullReferenceExceptions, but so what? Any element of ...
12
votes
5answers
939 views

Question about Creating a Scripting Language

Say, for example, I wanted to pay somebody to create a programming language or scripting language for me. What type of document would they need, in order to fully understand what it is exactly that I ...