Skip to main content

Questions tagged [implementation]

For questions regarding the implementation of a feature in coding languages.

3 votes
1 answer
226 views

What are the pros and cons of dominator Phis vs predecessor Phis?

Phi nodes join data flow based on incoming control flow edges. Determination of incoming control flow can be encoded either by directly listing predecessors or by listing blocks dominating ...
feldentm's user avatar
  • 2,418
7 votes
4 answers
753 views

What makes a language "golfy"?

For those not in the know, a golfing language is a language designed such that its programs can be written with as few bytes as possible. With that in mind, what metric, what objective, do language ...
Rhaixer's user avatar
  • 353
13 votes
0 answers
141 views

Transforming imperative languages to continuation-passing style for evaluation

Continuation-passing style is a useful technique for implementing exceptions, coroutines, non-local returns, async/await, and ...
Michael Homer's user avatar
  • 15.3k
6 votes
0 answers
153 views

Function call in single pass compiler for B

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
-2 votes
2 answers
268 views

If this is the actual behavior of c preprocessor, then how should I interpret the standard if I were to implement it?

In the C standard, there's this: A parameter in the replacement list, ..., is replaced by the corresponding argument after all macros contained therein have been expanded. It's in Section 6.10.x.x, ...
DannyNiu's user avatar
  • 467
11 votes
3 answers
668 views

Delimited continuations and foreign functions

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
9 votes
2 answers
1k views

What's the rationale behind switch/yield in Java?

After upgrading to Java 21, I realized that the promised switch expression has several surprising properties. The most surprising part is the yield keyword which ...
feldentm's user avatar
  • 2,418
3 votes
0 answers
144 views

Is there a guide for implementing exceptions in languages with explicit memory management?

I'm looking for a guide for implementing exceptions in a language with explicit memory management like C++. However, the language's type system and exception handling semantics are incompatible with C+...
feldentm's user avatar
  • 2,418
3 votes
1 answer
394 views

How is a python namespace implemented in terms of memory under Cpython implementation? [closed]

I am confused about the implementation of a global namespace in python . How are variable names mapped as keys to the objects they reference as values ,since namespace is implemented as a dictionary? ...
Silah's user avatar
  • 33
6 votes
5 answers
2k views

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

Mainly, I want to know what existing languages/implementations that use this sort of multi-file module structure do. In my language, modules can consist of multiple files. (For now I don't plan on ...
texdr.aft's user avatar
  • 323
3 votes
0 answers
366 views

Is there a downside to using offsets instead of raw pointers in a virtual machine?

Say I'm designing a virtual machine for a bytecode compiler/interpreter, using C as the implementation language. Some kind of “tagged” representation of values is simplest for this language, where ...
texdr.aft's user avatar
  • 323
3 votes
0 answers
329 views

How to implement type checking of generics?

I am implementing a toy language, for learning. As of now, it has a Rust-like syntax and I would like to implement monomorphization of Generic types. After parsing, I have an Abstract Syntax Tree. Now,...
Jonas's user avatar
  • 705
4 votes
2 answers
501 views

What are the cons of inlining then optimizing and then reverse inlining?

In many programming languages, not all functions may be inlined. However, assuming that a language is designed in such a way that all functions may be inlined, what the disadvantages of inlining all ...
ggZQX6YPvD's user avatar
2 votes
1 answer
406 views

How would you implement an auto-correct feature for misspelled class attributes?

Suppose that we are working with an object oriented compiled language, such as somthing C-flavored or Java-flavored. There is a class named string ...
Samuel Muldoon's user avatar
9 votes
2 answers
487 views

Can total (primitive) corecursion be implemented?

I'm trying to understand how to implement corecursion in a total functional context. I've already implemented recursion using standard techniques (for loops) but I ...
Corbin's user avatar
  • 901

15 30 50 per page
1
2 3 4 5 6