Static vs Dynamic languages

Discussion in 'PC Hardware, Software and Displays' started by K.I.L.E.R, Jul 15, 2005.

  1. K.I.L.E.R

    K.I.L.E.R Retarded moron
    Veteran

    Joined:
    Jun 17, 2002
    Messages:
    2,952
    Likes Received:
    50
    Location:
    Australia, Melbourne
    Anyway I really do love dynamically typed languages. You can do so much more with them with very little.
    I've come across many occasions where static typed languages like Java and C just don't stack up to what I want.

    Too bad 3D libraries (OGL comes to mind) aren't developed for Ruby as of yet, neither is a JIT.
    I can't switch without losing my current codebase and without an advanced JIT like Java's JIT it's not worth making a switch as of yet.

    Just take a look at this:
    http://www.ruby-lang.org/en/20020101.html

    Another new and noteworthy language is D.
    http://www.digitalmars.com/d/comparison.html

    Programming languages are advancing and relatively new developers like myself will need to make a choice.
    I need something powerful, yet simple but not too simple that I'm coddled like a baby(like the horrible mess called Visual Basic *shudder*).
     
  2. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    Ruby is a dream comparatively speaking when interfacing with C++. Just use Ruby and when you hit a wall use C++.
     
  3. Frank

    Frank Certified not a majority
    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    3,187
    Likes Received:
    59
    Location:
    Sittard, the Netherlands
    Try Delphi.
     
  4. Diplo

    Veteran

    Joined:
    Apr 17, 2004
    Messages:
    1,474
    Likes Received:
    64
    Location:
    UK
    Dynamic typed languages are great for banging out the odd script but for any larger then they become a real pain to try and debug. Usually what you game in rapid development you loose in slow debugging and run-time errors that would have been caught by a static compiler. VBScript is a perfect example of how awful dynamic languages can be.
     
  5. nutball

    Veteran Subscriber

    Joined:
    Jan 10, 2003
    Messages:
    2,200
    Likes Received:
    512
    Location:
    en.gb.uk
    I'm more of a perl/python person myself, I have high hopes that something good will come out of Perl 6. Perl syntax hurts, but python isn't as mature wrt. freely available extension modules.

    I looked at Ruby in the past, it was too OO up it's own bum for my tastes (like Java, but worse). The web page even boasts about this:

    which is great and all that and I'm sure gives comp scis that special tingly feeling in their underwear, but in my world is more of a hinderance than a help.
     
  6. DudeMiester

    Regular

    Joined:
    Aug 10, 2004
    Messages:
    636
    Likes Received:
    10
    Location:
    San Francisco, CA
    I was reading a bit about this Phython JIT psyco.sourceforge.net Seems interesting. In theory it could work faster then even pure ASM. Although, if it actually is that fast is rather doubtful, lol.
     
  7. Frank

    Frank Certified not a majority
    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    3,187
    Likes Received:
    59
    Location:
    Sittard, the Netherlands
    Yes. For example, I hate variants. I always have to write all my own conversion routines and run those every time before and after I want to do something related to the API, or even format a string. They're a major pain.
     
  8. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    nutball,

    I suggest you look deeper. There are a lot of benefits, have a look at ruby on rails and you'll see why the way they did things makes a lot of sense. This gimmickry as you try to pawn it off, is actually very useful. This level of consistency really facilitates meta-programming.

    I'm pretty sure this is why Ruby is fine even by Paul Graham's tastes.
     
  9. DemoCoder

    Veteran

    Joined:
    Feb 9, 2002
    Messages:
    4,733
    Likes Received:
    81
    Location:
    California
    Ruby has nothing to do with "Rails" architecture. Java can do rails style architecture as well. All that is required is run-time reflection. But Rails is a severely limited CRUD "by convention" architecture that fails as soon as you have non-trivial database mappings.

    BTW, Graham is a blowhard idiot. Get your programming language commentary from someone like Guy Steele.
     
  10. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    Graham makes some good points, not to take anything away from Steele.

    Ruby, provides a lot of ease and consistency, that was my point, it's well illustrated with rails, besides the reflection.

    Also, java is like pulling teeth in this regard.
     
  11. Snyder

    Regular

    Joined:
    Feb 10, 2002
    Messages:
    609
    Likes Received:
    8
    Location:
    Vienna, Austria
    Don't fight it, embrace it! Give in to the wonderful world of OOP! You will be a better man afterwards! :)

    EDIT: Oh, and regarding static vs. dynamic: I'm a static fellow myself. Dynamic languages work well as long as the code is self-explaining, well-documented and well-designed. And even then debugging begins to be a growing PITA as the codebase gets larger and more complex.
     
  12. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    Really it'd be nice if static typing could be rolled in as part of invariance checks and/or performance reasons. That way one could drift in and out of the dynamic world. IIRC, python is working towards this.
     
  13. ERP

    ERP Moderator
    Moderator Veteran

    Joined:
    Feb 11, 2002
    Messages:
    3,669
    Likes Received:
    49
    Location:
    Redmond, WA
    Everyone should be forced to move to ML :)

    When I've actually sat down and tried to build reasonably sized software with dynamically types languages, I find that they start to become difficult to manage. Perhaps it's because I've spent so many years writing C and C++ or just that the tools are better.

    I think of OO programming as a lot like goto's. Where goto's are not always bad OO programming is not always good. Getting too obsessed with OO programming can lead to very unreadable and obfuscated code. In my mind these days code is all about maintenance, ifi t's difficult to get up to speed or to understand, it had better be something that requires performance opptimisation or it's just plain bad.
     
  14. DemoCoder

    Veteran

    Joined:
    Feb 9, 2002
    Messages:
    4,733
    Likes Received:
    81
    Location:
    California
    ML derived languages allow one to write code with or without type declarations, so that you only need to declare types where they are actually needed. Of all these, I would recommend Concurrent Clean as the fastest/most efficient.

    Ruby's treatment of primitive numbers as objects isn't innovative, many languages like Self and Smalltalk work the same way.

    The place where dynamic languages fall down is on large projects (hundreds of thousands to millions of lines of code) and when you have to do any kind of refactoring.

    The reason why IntelliJ IDEA IDE works so well, with code completion, generation, on the fly error checking, and refactoring, is because of type information. It's very hard to build a good Ruby or Python IDE that can refactor code automatically, or provide accurate popup CodeAssist/IntelliSense/etc, because the dynamism gets in the way of the IDE proving and infering what the types of a given variable are.

    The ML type system was invented so that type inferencing would work. Ruby and Python have no theoretical underpinnings that provide a consistent analytical framework for such type proving to work. They are in fact, systems developed by commitee decision, with features slapped into the language as requested.

    I just don't understand the hoopla over Ruby (or python for that matter) That are dozens of similar dynamic scripting languages (yes, with closures). It's just reinventing the wheel all over again, only all of the damn libraries that people are used to from Java, Perl, C, Python,et al, once again, must be recoded.. (you know, xml, http, files, image processing, widgets, you name it. )
     
  15. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    Reinventing the wheel will always take place until we have very powerful general virtual machines such as MS'. Add on top of that a Fowler like workbench and then you can extend languages, create DSLs and flip the lisp monkeys the bird.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...