View Full Version : Creating a programming language
Malekovits
16th April 2005, 05:57 PM
Hi everyone!
Does anyone knows how programming languages, like assembly, c, c++, pascal and etc, created?
monster
19th April 2005, 10:21 PM
Here might be quite a good place to start;
http://www.antlr.org/
And eventually that will lead you to;
http://compilers.iecc.com/crenshaw/
Assembly is a different kettle of fish altogether since it doesn't need all the complicated parsers and things, it'll just translate pretty much directly into machine code.
Malekovits
8th May 2005, 08:16 AM
About assembly: I thing it was the first programming language (machine language). How it was created the first pro. language(assembly)? I mean, to create a language, you need again a programming language?
PerFnurt
11th May 2005, 04:36 PM
Assebler isn't really a language, it is just instructions for the CPU to interpret. The CPU is really good at handling numbers (internally represented in binary format), it's really all it can do. Humans on the other hand arent that good at it and thus give instructions names.
Every instruction is really just representing a number and when the CPU gets that number it knows what to do.
Example of concept:
Say the instructions
mova corresponds to opcode 1,
movb corresponds to 2 and
sub to 3.
mova 5 ; Put 5 in register a
movb 3 ; Put 3 in register b
sub ;; reg a = reg a - reg b
The asm above would really just be a stream of integers for the CPU to handle:
1 5 2 3 3
monster
13th May 2005, 12:37 AM
Indeed. If you're as old as me you'll remember a ZX Sepctrum game called Ant Attack. On the author's homepage he's got information about the game, including how he wrote the game without an assembler by compiling the assembly language instructions down to machine code by hand. Rather him than me!
http://sandywhite.co.uk/fun/ants/AAsource.htm
PerFnurt
16th May 2005, 11:11 AM
In the really old days programmers used punch-cards to program.
A hole/no hole in the card could represent a binary digit, and consequently the "assembler" of those days could simply be a human with a small pointy stick and a good sense of math.
http://www.fourmilab.ch/documents/univac/cards.html
acdep
25th May 2005, 04:59 PM
Well actualy it start with a need ;-)
..lex and Yack do a nice job to understand how to make...
(reading it itself already does ;-) The rest is upto the intepreter and compiler..
Not that difficult the crazy part starts with complex objects and optimalization...
Norman.
Shockwaveworld
17th June 2005, 04:05 AM
Research Fortran, it was the first "high level" language....
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.