DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Servo: A Vision for the Future of Firefox

Servo: A Vision for the Future of Firefox

Axel Rauschmayer user avatar by
Axel Rauschmayer
·
Feb. 03, 12 · Web Dev Zone · Interview
Like (0)
Save
Tweet
4.70K Views

Join the DZone community and get the full member experience.

Join For Free
Recently, Mozilla stopped the Electrolysis project [1] that was to give Firefox per-tab processes. Hence, I was relieved when David Bruant pointed out to me that Mozilla haven’t given up on a parallel browser. They are working on a project called Servo which is being implemented in the Rust programming language.

Servo – the next Firefox

Firefox has grown to a very large code base, written in C++. C++’s main forte is speed. Writing a web browser in it poses two problems:

  • Safety: one of the key issues for a web browser is to keep users safe from attacks. C++ is an inherently unsafe language (especially when it comes to memory management).
  • Parallelism: Single-core speeds are improving at a decreasing rate, hence multi-core parallelism is the best strategy for making the web faster. C++ is not ideally suited for parallel programming.

With C++, safety and parallelism are antagonistic goals. Quoting Brendan Eich [2]:

Adding more threads to utilize multiple cores while fighting security bugs is like team-juggling chainsaws to music where the record player has been sped up!

The Servo project [2] is about building a parallel browser:

  • Use Rust instead of C++ which is safer and better equipped for parallelism.
  • Try to parallelize as many stages of the rendering process as possible (ongoing research).
  • Implement the DOM mostly in JavaScript (which makes it faster, because there are less context switches).

Note that Servo is a research project, it may or may not become an actual product. Furthermore, Firefox will be evolved in parallel; first voices on Firefox 10 sound positive. For example, the following tweet by Mikeal Rogers:

Firefox 10 looks like it's going to pull me away from Chrome. Crazy fast & the new inspector is amazing.


The Rust programming language

On January 20, 2012, the release of Rust 0.1 was announced on the rust-dev mailing list. The announcement describes Rust as a “strongly-typed systems programming language with a focus on memory safety and concurrency”. Version 0.1 is usable, but many features are still in flux:

This is the initial release of the compiler after a multi-year development cycle focusing on self-hosting, implementation of major features, and solidifying the syntax.

Version 0.1 should be considered an alpha release, suitable for early adopters and language enthusiasts. It's nifty, but it will still eat your laundry.


Rust
is an interesting language. To me, it looks like a mixture of C (syntax), Common Lisp (polymorphism via generic functions), Erlang (Actor-style concurrency), ML (immutable data, modules), and several other ideas. The following code from the language tutorial gives you a first impression:

    fn fac(n: int) -> int {
        let result = 1, i = 1;
        while i <= n {
            result *= i;
            i += 1;
        }
        ret result;
    }


As a systems language, Rust shares several goals with Google’s Go, but its inception predates that language. Mozilla plans to use it for desktop applications and server-side endeavors.

References

  1. Firefox Electrolysis project put on hold
  2. Future Tense (slides from Brendan Eich’s talk during a Mozilla all-hands in April 2011)

 

Source: http://www.2ality.com/2012/02/servo.html

 

Rust (programming language) Common Lisp Systems programming c++ Release (agency) Memory (storage engine) IT

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 12 Modern CSS Techniques For Older CSS Problems
  • Automation Testing vs. Manual Testing: What's the Difference?
  • What I Miss in Java, the Perspective of a Kotlin Developer
  • How Java Apps Litter Beyond the Heap

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo