Skip to main content

Questions tagged [stack]

Use the stack tag for questions relating to the implementation and design of stack-based languages.

3 votes
1 answer
537 views

So, obviously, the C compiler, when compiling gotos, before inserting the jump instruction, needs to insert ...
FlatAssembler's user avatar
6 votes
0 answers
155 views

I've been implementing a B compiler for x86 assembly for a while now and have been asking one or two questions in Retrocomputing. My tools for implementing it is using flex/bison with C. Recently I've ...
아이스크림은메로나's user avatar
11 votes
3 answers
718 views

Guile Scheme has had support for delimited continuations for over a decade. Much was written about it in a 2012 blog post: guile and delimited continuations. They have a limitation: continuations that ...
Matheus Moreira's user avatar
5 votes
1 answer
497 views

Rosetta 2 is a program that enables the new ARM-based Macs to run programs for old x86-based Macs by translating x86 machine code to ARM machine code. But how does it do that? What seems especially ...
FlatAssembler's user avatar
11 votes
5 answers
4k views

I'm writing a register- and stack-based virtual machine. My goal is to have something easy to use and general purpose, so I abstain from any form of hardware limitation in its design. Since my VM's ...
Foxy's user avatar
  • 254
16 votes
11 answers
5k views

While programming, I often wonder what prevents languages from allowing arbitrary sized stack returns, like this: ...
user avatar
20 votes
3 answers
5k views

At first C did not have variable-length arrays; all array sizes must be compile times constants. Then, in C99, variable-length arrays, a controversial addition, were added, permitting runtime-sized ...
CPlus's user avatar
  • 10.5k
17 votes
3 answers
5k views

What are the pros and cons of choosing a register or stack based VM for a language implementation? For example Python has stack-based virtual machine, while Lua has register-based VM. What makes a ...
kouta-kun's user avatar
  • 1,747
2 votes
1 answer
283 views

What are differences between stack- and register-based virtual machine's bytecode commands? For example Python has stack-based virtual machine. But Lua has register-based vm. So, what are the ...
чистов_n's user avatar
15 votes
1 answer
417 views

Segmented stacks are one method to enable the growth of execution stacks in multi-threaded paradigms at runtime, instead of having to statically pre-allocate a fixed-sized stack at compile time. Some ...
WormholeX's user avatar
  • 153
7 votes
2 answers
516 views

What level of static typing can be added to a stack-based language? I know it's impossible to fully statically type some stack languages: ...
lyxal's user avatar
  • 2,045
10 votes
2 answers
589 views

A stack-based language necessarily contains at least "push" and "pop" instructions. However, these typically aren't the only ways to manipulate the stack. For example, several ...
Bbrk24's user avatar
  • 9,672