Getting Dynamic Productivity in a Static Language

Discussions

News: Getting Dynamic Productivity in a Static Language

  1. The debate around static vs. dynamic languages often centers around productivity: dynamic language fans claim that languages with static typing slow them down. In a recent blog post, Artima's Bill Venners notes that while dyanamic languages, such as Python or Ruby, tend to improve developer productivity, it's not because of their dynamic type system, but mainly because of their rich language features: Getting Dynamic Productivity in a Static Language:
    One of the most commonly cited productivity benefits of dynamic languages is that they enable much more concise programs compared to Java. While this is true, the productivity benefit here is actually conciseness, and that doesn't require dynamic typing. I show how type inference in Scala lets you get much of the conciseness of say, a Ruby or Python program, but in a statically typed language.
    Venners shows in the post several Scala features that boost developer productivity while providing all the benefits of static typing. Do you agree with Venners that you can be as productive in a rich static language as you can be using a dynamic language?

    Threaded Messages (19)

  2. Using languages with a fixed syntax isn't a right solution. You can't change you language, in order to add a new useful construct which might be (re)invented by someone. What would you do if someone created another fancy syntax for common operation? Instead you need a language which syntax can be modified in a reusable way. In JetBrains MPS it's absolutely possible. You can take existing general purpose language which implemented in MPS and extend it. For example, we added beautiful interval notation to Java. You can read about it here. Such things are just impossible in widely used languages.
  3. Using languages with a fixed syntax isn't a right solution. You can't change you language, in order to add a new useful construct which might be (re)invented by someone. What would you do if someone created another fancy syntax for common operation? Instead you need a language which syntax can be modified in a reusable way.

    In JetBrains MPS it's absolutely possible. You can take existing general purpose language which implemented in MPS and extend it. For example, we added beautiful interval notation to Java. You can read about it here. Such things are just impossible in widely used languages.
    I'm not sure what you're post has to do with the article, but MPS might be the answer for some groups, but for the majority it won't be, because you're basically inventing another language (or an external DSL). On the other hand look at http://www.scala-lang.org/node/138 for building your own control constructs in Scala. Or look at Scala test (Bill Venner's creation) for examples of an internal DSL that is more English-like than Ruby's DSLs. On the other hand
  4. I'm not sure what you're post has to do with the article, but MPS might be the answer for some groups, but for the majority it won't be, because you're basically inventing another language (or an external DSL). It's not external DSL. The main point of MPS isn't creating external DSL, there are plenty of tools around which allows you to efficiently do this. The main point MPS is extending existing languages, i.e. adding new control structures, new kinds of expressions, etc. Not only you can extend a language in MPS, but can use many of such extensions at the same time. On the other hand look at http://www.scala-lang.org/node/138 for building your own control constructs in Scala. Or look at Scala test (Bill Venner's creation) for examples of an internal DSL that is more English-like than Ruby's DSLs. The same thing can be done in MPS but you have much more flexibility both in syntax and runtime capabilities. You can choose any syntax you want, not only closure based DSLs. In MPS, you can override generation (compilation) and do whatever optimisations/transformations you want. What you see on the screenshot in the blog post is Java with intervals support added. In addition to intervals, you can add many other language, for example, collections, dates, etc.
  5. My point is that it's hard enough to get organizations to accept a language with macros. To get them to accept something like MPS will be next to impossible. Baby steps first. Currying and closures can you get much of the way there without macros or some system like MPS. I definitely want to take a closer look at MPS though.
  6. My point is that it's hard enough to get organizations to accept a language with macros. To get them to accept something like MPS will be next to impossible.
    I think your comparison is wrong. A language with macros is hard to accept since it requires a lot of knowledge and expertise in order to write maintainable programs in it so there is a high risk. MPS doesn't has such problem since it clearly separates a program definition from a language definition. If you don't have quite sophisticated developers, you can just hand languages with extended syntax to your average developers and make them use it. It's possible that the won't write any language constructs at all. For example, in MPS we have a full stack of web development languages which can be used (and actually was used) without language and meta stuff.

  7. My point is that it's hard enough to get organizations to accept a language with macros. To get them to accept something like MPS will be next to impossible.

    I think your comparison is wrong. A language with macros is hard to accept since it requires a lot of knowledge and expertise in order to write maintainable programs in it so there is a high risk.

    MPS doesn't has such problem since it clearly separates a program definition from a language definition. If you don't have quite sophisticated developers, you can just hand languages with extended syntax to your average developers and make them use it. It's possible that the won't write any language constructs at all. For example, in MPS we have a full stack of web development languages which can be used (and actually was used) without language and meta stuff.
    I disagree with you completely, so we'll leave it at that. But good luck with MPS
  8. I think your comparison is wrong. A language with macros is hard to accept since it requires a lot of knowledge and expertise in order to write maintainable programs in it so there is a high risk.


    I disagree with you completely, so we'll leave it at that. But good luck with MPS
    I'm with Frank, but I'll cite an example. Simply, look at the success of JSP. A language that has a very powerful macro facility (i.e. JSP Tags and Tag files), yet has a very wide adoption rate and is successfully used by novices and experts alike. As with any language with macros, the experts are the ones that create the macros, and the novices are the ones that get to leverage, and I should add, get the most benefit from the macros. Pretty much anything can, and has, been done with JSP today. Simple expansions, complex control structures (JSTL anyone?), powerful frameworks. When JSP 2.0 added tag files making JSP tags trivial to make, JSP became FAR FAR more useful than it ever was. So, I challenge that "no one uses macros" and that they're "unmaintainable". Obviously macros CAN be abused, but, frankly, the power outweighs the risk. You can always refactor something that is unmaintainable in to something that is, but you can't leverage power that you don't have.
  9. Oh, and cue Paul Beckford ;)[ Go to top ]

    Just giving you trouble Paul;) you know I agree with a lot of what you have to say.
  10. Boo[ Go to top ]

    Boo ( http://boo.codehaus.org/ ) is a very sweet language, for DotNet statically typed but with a python inspired syntax which reduces typing. Most importantly it supports closures. It also provides a powerful and interesting macro facility. Is there anything like this for the JVM? Scala, Clojure seem the closest but not with python style syntax. There is jython of course as well.
  11. Re: Boo[ Go to top ]

    Boo ( http://boo.codehaus.org/ ) is a very sweet language, for DotNet statically typed but with a python inspired syntax which reduces typing. Most importantly it supports closures. It also provides a powerful and interesting macro facility.

    Is there anything like this for the JVM?

    Scala, Clojure seem the closest but not with python style syntax. There is jython of course as well.
    Hey, I'm the one here usually pimping Boo:) But to answer your question, no there isn't anything like Boo on the JVM, but I believe it is being ported to the JVM. Boo also supports duck typing.
  12. Groovy[ Go to top ]

    ...no there isn't anything like Boo on the JVM, but I believe it is being ported to the JVM...
    For the JVM world there is Groovy: http://groovy.codehaus.org/ Quote: Groovy... * is an agile and dynamic language for the Java Virtual Machine * builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk * makes modern programming features available to Java developers with almost-zero learning curve * supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain * makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL * increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications * simplifies testing by supporting unit testing and mocking out-of-the-box * seamlessly integrates with all existing Java objects and libraries * compiles straight to Java bytecode so you can use it anywhere you can use Java
  13. Re: Groovy[ Go to top ]

    Groovy is dynamically typed all the time. The whole point of the article is to get that scripting feel in a statically-typed language.
  14. Re: Groovy[ Go to top ]

    Groovy is dynamically typed though right ?
  15. Productivity?[ Go to top ]

    "One of the most commonly cited productivity benefits of dynamic languages is that they enable much more concise programs compared to Java..." We are not pretending that being able to write programs with fewer lines of code is the same thing as productivity, are we? I though we understood some decades back that measuring SLOC doesn't tell us much about productivity. It seems to me that using programming languages will probably not offer important gains in productivity compared with component development systems (TIBCO's Designer product, for instance, comes to mind as an example from the real world). I think that the software we need to build most business systems has already been built, many times over. For those systems, a true component assembly tool ought to be the the thing we are looking for if what we want is productivity - wouldn't you agree?
  16. Re: Productivity?[ Go to top ]

    It seems to me that using programming languages will probably not offer important gains in productivity compared with component development systems (TIBCO's Designer product, for instance, comes to mind as an example from the real world).
    I'd agree partly. Productivity for real world scenarios is mainly a question of the quality and size of the libraries and frameworks that the programming system - language or not - offers. Consider Systems like LabView or PVWave that some would call "Domain Specific Languages". Yet their point is not that they are "Domain Specific Languages" but that they provide the components/libraries required to perform particular jobs (Unlike SQL which *is* a domain specific language). Productivity for building GUI Applications using COCOA in Mac OS/X is for example magnitudes higher than in most other environments because the quality of the API and the Application Framework is outstanding while the language is fairly "traditional OO".
  17. Why Scala for Web 2.0?[ Go to top ]

    I think the best benefits of Scala is its statically typed nature and its interoperability with the JVM. Here is a interesting presentation I received from dserodio about the use of Scala for developing Web 2.0 apps. The presentation is held by one of the Twitter developers which used the Scala language as part of its production system. Why Scala for Web 2.0?
  18. Re: Productivity?[ Go to top ]

    It seems to me that using programming languages will probably not offer important gains in productivity compared with component development systems (TIBCO's Designer product, for instance, comes to mind as an example from the real world).
    Sorry, off subject but this is hilarious. TIBCO Designer increasing productivity! I used to take me over a half an hour just to get the thing to start and it would crash 3 or 4 times a day (yeah, that's 2 hours a day lost per developer.) I once mocked-up the logo from saying "The Power of Now" to "Please Wait" which is what is on the screen at most any given moment when using their tools. Cracked all my coworkers up.
  19. Re: Productivity?[ Go to top ]

    It seems to me that using programming languages will probably not offer important gains in productivity compared with component development systems (TIBCO's Designer product, for instance, comes to mind as an example from the real world).


    Sorry, off subject but this is hilarious. TIBCO Designer increasing productivity! I used to take me over a half an hour just to get the thing to start and it would crash 3 or 4 times a day (yeah, that's 2 hours a day lost per developer.) I once mocked-up the logo from saying "The Power of Now" to "Please Wait" which is what is on the screen at most any given moment when using their tools. Cracked all my coworkers up.
    LOL, that would be epic suxxors ;-) Seriously speaking, I've been using TIBCO Designer versions 5.4 and 5.6 for about two years - nobody here has ever encountered anything like that. Was that something you saw in earlier versions?
  20. Re: Productivity?[ Go to top ]

    Seriously speaking, I've been using TIBCO Designer versions 5.4 and 5.6 for about two years - nobody here has ever encountered anything like that. Was that something you saw in earlier versions?
    It's been almost three years since I used it, and I used it starting about 5 years ago. It was in use for a number of years before I started on the team. It's got better over time so they may have fixed some of the issues. I don't know the version number. The problems with start-up were related to the size of the project which could not be reduced because there was no way to create libraries (or some other sort of module.) Designer required about a 1.5 GB heap to open the project if I recall correctly and it swapped like crazy. It would OOME on me because I only had a GB of physical RAM so I couldn't create a heap bigger than 2GB. So I ended up saving constantly which was also slow. These were just the basic software problems. The bigger issues were that the code defined in designer was completely non-resuable and the extensions they gave us for things like parsing application data from COBOL were super-unwieldy. Also the processes were non-reentrant, their tools (we also used BusinessConnect) had serious incompatabilities with each other (couldn't understand each other's WSDLs.) Other problems were with things like that you could easily get passwords out of encrypted variables and that ClearCase couldn't merge their source files (XPath stored as XML-encoded-XML, what were they thinking?) because the source file order was not stable with changes. It would have been OK for a small-shop, I think, but for a distributed team it was a nightmare. Some of those issues were our fault but it was generally faster and easier to change Java programs that fed BusinessWorks than to solve things in BW and that's saying a lot because the Java code was atrocious. All-in-all a pretty horrible job that I'm glad to have behind me. I used to have to stay late to walk the ops people through deployments (no real deployment model, another problem) and they would take 2-4 hours (try, fail, retry, fail, retry, oops timeout, retry). I got to know the admins well because all we were doing was talking while waiting for the software for hours on end. It sucked especially for me because I'm on the east coast and the deployments had to be done after 5 Pacific. I was at work often after midnight. Having said all that, their interface for working with XPath was quite good and if they just let go of the idea of creating their own application server and just had a kick-ass XPath/XSLT editor that I could generate jars from it would have been great.