views:

1237

answers:

5

So, I am writing some sort of a statistics program (actually I am redesign it to something more elegant) and I though I should use a language that was created for that kind of stuff (dealing with huge data of stats, connections between them and some short of genetic/neural programming).

To tell you the truth, I just want an excuse to dive into lisp/smalltalk (aren't smalltalk/lisp/clojure the same? - like python and ruby? -semantics-wise) but I also want a language to be easily understood by other people that are fond of the BASIC language (that's why I didn't choose LISP - yet :D).

I also checked Prolog and it seems a pretty cool language (easy to do relations between data and easier than Lisp) but I'd like to hear what you think.

Thx

Edit: I always confuse common lisp with smalltalk. Sorry for putting these two langs together. Also what I meant by "other people that are fond of the BASIC language" is that I don't prefer a language with semantics like lisp (for people with no CS background) and I find Prolog a little bit more intuitive (but that's my opinion after I just messed a little bit with both of them).

+7  A: 

Is there any particular reason not to use R? It's sort of a build vs. buy (or in this case download) decision. If you're doing a statistical computation, R has many packages off the shelf. These include many libraries and interfaces for various types of data sources. There are also interface libraries for embedding R in other languages such as Python, so you can build a hybrid application with a GUI in Python (for example) and a core computation engine using R.

In this case you could possibly reduce the effort needed for implementation and wind up with a more flexible application.

If you've got your heart set on learning another language, by all means do it. There are several good free (some as in speech, some as in beer) implementations of Smalltalk, Prolog and LISP.

If you're putting a user interface on the system, Smalltalk might be the better option. If you want to create large rule sets as a part of your application, Prolog is designed for this sort of thing. Various people have written about the LISP ephiphany that influences the way you think about programming but I can't really vouch for this from experience - I've only really used AutoLISP for writing automation scripts on AutoCAD.

ConcernedOfTunbridgeWells
the only reason is that I find R to be a little bit difficult to graps (more difficult than python at least). But creating an interface between Python and R, sound good
Jon Romero
+2  A: 

I can answer you partially

(aren't smalltalk/lisp/clojure the same? - like python and ruby? -semantics-wise)

No, it is not. Smalltalk is OO language with message pass instead method calls. Lisp is Lisp ;-) It means truly functional language with powerful macro system, OO support which never seen in other language (in CL) and many more features. Closure is Lisp like language without many Lisp features but good integration to JVM. It's not supporting tail call optimization for example. And python or ruby are classic imperative OO languages with some limited functional ability. Note word limited. For example Guido don't like functional programing and removed some functional features in version 2.5 and 2.6.

If you familiar with imperative procedural programming as in Python and you want change your paradigm you should make your decision carefully.

Hynek -Pichi- Vychodil
A: 

If you're interested in Prolog then there's a free version of Visual Prolog available and the commercial version is reasonably priced.

It's a strongly type offshoot of Prolog so isn't your classic implementation of the language, but has respectable history - Borland marketed the DOS ancestor of it as Turbo-Prolog back in the late 80's.

It's also Windows only, but can be used to create standard windows DLLs so you can link you code into a 'normal' windows programming language. I've never used the package in anger myself, but I did a couple of Prolog courses at Uni so have downloaded it from time to time to play with and look for possible uses and it looks solid enough. Might be just the set of cogs you're looking for.

Cruachan
Visual Prolog is not really Prolog. If you want a real interactive untyped Prolog try SWI Prolog; if you want a strongly typed language inspired by Prolog try Mercury.
starblue
Sheesh. I did point out that strong typing marks it as an offshoot. The point is that the ability to wrap up a subset of logic (ie that which suites declarative coding) and embedded that elsewhere might be what he needs - *given how the question is worded*. You can't do that with your alternatives.
Cruachan
+5  A: 

At the risk of offending some, I have a hard time reconciling "easily understood by other people that are fond of the BASIC language" with any of the languages you mentioned. That's not intended as a criticism, but as an observation that each of the languages you mention has a style and natural idiom that's quite different from that of BASIC.

  • Smalltalk - pure OO from the ground up, usually (e.g. Squeak) coupled with an integrated environment that is simultaneously the IDE and the runtime. IOW you enter the Smalltalk Vm and work inside it rather than just writing text that is "source code".

  • LISP - much closer to functional programming (although with imperative overtones); the prefix notation is the first barrier to most people who "like" other languages, but the concept and use of macros is a much more substantial one.

  • Clojure - The combination of LISP, OO, and JVM integration makes this one even less BASIC-like.

  • Python and Ruby - I lump these together (at the risk of further annoying fans of either ;-) because they are both OO language with distinct notations that will take an outsider a bit of learning curve. The use of indentation-only for control nesting in Python, and the Perl-like use of special characters in Ruby are often points of complaint by newcomers. Although both can be written in an imperative style, that would be considered non-standard by seasoned users.

  • PROLOG - This is the most unlike BASIC of all languages mentioned. All of the other languages you mentioned can be (ab)used in a semi-procedural style, but that is essentially impossible in PROLOG. It requires a thorough understanding of, and comfort with, recursion to do anything non-trivial.

Code written with a "native accent" in essentially all of these languages (but especially PROLOG, IMHO) will make use of idioms and concepts that are outside the norm for conventional BASIC programming. Put another way, if you pick one of these and then write code "with a BASIC accent" you've pretty much wasted the benefits that the language can offer.

I believe that all of them are worth learning for the concepts they can teach (or at least reinforce, depending on your background). But similarity to Language X (for a wide range of values of X) is not what you'll get.

joel.neely
+2  A: 

Prolog is a very different language. It can be very hard to grasp, mainly because it relies heavily on recursion to do very basic tasks. If you are really willing then give it a go. It can be very powerful because it allows to expess relationships and solve complicated problems simply, typical examples are Towers of Hanoi or quicksort. It will change the way you think, which can be difficult if you are used to imperative languages.