Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My personal programming background is mainly in Java, with a little bit of Ruby, a tiny bit of Scheme, and most recently, due to some iOS development, Objective-C.

In my move from Java to Objective-C I've really come to love some features that Objective-C has that Java doesn't. These include support for both static and dynamic typing, functional programming, and closures, which I'm trying to leverage in my code more often. Unfortunately there are trade-offs, including lack of support for generics and (on iOS at least) no garbage collection.

These contrasts have lead me to start a search for some of the programming languages that support the following features:

  • Object Oriented
  • Functional Programming Support
  • Closures
  • Generics
  • Support for both Static and Dynamic Typing
  • Module Management to avoid classpath/dll hell
  • Garbage Collection Available
  • Decent IDE Support

Admittedly some of these features(IDE support, Module Management) may not be specific to the language itself, but obviously influence the ease of development in the language. Which languages fit these criteria?

share

migration rejected from stackoverflow.com Aug 25 '13 at 17:14

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by gnat, MichaelT, GlenH7, mattnz, Bart van Ingen Schenau Aug 25 '13 at 17:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, MichaelT, mattnz
If this question can be reworded to fit the rules in the help center, please edit the question.

    
I reworked the question to be less subjective (the reason it was closed). Hopefully I've succeeded. –  donalbain Apr 13 '11 at 18:04
    
Thats good atleast you have upvotes. Looks like C# is a winner, Visual Studio is an excellent IDE IMHO. –  Joe Apr 13 '11 at 18:05
    
As a side note, Objective-C doesn't have generics like Java because they're not really necessary (or even that meaningful) in a dynamically-typed language. –  mipadi Apr 13 '11 at 18:16
    
how strict are you about the meaning of "garbage collection support"? Vala for example uses (automatic) reference counting for memory management, instead of the typical .net/java gc. –  Tedil Apr 13 '11 at 18:18
1  
@donalbain: I suppose...except every object is an id, so everything but the C-ish parts (i.e., primitive types like float and int) are effectively dynamically typed. –  mipadi Apr 13 '11 at 18:29

9 Answers 9

Common Lisp/CLOS. I'm not sure what you mean by module management though.

share
    
If I'm not mistaken CLOS and Ocaml are fundamentally functional languages that were made "object-y". I'm wondering how these implementations differ from object oriented languages that have become "functional-y". –  donalbain Apr 13 '11 at 18:34
    
by Module Management I'm talking about stuff like OSGi for java and The Global Assembly Cache of C#. –  donalbain Apr 13 '11 at 18:43
1  
@donalbain: Common Lisp evolved from a largely functional language, so it's still possible to do whatever you want with functional programming. Languages that started out O-O typically don't have the same facilities for functional programming. –  David Thornley Apr 13 '11 at 21:22
    
@donalbain, Common Lisp is not a functional language now and it never was functional enough (for the same reason as C# - proper tail calls support is not guaranteed). It is a multiparadigm language from its very beginning, with only rudimentary support of functional programming. –  SK-logic Apr 14 '11 at 9:53

Ocaml support everything you state but the IDE. F# looks to be like a OCaml on .NET with visual studio.

share

There is this wondeful C++ like language known as D. I have used it very little, though when I have done so it was great. It supports all the features you asked for. I have just used Vim+GDC, but there seems to be OK IDE support as well.

share

Clojure has all of these apart from the fact that it's not object oriented - it's unashamedly functional throughout.

Some consider not being object oriented an advantage. I strongly recommend this video by Clojure creator Rich Hickey to explain why:

On top of that, Clojure has some additional features that you may find particularly valuable:

  • Concurrency capabilities with software transactional memory
  • It's a homoiconic language which enables powerful metaprogramming capabilities
  • It's a JVM langauge with access to the entire Java library ecosystem - so no worries about lack of library availability!

Overall, worth a try if you want to escape the straightjacket of mainstreamm OOP languages and live a bit closer to the cutting edge.

share

Ada 95 should meet those criteria, though any good IDE is probably expensive. Ada wasn't widely used, but those who did use it tended to get paid well... Don't know what the current usage is.

share
    
Ada has dynamic typing? It doesn't seem like the US military would be cool with the possibility of their Missle objects being interpreted as Soldier objects no? –  donalbain Apr 13 '11 at 19:15
2  
You didn't ask for "dynamic typing", did you? –  Ingo Apr 13 '11 at 20:34
    
Woops, that was my mistake. Corrected my question. –  donalbain Apr 14 '11 at 5:53
    
Ada compiler and IDE (for free) is available for example from AdaCore. Compiler is called GNAT, and is based on GCC. Their IDE is called GPS. Ada2005 still does not support dynamic typing though, so perhaps this is not what the OP wanted. –  Schedler Apr 14 '11 at 10:59

Answer to @CRD et al.:

There are Ada83, Ada95 then Ada2005 with Ada 2012 now pending. No, Ada is a strong typing language therefore it is more suitable for mission/safety critical applications. That does not mean Ada is only for aerospace and military applications. Business, as we know, is also mission critical nowadays. My company uses (mostly 95-100%) Ada to develop server-side applications for manufacturing, retail, healthcare and many more other business sectors.

I published a paper for my former company. You can read it here: http://adrianhoe.com/adrianhoe/publication/papers/software-development-reengineering-an-experience-report/

As far as Ada is concerned, there is no garbage collection and one does not need it in Ada but that doesn't mean you can't implement garbage collection in Ada. The approach will be Initialization and Finalization as to speak of Ada.

As for generic, Ada has the most elegant implementation IMHO. Creating reusable libraries with generic is easier to understand.

share

Perl6

Perl 6 supports your requirements. It also is a great language with a large community!

share

I think that the Groovy language is closest to your requirements.

  • Object Oriented - indeed, classes, inheritance, etc.
  • Functional Programming Support - not so good, it mostly "mutable" by default, but...
  • Closures - are supported and used well by the standard and third-party libraries.
  • Generics - the same as in java.
  • Support for both Static and Dynamic Typing - you can avoid type declarations if you want to. All the methods calls could be dispatched in runtime by reflections.
  • Module Management to avoid classpath/dll hell - standard java tools like maven and OSGi are available.
  • Garbage Collection Available - of cause.
  • Decent IDE Support - there is pretty IDEA support for it.

I'd say that if you are more interested in tools and dynamic typing you should inspect Groovy and if you more interested in FP you should have a closer look at Scala or F#.

share

The closest to your requirements are:

  • C#
  • VB.NET
  • Ada
  • Object Pascal / Delphi
share

Not the answer you're looking for? Browse other questions tagged or ask your own question.