Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [compiler]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
150 views

structs are great, the only problem is that not only do they associate data (topo)logically, they also crystallise a memory layout for that set of concepts. I would like to avoid the latter. So I'm ...
Engineer's user avatar
  • 781
1 vote
2 answers
346 views

I have a personal project, I want to write a JIT compiler/runtime in Rust (well, the language is not that relevant). I'm thinking about using a technique where the code is interpreted first and then ...
freakish's user avatar
  • 3,085
0 votes
5 answers
623 views

In various languages I came across during my career require some import/using/include etc. to refer to the code in other file. while the same languages also require a package manager or a list of ...
Simple Fellow's user avatar
0 votes
1 answer
111 views

<Definition> ::= <Name> <LeftPar> <param> <RightPar> <Name> ::= <Letter><LetterTail> <LetterTail> ::= <Letter><LetterTail> | ‘’ A ...
User's user avatar
  • 11
0 votes
0 answers
122 views

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
1 vote
0 answers
459 views

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
1 answer
258 views

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
1 vote
1 answer
169 views

I would like to have a series of small stand-alone services that would either consume a Kafka topic and output the data into a different system or the reverse: receive data from a system and produce ...
mparada's user avatar
  • 11
15 votes
6 answers
6k views

In C# and C++, an apparent trend is in place to reduce / avoid inheritance: C#: "Sealing types can improve performance." https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/...
user avatar
0 votes
1 answer
594 views

I've just accidentally came across this answer about inlined functions and I'd like to know how this affects call stack. But I can't add comments because I don't have enough rep so I decided to ask ...
b3rry's user avatar
  • 3
1 vote
0 answers
165 views

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
0 votes
1 answer
194 views

I was looking through the prettier docs and the prettier source code. It essentially has those defined helper functions to layout the text, given an AST. It operates on the level of the whole file, on ...
Lance Pollard's user avatar
0 votes
1 answer
615 views

I'm writing my own F#-esque language and I'm using LLVM for code generation. I want my language to support continuation passing style and I think I've got TCO figured out but I cannot figure out how ...
Gabriel's user avatar
  • 11
0 votes
2 answers
353 views

Does modular design decrease compilation time in cpp? My professor said so, but I don't understand how, because the build and compilation time depend on the amount of code, right? Also, wouldn't ...
happy's user avatar
  • 11
-3 votes
3 answers
367 views

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
1 answer
136 views

Recently I encountered an issue at work where a unit test written in C++ would crash only when being compiled with MSVC 2017 (MSVC 2019 and up are fine). I tried to debug this issue and it seems like ...
yijiem's user avatar
  • 107
0 votes
1 answer
252 views

I have seen information that at least one of reasons why type placed before variable name is that it allows compiler easier evaluate size and type of variable. If so then how (what way) it eases this ...
Ya Y's user avatar
  • 29
-1 votes
2 answers
223 views

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
0 votes
1 answer
879 views

I'm creating a language parser on a microprocessor in C++. For the tables of keywords and commands, rather than maintaining a single curated file (alphabetically sorted, etc), I'd prefer to declare ...
SteveG's user avatar
  • 33
0 votes
1 answer
177 views

In the case of kotlin, rust and many other programming languages... There are variables with direct implicit type declarations... Where you can see the type of a variable at the same line where it's ...
user avatar
-1 votes
1 answer
242 views

I'm trying to build a simple compiler for a subset of the C language in C. To achieve this, I needed to figure out a way to represent the grammar symbols. Basically, each symbol can either be a "...
Mehdi Charife's user avatar
-1 votes
3 answers
249 views

I am working on a compiler in TypeScript, and currently am focused on how to pass around the "lexical scope" to the relevant objects. Essentially every time there is a conceptual major ...
Lance Pollard's user avatar
13 votes
8 answers
6k views

I'm recently learning the programming language, and I wonder how compilers work when the language itself does not allow recursion, like how the compiler or the runtime checkers makes sure that there ...
csxyyyyy's user avatar
  • 151
7 votes
3 answers
2k views

Assuming that a VM runs a JIT compiler on otherwise "interpreted" code, such as a line by line interpreter or some form of bytecode/IL code and determines that it can create optimised native ...
AIWalker's user avatar
  • 1,365
0 votes
1 answer
2k views

I followed the guide here https://quarkus.io/guides/building-native-image to set up a minimal quarkus webservice graalvm native image. Ran command 'time quarkus build --native' to compile the example. ...
vancan1ty's user avatar
  • 119
1 vote
1 answer
115 views

Processors have come a long way in their handling of unaligned data - from crashing at the very notion of it, through suffering severe penalties, all the way to having almost no impact. I suppose it ...
dtech's user avatar
  • 763
3 votes
1 answer
2k views

Is there any performance detriment to assigning variables vs using them inline. I'm guessing this WOULD be worse if a method was returning primitive and I was 'boxing' it (e.g. method returning int, ...
nanotek's user avatar
  • 341
-3 votes
3 answers
100 views

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
1 answer
167 views

TL;DR: How do you manage the complex development toolchain in different (embedded) projects? In our company we are discussing the toolchain setups in different development teams and how to work ...
ThePMO's user avatar
  • 109
0 votes
1 answer
212 views

How do compilers parse complex data types names like function pointers. The type has to be somehow put into the AST or it has to be processed during parsing. What are the pros and cons of different ...
Wojak2121's user avatar
-3 votes
1 answer
488 views

I know that a lot of compilers use an assembler to compile to machine code, to make an executable (compiled program). Some people even made their own assemblers, or they just use an existing assembler,...
Jack Murrow's user avatar
-2 votes
2 answers
366 views

Certain OS in it's system requirement doesn't specify anything peculiar like in case of ubuntu it asks only for "2 GHz dual core processor or better". If yes, how does it compares with ...
D J's user avatar
  • 107
0 votes
3 answers
462 views

I'm creating a very simple compiler PoC that only has Procedures Calls to procedures. The syntax of the language is really simple: Main { Call("Proc1"); } Proc1 { // Empty } I ...
SuperJMN's user avatar
  • 453
3 votes
2 answers
847 views

Given the abstract syntax tree (AST) of each line of a function's code, I am asked to generate code for that function's corresponding unit tests, similar to what Microsoft's IntelliTest tool does here:...
David Johnson's user avatar
0 votes
3 answers
982 views

Logically, not based on how cost we will spend or how much we will hire programmers to do it. Can we (Is it possible to) make a compiler for any dynamic/script/interpreter language, like Lua, Python, ...
Zaher Dirkey's user avatar
-5 votes
2 answers
193 views

Suppose we maintain a massive electronic library of texts/photos/videos etc., and want to ensure that these files are readable indefinitely long in the future. [Update] one of the major problems with ...
Ilya Zakharevich's user avatar
1 vote
0 answers
414 views

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
-2 votes
3 answers
501 views

Considering example below, one observe that for reference type argument is successfully understood as nullable parameter. For value type conversion to T?/Nullable<T> fails. T Method<T> ( T?...
Yarl's user avatar
  • 298
5 votes
5 answers
3k views

I recently started researching about coding, but there are a few things that made me confused. I chose Visual Studio Code to start coding in C and Python (I was using IDLE for Python before), but ...
Burcu Avcu's user avatar
4 votes
1 answer
5k views

A very straightforward question. When I think about many of the member functions I create for my classes, many of them can be made static without affecting any functionality whatsoever. If I do so; ...
Anon's user avatar
  • 3,649
0 votes
1 answer
396 views

I am trying to build a static program analyzer for a proprietary progamming language for a school project, and am currently trying to implement the parser from scratch. I was wondering, what are the ...
Meowmi's user avatar
  • 101
0 votes
2 answers
114 views

Suppose we have a code: for(int i=0;i<n;i++) sum+=i; We say the time function here is: f(n) = n+1+n = 2n+1. The order of the time function is 1. So, our time complexity becomes O(n). But, for the ...
Md Mosleh Uddin's user avatar
2 votes
3 answers
279 views

I am brain storming on how to create a type system for a programming language, and what the compiler will do with the typing information. Here is what I have found, followed by the main question, ...
Lance Pollard's user avatar
2 votes
1 answer
2k views

This occurred to me when looking at stencil computations in numpy. This python library compiles compute-intensive components, so I believe that it's a valid example. Here making selections on an array ...
Daniel Krajnik's user avatar
-2 votes
1 answer
528 views

C and C++ have standards, but support isn't perfect, the only available copies on the internet are drafts, and there are immensely useful things that aren't standard, such as __attribute__((cleanup)). ...
Dan's user avatar
  • 123
-1 votes
3 answers
941 views

Say we call 10000 setTimeouts, each with a random time, each with a few nested timeouts too. What happens in terms of the 1 call stack, or are there multiple call stacks? How does that work? So for ...
Lance Pollard's user avatar
1 vote
4 answers
399 views

As far as I know the big argument for C#, Java and other high level languages having to be memory managed by a runtime environment is that the programmer does not take care of garbage collection or ...
stevie's user avatar
  • 225
1 vote
2 answers
2k views

When using templates we can have T be any type upon class instantiation. If T is a specific type that needs to be handled differently or in a special way we can specialize or partial specialize that ...
Francis Cugler's user avatar
26 votes
4 answers
6k views

Presuming that I have written some sequential code where it can be broken down into multiple isolated tasks, it seems it might be efficient for concurrency to be introduced. For example print(...
Ben's user avatar
  • 369
1 vote
3 answers
3k views

EDIT: Perhaps what I am misunderstanding is that when it is said that the code we type gets turned into machine code of 0s and 1s. If these 0s and 1s are the abstracted representation of their ...
steez's user avatar
  • 31

1
2 3 4 5
10