The Ascendency of Dynamic X vs. Static X, where X = ... 22

Posted by Dean Wampler Sun, 27 Jul 2008 02:48:00 GMT

I noticed a curious symmetry the other day. For several values of X, a dynamic approach has been gaining traction over a static approach, in some cases for several years.

X = Languages

The Ascendency of Dynamic Languages vs. Static Languages

This one is pretty obvious. It’s hard not to notice the resurgent interest in dynamically-typed languages, like Ruby, Python, Erlang, and even stalwarts like Lisp and Smalltalk.

There is a healthy debate about the relative merits of dynamic vs. static typing, but the “hotness” factor is undeniable.

X = Correctness Analysis

The Ascendency of Dynamic Correctness Analysis vs. Static Correctness Analysis

Analysis of code to prove correctness has been a research topic for years and the tools have become pretty good. If you’re in the Java world, tools like PMD and FindBugs find a lot of real and potential issues.

One thing none of these tools have ever been able to do is to analyze conformance of your code to your project’s requirements. I suppose you could probably build such tools using the same analysis techniques, but the cost would be too prohibitive for individual projects.

However, while analyzing the code statically is very hard, watching what the code actually does at runtime is more tractable and cost-effective, using automated tests.

Test-driving code results in a suite of unit, feature, and acceptance tests that do a good enough job, for most applications, of finding logic and requirements bugs. The way test-first development improves the design helps ensure correctness in the first place.

It’s worth emphasizing that automated tests exercise the code using representative data sets and scenarios, so they don’t constitute a proof of correctness. However, they are good enough for most applications.

X = Optimization

The Ascendency of Dynamic Optimization vs. Static Optimization

Perhaps the least well known of these X’s is optimization. Mature compilers like gcc have sophisticated optimizations based on static analysis of code (you can see where this is going…).

On the other hand, the javac compiler does not do a lot of optimizations. Rather, the JVM does.

The JVM watches the code execute and it performs optimizations the compiler could never do, like speculatively inlining polymorphic method calls, based on which types are actually having their methods invoked. The JVM puts in low-overhead guards to confirm that its assumptions are valid for each invocation. If not, the JVM de-optimizes the code.

The JVM can do this optimization because it sees how the code is really used at runtime, while the compiler has no idea when it looks at the code.

Just as for correctness analysis, static optimizations can only go so far. Dynamic optimizations simply bypass a lot of the difficulty and often yield better results.

Steve Yegge provided a nice overview recently of JVM optimizations, as part of a larger discussion on dynamic languages.


There are other dynamic vs. static things I could cite (think networking), but I’ll leave it at these three, for now.

Comments

Leave a response

  1. Avatar
    The North Face Shop over 2 years later:

    Buy the cheap North Face online in The North Face Shop for free shopping and save 50~70% OFF. north face outlet , Northface shop.

  2. Avatar
    shopping over 2 years later:

    Moncler is the renowned high-end outerwear Discount Moncler brand which created a quilted jacket trend in the fashion world. Never one to stand still in time,It has always kept abreast of the latest Moncler Jackets technologies and stayed true to its origins without compromising its Moncler runway worthy style. If it has a Moncler tag, it will keep you warm on top of the highest mountain and be Moncler Men’s trendy on any city street.Features the latest selection of the north face clothing. You will enjoy what you Moncler Women’s show you. As well we offer you the good shopping experience with cheap and discount price.

  3. Avatar
    shopping over 2 years later:

    Hermes Birkin Handbags are fashion icons regarded Hermes Handbags as much more than simple purses. They are status symbols, with waitlists forcing fashion fans to wait more than Hermes Birkin two years to own one.Hermes Birkin Handbags were created by Hermes head Jean Louis Dumas and actress Jane Birkin. Word is that Jean wanted a functional weekend bag, and so the Birkin was born. Now these Hermes Belts prestigious bags are seen on the arms of all the hottest celebs including Hermes Purses Victoria Beckham, Sarah Jessica Parker, and Oprah Winfrey.

  4. Avatar
    shopping over 2 years later:

    Herve Leger Bandage High Waist Mini Skirts It is very eye-catching. You can wear Discount Herve Leger it in your casual time,go to office, go shopping, as you like in every place. As we know ,Herve Leger Dresses comes from French ,and found in 1985,it is the most famous designer house ,it always go in for the women’s beautiful shaped 90% Rayon, 9% Nylon,1% Spandex Zipper Herve Leger Dresses closure please just follow the show on the label to maintain the beauty Dry clean only These designer Herve Leger Bandage Dress and Herve Leger Skirts are feminine and sensual,stand out.

  5. Avatar
    shopping over 2 years later:

    There is a brand that continues to turn out the Hermes Birkin seasons to seasons, yes, there is Hermes Handbags. In this season, there is bright colors. The hermes birkin replica,Birkin HandBags,hermes birkin purses are all in our warehouse.The Replica Hermes Birkin makes an effort to please the all Hermes 35CM Birkin Bags request by the masses. When you first come across with the Replica Hermes Belts the showroom, you instantly think that it is a Replica Hermes Birkin you would love to tote.

  6. Avatar
    shopping over 2 years later:

    To have the Hermes birkin bag is becoming every woman’s dream.Though they have a hilarious collections of Replica hermes birkin,and others feminine accessories,but only few women are able to obtain it,because Cheap hermes handbags of the price,Since that it designed by the would’s most known designer,then the price reaches more ther hundreds Hermes Belts dollars for an item. If you are in such problem,loving the handbags,but have limited fund that Hermes Purses are far away from it’s price,then Replica Hermes Bags would your best solution.

  7. Avatar
    shopping over 2 years later:

    Beginning as a professional Cheap Moncler Coats seller, We achieved great success in this field. Moncler Giubbotti have a pretty good team who have been devoting themselves into reducing the costs by constantly Moncler Uomo looking for a best and steadiest manufacturer.By the year 2006, we had expanded our line from Moncler Gilet Donna to a wider range, They are Moncler Outlet,Moncler Boots,Moncler Scarf,Moncler Giubbotto Uomo. From Outletmoncler.com,People all over the world enjoy buying stuff and give high praises.

  8. Avatar
    Pandora over 2 years later:

    This looks a lot like the way “good” inheritance should behave.

  9. Avatar
    dvdsoft over 2 years later:

    With the right tool, you can easily burn mp4 to dvd and itunes to dvd. Also, you can use drm removal tool to remove drm protection from itunes, zune, amazon legally. wmv to dvd, mov to dvd, mp4 to dvd, itunes to dvd

  10. Avatar
    hermes replica watches over 2 years later:

    those distinctive markings on hermes handbags on sale on one of Kulula’s aircraft, dubbed Flying vintage hermes kelly bag Flying 101: The exterior includes helpful printed hermes garden party bag printed phrases complete with pointing arrows to ???? ?? to indicate “windows,” “wing #1” and “loo” Hermes Scarf “loo” while over the cockpit you’ll see birkin 40 see the words “the big cheese.” Hermes Scarf cheese.” Now that’s entertainment. But it’s

  11. Avatar
    US Criminal Record over 2 years later:

    The JVM can do this optimization because it sees how the code is really used at runtime, while the compiler has no idea when it looks at the code.

  12. Avatar
    Criminal Search over 3 years later:

    There are other dynamic vs. static things I could cite (think networking), but I’ll leave it at these three, for now.

  13. Avatar
    okey oyunu oyna over 3 years later:

    i love this blog. Thanks

    internette görüntülü olarak okey oyunu oyna, gerçek kisilerle tanis, turnuva heyecanini yasa.

  14. Avatar
    worldniketrade over 3 years later:

    Search for knowledge,read more ,sit on your porch and admire the view without paying attention to your needs

  15. Avatar
    christian louboutin shoes on sale over 3 years later:

    The article has been finished.

  16. Avatar
    beats by dr dre headphones over 3 years later:

    I found that his foot odors never bring us to death.I never regret buying these beats by dr dre studio for him. These beats by dr dre solo are just the same as selling in the franchise store.Or even better.

  17. Avatar
    ferragamo shoes over 3 years later:

    Ferragmo belt from ferragamo outlet has top quality with best craftsmanship. Now Salvatore ferragamo sale belts online with reasonable price and free shipping.

  18. Avatar
    Uniformes De Fútbol over 3 years later:

    I really like your article. Please keep on writing excellent posts. To find out more please go to http://baratasfutbolcamiseta.es/ http://baratasfutbolcamiseta.es/category.php?id=9 http://baratasfutbolcamiseta.es/goods.php?id=76 http://www.camisetas-de-futbol.es/ http://www.camisetas-de-futbol.es/category-66-b0-FIFA+del+Copa+del+Mundo.html http://www.camisetas-de-futbol.es/goods-4080-10+11+Holland+Tercel+Blanco+camiseta+del+futbol.html http://www.camisetasfutbolchina.es/ http://www.camisetasfutbolchina.es/category-122-b0-Real+Madrid.html http://www.camisetasfutbolchina.es/goods-4605-11+12+England+Titular+Blando+camiseta+del+futbol.html

  19. Avatar
    Breguet watches over 3 years later:

    progress or not

  20. Avatar
    Head Rackets over 4 years later:

    That event forms a serious part of this game that invokes thousands of tennis fans to devote their time for live tennis score coverage.

  21. Avatar
    iPhone contacts backup over 4 years later:

    well. your article is very useful for all the programmer and it can help me have a better code.

  22. Avatar
    medical billing maine over 4 years later:

    Dynamic Resources can only be set on Dependency Properties. They do defer their value substitution until run time. If the value of the resource changes, they’ll be automatically updated, unlike Static Resources… medical billing maine

Comments