Newest Questions
949 questions
8
votes
1
answer
1k
views
Why does JavaScript use autoboxing?
JavaScript has a handful of primitive types such as strings and numbers. However, when doing something fancy, it often wraps these types inside temporary objects in order to use object methods, a ...
2
votes
2
answers
230
views
Is there something better than async in order to avoid dead or unused processing times in single thread?
I recently read about PHP's true async RFC.
The initial real life "picture" (unrelated to PHP or sync processing) that I imagined was a waiter in a restaurant. He/She/It works async, taking ...
5
votes
1
answer
1k
views
How will boostrapping libc be possible if python starts depending on Rust?
There has been a proposal to start implementing some python optional extension modules in Rust. Eventually, the authors hope to make Rust a core dependency of the language.
This creates some ...
16
votes
1
answer
2k
views
Why might C++ have been designed to make types like std::strong_ordering a class instead of an enumeration?
In C++, std::strong_ordering has four valid values, yet instead of being an enumeration, it is a class. This seems weird to me, for it prevents ...
16
votes
1
answer
2k
views
Incremental Compilation in Recursive‑Descent Parser (Roslyn)
I wrote a simple recursive‑descent parser for my DSL, but every edit in vscode forces me to reparse the whole file.
Roslyn (the C# compiler) also uses a hand-written recursive-descent parser yet ...
1
vote
2
answers
334
views
How can I design a simple programming language from scratch? [closed]
want to design a simple programming language for educational purposes.
My goal is to understand the fundamentals of how a language works — defining syntax, grammar, and how code gets executed (...
2
votes
2
answers
383
views
Should thread handles be atomic or thread-safe types?
I'm working on a general-purpose language, and right now I'm working on its threading library.
So far, I've worked out how to realize idiomatic critical sections - mutex objects that wraps values for ...
5
votes
0
answers
152
views
What efficient heuristics exist for factoring distributive operations?
Some operations are distributive over each other. (addition/multiplication, and/or, etc) That property can be used to optimize code with factoring.
However, optimal factoring can be quite slow in the ...
10
votes
2
answers
546
views
What are some examples of languages singularly for creating UI's?
I'm looking for examples of DSL's created for UI layout and appearance. There are lots of libraries/frameworks for defining UI's, like SwiftUI and Flutter, but I'm struggling to find actual languages. ...
3
votes
1
answer
537
views
How are C11 compilers calculating by how much to change the stack pointer before `goto` if the program uses variable-length arrays?
So, obviously, the C compiler, when compiling gotos, before inserting the jump instruction, needs to insert ...
-4
votes
3
answers
217
views
Did std::forward_list really need *_after member functions?
Did C++'s std::forward_list really need insert_after, emplace_after, ...
14
votes
1
answer
3k
views
What is the rationale behind the WebAssembly `if` statements behaving like `block` when it comes to breaking (`br`), rather than being transparent?
So, WebAssembly has two types of blocks of code, block and loop. When you break with br or <...
11
votes
4
answers
6k
views
Why does the do-while loop in C-like languages require the curly brackets `{` and `}`? Wouldn't the grammar be perfectly parsable without them?
So, nearly all (or perhaps all) C-like languages require us to use curly brackets { and } when writing a do-while loop of more ...
18
votes
2
answers
4k
views
What is the origin of ++ and --?
In a lot of languages (eg Java, C++, etc), you can use ++ and -- as increment/decrement operators.
What was the origin of ...
13
votes
6
answers
8k
views
Why do so few source level optimizers exist?
Why do optimizing compilers never offer backends in the source language itself? Isn't targeting the source language much easier than targeting assembly? Also, couldn't a source-to-source optimizer ...