Questions tagged [compiler]

A compiler is a computer program that transforms source code written in one programming language into another computer language.

20 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
259 views

Why does GHC represent recursion in Haskell with recursive binders instead of a fixpoint operator?

GHC's Core data type represents recursion with recursive binders in the Let constructor; as I understand it, all let expressions in Haskell are effectively let rec expressions. Why does GHC use this ...
DylanSp's user avatar
  • 265
4 votes
1 answer
366 views

I want to write a data processing & analysis programming language that compiles to SAS. How to go about choosing a language to write my compiler in?

As a side project I wrote a simple macro in SAS to add syntatic sugar to SAS code. I hate how verbose SAS is sometimes! So my macro looks like this %macro md(code); /* expects a superquoted ...
xiaodai's user avatar
  • 149
3 votes
0 answers
116 views

Windows: Have a dedicated MS Visual C/C++ toolchain

For a CI system and the developers in our team, I'd like to be able to use a specific version of a MSVC toolchain for native Windows builds. The goal is to have a well-defined consistent build-...
radix's user avatar
  • 131
3 votes
0 answers
100 views

Loop Unfolding and Named Significant Bits

I've been writing a Parser Compiler for the last seven or so years, and I recently got to the point (yet again, never satisfied) of structuring the portion dealing with the portions of the language ...
Allen Clark Copeland Jr's user avatar
2 votes
0 answers
316 views

Is it dangerous to link together -mno-red-zone and regular code?

I know that in x86_64, there exists a 128 byte red zone above (or below, address-wise) the stack pointer that functions can use without subtracting from rsp. This sounds to me like the only things ...
Ferdi265's user avatar
  • 129
1 vote
0 answers
144 views

Implementing a memory efficient Abstract Syntax Tree

I am writing a compiler in C++ 20. I am looking for ways to improve heap memory performance. For example, I can compile a 36.8 MB source file that is just many repeating lines of: let x0: string = &...
Wesley Jones's user avatar
1 vote
0 answers
86 views

How can I represent a transformed AST between compilation stages?

I'm writing a compiler in Rust. I've reached the point where I have an AST and am ready to do symbol resolution, type-checking, etc. But, I'm unsure of how to represent an AST as containing "...
gmdev's user avatar
  • 119
1 vote
0 answers
305 views

How to practically implement a symbol table during compiler design?

I was trying compiler design with flex and bison. This is my first attempt in that sense. For my compiler, I wanted to build a symbol table which would help in building a proper compile-time type-...
Sourav Kannantha B's user avatar
1 vote
0 answers
100 views

Is there a easy and useful error handling algorithm for bottom-up based parser?

My English skill is poor because I'm not a native English speaker. Please understand. I wonder that there is a error handling algorithm easy and useful in LR parser. LR Parser is bottom up based so it ...
jjw's user avatar
  • 217
1 vote
0 answers
173 views

How to get verification that you've implemented all your API in a static library?

I just learned that static library building skips the linking stage, which explains why my build process succeeds all the time when it's possible I actually haven't implemented a function in my header....
johnbakers's user avatar
1 vote
0 answers
140 views

Advantages of tiling based instruction selection algorithms with tiles representing more than one machine instruction?

In Modern Compiler Implementation in C of A. Appel some instruction selection algorithms are discussed based on tiling an intermediate representation tree. Each tile (or tree pattern) expresses a ...
Matthias's user avatar
  • 169
1 vote
0 answers
3k views

First and Follow Algorithm in Compiler Design

While I was studying Compilers,I saw an example in first and follow that illustrated how to 'find the first and follow' non-terminals in a grammer. But I couldn't get how FOLLOW(E')=FOLLOW(E)={ $ ,) }...
justin's user avatar
  • 237
1 vote
0 answers
77 views

Built-in Context-and-Input-to-Output-Hashing in Compilers

Why doesn't (open source) compilers contain builtin funtionality for (shared) caching and reuse-fetching (using SHA1-hash of compiler-version, build-flags, target-platform and inputs) of executable ...
Nordlöw's user avatar
  • 151
0 votes
0 answers
68 views

Is it possible to build a semantically unambigous grammar / language / graph?

It's been a long time that I had an idea of a semantic constraint as compiler optimizations which allows for sophisticated high level optimization allowing you to transform the AST/CFG based on a SFG (...
C5H8NNaO4's user avatar
  • 129
0 votes
0 answers
119 views

Results of testing different compiler optimizations of GNU GCC are confusing

I tested out a few different compiler optimizations on GNU GCC, in the CodeBlocks IDE. With each different optimization I ran the same test: I let my program try to build as big of a tree as it could ...
Inertial Ignorance's user avatar
0 votes
0 answers
92 views

Why are datatypes different in terms of bit size based on complier, and OS used

I was reading a tutorial on C++ as I am new to programming, and I was wondering why the sizeof operator gives different output depending on what you're programming with.
Ryan Lee's user avatar
0 votes
0 answers
3k views

Java platform vs Source/Binary format settings in Netbeans

I've just wanted to get to know what these particular settings really do: Project Properties -> Libraries -> Java Platform Project Properties -> Sources -> Source/Binary Format After a little bit of ...
radekEm's user avatar
  • 367
0 votes
0 answers
600 views

Android runtime - does ART miss optimization opportunities over Dalvik?

Is ART a strict improvement over Dalvik, or there are optimizations that an ahead-of-time compiler will miss compared to JIT, but Google decide they don't matter in practice? For example, with JIT, ...
Phil's user avatar
  • 542
-1 votes
1 answer
298 views

Do C# compilers optimize away the facade pattern?

In C#, if I hide away implementation behind a facade, or the "pimpl" pattern, does the compiler optimize away the intermediate function call if all it's doing is calling an equivalent method from ...
pugdogfan's user avatar
  • 109
-3 votes
1 answer
357 views

What programming languages besides Apple Swift & Objective-C use the Llvm compile-time Automatic Reference Counting exclusively for memory management?

Are there other general purpose programming languages besides Objective-C +ARC and Swift which target the llvm and use static compile time Automatic Reference Counting for memory management?
v217's user avatar
  • 95