Skip to main content

New answers tagged

2 votes

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

For now I don't plan on having the compiler operate on anything other than complete modules. Frame challenge: if the compiler has to read the complete source of a module every time any file in the ...
John Dallman's user avatar
7 votes

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

Frame challenge: In general in my language, the order of declarations doesn't matter, but there are edge cases when it does. That's not great. If "independent" units aren't independent, ...
R.M.'s user avatar
  • 179
1 vote

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

Alsys Ada did this in two phases: Code was compiled with the information available, including generating calls to pieces of code expected to be supplied later in other modules. A special Ada linker - ...
davidbak's user avatar
  • 353
1 vote

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

Tyr has been like that from the very beginning. The definitions in files can be distributed amongst files in the same module without changing the semantics. The solution here is to merge the ASTs from ...
feldentm's user avatar
  • 1,831
3 votes

How do languages where multiple files make up a module handle combining them into one translation/compilation unit?

I think that what you're describing is almost exactly the Go package system: Declarations from multiple files are combined into a single unit. Each file has a ...
Michael Homer's user avatar
  • 13k
2 votes

Executable files with a bytecode compiler/interpreter

It is certainly possible to write a compiler which accepts bytecode as its source and outputs native code. That's what Java's JIT compilers do, after all. Writing one that produced standalone ...
keshlam's user avatar
  • 121
9 votes
Accepted

Executable files with a bytecode compiler/interpreter

It depends on what you mean by "native executable". If you mean "runs natively on the hardware", then no: if you don't have machine code, then you don't have machine code, and a ...
Karl Knechtel's user avatar
19 votes

Executable files with a bytecode compiler/interpreter

Here is one way to do it, which is used by the LÖVE game engine: The bytecode gets stored in a .zip file which gets concatenated to the interpreter. When the interpreter starts up, it tries to open ...
Jasmijn's user avatar
  • 990
7 votes

Executable files with a bytecode compiler/interpreter

As long as you have a bytecode interpreter implemented, all you need to do is generate a program that's the equivalent of ...
dan04's user avatar
  • 1,959

Top 50 recent answers are included