- 1: AsmSrc -> Assembler -> binary (exe,dll,obj,etc)
2: PureSrc -> PureBasic -> asmSrc -> Assembler -> binary
3: BcxSrc -> Bcx -> cSrc -> cCompiler -> binary
4: langASrc -> langA -> binary
5: langBSrc -> langB -> PureSrc -> PureBasic -> asmSrc -> Assembler -> binary
What is a "Compiler"
What is a "Compiler"
Just interested to know what your definition of a compiler is.
@}--`--,-- A rose by any other name ..
Well, "compiler" is fairly generic and can mean several things..
http://en.wikipedia.org/wiki/Compiler
http://en.wikipedia.org/wiki/Compiler
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Re: What is a "Compiler"
A compiler is a translator for translating input in one programming language into another programming language. The second language can be as high-level as you want, provided the first language is even more high-level. (So a compiler translates "down".)Dare2 wrote:Which is a compiler? Which is a translator?
I like dictionary.com's definition better than wiki because it's much closer to how i was taught and how I've always viewed them.
compiler
<programming, tool> A program that converts another program
from some source language (or programming language) to
machine language (object code). Some compilers output
assembly language which is then converted to machine
language by a separate assembler.
A compiler is distinguished from an assembler by the fact that
each input statement does not, in general, correspond to a
single machine instruction or fixed sequence of instructions.
A compiler may support such features as automatic allocation
of variables, arbitrary arithmetic expressions, control
structures such as FOR and WHILE loops, variable scope,
input/ouput operations, higher-order functions and
portability of source code.
AUTOCODER, written in 1952, was possibly the first primitive
compiler. Laning and Zierler's compiler, written in
1953-1954, was possibly the first true working algebraic
compiler.
compiler
<programming, tool> A program that converts another program
from some source language (or programming language) to
machine language (object code). Some compilers output
assembly language which is then converted to machine
language by a separate assembler.
A compiler is distinguished from an assembler by the fact that
each input statement does not, in general, correspond to a
single machine instruction or fixed sequence of instructions.
A compiler may support such features as automatic allocation
of variables, arbitrary arithmetic expressions, control
structures such as FOR and WHILE loops, variable scope,
input/ouput operations, higher-order functions and
portability of source code.
AUTOCODER, written in 1952, was possibly the first primitive
compiler. Laning and Zierler's compiler, written in
1953-1954, was possibly the first true working algebraic
compiler.
Hi guys,
Thanks for the comments and opinions.
My initial thought was that a compiler was something that took something at least vaguely human-readable and converted it to something machine readable - that is, executable - and that most compilers today were in fact only a part of the compilation process, relying on at least a linker for the last step.
However I heard a rather heated conversation on this and so thought I would find out what others thought.
My take at the mo is that most compilers nowadays are in fact translators.
Thanks for the comments and opinions.
My initial thought was that a compiler was something that took something at least vaguely human-readable and converted it to something machine readable - that is, executable - and that most compilers today were in fact only a part of the compilation process, relying on at least a linker for the last step.
However I heard a rather heated conversation on this and so thought I would find out what others thought.
My take at the mo is that most compilers nowadays are in fact translators.
@}--`--,-- A rose by any other name ..
Heres my attempt to put it all in a context.
At the bottom of the pile is the Machine code.
Machine Code is a numeric code understood by the processor itself. Each command is a separate opcode which has a specific value.
Assembly is a set of short codes that relate to the machine code opcodes, called mnemonics.
So all an assemler has to do is take the source code and translate the mnemonics into their numeric equivalents. They usually do some other stuff, like resolve addresses for labels and constant numeric expressions. The important thing is that the ASM source will be in the exact same structure as the final machine code executed by the Assembler.
Assembly makes machine code accessible to humans, the code is still written for the convenience of the processor.
A compiler accepts a high level language, which is written in an entirely different structure to the final machine code. The structures in a high level language, such as IFs, SELECTs and PROCEDURES have no equivalent in machine code.
The compiler therefore has the job of translating not just the words, but also the concepts expressed in the language. The machine code output may not reflect the origianl program structure very closely.
A preprocessor is used by both Compilers and Assemblers. It transforms the text of a code following some templating syntax. So called High Level Assemblers, such as FASM and HLA, use this to implement MACROs that enable them to emulate high level structures.
At the bottom of the pile is the Machine code.
Machine Code is a numeric code understood by the processor itself. Each command is a separate opcode which has a specific value.
Assembly is a set of short codes that relate to the machine code opcodes, called mnemonics.
So all an assemler has to do is take the source code and translate the mnemonics into their numeric equivalents. They usually do some other stuff, like resolve addresses for labels and constant numeric expressions. The important thing is that the ASM source will be in the exact same structure as the final machine code executed by the Assembler.
Assembly makes machine code accessible to humans, the code is still written for the convenience of the processor.
A compiler accepts a high level language, which is written in an entirely different structure to the final machine code. The structures in a high level language, such as IFs, SELECTs and PROCEDURES have no equivalent in machine code.
The compiler therefore has the job of translating not just the words, but also the concepts expressed in the language. The machine code output may not reflect the origianl program structure very closely.
A preprocessor is used by both Compilers and Assemblers. It transforms the text of a code following some templating syntax. So called High Level Assemblers, such as FASM and HLA, use this to implement MACROs that enable them to emulate high level structures.
a COMPILER: someone who collects totally useless company data
an ASSEMBLER: an engineer who puts together the v12 jaguar that one of his students took apart so carelessly
an ASSEMBLER: an engineer who puts together the v12 jaguar that one of his students took apart so carelessly
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )


