Linked Questions

138 votes
27 answers
33k views

If something can be generated, then that thing is data, not code. Given that, isn't this whole idea of source code generation a misunderstanding? That is, if there is a code generator for something, ...
201 votes
10 answers
84k views

Sometimes while programming in different languages (C/C++, C#), this thought comes to my mind: Is each and every language written in the C programming language? Is the C language the mother/father of ...
FaizanHussainRabbani's user avatar
15 votes
8 answers
11k views

I was wondering why C++ is a good choice to write a compiler. Of course C is good for this purpose too, because many compilers are written either in C or C++ but I am more interested in C++ this time. ...
terenaa's user avatar
  • 261
6 votes
7 answers
10k views

Is it possible to define variables dynamically? Last night I was writing some code (C and VB2010) and I ran into a problem related to defining variables in my program. The variables needed depend on ...
niko's user avatar
  • 2,119
12 votes
6 answers
3k views

Anyone knows a solution that works something like this: #include <stdio.h> #include <gcc.h> /* This .h is what I'm looking for. */ int main (void) { /* variables declaration (...) */ ...
WhyWhat's user avatar
  • 223
3 votes
6 answers
2k views

I'm really interested in writing my own general-purpose high-level programming language, but I'm somewhat confused. I know that Python and Ruby were written in C, which makes me wonder that if I want ...
Ericson Willians's user avatar
9 votes
2 answers
2k views

I'm currently building a server responsible of storing and managing few million records of fairly complex and interconnected data. For reasons beyond my control the work has to be done with C++. I ...
Muton's user avatar
  • 627
5 votes
2 answers
3k views

Let's say that I'm a theoretical programmer hunting for a cross platform programming language, what are my options. This language must satisfy this list of requirements: It must not require the user ...
J-''s user avatar
  • 99
3 votes
4 answers
2k views

I was taking this course - CMU 18-447, Computer Architecture at Carnegie Mellon to brush my knowledge and concepts. They say that most of the machine level details and implementations are taken care ...
Greedy Coder's user avatar
2 votes
4 answers
4k views

Both the comma operator and the semicolon can be used to separate statements. Let's consider this simple code: #include <stdio.h> void do_something(int*i) {(*i)++;} int main() { int i; ...
gaazkam's user avatar
  • 4,529
4 votes
3 answers
856 views

Often when translating between languages (whether with program translation or compiling) it's a one-way, destructive translation. The functionality of the "port" isn't lost, but some of the intent ...
Sam Washburn's user avatar
4 votes
2 answers
3k views

Suppose I create a simple functional Domain-specific language (DSL) using an imperative language, in this case C++. Here is a simple implementation of a DSL that can has the notion of a simple value ...
quant's user avatar
  • 1,386
2 votes
1 answer
1k views

I am going to write a very simple VM and bytecode compiler. Is it typical for a bytecode compiler to read the syntax and attempt to create the bytecode directly or is there an intermediate stage to ...
Synaps3's user avatar
  • 147
-1 votes
1 answer
863 views

I am writing a simple compiler. I have written lexer and parser and it now generates assembly code from given code. Now I need to write an assembler which generates machine code. But the problem is ...
Greatcode's user avatar
5 votes
2 answers
2k views

Let's say we wanted a typeful, pure functional programming language, like Haskell or Idris, that is aimed at systems programming without garbage collection and has no runtime (or at least not more ...
analogyschema's user avatar
-3 votes
2 answers
597 views

I just wonder if exists a compiled language that can modify it's own machine code. I know that in most common operative systems the executable code is protected during execution time, but maybe if ...
Edwin Rodríguez's user avatar
1 vote
2 answers
2k views

I'm working on a C compiler for Linux for the purpose of personal curiosity/fun. How can I test the generated assembly before the compiler is complete enough to do anything useful? For example, if I ...
user avatar
0 votes
1 answer
1k views

Presume this situation: Max Number of 256 key slots. Key slots are defined by a struct, and a variable for each (256) has to exist. User defines which keys slots are active at initiation (in my ...
Anon's user avatar
  • 3,649
0 votes
2 answers
571 views

How does a Program that is already compiled create standalone .exe files without an apparent compiler? Example game making software like GameMaker that lets you create a game, add all the resources, ...
Robert Tattorn's user avatar