Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
128 views

Can I program a universal Turing machine to accept arbitrary input encodings?

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 ...
4
votes
1answer
174 views

How to generate branch tables from SSA form?

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 ...
1
vote
1answer
53 views

Software code generation from the (operational) semantics - reference request for automatic programming

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 ...
3
votes
1answer
74 views

Is there a computer science theory behind automatic source code generation

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: ...
1
vote
1answer
160 views

How to Identify which instructions are represented by this microcode

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 ...
1
vote
1answer
1k views

How are codes like 5421 and 2421 unique?

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? ...
5
votes
1answer
149 views

Implementing a Compiler with Macros

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): <...
1
vote
3answers
111 views

Is it possible to define branches which, once taken once, will become the default forever?

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 ...
1
vote
2answers
341 views

How to generate (Java) source code in academically acceptable way - using abstract syntax tree?

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/ ...
0
votes
1answer
133 views

How to represent software code for code generation / automatic programming? How to integrate procedural and declarative knowledge?

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**, ...
0
votes
1answer
55 views

What is the quickest way to allocate a set of points to a fixed number groups based on Euclidean distances from a point in each group?

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 ...
0
votes
1answer
3k views

In a bottom-up evaluation of a syntax directed definition, inherited attributes can

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 ...
5
votes
1answer
131 views

The importance of the language semantics for code generation and frameworks for code generation in model-driven development

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 ...
5
votes
2answers
294 views

Is there a described algorithm converting _from_ Continuation Passing Style?

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 ...
1
vote
2answers
530 views

Number of operations performed in increment operators [closed]

How many operations are performed in the following in order to get a running time function of an algorithm: x = x + 1 x += 1 <...
2
votes
0answers
26 views

Codes for correcting a single deletion and re-ranking of a permutation

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:...
1
vote
1answer
59 views

Assigning one variable to another in 3 address code?

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 ...
3
votes
1answer
82 views

About codes over $\mathbb{F}_2$

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 ...
1
vote
1answer
50 views

Programs for artificial system design? [closed]

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 ...
0
votes
1answer
384 views

Conversion from assembly program to low-level machine language

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-...
17
votes
6answers
7k views

Why do compilers produce assembly code?

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?...
1
vote
2answers
290 views

Some questions regarding compilers and assemblers

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 ...
0
votes
1answer
118 views

What are current approaches to auto-parallelisation?

I am looking for answers which provide short overview of models and current state of research for auto-parallelisation of sequential code.