Stretching of "compile" to include "assemble"

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
tepples
Posts: 22017
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Stretching of "compile" to include "assemble"

Post by tepples » Sun Nov 02, 2014 3:44 pm

In [url=http://forums.nesdev.com/viewtopic.php?p=135895#p135895]this post[/url], koitsu wrote:P.S. -- Nitpicky terminology thing (take with grain of salt), but: assembly code is assembled, not compiled. :)
These words have precise accepted definitions:
  • Preprocess: Perform lexical macro substitution on a source code file to produce a translation unit
  • Compile: Translate a translation unit in a high-level language to a low-level language, usually assembly language
  • Assemble: Translate a translation unit in assembly language to an object code file
  • Link: Resolve references from one object code file to another and produce a larger object code file
  • Source code: "The preferred form of a work for making modifications to it" (GPLv2; GPLv3)
In order to target multiple object code formats, many compilers produce assembly language as their output instead of object code directly. These compilers ship with a "driver program" that calls the preprocessor, compiler, assembler, and linker in turn. For example, GCC includes gcc which calls cpp (the preprocessor), cc1 (the compiler proper), as (the assembler), and ld (the linker), and cc65 includes cl65 that does analogous things. But because the compiler uses the most CPU cycles of the bunch, people started to refer to the whole toolchain as the "compiler":
  • Compile (colloquial): source code goes in, object code comes out.
This process also happens to cover what an assembler does. Is there a better verb than "compile" to refer to translating a program whose source code is in either C or assembly language to object code?

User avatar
Bregalad
Posts: 7889
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: Stretching of "compile" to include "assemble"

Post by Bregalad » Mon Nov 03, 2014 2:31 am

I have also been scolded by someone on 6502.org because I said I was "compiling 6502 assembly code" or something like that. But for me compile is a more generic term, while "assemble" is a specific term. Therefore for me both are correct.

Saying you assemble a high level language would definitely be wrong, though.

User avatar
rainwarrior
Posts: 7824
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Stretching of "compile" to include "assemble"

Post by rainwarrior » Mon Nov 03, 2014 10:39 am

There is a time and a place where compile needs to mean just one specific thing, like the "compile" stage when building a C++ project. It is usually quite clear by the context when this meaning is required.

Otherwise, yes it's fine to "compile" assembly code. It's fine to "compile" a build (compile and link, assemble and link). It's fine to "compile" a CHR file (process a PNG into CHR data). It is a very broad and useful term this way.

User avatar
mikejmoffitt
Posts: 1351
Joined: Sun May 27, 2012 8:43 pm

Re: Stretching of "compile" to include "assemble"

Post by mikejmoffitt » Mon Nov 03, 2014 11:28 am

I don't know, I think discarding specific meaning of a technical term in favor of having something "easier" to say colloquially isn't a great thing. I think a lot of situations where "compile" is used to describe the general process of "source and resources in, binary out" can be better generalized with "build".

3gengames
Formerly 65024U
Posts: 2276
Joined: Sat Mar 27, 2010 12:57 pm

Re: Stretching of "compile" to include "assemble"

Post by 3gengames » Mon Nov 03, 2014 12:16 pm

When talking about assembly, the only difference is the semantics are exactly what is defined by the processor. I would say both are correct for assembly code. Only when I talk about C am I strict about calling it assembling from the people I help out with this stuff.

User avatar
Punch
Posts: 362
Joined: Sat Feb 16, 2013 11:52 am

Re: Stretching of "compile" to include "assemble"

Post by Punch » Fri Nov 07, 2014 2:10 pm

I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P


Your description of being scolded on 6502.org sounded like people that go nuts if you say "Linux" instead of "GNU/Linux" :lol:
This is a block of text that can be added to posts you make. There is a 255 character limit.

tepples
Posts: 22017
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Stretching of "compile" to include "assemble"

Post by tepples » Fri Nov 07, 2014 4:17 pm

"Linux" is correct when referring to GNU/Linux, Android, and embedded stuff put together.

If you happen to be in Finland in July and August, I challenge you to go to Assembly and say it should be called "High Level Language" because PC demos aren't written in 100% asm anymore.

zzo38
Posts: 1067
Joined: Mon Feb 07, 2011 12:46 pm

Re: Stretching of "compile" to include "assemble"

Post by zzo38 » Sat Nov 08, 2014 2:00 pm

The name "Linux" correctly refers to the kernel, although a GNU/Linux system is still a kind of Linux system (although sometimes it is abbreviated when it is made clear otherwise).

Also, some compilers directly convert from high-level into binary codes, and don't use an assembler. Also, there is some "high level assembler" programs, too. Furthermore there are assemblers that may include macros. A few programs may be written directly in hexcodes, and therefore don't have any source-codes. Some systems have "dependent macros", where it isn't possible to do preprocessing separately from the rest of the program. Some compilers use intermediate codes, such as LLVM. At least one assembler even allows the program to contain a custom postprocessor, which is assembled like the rest of the program but into a separate memory space, and then is executed just before writing out the data to the target file.
[url=gopher://zzo38computer.org/].[/url]

User avatar
mikejmoffitt
Posts: 1351
Joined: Sun May 27, 2012 8:43 pm

Re: Stretching of "compile" to include "assemble"

Post by mikejmoffitt » Sat Nov 08, 2014 10:04 pm

Punch wrote:I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P
I still think of this as your build process of which assembly is one component.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Stretching of "compile" to include "assemble"

Post by koitsu » Sun Nov 09, 2014 6:48 pm

mikejmoffitt wrote:
Punch wrote:I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P
I still think of this as your build process of which assembly is one component.
I'm in agreement here, although I would describe that process as either "generation" (you're creating something), or for the first step, concatenation.

User avatar
Bregalad
Posts: 7889
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: Stretching of "compile" to include "assemble"

Post by Bregalad » Mon Nov 10, 2014 2:38 am

Your description of being scolded on 6502.org sounded like people that go nuts if you say "Linux" instead of "GNU/Linux" :lol:
No, it was more like "Youngs guys have no respect for nothing, they don't know how to use the proper terms, etc, etc..."

And by the way I've checked the doccumentation of WLA-DX, and it says everywhere "compilation", even though it's just an assembler.

Pehaps if there was a more appropriate word for the fact to transform high level language into it's low level equivalent, "compile" wouldn't be ambigious anymore and would refer to the generic transformation of any program into another form unambigiously.

Post Reply