What technology is involved in making Mozilla Firefox? - firefox

Programming Languages, Open source libraries and standards adopted to make Firefox works.

It's a large, long lived project, so it's got far too many to list. Especially when you consider ancillary technologies - for example, the Elkhound parser combined with their JavaScript engine creates Dehydra, used to perform static analysis and transform source code, used to bring the old XPCOM stuff up to more recent standards and update dependencies on JavaScript calls.
At the broadest level, the runtime consists of mostly C++ components, configured by XUL interface description language and scripted with JavaScript. IIRC, some of the JS engine code from Adobe is C rather than C++, as are some of the lower level networking libraries. Over recent years, some UI functions have moved from C++ into JS. Then there are the build support and debugging code, which can be Python, perl, make scripts, and so on.

Its all in here :-)
https://developer.mozilla.org/En

Related

Is it possible to use TurboFan as the backend for your programming language?

Can the v8's code generating backend be used in a third party programming language, in a way similar to LLVM is used? Is it "general enough" for that, can you even separate the backend from the v8?
I found this, but it does not help to answer my question:
https://github.com/v8/v8/wiki/TurboFan
V8 developer here. No, V8's compiler is not designed to be used as a stand-alone compiler. It is closely intertwined with the rest of the V8 runtime system, and very much tailored towards JavaScript.
Of course, many of the concepts in Turbofan are applicable to other compilers/languages too. If you have a couple of person-years of engineering time available, you could totally extend (or fork and adapt) it to support one or more other languages. But that would be a lot of work.

Firefox add-on in C++

Firefox provides XPCOM API interface for writing add-on classes in C++ and allow third-party web applications to access them. I'm wondering - is there any other way of achieving these benefits (i.e. write an add-on in C++ and provide a JavaScript interface, so any JavaScript app can use this interface and eventually C++ class functionality)?
Yes, it is possible to write XPCOM components in C++ (or Javascript for that matter) and expose them to websites. You would register them in the JavaScript-global-property, JavaScript-global-constructor, etc. category or categories.
This stuff is generally not documented very well, if at all. If you'd like to know more about it, then read the code (e.g. on mxr).
But doing so is strongly discouraged for a lot of reasons:
It is very hard to ensure such things are actually secure and make it work reliable.
It is hard to control what website may actually use the new API. JavaScript-global-property and friends will be available to all websites!
Your add-on would be introducing new names into the global javascript namespace, which might clash with web site code. (Because of this, many new WebAPIs aren't introduced directly into the global namespace, but are made a property of navigator).
Due to these reasons, the addons.mozilla.org site will only accept add-ons using this mechanism as an exception to the rule and only when the author demonstrates that the use is required and without real alternatives.
MDN has a couple of articles regarding webpage-to-extension communication and vice versa you could use instead, e.g. "Interaction between privileged and non-privileged pages".
Also, it is discouraged to ship binary XPCOM components within extensions:
You'd need to re-compile your binaries against each Gecko version (every six weeks), because binary components are version tagged since Firefox 4.
Binary APIs/ABIs between (point) releases are not as stable as you would hope. Actually APIs/ABIs where inadvertently broken late in the game quite often, causing lots of unnecessary crashes for a lot of users, e.g. bug 828296.
The platform developers officially said binary components in extensions are a hassle.
Instead, you should try to use Javascript where possible, and/or create a normal binary library (.so, .dll, .dylib) with a C-API/ABI and use js-ctypes. You could implement your XPCOM components in javascript, which would then call into your library with js-ctypes.
AFAIK most add-ons switched to js-ctypes by now.

What language can create relatively quick starting cross-platform applications with custom widgets?

I want to create an application that "plays well as a tray icon". That is, it starts up quick and doesn't hog resources. The application will likely need some custom UI widgets as well, and although I mention "tray icon", cross-platform would be ideal as well.
Obviously, I can do this with C++ and some cross-platform UI library (I wouldn't know which one), but I was hoping for a language with garbage collection.
I can do this with Java, but I'm guessing even after compilation, it likely builds a relatively large and slow-starting .exe (maybe the SWT UI library would cut some bloat?). Another way to ask this question, is it possible in Java, and if so what is the best way to make quick/snappy app? I want it pop up similar as popping up Google Desktop search.
Is there something "between Java and C++?"
So,
* Higher-level than C++ (mainly GC)
* Quick starting and resource friendly/snappy (.exe or otherwise)
* Cross-platform desktop UI (even with custom UI widgets)
Try Python it is a high level cross-platform language with GC.
Use Qt and pick an arbitrary supported language
Here is the link to it : Qt - A cross-platform application and UI framework
You can use it freely if you don't develop commercial application.
The reference documentation is very good, and you can find a lot of help all over the net.
It uses a hierarchy of the objects, and if a parent object destroys, it frees up all the children. In a GUI app you don't have to bother with deallocations, if you use the proper syntax. I am developing a 2D presentation application for linux with it, and I am very satisfied with its performance.
Don't forget to use Qt Creator if you decide to use Qt, it simplifies project creation, contains "intellisense", very useful. Without it Qt is a pain..
Supported programming languages: (quoted from qt site)
Programming Language Support
The Qt API is implemented in C++, and
provides additional features for
easier cross-platform development. QML
– introduced with Qt 4.7 – QML is a
JavaScript-based declarative, language
designed to describe the user
interface of a program: both what it
looks like, and how it behaves.
Bindings to Qt exist for several other
languages, including Ada, Pascal,
Perl, PHP, Ruby, Python and Java™.

AJAX Toolkit - AJAX Framework

What's the difference between toolkits and frameworks? Do you know a good comparison?
If I had to make a distinction, then I'd say a toolkit provides specific tools to do specific jobs, whereas a framework provides you with a foundation on which to build further, higher-level structures.
Tools are useful on their own, frameworks have no innate function.
jQuery, prototype, Yahoo! User Interface, MooTools, dojo, and ExtJS will have you working with very solid code.
Other posibilities that I can't vouch for myself: QooxDoo
I believe he's looking for a comparison of the javascript libraries/toolkits(whatever they happen to call themselves).
The names say it all really, a toolkit is a set of tools that you can use however you wish. A framework is an empty frame that you can fill in to form your application. The line between them is blurry though a framework contains tools, and a toolkit sometimes forces you to perform actions in a specific sequence.
I wouldn't know of a generic comparison, i guess it depends on the toolkits and frameworks themselves.
Not Specific to AJAX though. But a have a read..
What is the difference between a framework and a library?
A toolkit provides the basic, minimum building blocks for building something. A framework already has an approach laid for your. A framework defines the application architecture for you (most of the times), where a toolkit only gives you the tools, so you define your own architecture.
For example, GWT(Google Web Tookit) is a toolkit; it does not impose a certain way of doing things, the Java JDK is also a toolkit (Java Developer's Kit), but Rails (from Ruby on Rails) is a framework. It encourages the use of their worflow and classes (MVC, share-nothing, etc).
A toolkit is like a library. You pull it into your application and you use it. A framework provides a structure to your application, so all of your code goes inside of it. The strength of a framework is that by following it's conventions and staying inside of its process it is capable of doing a lot of heavy lifting for you. A toolkit is more flexible, but there are many types of problems that are better solved by a framework. With Ajax, it is a little harder to define. For example, simple widgets and dom manipulation can be done in a toolkit style, but if all of your javascript uses special event wrappers and framework based class functionality and inheritence, all of your code becomes dependent on that framework and is really contained inside of it.

GUI toolkit for rapid development?

I want to write a front-end to an application written in C/C++.
I use Solaris 10 and plan to port the application to some other architectures (Windows first).
I'd recommend taking a look at wxWidgets to provide some cross platform UI widgets that will work on Solaris and Windows.
Qt 4 is the best tool for this job. If you want to work with other languages, it also has bindings for Java and Python
On a Mac, this would be easy. The Cocoa API is great when programming in Objective C (which compiles fine with C/C++ files).
Otherwise the situation is a bit more grim. As for Rapid prototype, you might want to check the CodeGear (Borland/C++ Builder) tools. I think their VCL library is cross-platform.
Otherwise, you could interface with a scripting language like Ruby and use fantastic front end libraries like Shoes. Python also interfaces with wxWidgets to make writing cross-platform front ends easy. Keep in mind that this all requires taking time to make sure your C/C++ code can talk to the scripting language. This is not trivial, and the amount of effort required depends upon the style of your code base. (Oh my God.)
Lastly, you could just use wxWidgets itself. This might be your best bet since it requires no additional overhead than coding the UI itself. That said, C++ is not the greatest language for designing UIs.
And super lastly, consider writing a code generator that converts from say Shoes to whatever wxWidgets code is needed to generate the same Shoes app. That way you can do easier UI design but still get C++ code in the end. Likewise, you could code gen off of the Python/wxWidgets code. Then sell such a code generator. :-)
GTK-- and Glade.
Thats' the C++ bindings on GTK
GTK will work on windows ( just look at GIMP )
Works everywhere, no QT license to mess with your millions-making.
I use wxWidgets myself. It makes good use of the C++ language features and uses smart pointers, so object and memory management is not that hard. In fact, it feels like writing in a scripting language.
Coupled with a dialog editor/code generator like wxFormBuilder or wxDesigner, (links to screenshots) it becomes a good toolkit for rapid development.
Have a look at FLTK which supports X11 and Windows.
Ultimate++ is a cross platform rapid application development framework for C++. It is aimed specifically at rapid development. The Ultimate++ website provides some comparisons to other frameworks mentioned such as Qt and wxWidgets.
I have used ASP.NET Web Forms to make UI front-end to collection of command line application written in legacy language, RESTful-ish web service, and bash scripts.
Once it works on Firefox, it should work at least on Firefox on other architecture. If you haven't played around with it, you should give ASP.NET a try (ASP.NET MVC seems to be the current trend). Not quite the same as RAD, but it does give you visual design of forms etc.

Resources