Why do we learn compilers? – Computer Science Stack Exchange

Let me break down some possible interpretations of your question:

What is the purpose of learning compilation?

There are several possible answers:

  1. This should be required so that you know how to create a compiler. This is not a good answer these days.
  2. Part of the goal of the computer science curriculum is to explain how a computer works, paying attention to the hardware. This includes the operating system, file systems, the compiler, the network stack and much more.
  3. As a programmer, you use compilers. Sometimes it helps to know what happens under the hood. For example, if you understand garbage collection, you can more easily choose which language to use in embedded applications.
  4. The compilation is part of the standard curriculum, so you may be asked about it in interviews.

Why are you teaching me to compile?

Apart from the reasons mentioned above, there is another one: the universities are very conservative. In the past, it has become increasingly important to understand how compilers work. This is less important these days, but change is slow, material
that made sense 10 years ago and is still taught today.

That means some universities could reform their compilation curriculum, for example, by reducing parsing, focusing on more exciting aspects such as optimization, memory management, dynamic and static analysis, and the like.

Why do I study compilation?

As a prospective programmer, your university education includes many seemingly useless classes, such as calculus. People go to university for a variety of reasons – it's a rite of passage, an opportunity for socializing and dating, and it can help you find a job. or just family or peer pressure.

Some people refrain from university education, prefer another formal education or even self-education. Some of these people are very successful.
For some reason you opted for the university and not for one of these alternative routes. They should accept that university education is more theoretical and try to make the most of it.

Will C ++ Header Only will support the future direction of the C ++ programming style with the supporting compilers / tools in the near future

Writing C ++ code with just a header is more convenient, but it is not efficient if the program needs to be continually recompiled. Is it possible in the future that C ++ will be fully optimized in this type of programming? This will be very helpful for new programmers in C ++ and avoid the complex compilation process.

vb.net – How is MsBuild related to the compilers vbc.exe and csc.exe in Visual Basic or C #?

These are the concepts that I have just read on the internet:

VBC.EXE is the Visual Basic Compiler.
CSC.EXE is the C # compiler

MsBuild is the compiler that uses Visual Studio to translate Visual Basic and C # into intermediate code.


I do not understand how these terms are related.

Automata – How do compilers use a regular language, a context-free language, and a context-sensitive grammar to shape the language?

I know that regular language can be used for pattern matching, context-free language is used for syntax matching, and context-sensitive for semantics or meaning of the sentence. But I find it hard to imagine how the whole process works. For example, say we want to justify a statement in any language, and then how should I begin to form a complete sequential generation of the grammars that correctly represent the language.

what I think is like this. Suppose we want to match the first characters of the statement first. Now we try to feed the input into many of the machines that work in the background. When one of them reaches the final state, we have a match and issue a token. Its class is like the data type, identifier, and so on, but at the same time we check that other machines have the same pattern as for & # 39; int & # 39; match that there are two machines that reach the final state, one for keywords and the other for identifiers We then check the priority. Now that we have assigned a class to each string that we did with pattern matching and now go to syntax, we'll use CFG. From here I do not know how to proceed. Please tell me how we work from here. Even if you find something wrong here, tell me it's much appreciated.

Java – How to organize a project when it gets more complex and depends on multiple languages ​​and compilers across multiple operating systems?

I wrote a music player and library in Java for GNU / Linux and Windows.

My build process is currently in ANT, but I intend to switch to the next version of something more modern. Probably Gradle.

The project was originally in pure Java, but to access certain features, I had to build several native functions in a special enclosure and integrate them into my program using JNI.

Here is an overview:

  • Hypnos Base – written in Java
  • JXGrabKey – An existing open source hotkey library modified by my project to support Javafx.
  • GNU / Linux Native Launcher – written in C ++, compiled with g ++,
  • Windows Native Launcher – written in C ++, compiled with cl.exe,
  • GNU / Linux GTK Tray Icon – written in C, compiled with gcc,

My src tree is currently the standard for Java:

  • src
    • network
      • Joshuad
        • Hypnos
          • [all the Hypnos Base code and packages]
    • jxgrabkey
  • packaging
    • NSIS script for Windows Installer
    • AppImage for the standalone runtime of Linux

For the different native compiled code, I compiled it by hand when needed and then provided ANT in binary form to make my packaging.

When adding more and more native code, I'd like to be able to recompile the entire project as needed instead of having to manually run each module before starting ANT. It feels irresponsible to have an open source project where the build process is secret.

My primary development system is Ubuntu 18.04. Before that day, the entire build code was possible on this system. Now I've added the native launcher for Windows, which is currently being compiled with cl.exe and is aimed at 64-bit Windows. It is relatively simple code (~ 60 lines) with a single function. WinMain, some basic library linking works and passing on jvm.dll,

This post may be too open for this site, but I thought I would try. What are some paradigms or resources that I can use to try to make my build process a little more reasonable?

What is the difference between A normalization and K normalization for compilers?

Administrative normal form is a program intermediate representation in which each direct command has a name. It is used in GHC.

K-normalized form is an intermediate representation in which each instruction consists of an assignment and an operation. It is used in MLKit, Min-Caml and GoCaml.

For both A-normalization and K-normalization, a Let expression is generated with a continuation.

A normalization and K normalization seem to be exactly the same transformation. What is the difference between them, so they deserve different names?