What is a potatoese?

Started by
35 comments, last by RoundPotato 9 years, 8 months ago

The thread title is, "What is a browser?"; you've asked multiple questions, hence multiple answers.

All of the functional support is implemented using C++(or other language) and rendering( graphical interface components, images, fonts ,ect ect) is DirectX/OpenGL, so repeating myself it's just a program written in C++(or other) and OpenGL/DirectX.

After having read the above, can you confirm that, or am I missing/misunderstanding something?


They are normal computer programs, yes. Just like Microsoft Word or Microsoft Excel. Browsers that are modern-day feature-complete like Firefox are also fairly complex, just like Microsoft Word and Microsoft Excel.

'Normal computer programs' can be programmed in any language that can generate regular executables. So, yes, C++ is a likely bet for Firefox. It could've just as easily been coded in Python or Java or C#.

You are misunderstanding DirectX and OpenGL. While they likely do use DirectX and OpenGL on some level, they don't have to. They could've just as easily done their rendering in SDL or any other graphics library. Infact, Firefox used to use Cairo, and now uses a different API. Technically, Microsoft Windows could (and maybe does) still use DirectX behind the scenes to visually present the windows, but most programmers wouldn't say Firefox "uses" DirectX.

Technically, Firefox could use Cairo, with an OpenGL backend, using Angle to convert the calls to DirectX, running in WARP software mode, rendering to a Direct2D window, that presents the window behind the scenes using DirectX. wacko.png

I'm not saying that this is what is actually happening, but such things are possible. So "technically" Firefox could be using, calling, or interacting with on some level DirectX, but it still wouldn't have to be "written in" DirectX.

DirectX is not a requirement, though the Operating System (or other APIs you might be using) may happen to use DirectX behind the scenes. smile.png

Advertisement
I had to read through all of these posts several times to see where the miscommunication was.

I guess the general answer is that in order to make a browser like Firefox or Chrome or a Internet Explorer, you have to have some way to render the graphics, and some way to program the functionality.

Direct3D/OpenGL are potential rendering APIs that "can" be used for rendering, but they are not necessary.

C++, Python, JAVA, C# etc, are programming languages that "can" provide the functionality.


And as Samith said:

"Internet browsers are responsible for interpreting and executing HTML, CSS, XML and Javascript. PHP is a server side technology, your web browser doesn't know anything about PHP.

The parsing and executing of HTML/Javascript/etc can obviously be done in C++."

So, there is a lot that "can" go into modern browsers, but basically they just need to be able to communicate with servers and retrieve and display data (http protocol)

They don't even have to have graphics (maybe text)

They call me the Tutorial Doctor.


 

Wouldn't this thread be a lot shorter if somebody just pointed out that most modern browsers are open source so you can just go and look at what they are made of:

http://www.chromium.org/developers/how-tos/get-the-code

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Downloading_Source_Archives


Cairo is just a software rendering API isn't it?

No it isn't.

A web browser is a program just like any other on your computer, and it could potentially be written in almost any popular programming language including C++.

Like any piece of software with graphical output it needs to use a graphics API to draw to the screen. That could be DirectX or OpenGL, or it could be any other API which provides the necessary capabilities, such as GDI on Windows amongst other alternatives.

- Jason Astle-Adams

While they likely do use DirectX and OpenGL on some level, they don't have to. They could've just as easily done their rendering in SDL or any other graphics library.


Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

So it's kind of the same thing, just a wrapper.

Everything is a wrapper over something else. Even DirectX is just a wrapper around each videocard's unique card-specific hardware assembly language.

If you dismiss something as "just a wrapper", then you can't say they are written "in" DirectX. Ultimately, everything is made of assembly, as you know. Different assembly languages for CPUs and unique assembly languages for GPUs. With CPUs we have an intermediate assembly language, so many types of CPUs can share that "lowest common denominator" in common, but that's not really the point.

The point is: Web browsers are made of the exact same "stuff" videogames and Microsoft Office, and Notepad and

They can use any language and any API they want to, as long as the resulting program runs properly on our computers. The fact that some of them just so happen to use C++ and some of them maybe might use DirectX unintentionally at some point of their multi-layered APIs is inconsequential.

You asked multiple questions, so we're giving different answers to different questions.

Your questions were:
A) What is a browser?
See my first post.

B) Browsers like firefox, chrome, etc. Aren't they simply DirectX/OpenGL applications?
No, they are regular computer programs, but they don't need to use DirectX or OpenGL.

C) So [people in general] could use C++ and Direct3D 11 to make a browser like firefox?
Yes, they can choose to use that language and that API and make a browser if they wanted to. They wouldn't be bad choices.

D) So say I could [on my own] make a [feature-complete] browser like firefox [from scratch]?
Not really, they are very very large multi-person projects. Making them from scratch AND making them feature-complete is nowadays too complex of a job for a single person. Even Google when making Google Chrome used WebKit so the vast majority of the complex work was already done for them. Later, they forked WebKit, and the forked version is what Chrome currently uses.

E) So say I could [on my own] make a [simple, not feature-complete] browser?
Yep. See Karsten_'s answer.

F) So say I could [on my own] make a [feature-complete or semi-feature-complete] browser like firefox [using pre-made components like Google did]?
Yep - see my first post for the API I suggest.

You are misunderstanding DirectX and OpenGL.


If that's the case then I'm struggling to figure out what they are. The way I see it they are the two main Common Denominators for Graphics that actually render(in the sense that it's not CPU/software rendering but using a GPU). Am I wrong, what the deal here?

You're very close. They don't have to run on the GPU, and even when they are running on a GPU, they don't have to have all their code running on the GPU. They both define specifications, and others write 'drivers' to fit those specifications. How the drivers go about doing what the specification says is up to the driver - and what mix of hardware they use is also up to the driver.

Also, browsers don't need to be hardware accelerated. It wouldn't be unreasonable to make a pure-CPU browser, and until recently most browsers were running on the CPU (now they are mostly CPU with a little bit GPU).



This topic is closed to new replies.

Advertisement