The compiler tag has no wiki summary.
-2
votes
0answers
56 views
A python complier for a program [on hold]
I want to make a module software (an extension of a current python library) in python where by a compiler would be needed to interpret code inputed by the user who will be using the software. So ...
0
votes
2answers
150 views
Path to learning compiler design [closed]
I'm not sure if this is an acceptable question, but compiler-os-design-where-to-start was, so I figured that I'd take a shot at it.
I have taken no formal Computer Science classes. I have programmed ...
4
votes
2answers
210 views
Should I commit my generated parser to source control?
I'm using a parser generator to build a compiler. Should I commit the source files produced by the parser generator?
I want to commit them to avoid a dependency on the parser generator during the ...
0
votes
2answers
398 views
How would I make a compiler in C++? [closed]
This probably been asked for but I can't google "How to make a compiler in C++" because I will just get "How to compile C++" as the results. Anyway, for my question, I'd like to make a simple ...
-1
votes
1answer
146 views
beginner question about compiler [closed]
I learned that a compiler translates a source file in a high-level language to an object file in machine language.
I use Code blocks IDE, which is backed by MinGW compiler.
But when I hit F9, Code ...
7
votes
5answers
296 views
Is it a good idea to read compiler source code? [closed]
I'm a junior in college majoring in Computer Science. Apart from writing lots of code, I want to start reading source code written by others to improve my coding skills and learn better/different ways ...
3
votes
2answers
246 views
Implementing non-fixed length array support in a compiler
I'm thinking of building a language for PIC microcontrollers. I want to be able to use non-fixed size arrays, like this:
Declare the variable as int[]
Wait for input from serial connection
Make the ...
4
votes
3answers
1k views
Understanding stack frame of function call in C/C++?
I am trying to understand how stack frames are built and which variables (params) are pushed to stack in what order? Some search results showed that the C/C++ compiler decides based on operations ...
3
votes
1answer
599 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?
5
votes
3answers
260 views
Compiling multiple languages and Javascript
I have read numerous times that programming languages when making games or large software often use multiple languages / scripts together. I'm wondering how that works. How do they compile it? How ...
8
votes
3answers
360 views
Convert an interpreter to a compiler?
First off, I know this is a question asked by MANY other programmers before me. But I couldn't find any useable resource that could help me.
Well, I'm creating an programming language called "Light" ...
88
votes
10answers
22k views
Is Ken Thompson's compiler hack still a threat?
Ken Thompson Hack (1984)
Ken Thompson outlined a method for corrupting a compiler binary (and other compiled software, like a login script on a *nix system) in 1984. I was curious to know if modern ...
7
votes
3answers
293 views
What are the challenges related to typing in writing a compiler for a dynamically typed language?
In this talk, Guido van Rossum is talking (27:30) about attempts to write a compiler for Python code, commenting on it saying:
turns out it's not so easy to write a compiler that maintains all the
...
0
votes
0answers
251 views
Steps in converting a grammar to LL(1) Grammar
I have the following question:
Convert the following grammar into an LL(1) grammar which recognises the same
language (you may assume that the grammar is unambiguous).
A -> int
A -> int + A
A ...
4
votes
4answers
565 views
Can someone provide a short code example of compiler bootstrapping?
This Turing award lecture by Ken Thompson on topic "Reflections on Trusting Trust" gives good insight about how C compiler was made in C itself.
Though I understand the crux, it still hasn't sunk in. ...
27
votes
6answers
6k views
Why does Facebook convert PHP code to C++?
I read that Facebook started out in PHP, and then to gain speed, they now compile PHP as C++ code. If that's the case why don't they:
Just program in c++? Surely there must be SOME errors/bugs when ...
1
vote
1answer
189 views
Brief explanation for executables in a GNU/Clang Toolchain?
I roughly understand that cc, ld and other parts are called in a certain sequence according to schemes like Makefiles etc. Some of those commands are used to generate those configs and Makefiles. And ...
1
vote
1answer
427 views
Do compilers have to be written for each model of CPU?
Do you need to take account of the different processors and their instructions when writing a compiler? Have instructions been standardised? Or what tools and techniques are available to assist with ...
0
votes
5answers
700 views
why compiler design/coding design considered the highest level activity in programming? [closed]
In some recent articles I have read I have found that in the programming ladder compiler design is always considered as highest level activity. Why is this so? Why not database design or network ...
3
votes
5answers
7k views
How to write a very basic compiler [duplicate]
Possible Duplicate:
Best Online resources to learn about Compilers?
What would be the best way to learn about compilers, and executable formats?
Advanced compilers like gcc compile codes ...
0
votes
6answers
777 views
Can I get a C++ Compiler to instantiate objects at compile time
I am writing some code that has a very large number of reasonably simple objects and I would like them the be created at compile time. I would think that a compiler would be able to do this, but I ...
2
votes
5answers
2k views
How are operators organized in memory
How are operators organized/saved in the memory in context of a programming language. Are they procedures/functions saved somewhere and compilers just manipulate things to call these procs whenever ...
5
votes
4answers
663 views
Programming Language Parser (in Java) - What would be a better design alternative for a special case?
Background
I'm currently designing my own programming language as a research project.
I have most of the grammar done and written down as context-free grammar, and it should be working as is. - Now ...
6
votes
5answers
856 views
Why is it called Just In Time?
I know what the JIT compiler is but how about why is it called that, it obviously catches exceptions Just in Time, but how and why should it be called this?
Sorry if this sounds a bit vague.
3
votes
5answers
896 views
Understanding hand written lexers
I am going to make a compiler for C (C99; I own the standards PDF), written in C (go figure) and looking up on how compilers work on Wikipedia has told me a lot. However, after reading up on lexers ...
11
votes
3answers
324 views
How compilers know about other classes and their properties?
I'm writing my first programming language that is object orientated and so far so good with create a single 'class'. But, let's say I want to have to classes, say ClassA and ClassB. Provided these ...
0
votes
2answers
743 views
Is there a more modern program than lex or yacc, which does not require JVM?
Is there a "modern" bison and flex equivalent which does not require the JVM or .NET or similar "heavy" runtimes?
Thanks for comments, edit:
By modern, I mean for example Antlr and another one in ...
2
votes
6answers
2k 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
1answer
273 views
what's the most efficient emacs workflow for compilation and interactive execution cycles (C++/makefile)
I try not to cross-post, but the only response I got at stack-exchange was to post here...
What's the preferred practice for a compile-run cycle in emacs?
Previously, I used alt-x compile (mapped to ...
1
vote
2answers
447 views
Converting ANTLR AST to Java bytecode using ASM
I am currently trying to write my own compiler, targeting the JVM.
I have completed the parsing step using Java classes generated by ANTLR, and have an AST of the source code to work from (An ANTLR ...
5
votes
3answers
311 views
Should a standard include header be specified in each file or as a compiler parameter?
I've got a file such as this:
#ifndef STDINCLUDE
#define STDINCLUDE
#include <memory>
#include <stdexcept>
#endif
I want this file to be included in every header file, because I use ...
4
votes
1answer
636 views
What would be the best way to learn about compilers, and executable formats? [closed]
I want to write my own compiler for my own language. Yes, it's going to be hard, and it will take long, but I think it will be worth it.
I have looked into OSDev.org, and read about executable ...
5
votes
1answer
322 views
Apple's new compiler
I heard that Apple is going to replace the GNU compiler built into Xcode with a new compiler.
What is the new compiler and what type of changes can we expect to see?
1
vote
2answers
78 views
Methods on packaging an assembler with compiler
I am planning on creating a compiler that will generate assembly, that is as far as I really want to go with this project (don't want to create the object files myself or any of the machine code). ...
11
votes
3answers
318 views
How is type checked in a dynamic language interpreter/compiler, such as JavaScript?
In dynamic languages, such as JavaScript or Python, the type of a variable is determined at runtime. This is one reason why they are slower than typed languages such as Java.
How is type checking ...
2
votes
4answers
320 views
What programs emit C++ code and pass it to mainstream compilers?
I suspect there're programs that instead of emitting machine code instead emit C++ code and then start a mainstream C++ compiler to compile it to machine code.
I can't find any notable examples ...
6
votes
9answers
746 views
How do I know if the compiler broke my code and what do I do if it was the compiler?
Once in a while C++ code will not work when compiled with some level of optimization. It may be compiler doing optimization that breaks the code or it may be code containing undefined behavior which ...
2
votes
5answers
218 views
Where could SPMD parallel programming be used in a Compiler?
I have little knowledge about the subjects of compiler construction and parallel programming, so please bear with me. This is a course about compiler construction, and we are asked to learn CUDA while ...
6
votes
2answers
325 views
Idea for a domain specific language or DLR port?
I have my undergraduate final year project coming up and am very interested in lexers, parsers, compilers and so on. I would like to use the DLR (.NET 4.0 dynamic language runtime) for my ...
24
votes
0answers
2k views
What are the advantages of the Intel C++ compiler? [duplicate]
What are the advantages over the Intel C++ Compiler over the (much cheaper) free alternatives, such as gcc?
10
votes
2answers
481 views
How easy should a language development framework be to use?
This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework.
Another ...
1
vote
10answers
469 views
Compiler time versus programmer time
I want to briefly discuss managed or interpreted languages. It's said that they're worth developing in, because the CPU time is worth less than the programmer time required to develop in a faster ...
5
votes
7answers
370 views
Does the source language matter for your first (few) compilers?
I've been very interested in writing compilers but have been scared off by the complexity of it. I've finally took the plunge and started writing my first compiler and the language I picked is ...
9
votes
4answers
471 views
General rules for writing a X compiler to Z in Y
Suppose X is the input language, Z is the output language, then f is the compiler, which is written in language Y.
f = X -> Z
Since f is only a program, I think Y can be any language, right? So ...
14
votes
5answers
3k views
What is the history of the C compiler?
When we say that "Dennis Ritchie developed C language", do we mean that he has created a compiler (using an 'already' developed other language) which can compile the source code written in C language?
...
1
vote
2answers
122 views
Cross-library and cross-programming-environment support
Often people talk about cross-platform compatibility, but is it possible to write such "universal code" that would work both in browser, in desktop, on opengl, on webgl, and on html5 canvas-object? ...
7
votes
2answers
834 views
Why isn't anyone talking about parallel compilation for .Net?
Builds are slow and take time. We can get MSBuild to parallelize them, but only on a single machine, not across a cluster. Why hasn't anyone come up with clustered build solutions in the .Net space? I ...
11
votes
7answers
633 views
Do you read C or C++ compile errors after the first one?
I never understood why C and C++ compilers try to recover from errors and continue parsing. Almost always, the first error generates a stream of bogus errors that will disappear as soon as the first ...
3
votes
5answers
956 views
Learning to implement dynamically typed language compiler
I'm interested in learning how to create a compiler for a dynamically typed language. Most compiler books, college courses and articles/tutorials I've come across are specifically for statically typed ...
18
votes
6answers
765 views
Aren't there compilers better at telling the programmer what's wrong in a code?
I have worked a little while with the Microsoft compiler from Visual C++ but I worked a long time with G++, and I remember often having bad times understanding what was wrong in my code with the ...