Questions tagged [programming-languages]

A programming language is an artificial language designed to express computations that can be performed by a machine. **Please note:** As is the case elsewhere on Stack Overflow, resource and tutorial recommendation requests, requests for lists of things ("which languages have this feature..."), and excessively opinion-based ("what's the best...") questions are off topic.

In the 1950s E. Dykstra stated that:

We can call something a programming language if it does three things: execute sequential statements, make decisions and allow looping or iteration.

A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer.

This tag is particularly suitable for questions about programming languages and programming language design in general.

A programming language is a notation for writing programs, which are specifications of a computation or algorithm.

A popular weblog dedicated to programming languages design is Lambda the Ultimate.

Programming language description wikipedia

For a discussion on the use of the tag see here.

4117 questions
133
votes
25 answers

Should I use multiplication or division?

Here's a silly fun question: Let's say we have to perform a simple operation where we need half of the value of a variable. There are typically two ways of doing this: y = x / 2.0; // or... y = x * 0.5; Assuming we're using the standard operators…
edmundito
  • 1,552
  • 2
  • 10
  • 10
131
votes
4 answers

What are some compelling use cases for dependent method types?

Dependent method types, which used to be an experimental feature before, has now been enabled by default in the trunk, and apparently this seems to have created some excitement in the Scala community. At first look, it's not immediately obvious…
127
votes
80 answers

File I/O in Every Programming Language

This has to be a common question that all programmers have from time to time. How do I read a line from a text file? Then the next question is always how do i write it back. Of course most of you use a high level framework in day to day programming…
Brock Woolf
  • 46,656
  • 50
  • 121
  • 144
121
votes
7 answers

What's the difference between compiled and interpreted language?

After reading some material on this subject I'm still not sure what the difference between a compiled language and an interpreted language is. I was told this is one of the differences between Java and JavaScript. Would someone please help me in…
SIr Codealot
  • 5,331
  • 9
  • 33
  • 45
120
votes
4 answers

Is a statically-typed full Lisp variant possible?

Is a statically-typed full Lisp variant possible? Does it even make sense for something like this to exist? I believe one of a Lisp language's virtues is the simplicity of its definition. Would static typing compromise this core principle?
119
votes
8 answers

What is a trampoline function?

During recent discussions at work, someone referred to a trampoline function. I have read the description at Wikipedia. It is enough to give a general idea of the functionality, but I would like something a bit more concrete. Do you have a simple…
Benoit
  • 37,894
  • 24
  • 81
  • 116
118
votes
9 answers

Truly understanding the difference between procedural and functional

I'm really having a hard time understanding the difference between procedural and functional programming paradigms. Here are the first two paragraphs from the Wikipedia entry on functional programming: In computer science, functional programming…
118
votes
7 answers

Why are dates calculated from January 1st, 1970?

Is there any reason behind using date(January 1st, 1970) as default standard for time manipulation? I have seen this standard in Java as well as in Python. These two languages I am aware of. Are there other popular languages which follows the same…
Vijay Shanker Dubey
  • 4,308
  • 6
  • 32
  • 49
117
votes
11 answers

Meaning of Leaky Abstraction?

What does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.)
108
votes
5 answers

What does vanilla mean?

The vanilla adjective appears in many places: plain-vanilla java, vanilla javascript: what does it exactly mean? From context, is seems to stand for something "plain". When is a specific code considered vanilla and when is it not? Plain, like not…
Question Everything
  • 2,249
  • 4
  • 20
  • 24
107
votes
7 answers

Is it worthwile to learn assembly language?

Is it still worthwhile to learn ASM? I know a little of it, but I haven't really used it or learned it properly because everything I learn to do in assembler I can do in 1/10th the time with some language like C or C++. So, should I really learn…
ApprenticeHacker
  • 21,351
  • 27
  • 103
  • 153
107
votes
12 answers

Is there an "opposite" to the null coalescing operator? (…in any language?)

null coalescing translates roughly to return x, unless it is null, in which case return y I often need return null if x is null, otherwise return x.y I can use return x == null ? null : x.y; Not bad, but that null in the middle always bothers me --…
Jay
  • 56,361
  • 10
  • 99
  • 123
107
votes
40 answers

When is a language considered a scripting language?

What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria? See also: What’s…
Sietse
  • 7,884
  • 12
  • 51
  • 65
103
votes
19 answers

At what point does a config file become a programming language?

I have been mulling over config files and their relationship to code for a while now and depending on the day and direction of the wind my opinions seem to change. More and more though I keep coming back to the realization I first had while…
Chas. Owens
  • 64,182
  • 22
  • 135
  • 226
100
votes
9 answers

How to approach creating a JVM programming language?

I have created a compiler in C (using Lex & Bison) for a dynamic typed programming language that supports loops, functions declarations inside functions, recursive calls, etc. I also created a virtual machine that runs the intermediate code created…
functional