Questions tagged [programming-languages]

Questions related to design, implementation, and analysis of programming languages. NOT for questions about how to program, which are off-topic on this site.

Use this tag for questions about programming language design and implementation and about theoretical concepts underlying existing programming languages.

Questions about concrete features of existing programming languages belongs on Stack Overflow.

For questions related to lambda calculus and type theory consider using the tag.

Related tags

1006 questions
193
votes
10 answers

How can a language whose compiler is written in C ever be faster than C?

Taking a look at Julia's webpage, you can see some benchmarks of several languages across several algorithms (timings shown below). How can a language with a compiler originally written in C, outperform C code? Figure: benchmark times relative to…
StrugglingProgrammer
  • 1,973
  • 3
  • 12
  • 10
145
votes
12 answers

Why are there so many programming languages?

I'm pretty fluent in C/C++, and can make my way around the various scripting languages (awk/sed/perl). I've started using python a lot more because it combines some of the nifty aspects of C++ with the scripting capabilities of awk/sed/perl. But why…
Suresh
  • 5,417
  • 2
  • 28
  • 31
139
votes
7 answers

Is Category Theory useful for learning functional programming?

I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer. I want to learn category theory so I can become better at Haskell. Which topics in category…
94
votes
7 answers

Why are some programming languages "faster" or "slower" than others?

I have noticed that some applications or algorithms that are built on a programming language, say C++/Rust run faster or snappier than those built on say, Java/Node.js, running on the same machine. I have a few question regarding this: Why does…
evil_potato
  • 1,372
  • 2
  • 12
  • 11
93
votes
8 answers

Formal program verification in practice

As a software engineer, I write a lot of code for industrial products. Relatively complicated stuff with classes, threads, some design efforts, but also some compromises for performance. I do a lot of testing, and I am tired of testing, so I got…
Zeus
  • 1,712
  • 1
  • 13
  • 15
80
votes
4 answers

Dependent types vs refinement types

Could somebody explain the difference between dependent types and refinement types? As I understand it, a refinement type contains all values of a type fulfilling a predicate. Is there a feature of dependent types which distinguishes them? If it…
74
votes
9 answers

What properties of a programming language make compilation impossible?

Question: "Certain properties of a programming language may require that the only way to get the code written in it be executed is by interpretation. In other words, compilation to a native machine code of a traditional CPU is not possible. What are…
73
votes
7 answers

Are there minimum criteria for a programming language being Turing complete?

Does there exist a set of programming language constructs in a programming language in order for it to be considered Turing Complete? From what I can tell from wikipedia, the language needs to support recursion, or, seemingly, must be able to run…
69
votes
10 answers

Can a dynamic language like Ruby/Python reach C/C++ like performance?

I wonder if it is possible to build compilers for dynamic languages like Ruby to have similar and comparable performance to C/C++? From what I understand about compilers, take Ruby for instance, compiling Ruby code can't ever be efficient because…
Ichiro
  • 815
  • 1
  • 7
  • 5
63
votes
10 answers

What is a safe programming language?

Safe programming languages (PL) are gaining popularity. What is the formal definition of safe PL? For example, C is not safe, but Java is safe. I suspect that the property “safe” should be applied to a PL implementation rather than to the PL itself.…
beroal
  • 781
  • 1
  • 5
  • 12
63
votes
14 answers

How can I explain to my parents that I study programming languages?

I am currently finishing my MSc in computer science. I am interested in programming languages, especially in type systems. I got interested in research in this field and next semester I will start a PhD on the subject. Now here is the real question:…
effeffe
  • 741
  • 1
  • 5
  • 10
57
votes
8 answers

How are variables stored in and retrieved from the program stack?

Apologies in advance for the naivety of this question. I am a 50 year old artist trying to properly understand computers really for the first time. So here goes. I have been trying to understand how data types and variables are handled by a compiler…
Celine Atwood
  • 689
  • 1
  • 6
  • 4
54
votes
1 answer

What is the earliest use of the "this" keyword in any programming language?

I understand the this (or self or Me) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The earliest language I could find which has such a concept was Smalltalk, which uses self but was…
huijing
  • 651
  • 1
  • 5
  • 7
43
votes
9 answers

Why are some programming languages Turing complete but lack some abilities of other languages?

I came across an odd problem when writing an interpreter that (should) hooks to external programs/functions: Functions in 'C' and 'C++' can't hook variadic functions, e.g. I can't make a function that calls 'printf' with the exact same arguments…
43
votes
2 answers

What can Idris not do by giving up Turing completeness?

I know that Idris has dependent types but isn't turing complete. What can it not do by giving up Turing completeness, and is this related to having dependent types? I guess this is quite a specific question, but I don't know a huge amount about…
1
2 3
67 68