Re:Why are most browsers developed in C++?
by Arelius on Wednesday July 31, 2013 @02:06PM
(#6135669)
> You can surely write a better browser from scratch in a language like Haskell.
This isn't something quite as self-evident as you make it.
Re:Why are most browsers developed in C++?
by cwzwarich on Wednesday July 31, 2013 @02:25PM
(#6135818)
Having written web browsers / browser engines and compilers for functional languages, I don't think you could do this with anything that exists today. And if you did it, the result would not be idiomatic Haskell; it would just have one huge monad threaded through the entire thing with no pure portion. You would also probably have to drop down to unsafe manual memory management for performance reasons.
A browser that breaks on non-standard markup is worse than useless. Legacy compat is so critical and so complex that a rewrite is just not an option. Lots of money and time is invested in battle-tested security etc, you can't just throw that investment away. Again, like how Facebook is still written in PHP.