« first day (571 days earlier)      last day (75 days later) » 

05:40
@EldritchConundrum not really
unions can't express int | int, or any situation where the types are the same but are semantically different
polymorphic variants can
qed
expressiveness is not just "minimize typing"
 
2 hours later…
07:43
you didn't consider at all what I said about wrapping.
unions can express `int | int` simply by wrapping them, like polymorphic variants forces you to.
07:57
polymorphic variants can't express typescript's A|B, they can only express 'X A | 'Y B
08:54
0
Q: What are the ways to define optionally binary / ternary operators with shared keywords (e.g. for ... else) without unintended ambiguities?

user23013Suppose I would add an optional else branch to the for statement, with whatever semantics. Or even harder, that I would allow the programmer to define custom ternary operators, with the third operand being optional. How to design it so that it would not surprise programmers get used to similar co...

 
5 hours later…
13:37
0
Q: Idiomatic memory allocation and garbage collection in LLVM

user65560I am working on a new backend for a programming language using LLVM IR. This language makes a distinction between basic values and pointers to nodes on the heap, and uses a copying collector for memory management. In an existing backend for this language, basic values are kept on the system stack...

 
9 hours later…
22:12
0
Q: In C/C++, why does the logarithm of zero have a well-defined imaginary part?

Dannyu NDosBy the C standard and the C++ standard: $\log(0+0i) = -\infty+0 i$. $\log(0-0i) = -\infty-0 i$. $\log(-0+0i) = -\infty+\pi i$. $\log(-0-0i) = -\infty-\pi i$. However, if the floating-point complex zero is understood as the "absolute" zero plus some infinitesimal toward a specific quadrant in th...

If that question is a serious problem.
 
2 hours later…
23:52
wow, your question just convinced me to never try to write a type for complex numbers

« first day (571 days earlier)      last day (75 days later) »