Questions tagged [compilation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
199 views

Is there any logical reason to "store" just one object file (.o) into archival file (.a)?

As far as I understand (not much), the archival .a file is just, roughly speaking, the collection/batch of object .o files. It's like a library of compiled code that can be cached and which can be ...
LeaBit's user avatar
  • 151
-3 votes
3 answers
242 views

why do we need instructions set for processor or controller?

Why is it necessary to have an instruction set for processors and controllers? Can't we simply convert high-level language programs, like those written in C, directly into binaries without the need ...
Harshith Gowda's user avatar
-1 votes
2 answers
184 views

When writing a tokenizer, what is the standard practice for handling aliased language keywords?

When writing a tokenizer, what is the standard practice for handling aliased language keywords? For example, notethat signed short int is a language keyword in C++ and several aliases might be allowed....
Samuel Muldoon's user avatar
-3 votes
3 answers
72 views

How to Validate Output Binary During/After Compilation on Platform without ECC Memory [closed]

On a platform with ECC memory, you can assure the compiled binary is 100% legit with EDAC daemon. (single-bit error will be corrected automatically, and multi-bit error will be logged so you can just ...
hurryman2212's user avatar
0 votes
0 answers
44 views

How could i reduce compilation time without using less templates? [duplicate]

I am part of a small project that is doing some research code in C++. Our work involves a lot of mathematics and due to its nature we often need to temporarily use other people's code/libraries. To ...
Makogan's user avatar
  • 261
1 vote
4 answers
2k views

Does the JVM compile bytecode into machine code and run it or does it just run bytecode directly?

Java source code is compiled into bytecode for the JVM. But, how does JVM convert bytecode into machine code? Does it re-compile bytecode into machine code and then run it? Or does it simply just run ...
Grateful's user avatar
  • 149
0 votes
1 answer
265 views

How is it possible to have an efficient edit-compile-try cycle on large codebases?

Related (but different) question: How do you dive into large code bases? I have always worked on small projects where editing a piece of code is easy: you modify the code, you recompile and in a ...
Acerbic's user avatar
  • 69
-3 votes
2 answers
218 views

How specific is hardware optimization when building from source/how do I know?

How specific is hardware optimization when building from source and what should I look for in the documentation to decide if building for my hardware might be worth it? From threads like this one I ...
Stonecraft's user avatar
-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
0 votes
1 answer
1k views

Gradle build interdependence between compilation and integration test

Scenario After having written an integration test in in JUnit 5, that executes the compiled project.jar, I used to manually compile the project after modifications, then manually execute the ...
a.t.'s user avatar
  • 225
-1 votes
1 answer
625 views

How to modify and compile ONLY few java files among many thousands and deploy? [closed]

This is basically a code development question that deals with frequent changes to one or more java files among many thousands. A few years ago, as a software intern, I was given a large java / jsp ...
gordonprog's user avatar
1 vote
2 answers
916 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 (...
Hazel へいぜる's user avatar
63 votes
9 answers
13k 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 ...
einpoklum's user avatar
  • 2,508
5 votes
3 answers
17k 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 ...
Arthur Tarasov's user avatar
3 votes
1 answer
414 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 ...
SuperJMN's user avatar
  • 443
-7 votes
1 answer
225 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 ...
Sanich's user avatar
  • 243
0 votes
2 answers
637 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). ...
coding_ninza's user avatar
1 vote
5 answers
326 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 ...
iArnold's user avatar
  • 119
8 votes
3 answers
7k 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 ...
Qqwy's user avatar
  • 4,799
6 votes
3 answers
3k 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 ...
Christian Dean's user avatar
0 votes
3 answers
203 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 ...
reemq8's user avatar
  • 13
5 votes
1 answer
2k 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?
Frederick Zhang's user avatar
4 votes
1 answer
231 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 ...
Jodes's user avatar
  • 849
0 votes
1 answer
116 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 &...
diego9403's user avatar
  • 103
2 votes
4 answers
513 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 ...
John Dream's user avatar
2 votes
1 answer
3k 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-...
iammilind's user avatar
  • 2,232
1 vote
1 answer
429 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 ...
NeinDochOah's user avatar
5 votes
0 answers
869 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 ...
amaidment's user avatar
  • 428
2 votes
1 answer
456 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 ...
Burdock's user avatar
  • 203
2 votes
2 answers
669 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 ...
Rk..'s user avatar
  • 125
0 votes
2 answers
302 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?...
m fran's user avatar
  • 131
6 votes
1 answer
7k 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 ...
Mitch Lindgren's user avatar
1 vote
2 answers
279 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 ...
satej k's user avatar
  • 11
5 votes
2 answers
7k 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 ...
user avatar
0 votes
3 answers
221 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 ...
m0nhawk's user avatar
  • 1,490
2 votes
2 answers
2k 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 ...
petko10's user avatar
  • 31
-2 votes
1 answer
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 ...
cseav's user avatar
  • 19
38 votes
6 answers
13k 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 ...
Thunderforge's user avatar
  • 2,708
2 votes
4 answers
141 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 ...
Peter Smith's user avatar
  • 2,587
170 votes
1 answer
67k 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 ...
Aviv Cohn's user avatar
  • 21.4k
19 votes
11 answers
11k 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" ...
Serge's user avatar
  • 891
8 votes
3 answers
5k 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 ...
jds's user avatar
  • 1,102
2 votes
2 answers
2k 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 ...
wirrbel's user avatar
  • 3,028
7 votes
2 answers
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 ...
Ryan Rich's user avatar
  • 179
5 votes
5 answers
7k 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 ...
Googlebot's user avatar
  • 3,243
0 votes
1 answer
533 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 ...
pradyunsg's user avatar
  • 245
1 vote
0 answers
77 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 ...
user1049697's user avatar
4 votes
3 answers
666 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 ...
backToBasics's user avatar
12 votes
3 answers
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 ...
Mr. JavaScript's user avatar
9 votes
4 answers
1k 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?
Arun's user avatar
  • 477