Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a "BORLAND DELPHI" !! 4

Status
Not open for further replies.

doctorit

Programmer
Aug 17, 2006
5
IR
i faced many basic questions about programming for exapmle how delphi makes a standalone program or why some programs can run under win paltform but not in linux so i ask this one that covers all of them :

HOW TO MAKE AN IDE LIKE DELPHI AND A NEW PROGRAMMING LANGUAGE FOR WIN AND ANOTHER ONE FOR LINUX?

what should i start to read a book or ... please guide
 
HOW TO MAKE AN IDE LIKE DELPHI AND A NEW PROGRAMMING LANGUAGE FOR WIN AND ANOTHER ONE FOR LINUX?

Getting a job at Borland would tremendously help, most of the big writers on Delphi have been "employed/supported" by Borland.

Steven
 
I'm just curious, what is your motivation for creating a new programming language?

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
well,
i said

" i ask this one that covers all of them : "

ok i eager to know : 1-how delphi can make an executable file does a borland expert have something magic and i don't know how to
2- i want to know what is the difference between borland C++ and other compilers
3- i want to know if they make a program language and translate simple sentences to 0 & 1 why doesn't the program work on the linux if they are 0&1 now?


and also many other questions !!
 
1) Magic at Borland.

To make a compiler you need a lot of experience and knowledge.

To define a language you need still more knowledge. Actually, defining a good language is way difficult than to make a compiler.

Sure the guys at Borland have some black knowledge we have not! And the guys at MS too, and the guys at AQTime too, and the guys who made Indy too, and etc, etc, etc.

Think about a web navigator: making a good navigator is about reading all the due RFCs, right? Wrong. It is about reading the dues RFCs plus knowing a lot of glitches you can find in the servers around the world. And in the pages around the world. Bad server headers, page tags opened but not closed, bad charset definitions, bad stacked tags and, again, etc, etc, etc. That is black knowledge, that is magic, things you can't get from any book, paper or web page. Only the experience can solve those things.

Now think about making a compiler. Believe me, making a compiler is not so difficult. Making a good compiler, able to compile fast and able to optimize code is a very different thing.

Programmers are specialized professionals. For a guy skilled writing compiler code, making a compiler is easy; for a guy skilled in writing web navigators, writing a compiler can be a daunting, almost impossible task. Same for a compiler skilled guy trying to write a good web navigator.

2) Difference between Borland C++ and another compilers.

Little in the language itself, as C++ is a well stablished language. Pure K&R C or C++ code will compile the same in Borland Builder, MS VC++ or any other compiler for the same platform (at least theoretically).

On the other way, the frameworks are different: MS VC++ uses MFC (Microsoft Foundation Classes) and Borland uses VCL (Visual Component Library). The language is the same, but the pre-made classes you use are different. The MFC Rich Edit is different to the VCL Rich Edit; MFC have a lot of classes VCL have not, etc.

The code generated in not the same either, even for simple sentences, as the optimizations are different.

3) Translating to 0&1 (to machine code?)

The platform is the difference. When you try to open a file, your code calls some OS resource (API function) which is laying there to open files.

The way Unixes open a file is not the same the way Windowses open a file, the functions are not the same, the parameters are not the same, the responses the OS produce back are not the same.

Think about writing a string to the CRT. Long gone are the days where the program itself addressed the video hardware to write a string (imagine the nigthmare: machines may and will have very different video hardware).

To write a string you call an OS API function able to call some other low level code (a driver) which in turn knows how to address the video hardware.

Guess what? The API functions used to write strings in Windows are different to the Unix ones.

Same for nearly everything: wanting to start a timer to tick you every 100 mSecs? The OS is managing the timer. Wanting to print a image? The OS will print the image after you calling the due API function. Your program ended and want to be closed and unloaded? It needs to tell the OS it ended.

At anytime you need to call the OS, you are calling an API function, and any OS have his own API, different from the other OSes.

That is why, even for the same language, you need different compilers for different platforms.

HTH.
buho (A).
 
thank you very much , dear "buho"

but how do they protect their secrets every year many developers retire or are empolyed in different companies
 
Actually, most of the knowledge needed to make a PASCAL IDE is out there. Check FreePascal or the VCL alternatives.

But you are not going to learn the magic only reading sources. Getting your hands dirty for a time (sometimes a LONG time) is needed to master any hermetic art.

Reading books, papers and web pages and chating with fellow programmers while drinking wine is a necessary condition to become a wizard in any programming area... but it is not a sufficient condition: writing/debugging code is what makes a real guru. Confronting reality, confronting the zillion and half little things you can't envision beforehand is what makes the difference. Most of those things you need to learn by yourself.

buho (A).
 
good, i can't let u go!

-ok now i know what is API but there is just one problem how does delphi work with API?

-and also delphi or ... have a GUI and i can't understand how delphi make itself before being made (maybe wrong idea: they use another thing like VB)

-which one do u prefer microsoft products or borland or ... (according to what u said about MFC)
 
1)

API stands for Application Program Interface. An API is a collection of functions the OS offer to the program to make things.

Actually "offer" is a little misguided. In today OSes the use of the API functions is nearly mandatory. You can't show a string in the CRT if you do not call the due API function; you can't open a file if you do not call the due API function; you can't open or write or read a file if you do not call the due API function; you can't..., you can't..., you can't...

Any compiler works with the API. Any time you use a WriteLn or OpenFile or TCanvas.DrawText the compiler translates your statement to the due API call (sometimes making a lot of other things in the way; like checking if your canvas have a handle; analizing the WriteLn parameters; converting your file name from your compiler format to the needed OS format... a lot of work).

2)

The Delphi compiler/IDE is written in PASCAL itself, C in some parts (I believe) and assembler in another ones.

What the problem with a program having a GUI? You can write a GUI program in assembler, where you have only the processor instructions, the OS API and your knowledge. Why do you thing Delphi is related to VB or any other thing only for the fact it having a GUI?

I think I'm not getting the meaning of your question.

3)

<RANT MODE>

None of them. Used to like Borland very much a truckload of years ago, but today Borland is buggy as MS, expensive as MS and -painfull to say- still less atentive to customers than MS. Man! D6 still have bugs reported in D4! Ansi strings was kinda thread unsafe till D7! Is Borland fixing the bugs in the product you paid for? No. It is producing a new version you need to pay again (with some of the bugs still there). Even MS itself is doing better, it is still producing fixes for W2K.

I use Borland compilers due to the same reason I use MS compilers: I have no option. I've started with them years ago and I need to maintain compatibility with hundreds of megabytes of source code, plus not much other offers in the market.

Sometime in the future I'll drop this profession and go to grow crops and chickens.

If you have a farm to sell, please mail me.

</RANT MODE>

buho (A).

 
lol Buho, I like your ranting mode :) I'll give you a star for that...

[thumbsup]

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Blowing some steam now and then is good for health, you know... :) :)

buho (A).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top