Trending questions
877 questions
9
votes
4
answers
3k
views
Is it plausible to let modulo-by-zero have a well-defined output value, provided that my language is C-like?
By mathematical definition, for every nonnegative integer n and every positive integer d, it holds that the modulo ...
77
votes
2
answers
31k
views
How do modern compilers choose which variables to put in registers?
C has the register keyword, originally designed as a hint to the compiler that a variable should be placed in a register rather than on the stack. However this is ...
0
votes
1
answer
337
views
Why don't assemblers, even those that support arithmetic expressions in compile-time constants, tend to support the ternary conditional `?:` operator?
So, as per my previous question, I added the support for the ternary conditional operator ?: into my PicoBlaze assembler written in JavaScript for compile-time ...
2
votes
1
answer
540
views
Semantics on `with` keyword in C# for (heap-based) records
I have a question about a C# language design. Let's have a following code:
...
-5
votes
2
answers
320
views
How can an assembler provide suggestions for misspelt named registers with Levenshtein distance, as it cannot know token is supposed to be a register?
Here is an example program in PicoBlaze assembly language illustrating and explaining the problem:
...
12
votes
4
answers
5k
views
Why not make all keywords soft in python?
In Python we have the concept of a soft keyword, which makes some keywords reserved only in some special cases (e.g. match, case ...
21
votes
9
answers
8k
views
Why no "full-stack" SQL-like language?
I've been a user of SQL for a long time now, and it is regarded as extremely well-adapted for its various and widespread uses in data processing. I think you'll hardly find a business that owns a ...
10
votes
1
answer
331
views
What's the current state of the art for inferring/checking integer range types?
I'm putting together a small language, and I'd like its type system to include bounded integer types, where for any expression e and integer literals $l,h$, the ...
17
votes
4
answers
3k
views
Why did C99 have to add the underscored keywords for _Bool _Complex _Imaginary but not for inline or restrict?
C99 introduced the following keywords: _Bool _Complex _Imaginary ...
6
votes
4
answers
535
views
Do any notable programming languages other than Fortran mark line continuation at the beginning of the following line?
In the first high-level language (FORTRAN), lines of text would by default be treated as individual statements, except that a card which contained something other than an asterisk or C in column 1 and ...
7
votes
1
answer
406
views
What problems do applicative functors solve, as an abstraction relative to monads and arrows?
TL;DR
This site is of course particularly interested in the language designer's and implementor's perspective so, following What is an arrow and what powers would it give as a first class concept in a ...
1
vote
1
answer
156
views
In the old Angular, why did `[ngSwitch]` go into square brackets, but `*ngSwitchCase` was preceded by `*`? Wouldn't `*ngSwitch` make more sense?
In the old versions of Angular (before the @if, @for, and @switch), why did ...
6
votes
6
answers
1k
views
Language constructs to reduce inadvertent interface implementation in purely structural type systems?
In a structural type system there may be cases where an inappropriate object is passed to a function because it implements the interface by chance.
For example (in some hypothetical structurally typed ...
13
votes
2
answers
806
views
What optimizations are possible with unsequenced operators?
In C, most binary operators do not specify which operand will be evaluated first:
...
26
votes
3
answers
7k
views
Why do many programming languages use the symbol of two vertical parallel lines `||` to mean "or"?
Why do many programming languages use the symbol of two vertical parallel lines || to mean "or"? Is it because two switches connected in parallel form a ...