Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is WebKit written in C++ and not in ObjectiveC [closed]

Apple is the backing force of ObjectiveC.

However WebKit is written in C++.

Apart from portability (not all systems have ObjectiveC compilers/runtimes) is there any other valid reason for this? Performance, features?

Lately Apple does not seem to care of other languages than ObjectiveC.

like image 756
Daniel Voina Avatar asked Oct 27 '10 20:10

Daniel Voina


4 Answers

Aside from portability, the use of C++ is an historical artefact. WebKit wasn't started by Apple; it was a fork of KHTML, which was developed as part of the KDE project. The decision to use C++ was made by the KHTML team, likely because KDE itself is written in C++ using the Qt framework.

like image 181
Jeremy W. Sherman Avatar answered Nov 02 '22 12:11

Jeremy W. Sherman


WebKit was originally forked from KHTML, which is written in C++. This, and the fact that it is "more" portable (not really, but it's hard to find ObjC developers for other platforms) probably contributed to Apple not rewriting it in ObjC. This has proven to be a good decision lately, after Google picked it up for their own browser, Chrome, which has resulted in several major contributions and thus a very up-to-date/on-the-edge renderer.

like image 33
You Avatar answered Nov 02 '22 14:11

You


WebKit is a fork of KHTML which was written in C++...

You will ask me... Why KHTML was written in C++ ? I do not know.

like image 27
Xavier V. Avatar answered Nov 02 '22 13:11

Xavier V.


Check the WebKit homepage. It is a branch of the KHTML library used in Konqueror, so Apple really had nothing to do with deciding what language it was written in.

like image 1
Kevin Stricker Avatar answered Nov 02 '22 12:11

Kevin Stricker