| New Reply |
How programming languages are created? |
Share Thread | Thread Tools |
| Nov12-11, 03:26 PM | #1 |
|
|
How programming languages are created?
If we write better compiler does it mean that programming language is getting better?
|
| Nov12-11, 03:32 PM | #2 |
|
|
All a compiler does is check the code for syntax. If there are errors, it should alert you about the errors. If syntax is correct, it does not necessarily make the program run the way it should. In other words, building a better compiler doesn't mean the programming language is better.
|
| Nov12-11, 05:35 PM | #3 |
|
|
No, a compiler translates from a source language to a target langauge. The latter is often machine code or an intermediate language such as Java bytecode. pairofstrings, programming langauges are often documented first, and then a compiler is implemented. If the compiler is better because it is closer to what is specified by the document(s), then we might not say the language has changed, but rather the compiler is more compliant to the language specification. The compiler might also be better because it produces code that runs faster or is more compact. We would probably only claim the langauge has been revised if there were new specifing documents. |
| Nov12-11, 05:37 PM | #4 |
|
|
How programming languages are created?
"better" is too ambiguous to mean anything. A compiler can be "better" in many ways: faster, more memory efficient, faster object code, size-optimized object code, etc. A programming language can be more expressive, have more features, etc.
|
| Nov12-11, 06:02 PM | #5 |
|
|
To basically just restate what's already been said (we ALL think our own way of saying things is superior ... sorry about that), a compiler is just a tool to implement a language and does NOTHING to make the language better or worse (it might make how the language WORKS better or worse, but that is in the implementation, not in the language.
To make a language work better can be a VERY good thing, so good compilers are important, but it's even more important to have languages that are helpful in allowing humans to construct algorithms that get done whatever it is they need to have done. The progression of languages from machine language to assemblers and then interpreters, and compilers has been an evolution of languages, not of implementation (which necessarily followed along to implement the improved languages). So, based on what I just said, I'd say no, better compilers don't have anything to do with making better languages, but they can have a lot to do with better implementations of languages, which I see as a different thing. |
| Nov12-11, 11:41 PM | #6 |
|
|
Also you should be aware that different languages are created for different specific purposes. Languages like C/BASIC/Java/FORTRAN are created for specific purposes. BASIC is good to run toy programs or models where speed is not an issue. C on the other hand has a very close resemblence to assembler although it is a lot easier to read (and you can even embed assembler code and use it from your C program under some environments). Consequently there are languages that solve optimization problems, list processing languages (like LISP), and many others. Again the different languages are built for (a) specific purpose(s) and when you understand those purposes it becomes a lot easier to understand the language and appreciate it. If someone has a purpose and needs a new language (or a substantial extension to an existing one), then one is usually created. |
| Nov13-11, 12:48 AM | #7 |
|
Recognitions:
|
Your title asks one question, then your post asks a different question.
|
| Nov13-11, 12:49 AM | #8 |
|
|
Question 1:
In language 1 if the instruction goes like this : add x y In language 2 if the instruction goes like this : x add y My understanding is that we need to have two different compilers which can understands the instructions of language 1 and 2. Am I right? I mean we cannot have same compiler compiling instructions of both Java and C,or instructions of different operating systems. Right? Question 2: If we have 'C' language code like this: # include <stdio.h> main(){ c = a + b; printf(c); } When above code is compiled it might look like this(not familiar with machine language): 11111000 stdio.h 110011() 10101010 01 10 001100(01) Is it an object code or machine code? I think of it as an object code because machine code has to be only 0's and 1's. There shouldn't be any stdio.h in the code. True? Now. Question 3: If you see above main() statement when it is compiled it got converted into 1111100. Similarly, the other statements also got converted into 0's and 1's. And every time I compile the same statements in our above 'C' program we will get the exact object code( in other languages exact intermediate code). Right? Ok now, that means compiler has to know that the statements should be represented by a particular binary numbers only. In this case, the main() statement is represented as 11111000. That means the compiler has to remember which statement has to be converted to what binary numbers. That means if we are able to make/program a compiler then we are able to create a new programming language. Or make changes(adding new features, as Chiro said) to existing ones. Is it right? That is my understanding. Help please. Question 4: How to program/make a compiler? I know it has evolved as phinds said, but can you tell me if we are using any language or something else in it's creation? Thanks. |
| Nov13-11, 01:21 AM | #9 |
|
Recognitions:
|
|
| Nov13-11, 01:09 PM | #10 |
|
|
The object files will typically be the output of the compiler. These object files may contain machine code, as well as other things such as object file headers and data sections. |
| Nov13-11, 01:18 PM | #11 |
|
|
|
| Nov13-11, 01:18 PM | #12 |
|
|
|
| Nov13-11, 01:20 PM | #13 |
|
|
|
| Nov13-11, 01:42 PM | #14 |
|
Recognitions:
|
As an early example, Altair Basic's roots go back to an 8008/8080 emulator that ran on a PDP-10. The paper tape loader mentioned in the wiki article had to be toggled into memory using the Altair's front panel: http://en.wikipedia.org/wiki/Altair_BASIC |
| Nov14-11, 05:20 AM | #15 |
|
|
I am new to computer science. |
| Nov14-11, 06:28 AM | #16 |
|
Recognitions:
|
http://en.wikipedia.org/wiki/ARM_architecture Programmers can get an ARM toolset that runs on Wintel systems (Windows running on Intel processors). This includes a compiler, linker, emulator (includes it's own debugger), and debugger interface for the actual ARM processor using its "jtag" interface. Since the compiler and linker run on an Intel processor but produce code for the ARM processor, that would be an example of a cross compiler. http://en.wikipedia.org/wiki/Booting There's also a more general usage of the term bootstrapping used in the computer industry of developing a more complex environment from a simpler one. The wiki article mentions this here: http://en.wikipedia.org/wiki/Bootstr..._bootstrapping |
| Nov14-11, 07:06 AM | #17 |
|
Mentor
|
Mentor comment:
The questions raised in this thread fall into the category of questions that are beyond the scope of an internet forum. pairofstrings: While you do not realize this, what you are doing is asking us to write multiple books just for you, teach multiple classes in computer science just to you. Language theory and compiler design are upper level undergraduate / lower level graduate classes in college. It takes a long time, many classes, many books, to get from the "I am new to computer science" stage to the stage where a fair answer can be given to your questions on language theory and compiler design. What you'll get by reading wikipedia is an apparent hodgepodge of nearly incomprehensible stuff. Note: I am not disparaging wikipedia here. It is an encyclopedia; this is a generic problem with encyclopedias. Multiple books are needed to answer these questions fairly and comprehensively. An encyclopedia cannot do full justice to such questions. Nor can an internet forum. To those helping pairofstrings: Your work so far is commendable. Continue helping if you wish. However, don't be afraid to provide the short and sweet "Don't ask me to write a book" answer if it looks like you aren't helping or if answering the question at hand would indeed require you to write a book. |
| New Reply |
| Thread Tools | |
Similar Threads for: How programming languages are created?
|
||||
| Thread | Forum | Replies | ||
| Simulations - Programming languages? | General Astronomy | 4 | ||
| Programming languages used by physicists? | Academic Guidance | 5 | ||
| Programming Languages | Programming & Comp Sci | 19 | ||
| New ideas for programming languages? | Programming & Comp Sci | 2 | ||
| Parallel Programming Languages | Computing & Technology | 22 | ||