Re: Language design basics
- From: "Jim Langston" <tazmaster@xxxxxxxxxxxxxx>
- Date: Wed, 5 Dec 2007 03:24:10 -0800
<seexor@xxxxxxxx> wrote in message
news:fb077954-2e31-4c45-946e-715bb6d8f9a7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hihi, just wondering if anyone could supply me with a bit of knowledge
or point me in the right direction...
I'm just after some basic concepts so I can know what/how to research
it more thoroughly. I have some basic programming expertise
(specifically c++, javascript, and perl) - enough to create a *simple*
cryptanalytic bruteforce/analytic script.
1. How do you programme a programming language? ie. in assembly/
binary? --- then, how do you tell the computer that you're giving it
basic instruction?
Interestingly enough, C was written in C. Yeah, the C compiler was written
in C. Basically what they did is they used some language (doesn't matter
which) to create the first simple C compiler, and with that simple C
compiler, they wrote the C compiler.
Basically a compiler will parse the input and write assembly language
executable files. This can be simple or complex, depending on the language
and implementation. Some/most modern compilers output an object file, then
call a linker to produce the final executable file.
That stems from my initial curiosity about mathematical fundamentals,
specifically:
2. How do you programme basic mathematical operators? Is it all a
matter of base conversion - and if so, mainly from two to ten and back
again, or for division possibly all kinds of screwy bases?
Most modern day CPUs have a FPU (Floating Point Unit). With a few assembly
instructions you can do floating point mulitplication, division, etc...
They also have integer instructions add, subtract, multiply, divide. You
just need to make the proper assembly langauges instructions to do so.
While I'm here, although possibly better suited to a different thread:
3. Memory vs. Processing - which is faster/ more efficient? Do I
create *possibly* huge lookup tables or compute my values each time?
Is there a general rule, or should I take levels of wizard and work it
out through memory/ cpu speeds (omg no please have mercy)? Is this
actually a valid dichotomy, or am I barking up the wrong decision
tree?
The FPU has look up tables in it in hardware which are rather fast. Let the
FPU handle it by using the appropriate assembly language instructions.
.
- Follow-Ups:
- Re: Language design basics
- From: Chris Bore
- Re: Language design basics
- From: Bartc
- Re: Language design basics
- References:
- Language design basics
- From: seexor
- Language design basics
- Prev by Date: Re: Data structure for multiple-attribute matching?
- Next by Date: Re: Language design basics
- Previous by thread: Re: Language design basics
- Next by thread: Re: Language design basics
- Index(es):
Relevant Pages
|