3
votes
2answers
237 views

Are (C) object files created with different compilers binary-compatible?

I understand that C++ compilers are not compatible with each other. However, I was unable to find anything on this topic for C in particular. I know that the C standard leaves a lot of room for ...
1
vote
2answers
271 views

How do we go from assembly to machine code(code generation) [closed]

I know this is abstract as it's all about signals and switch - (electronics) - underneath, but is there a easy way to visualize the step between assembling code to machine code. For example if you ...
1
vote
5answers
249 views

How to alter the code at runtime in an interpreter?

While reading the difference between Compiler and interpreter , I found the following differences fromt he internet. Advantages of using compiler: Since compiler converts the program to native code ...
1
vote
4answers
547 views

Why languages that compile to C/C++ generate unreadable, cryptic code?

I'm willing to compile certain language to C or C++ for some speedups. My idea was, though, to generate readable code and use structures such std::vector and similar wherever I can, expecting CLANG to ...
1
vote
3answers
188 views

Requiring a specific order of compilaiton

When designing a compiled programming language, is it a bad idea to require a specific order of compilation of separate units, according to their dependencies? To illustrate what I mean, consider C. ...
0
votes
1answer
225 views

How small is the footprint of a small C compiler?

This week I could optimize using a reduced C library that allowed a drastic shrinkage in code size - from about 60 K to about 6 K and then we could load the code in the 8 K on-chip memory of an FPGA ...
5
votes
2answers
481 views

Learning YACC nowadays, does it make sense? [closed]

I have a huge project that is using YACC and I would need to fix a bug in it. I might ask someone else who wrote that to fix it but I'm interested in how compilers work. Does it make sense to learn ...
10
votes
4answers
1k views

Is it possible to use the Intel C/C++ compiler on Linux to create object files to be linked on Windows?

Why? Depending on your source the Intel compiler is likely or most definitely the compiler generating the fastest executables for the x86 architecture (5 to 100 % execution time improvement). Intel ...
3
votes
1answer
842 views

What is the Ken Thompson Hack? [duplicate]

I read some stuff like cm bell labs but i couldn't get it all. How does it work really? What is the logic in that?
18
votes
5answers
23k views

How to write a very basic compiler

Advanced compilers like gcc compile codes into machine readable files according to the language in which the code has been written (e.g. C, C++, etc). In fact, they interpret the meaning of each codes ...
2
votes
0answers
141 views

CoffeeScript translates to JavaScript. Is there something like it for C? [duplicate]

Possible Duplicate: Is there a language that transcompiles to C with a better syntax? There are many language implementations which compile to C. However, most of them have some language ...
2
votes
3answers
252 views

Integer sign and compilation via C

I'm writing a compiler that uses the time-honored strategy of using a C compiler as the back end, and I'm trying to figure out exactly how to handle integer sign. I'm using machine word integers as ...
6
votes
6answers
3k views

Is there a language that transcompiles to C with a better syntax? [closed]

CoffeeScript is a language with a very clean Ruby-like syntax that transcompiles to JavaScript. Does the same thing exists with C? Then writing more readable and as fast as original C programs would ...
1
vote
4answers
1k views

Computation Program Not Running at 100% CPU Utilization

I have a program which has a GUI and performs some very heavy mathematical computations for a couple of minutes and then outputs a result. When I try to directly interface it through its DLL's, it ...
23
votes
3answers
7k views

How could the first C++ compiler be written in C++?

Stroustrup claims that Cfront, the first C++ compiler, was written in C++ (Stroustrup FAQ). However, how is it even possible that the first C++ compiler be written in C++? The code that makes up the ...
4
votes
3answers
616 views

Role of linking, object files and executables

For a C or assembly program that does not require any other library, will linking be necessary? In other words, will conversion from C to Assembly and/or from Assembly to an object file be enough ...
8
votes
5answers
3k views

Do Fortran compilers really generate faster code than C compilers?

When I was studying in the university I often heard the idea that Fortran compilers produced faster code than C compilers for an equivalent program. The key reasoning went like this: a Fortran ...
16
votes
5answers
3k views

Are C++ templates just a kind of glorified macros?

From different comparisons among C++ templates and C#/Java generics like this one- ...
10
votes
3answers
1k views

Is Clang/LLVM ready for prime time? [closed]

Clang is able to be used instead of gcc? What your experience on that? What disadvantages there are yet? Performance of compilation is very better than gcc but about performance of code generated ...