Help me choose some new languages.

bear with me.....

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 2192 Views - Last Post: 21 June 2010 - 10:30 AM

#1 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Help me choose some new languages.

Posted 16 June 2010 - 07:17 AM

I know you get asked this question a lot but please bear with me. I currently program in Java and used various versions of BASIC in the distant past. I'm looking for some languages to pick up. I feel Java covers my needs for a general purpose language so I'd like to cover the two following camps:

1. Practical scripting
Something to bash out quick throwaway scripts. Something expressive. I'm a good programmer but Java simply isn't suited to this. I've been thinking about Python or Ruby. I've also considered brushing up on my Linux shell skills but the others offer so much more if I choose to take them in that direction.

2. Teach me to think differently
I've heard functional programming teaches you to think about programming in a different way. I've been considering Haskell (especially since I am an honorary researcher at Glasgow University :D ) but would like to know about my options. Are there any other paradigms or languages that would teach me something valuable?

What I'm after are some recommendations, thoughts and opinions.

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Help me choose some new languages.

#2 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 916
  • View blog
  • Posts: 3,206
  • Joined: 12-May 09

Re: Help me choose some new languages.

Posted 16 June 2010 - 07:46 AM

1)
Python is a very good rapid prototype language. If you can get over indentation for blocks (which can actually avoid errors), it's very nice for "quick throwaway scripts." Ruby is an excellent language, and very expressive. It has some excellent paradigms, and is just as capable as Python. I'd say Python is a quicker bang it together language, but both satisfy this.

2)
Haskell is supposed to be fun and eye opening. Any functional language can help here. A lot of schools use Scheme (any LISP dialect would also do).

Prolog is also nice for thinking in a different way (declarative programming). It's kind of neat to watch it work - you tell it facts, and then ask it queries which it tries to prove.

This post has been edited by xclite: 16 June 2010 - 07:50 AM

Was This Post Helpful? 2
  • +
  • -

#3 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Help me choose some new languages.

Posted 16 June 2010 - 08:11 AM

If you want something to put you in a different mind set, then i prefer Prolog over haskell. Both haskell and prolog are 2 of my favorite languages, but prolog requires more brain stretching.
Was This Post Helpful? 1
  • +
  • -

#4 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Help me choose some new languages.

Posted 16 June 2010 - 10:39 AM

Shell scripting is useful but kind of dull. Bash is almost universal (and therefore probably the one you should learn) but it is very primitive and you may find yourself bashing your head against the wall trying to do things that are simple in most normal languages.

Edit: Why not learn Perl? Python is becoming more common but I have yet to see a *nix that doesn't ship with Perl installed. :)

This post has been edited by Tom9729: 17 June 2010 - 02:11 AM

Was This Post Helpful? 1
  • +
  • -

#5 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Help me choose some new languages.

Posted 17 June 2010 - 02:06 AM

Quick throwaway scripting rules out the JVM. The startup time is too great and the JVM is too bulky for scripting. This rules out all JVM languages, including Clojure and Scala. Shame. These are both great languages. If ever one-off scripting isn't a necessity, I suggest checking out both of these languages, and giving them your time. If you use Haskell before using either of these languages, you'll be able to appreciate them more, so lets move on.

Haskell isn't really a scripting language, but it does scale nicely. For example, there is runghc which can be used to run Haskell code without compilation. Haskell might be a good choice based on your options.

I'd go with Haskell. Haskell, being a purely functional language, will force you to learn functional programming to use it properly. If you do this, code you write in other languages will reflect the new things you've learned. You're likely to take advantage of functional features in languages like Python and Ruby, and your code is going to be cleaner and more concise. I don't think you can go wrong with Haskell.

@xclite Not "any Lisp dialect" would do when it comes to FP. Scheme and Clojure are functional dialects of Lisp, but Common Lisp isn't especially functional at all. It has one of the most advanced object systems in existence, even. Reason I didn't mention Lisp is because I can't think of an implementation of any dialect of Lisp that would be suitable for scripting.

This post has been edited by Raynes: 17 June 2010 - 02:13 AM

Was This Post Helpful? 1
  • +
  • -

#6 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Re: Help me choose some new languages.

Posted 17 June 2010 - 02:59 AM

Thanks for the replies guys! Very useful stuff. :D

Quote

Shell scripting is useful but kind of dull.


Dull things are easily ruled out! ;) It seems people agree python and ruby are sensible choices. I'm going to look into the differences between these two and pick one of them. If anyone has any thoughts or experiences along this line I'd love to hear them!

@Tom9729, why perl? Does it have any advantages over Ruby/Python other than shipping by default?

Raynes, although I'm sure functional languages can work very well as scripting, I've had 19 years of imperative programming and maybe 5 hours of FP. I need the latter to expand my skills and thinking but for quick throwaway scripts imperative is where it is for now. Hopefully I'll get to the stage in both that I can eventually pick the best one for the job!

For the brain stretching part, it seems like it's between prolog (nice suggestion -- wouldn't have thought of that!) and FP. I think if I'm going to do FP properly, I'd like to start with a pure one as suggested. Might as well learn it properly before going for something less strict and more practical!

So, I'm going for:

1. Ruby or Pythin
2. Haskell or Prolog


Any further advice would be much appreciated!
Was This Post Helpful? 0
  • +
  • -

#7 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 916
  • View blog
  • Posts: 3,206
  • Joined: 12-May 09

Re: Help me choose some new languages.

Posted 17 June 2010 - 06:27 AM

@Raynes
As I read the post, he wanted one language for scripting and one to stretch the brain a little - this does not require that the brain-stretcher is also a scripting language. As a result, both Clojure and Scala would be good suggestions. Any LISP would do, provided the OP is trying to do functional programming, although Haskell is still probably the best choice for picking up FP.

@cfoley
For your choices, I still think that while Ruby is a pleasure to learn, Python fits the role of utility language more - you could always try each out, they're similar enough that you aren't going to be wasting time.


For Haskell vs Prolog, I think you would find Haskell more useful (unless you plan to do anything in AI, then both are good to have). Functional programming is a lot of fun. Prolog is too, but besides using it for niche things, you may find it somewhat obtuse to actually get work done in.


Oh, and as for Perl - while it has fantastic utility and writeability, it has a lot of implied variables and operators that you need to know to use it effectively, it is difficult to read, etc etc. I suggest Python or Ruby over Perl. Ruby inherits a lot from Perl, without the awful syntax. Python is the opposite of Perl in most senses.

This post has been edited by xclite: 17 June 2010 - 06:30 AM

Was This Post Helpful? 1
  • +
  • -

#8 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Help me choose some new languages.

Posted 17 June 2010 - 01:39 PM

View Postcfoley, on 17 June 2010 - 01:59 AM, said:

Thanks for the replies guys! Very useful stuff. :D

Quote

Shell scripting is useful but kind of dull.


Dull things are easily ruled out! ;) It seems people agree python and ruby are sensible choices. I'm going to look into the differences between these two and pick one of them. If anyone has any thoughts or experiences along this line I'd love to hear them!

@Tom9729, why perl? Does it have any advantages over Ruby/Python other than shipping by default?

Raynes, although I'm sure functional languages can work very well as scripting, I've had 19 years of imperative programming and maybe 5 hours of FP. I need the latter to expand my skills and thinking but for quick throwaway scripts imperative is where it is for now. Hopefully I'll get to the stage in both that I can eventually pick the best one for the job!

For the brain stretching part, it seems like it's between prolog (nice suggestion -- wouldn't have thought of that!) and FP. I think if I'm going to do FP properly, I'd like to start with a pure one as suggested. Might as well learn it properly before going for something less strict and more practical!

So, I'm going for:

1. Ruby or Pythin
2. Haskell or Prolog


Any further advice would be much appreciated!


I didn't realize you were asking for two different languages, so I tried to cover both requests with a single language.

View Postxclite, on 17 June 2010 - 05:27 AM, said:

@Raynes
As I read the post, he wanted one language for scripting and one to stretch the brain a little - this does not require that the brain-stretcher is also a scripting language. As a result, both Clojure and Scala would be good suggestions. Any LISP would do, provided the OP is trying to do functional programming, although Haskell is still probably the best choice for picking up FP.


I didn't realize he was asking for two languages. Anyways, he's on the right track.

One little nitpick. When it comes to FP, any Lisp will not do. Common Lisp supports functional programming, but there is nothing stopping you from being just as imperative and object oriented as you want. For FP, you want Clojure or Scheme, with the former being useful for actual work, and the latter being mostly a teaching language. However, any Lisp would do for expanding the mind. There is more enlightenment in Lisp than just functional programming. Code as data is a real mindfuck.
Was This Post Helpful? 1
  • +
  • -

#9 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Help me choose some new languages.

Posted 17 June 2010 - 03:21 PM

View Postcfoley, on 17 June 2010 - 04:59 AM, said:

Dull things are easily ruled out! ;) It seems people agree python and ruby are sensible choices. I'm going to look into the differences between these two and pick one of them. If anyone has any thoughts or experiences along this line I'd love to hear them!

@Tom9729, why perl? Does it have any advantages over Ruby/Python other than shipping by default?

Shell scripting is dull but very practical. I suggested Perl because it is pretty likely to be installed anywhere running some kind of *nix.
Was This Post Helpful? 1
  • +
  • -

#10 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 916
  • View blog
  • Posts: 3,206
  • Joined: 12-May 09

Re: Help me choose some new languages.

Posted 18 June 2010 - 07:13 AM

I'm not going to drag it out, but I don't buy the "This language supports multiple paradigms, so you can't learn any of them effectively in this language!" line. Just because Lisps ALSO support OO does not mean you can't learn FP in it.

I already conceded that Haskell is better as a purely functional language, but having more than one paradigm does not make a language useless for any of the paradigms it does support. I mentioned in my post that the OP has to make a conscientious effort to learn FP and not fall into OO in LISP.

Saying that you can't learn functional programming in LISP is like saying you can't learn procedural programming in Python. Both are patently false.
Was This Post Helpful? 1
  • +
  • -

#11 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Help me choose some new languages.

Posted 18 June 2010 - 08:30 AM

I never once said you can't learn FP from any ol' language that supports FP. And we're talking about Common Lisp, right?

You're completely missing my point. The point I'm trying to get across is that just because a language supports FP doesn't mean that by learning it, you're also learning fp, because that isn't true. If it was, every C# programmer would be an FPer. I'm pointing out that if you want to learn FP, you're better off learning a language that strongly encourages it or even forces it (like Haskell). Sure, you can learn FP in a predominately OOP language, but that doesn't mean it will be easy. You'll likely have trouble discerning what is FP and what isn't.

Common Lisp melds together many different paradigms in a way that makes you able to do things in many different ways, some ways sometimes better than others. The idea in languages like CL and Scala is not to place sharp edges and corners around each paradigm but to meld them together so that they work together well. Do you see what I'm trying to say?

Yes, you can learn FP off of any Lisp, but it's better if you actually use a language that *is* functional, like Haskell or Clojure.

I didn't mean to start an argument, and I hope this clarifies my statements.

EDIT: This is waaaaaaaay offtopic. @cfoley, Sorry for starting this. If this discussion needs to continue, we'll take it to PMs and let the thread try to stay on track.

This post has been edited by Raynes: 18 June 2010 - 09:02 AM

Was This Post Helpful? 1
  • +
  • -

#12 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Re: Help me choose some new languages.

Posted 18 June 2010 - 10:43 AM

No worries. I'm pretty much decided anyway and by arguing you guys are actualy giving me huge insights into how and why you choose languages. :)
Was This Post Helpful? 0
  • +
  • -

#13 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 916
  • View blog
  • Posts: 3,206
  • Joined: 12-May 09

Re: Help me choose some new languages.

Posted 18 June 2010 - 11:45 AM

What have you decided to go with?
Was This Post Helpful? 0
  • +
  • -

#14 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Re: Help me choose some new languages.

Posted 21 June 2010 - 06:11 AM

I'm going to go for Ruby. To be honest, there is very little difference I can find between it and Python. This indicates just how petty most of the differences are! Python does seem to win out on getting work done quickly but I doubt Ruby will be much worse. I'm choosing it because the syntax looks fun.

One thing I like about either choice is JRuby and Jython. Either will be able to make use of the Java library I'm writing as part of my phd.

I've not looked into Haskell and Prolog yet. Fortunately, I spent the weekend under the sun instead!
Was This Post Helpful? 0
  • +
  • -

#15 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 916
  • View blog
  • Posts: 3,206
  • Joined: 12-May 09

Re: Help me choose some new languages.

Posted 21 June 2010 - 06:14 AM

Ew, sunlight. Ruby is very nice - definitely a lot of cool things you can do with it.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2