Questions tagged [compilation]

The tag has no usage guidance.

1
vote
2answers
236 views

Solving issues in using post and pre increment operators as part of expressions

I recently had a discussion with a friend about code maintainability with regards to modifying an iterator inside of the body of a loop (C# syntax): List<int> test = new List<int>(); for (...
65
votes
9answers
12k views

Novice programmer(s) frustrated by lack of a glossary of compiler errors

A friend of my family asked me for a bit of help as he learns to program (in the C language). As we were talking, he expressed frustration about having a hard time understanding the error messages his ...
1
vote
2answers
6k views

Can I compile PHP to hide the code?

A pretty critical issue came up, which is more legal than technical, but I hope to find a lower cost technical solution. There are laws in some countries (I'll leave out name) where you have to keep ...
3
votes
1answer
179 views

Circular dependency problem

"Single item in a set depends on the whole set. Set depends on that item." I'm creating a compiler (https://github.com/SuperJMN/Plotty). In the last stage, the Intermediate Code is converted to ...
-6
votes
1answer
157 views

What is faster, to read 100MB from file or to compile 100MB of code?

I want to generate a test scene for a unit-test (big file parser). What will be faster, to have a test file and to perform I/O on it, or to generate a large memory buffer using some static parameters ...
0
votes
2answers
252 views

What is the meaning of the line - “the compiler is self-compiling if it is written in P”? [duplicate]

According to compiler definition, the compiler is a program that translates a program written in a programming language P (source code) into a program written in a machine language M (machine code). ...
0
votes
5answers
210 views

Where is the boundary between a programming language and the operating system itself

When a program is compiled, the code eventually ends up as instructions that can be executed by the processor. When for example a C program that writes data to a file is compiled, what code is in the ...
0
votes
3answers
2k views

Forth: How do CREATE and DOES> work exactly?

I am in the process of creating my own concatenative language, heavily based on Forth. I am having a little trouble understanding how the compiling words CREATE and DOES> work, and how they are ...
4
votes
3answers
1k views

How are literal values encoded into bytecode?

Note: This question is somewhat related to How exactly is bytecode "parsed"?, but it is not a duplicate of it. In this question, I'm asking about a specific part of how bytecode is generated, not how ...
0
votes
3answers
158 views

Creating a metaphorical compiled scripted language.

I'm studying for a final exam and I came across this question which I found pretty interesting. I was wondering what the stackExchange community who are more experience in scripted languages than I ...
2
votes
1answer
554 views

Why does Rust require external linkers? Any other similar languages?

Rust needs external linkers (e.g. GCC) to generate final output. Why doesn't it provide a bundled one? Are there any languages that does the similar?
4
votes
1answer
209 views

Compiled javascript code smell: good reasons for large classes?

I've been looking at a javascript library for drawing graphs, Dygraph, source on github. It has several enormous classes, such as here and here. Personally, I don't think justifications for large ...
0
votes
1answer
81 views

Preprocessor and double declaration include in different files

I am wondering how compiler (or preprocessor) include headers. I have three files. First is header.h, second first.cpp <- and there is #include <iostream>, third <- it contains #include &...
2
votes
4answers
437 views

Is it unusual for developers to have difficulty building their own code?

I am a build manager and release engineer with a programming/SW dev background. I manage build scripts and makefiles for our SW team on our project to produce different versions of releases and I ...
1
vote
1answer
784 views

Does having so many macros (#define) increase compilation time due to prolonged pre-processing?

In a very simplistic way, I understand: "Compilation" = "Pre-processing" + "Parsing" + "Linking" + "Executable" All the macros and other such pre-processing directives are taken care at the "Pre-...
0
votes
1answer
187 views

Are there compilers which optimize the use of mathematical functions?

Today while programming I stumbled upon the following question - are there any compilers which optimize based on mathematical assumptions? For instance in cases like unsigned int i,b; (i,b not ...
5
votes
0answers
599 views

How to monitor & record build (compile/test) time? [closed]

I work on a large-ish Java project. We are using maven as our build tool, and I use Intellij (14) as my IDE. Currently, if I build the whole project (c. 15 modules) it takes about 3 minutes. Due to ...
2
votes
1answer
269 views

Can JIT compilation be non-deterministic?

I have been profiling a lot of javascript today in writing a firefox js engine bug report, and started really noticing the slight differences between JIT compilations. While there are some obvious ...
1
vote
2answers
404 views

Compiling vs pre-built binaries on production machine?

I referred Compiling vs using pre-built binaries performance?. The post talks about performance and opportunities for optimization. My question is about reliability. I built both python and ...
0
votes
2answers
237 views

How to translate from a programming language to another?

I want to write a small DSL that will need to compile to another high level programming language (similar to C, but a lot more limited). What is the high level overview of what the compiler should do?...
5
votes
1answer
5k views

Why is Android Runtime's AOT compilation more performant than Dalvik's JIT? [closed]

With Android 5.0, Google has introduced the Android Runtime, or ART. ART "brings improvements in performance, garbage collection, applications debugging and profiling." However, it also replaces ...
1
vote
2answers
245 views

Do today's modern compilers perform run time checks?

This is regarding compilers. Do compilers perform run time dependency checks to decide to vectorize a loop ? In other words, do compilers trace through the logic as it would in run-time to ...
4
votes
2answers
4k views

How do you usually compile C/C++ source code ? (Large code bases) [closed]

It's been quite some times since I began learning C and C++ but I've been very limited only to the Windows platform and the Visual Studio environment. Recently, I wanted to look into some open source ...
0
votes
3answers
154 views

Usage of the argv[0]

Lately I've discovered that the latex and pdftex (with some other one) binaries in Ubuntu are the same: lrwxrwxrwx 1 root root 6 лип 29 18:03 latex -> pdftex* lrwxrwxrwx 1 root root ...
2
votes
2answers
935 views

Will there be a memory or processing time difference between a class member function and a global function

I'm writing a neuron network simulation program and every operation or additional byte per neuron scales insanely. I prefer C++ as a language over the others, but now I'm wondering if the class ...
-2
votes
1answer
2k views

Illustrate Meaning of : gcc -g programName.c

To debug a C program using gdb effectively it is required to compile it first using the command: gcc -g programName.c otherwise on using simply gcc programName.c and running we are unable to ...
37
votes
6answers
10k views

Are long compiles a thing of the past?

There are countless war stories about how long a compile can take. Even xkcd made a mention of it. Now, I haven't been programming for a long time and have mostly just been exposed to Java and ...
2
votes
4answers
118 views

In a large statically-typed software project with non-dynamic manual sql statements inside of it, how do you verify all the sql syntax?

One of the things I seem to struggle with frequently is the need to deploy a software application to test the database interaction. More often than I'd like, I have a syntax error or typo in my sql ...
123
votes
1answer
42k views

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes ...
19
votes
11answers
9k views

Does C++ compiler remove/optimize useless parentheses?

Will the code int a = ((1 + 2) + 3); // Easy to read run slower than int a = 1 + 2 + 3; // (Barely) Not quite so easy to read or are modern compilers clever enough to remove/optimize "useless" ...
7
votes
3answers
4k views

Why is inheritance only defined at compile-time?

I found this statement from the gang of four's "Design Patterns" particularly odd; for some context, the authors are comparing inheritance versus composition as reuse mechanisms [p. 19]: "...you ...
2
votes
2answers
1k views

Must OpenCL code be compiled for a specific GPU?

Most OpenCL Tutorials give a nice introduction to OpenCL, yet I have not found information on the question of interoperability of the compilation targets. It seems that I have to compile OpenCL code ...
7
votes
2answers
2k views

Is it considered bad practice to compile into Javascript as a matter of language preference? [closed]

I understand that compiling into Javascript is sometimes necessary and even in some cases results in a faster application. However I'm wondering if compiling into Javascript, for building web ...
5
votes
5answers
3k views

Is it bad to place “include directive” within main function?

It is always said that the include directives should be placed at the beginning of a script. The main reason is to make the functions available throughout the script. Regardless of this fact, is it ...
0
votes
1answer
249 views

Pros and cons of the following Parsing methods?

I'm thinking of making a Python-JavaScript converter/compile. I've been wondering about the pros and cons of the following methods to parse the Pythonic code, into JavaScript equivalent. Working ...
1
vote
0answers
70 views

Checking out and compiling repository. What is the correct approach for starting the compilation process?

I am writing a Bash script that automatically updates a repository containing source code and then compiles it. I have been a bit stuck on the part about how to start the compilation itself, i.e. if I ...
4
votes
3answers
645 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 ...
12
votes
3answers
1k views

Shipping my first class library. Any gotchas I need to be aware of?

I'm a Web Developer about to unlock the "First Class Library Published" achievement in my career and I'm sweating bullets (I was up all night stressing out). I'd love to tap the experience of the ...
9
votes
4answers
957 views

Constants in C#

Why does the compiler store constant values in the assembly metadata? Are they directly embedded to Intermediate Language code from the assembly metadata?
10
votes
3answers
10k views

Compiling vs using pre-built binaries performance?

Will performance be better (quicker) if I manually compile the source for a software component for the actual machine that it will be used on, compared to if the source was compiled on another ...
205
votes
5answers
259k 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 ...
6
votes
6answers
4k 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
2answers
551 views

Have javac call automatically run java [closed]

I want to be able to call javac <class file name>, and then automatically run java on the compiled .class file. I thought initially to use a x86 disassembler to hack it (javac.exe) but bumped ...
10
votes
4answers
2k views

What is the meaning of the sentence “we wanted it to be compiled so it’s not burning CPU doing the wrong stuff.”

I was reading this article. It has the following paragraph. And did Scala turn out to be fast? Well, what’s your definition of fast? About as fast as Java. It doesn’t have to be as fast as C or ...
14
votes
3answers
6k views

Why is the output of a compiler called object code?

From the essay Programming Languages Explained by Paul Graham, published in Hackers & Painters: The high-level language that you feed the compiler is also known as source code, and the ...
28
votes
4answers
29k views

What is the difference between building and compiling ?

What's the difference between Building and Compiling.
6
votes
6answers
3k views

How can I organize fast and comfortable solution compilation in VS 2010? [closed]

Most of programmers who are involved into development of more or less large project(s) know how annoying the process of compilation can be. There are some other things which are dependent on ...
10
votes
3answers
4k views

Do functional programming languages have more opportunity to do compile time optimization?

I was reading the book "Functional Programming for the Real World". It started with comparison between imperative and functional programming languages. And it stated how 'values' and 'expressions' in ...
0
votes
3answers
409 views

How to verify the code that could take a substantial time to compile? [closed]

As a follow up to my prev question: What is the best aproach for coding in a slow compilation environment To recap: I am stuck with a large software system with which a TDD ideology of "test often" ...
13
votes
8answers
4k views

Why doesn't my IDE do background compiling/building?

Today I develop on a fairly complex computer, it has multiple cores, SSD drives and what not. Still, most of the time I'm programming the computer is leasurely doing nothing. When I need to compile ...