Skip to main content

Questions tagged [code-generation]

Questions about the parts of a compiler that select assembly instructions or machine code specific to a specific target computer architecture.

Filter by
Sorted by
Tagged with
3 votes
0 answers
95 views

I would like to know if there are any limitations to macro systems, like the ones that many LISP dialects have. Can all meta programming paradigms be implemented through a LISP-ish macro system? Or ...
raptus's user avatar
  • 31
1 vote
1 answer
138 views

I am learning about and building a very basic compiler. My question is about code generation. I have read on a lot of materials about code generation when building a compiler and I get the concept. ...
Ali Ahmed's user avatar
0 votes
1 answer
71 views

what is the time complexity of: for (i = 1; i <= n; i = 2*i) for (j = 0; j < i; j++) sum++; ? I thought it is O(nlogn) since the otter loop ...
user163594's user avatar
5 votes
6 answers
2k views

I understand how backpatching works during intermediate code generation, but I do not understand why it is needed. A common argument for using backpatching during intermediate code generation is as ...
hengxin's user avatar
  • 9,711
0 votes
0 answers
45 views

At least intuitively, I understand the following terms to be rigorously associated: Field Separator (FS) as a delimiter which delimits text segments such as words, sentences or lines/fields and an ...
timesharer's user avatar
1 vote
1 answer
551 views

I wonder how can I construct 4 (distinct) codewords given the fact that code distance is 5. As far as I know that the code distance is the number of distinct bits between any 2 codewords. How to ...
Powerful blaster's user avatar
1 vote
1 answer
759 views

Disclaimer: I'm not a compiler expert, but some of my best friends are! :) I do a lot of embedded systems programming where stack (and other memory) is limited. Most of my code is written in gcc, ...
fearless_fool's user avatar
1 vote
1 answer
202 views

I am trying to figure out the process of generating code (set of instructions, implementation language specifics dont matter at this time) from an automaton. The description of my intent is vague ...
Abhishek Bhaduri's user avatar
0 votes
2 answers
249 views

We’ve all seen this: Can we get worse? Part 1: Can mathematical operations of increasing orders of growth be generated, with or without Knuth’s up-arrow notation? Part 2: If they can, can algorithms ...
JohnnyApplesauce's user avatar
1 vote
2 answers
472 views

I've been reading about building Turing machines for specific purposes, and some sources talk about input encodings and some talk about programming specific machines, but I've been unable to find ...
Stella Biderman's user avatar
6 votes
1 answer
363 views

Branch tables are usually described as an efficient way a compiler can implement a switch statement, and that actually seems how GCC and Clang do it (and LLVM even has an opcode just for that). If a ...
paulotorrens's user avatar
1 vote
1 answer
128 views

Are there research trends that try to research code generation directly from the (operational or some other kind of) semantics? One can imagine cognitive architecture that discovers and reasons about ...
TomR's user avatar
  • 1,411
3 votes
1 answer
132 views

The OpenAPI specification aims at standardizing the representation of REST based systems in json and yaml formats. A short version of the petstore is below: ...
SyCode's user avatar
  • 133
1 vote
1 answer
380 views

I'm having issues with a question how to identify which instruction are represented by this microcode. The pc starts at 5000 and 7000 and 7001 have values 31 and 64 - I'm really confused how to ...
rahulchawla's user avatar
2 votes
1 answer
5k views

For the number 6, if I need to represent it in 5421 code form, should I code it as 1001 or 0110? Why should I choose the one over the other? Similarly for the number 5 in 2421, is it 1011 or 0101? ...
Anupama's user avatar
  • 21
5 votes
1 answer
635 views

I've been thinking about embedded languages (domain-specific or otherwise), and in particular the approach where we define a datatype to represent terms of the embedded language, e.g. (in Haskell): <...
Warbo's user avatar
  • 662
1 vote
3 answers
190 views

Assuming I have a very simple branching: switch on var: 1 => branch1 2 => branch2 default => branch3 And I wish to implement a program that will ...
George's user avatar
  • 111
1 vote
2 answers
833 views

I am trying to do automated programming research: business software generation from the knowledge base that is implemented as Scheme (Lisp dialect) code (in the framework of http://opencog.org/ ...
TomR's user avatar
  • 1,411
0 votes
1 answer
280 views

I am learning about deontic logics and there I can make the following inferences: If A then there is **duty to create an entity of class C**, ...
TomR's user avatar
  • 1,411
0 votes
1 answer
173 views

Example, if i have certain geographic points in an array A=[a,b,c,d...n] and have 10 points distributed in the solution space B= [1,2,3...10], how can I allocate each member of A to the nearest point ...
David's user avatar
  • 3
-1 votes
2 answers
9k views

In a bottom-up evaluation of a syntax directed definition, inherited attributes can always be evaluated be evaluated only if the definition is L-attributed be evaluated only if the definition has ...
hululu's user avatar
  • 475
5 votes
1 answer
470 views

I am implementing worflow where the code in industrial programming languages (JavaScript and Java) should be generated from the formal (formally verified) expressions (from ontologies as objects and ...
TomR's user avatar
  • 1,411
6 votes
3 answers
693 views

Continuation Passing Style (CPS) is a form of code where the control is passed explicitly, by passing the continuation of the code at each call point, unlike direct style. There are many descriptions ...
John Källén's user avatar
0 votes
2 answers
2k views

How many operations are performed in the following in order to get a running time function of an algorithm: x = x + 1 x += 1 <...
JORGE's user avatar
  • 259
2 votes
0 answers
41 views

I was struggling with this paper about codes which can correct single deletion and re-ranking in permutations, http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6875337 [Published in:...
user6818's user avatar
  • 1,175
2 votes
1 answer
184 views

3 address code is a very common topic in many of the CS theories. I encountered it while studying Compiler Design. According to the Wikipedia article, it says - Each TAC instruction has at most ...
lethal's user avatar
  • 21
3 votes
1 answer
132 views

I was looking through these notes but I am not sure I can locate the answer to these questions of mine - it would be great if someone can just even point out what to look for! So any set of binary ...
user6818's user avatar
  • 1,175
1 vote
1 answer
81 views

Are there program systems that can discover the need of routines - and then design them, code them and use them as parts of the system? Any group of humans trying to pursue an activity has to develop ...
Lehs's user avatar
  • 121
0 votes
1 answer
639 views

While studying COMPILER-DESIGN through an online book from Google Books, referenced as Compiler Design by A.A.Puntambekar, I got stuck across a line. Actually, I am more curious to know the inner-...
Am_I_Helpful's user avatar
19 votes
6 answers
13k views

Assembly language is converted in to machine language by assembler. Why would a compiler convert high-level language to assembly? Can't it directly convert from the high-level language to machine code?...
CODERSAM's user avatar
  • 293
1 vote
2 answers
474 views

Lots of basic questions are there in my mind. I need to clear them. Statement 1: A compiler converts a human-readable codes to object codes, and those are converted to a machine code (executable) by ...
Shashwat's user avatar
  • 513
0 votes
1 answer
148 views

I am looking for answers which provide short overview of models and current state of research for auto-parallelisation of sequential code.
check123's user avatar
  • 530