Static vs Dynamic languages

K.I.L.E.R

Retarded moron
Veteran
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*).
 
Ruby is a dream comparatively speaking when interfacing with C++. Just use Ruby and when you hit a wall use C++.
 
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.
 
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:

Ruby is a complete, full, pure object oriented language: OOL. This means all data in Ruby is an object, in the sense of Smalltalk: no exceptions. Example: In Ruby, the number 1 is an instance of class Fixnum

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.
 
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.
 
Diplo said:
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.

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.
 
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.
 
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.
 
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.
 
nutball said:
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:

Ruby is a complete, full, pure object oriented language: OOL. This means all data in Ruby is an object, in the sense of Smalltalk: no exceptions. Example: In Ruby, the number 1 is an instance of class Fixnum

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.

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.
 
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.
 
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.
 
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. )
 
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.
 
Back
Top