What to learn? Lisp or OCaml or...? [closed] - programming-languages

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I already have a few languages under my belt (in a rough order of expertise): Python, C, C++, PHP, Javascript, Haskell, Java, MIPS, x86 assembler. But it's been almost 2 years since I learned a new one, and I'm starting to get the itch. I have a few criteria:
Must (repeat: must) have a free Linux implementation
Should be different from the languages I already know. In other words, it should have features that get me thinking about solving problems in a new way.
Should have some potential for practical use. It doesn't need to be the next Java, but this rules out Brainf* and Shakespeare :) I don't really care how many job postings does it have, but real-world apps and libraries are a plus.
Should have at least just enough free learning materials to get me started in it.
I was thinking Lisp (CL? something else?) or OCaml. I already have some experience with functional languages with Haskell (yes I know that Lisp/OCaml are multi-paradigm). I'm not an expert - e.g. parts of code from Real World Haskell can still contort my brain, but I understand the basic concepts and some advanced ones (functors, monads).
Which one to choose? Any other languages that I have overlooked? Also, could you please include some useful links to good books/tutorials etc.

Neither Lisp nor OCaml is super far afield from what you already know. Here are four suggestions chosen partly for intrinsic interest and partly to stretch your horizons.
A logic programming language, probably Prolog. I haven't found good materials online, but the book The Art of Prolog by Sterling and Shapiro is excellent. The more basic textbook by Clocksin and Mellish is also good. The main point of interest is programming with relations, not functions.
A pure object-oriented language, either
Smalltalk or Self. If you've only used hybrid object-oriented languages you'll be amazed how beautiful pure object-orientation can be. I've linked to the Squeak implementation of Smalltalk. I personally would recommend learning Smalltalk before tackling Self; there's a very large and active community and the software is well developed. Self stands on Smalltalk's shoulders and is an even more inspiring design, but the community is much smaller. For those who have access to the ACM Digital library I recommend the excellent talk by Dave Ungar at HOPL-III; the paper is also pretty good.
The Icon programming language has two great things going for it; a powerful and unusual evaluation model with implicit backtracking, and a user-extensible model of string processing that beats regular expressions all hollow. I'm sorry to say that Icon has never quite kept pace with the times, and of all my recommendations it is the least practical. In fact I fear the language is moribund. But it will stretch your mind almost as much as Haskell, and in wildly different directions. Icon is still very useful for string-processing tasks of modest size.
You can read about Icon string processing in an article by Ralph Griswold from Computer Journal.
The Lua programming language is my last and least radical suggestion. Its interest is not so much in novel language features or paradigms but in the superb engineering of the language and its implementation. Lua occupies a number of niches, including scripting, gaming, string processing, and lightweight functional programming. But its main point of interest is its seamless integration with C, and to get the full benefit, you should bind a C library into Lua.
The HOPL-III web site also contains an excellent talk and paper about Lua.

Both Common Lisp and Ocaml are certainly useful to learn. If you already know Haskell, CL might be the more different experience.
SBCL and Clozure CL are both very useful implementations of Common Lisp on Linux. (Overview about various implementations: Common Lisp survey.)
As a starting point I would recommend to use Peter Seibel's excellent book Practical Common Lisp, that is both available online and printed.
Community pointers are here: CLIKI.

Prolog may be what you are looking for.
Edit
The first commenter is right, my answer was pretty short and not very useful, so:
My preferred implementation is SWI-Prolog. I personally learned from Prolog Programming for Artificial Intelligence. It's style is pretty clear and it contains many examples, but I don't own any other book on logic programming (it's a shame, really :) so I have no basis for comparison.

Erlang is pretty interesting to learn because of its super efficient concurrency model, and the ease with which you can write distributed systems (for an example of this, CouchDB was written in Erlang). It's a dynamically typed functional language, but you can also write code in a procedural fashion. The tutorial I learned it with is called "Getting Started with Erlang", which covers just about every part of the language.

If you want to make use of your Java and functional programming knowledge, and you want to learn a Lisp, then try Clojure.
The implementation is free and cross-platform including Linux, because it runs on the JVM. Being a Lisp, it's different enough (in useful and wonderful ways) from most other languages to make things interesting. Some features such as immutable data structures, multimethods, metadata support, focus on safe concurrency, etc. are fairly novel compared to the languages you listed. Clojure is geared heavily toward being a practical and useful language rather than an academic one. It's a functional language but not "pure", which is arguably a good thing. You can also trivially make use of any Java library from within Clojure.
Clojure is a new language, so the only book out so far is Programming Clojure, but it's a pretty good one. There's also a wiki which may not be entirely up-to-date, because the language is still evolving very quickly. The mailing list and IRC channel are very friendly, welcoming places to ask questions. The official website is also a good resource, of course.

I'm going to recommend something that I haven't yet tried, but plan to, so you have to judge for yourself this one. There's this language, called IO, which is particular in that its prototype-based, like JavaScript, but also borrows concepts from many other languages. Its job market it's probably nonexistent, but I thought I mention this language.
Otherwise, a language from the Lisp family may be pretty different from what you already know. In that regard I'd recommend Scheme, which is, in my opinion, more elegant than Common Lisp. The new concept that you might found interesting in Scheme is continuations.
If you take the Scheme path, make some time to watch these videos from 1986. They're amazing.

Have a look at Smalltalk ! Either Cincom VWST or Smalltalk/X - dont bother with Squeak as the interface is terrible). VAST is good also but really only Windows centric. And dont bother about the sceptics that pore scorn on Smalltalk -- they arent using it and are stuck in the morass of edit-run-debug cycle languages and multiple dispirt linked libraries. :-)
Why these Smalltalks - well, they come complete wth excellent IDE, GUI tools builtin, best debugger you will ever see, online help, and is totally independent of the underlying OS. Eg a ST/X programming running under Linux can be transfered ( source code) to Windows ST/X and it should execute.
ST/X is free with only a very minor licience restrictions, Cincom offer a free NC ( Not Commercial ) version that is NOT restricted. I use ST/X as I prefer the default look & feel
it offers. Their IDE interfaces are very similar.
Languages without a IDE & GUI tools are just wasting your time as the world is really GUI, no matter how terrific the underlying language is. Eg Ruby is great, but with no IDE or easy GUI tools its really frustrating.
Smalltalk is not easy to get into, and its not perfect,(what language is?) but very satisfying to learn & use. And now that the hardware and operating systems have finally caught up with Smalltalks needs . very efficient.

I second Rainer's Common Lisp recommendation.
CL has all the things you're looking for and will provide a genuinely novel experience that will also make your coding efforts and approaches in other languages better.
But bring patience and persistence, you will have to grasp a lot of concepts that will seem alien at first.

You could try Tcl. It was sufficiently different to provoke an adverse reaction in my brain, so I can't really tell you how I found it different, but there's been a lot of good stuff written in it (maybe less nowadays than earlier).

C# has a free implementation in Linux under the Mono project, and it arguably is a very marketable skill unless you're completely anti-Microsoft.
My favorite C# book is Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition.
If you're really want exotic, F# is an OCaml style language that runs on the .NET platform and mono, and is getting a lot of attention these days.
http://msdn.microsoft.com/en-us/fsharp/default.aspx
Books for F#:
http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=f%23

Of the suggestions I've seen so far, I like Lisp (see Secko) and Smalltalk (see brett), as both will give you another view of languages. Prolog even more so.
Another language that is different is Erlang -- I haven't had a chance to learn it yet, but it handles concurrency in a different way. The best link I can give you is the main website.
In terms of recommendations, Lisp is good both because it is currently used and because it is very old. The others you will have to look at sources and see which one appeals the most.

Try FORTRAN, then? I hear it's still actively used by the scientific and mathemematical communities, plus it should be dissimilar enough to be a learning challenge.
Compilers:
http://gcc.gnu.org/wiki/GFortranBinaries
http://www.g95.org/
http://www.fortran.com/compilers.html
http://www.thefreecountry.com/compilers/fortran.shtml
IDEs:
http://www.eclipse.org/photran/
http://force.lepsch.com/ (FORTRAN 77 only)
Tutorials:
Introduction to Modern FORTRAN: http://www-uxsup.csx.cam.ac.uk/courses/Fortran/
FORTRAN 90 Tutorial: http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/fortran.html
You could also learn Visual Basic.NET, in case you ever get forced to maintain that. Evidently mono has a working Linux implementation of it:
http://www.mono-project.com/Visual_Basic

Factor is pretty radically different from everything you said you know, and also everything else listed. It's stack-based, like Forth, but has a fairly comprehensive library and a lot of interesting features.
Ada is very practical -- there's a compiler based on gcc -- but also quite different from the other imperative languages you know. I find the type system a bit stifling, but it was worth learning something about.

Lisp is a great HLL, it has everything that other languages lack. In my opinion, this is a very good language that can "satisfy" any programmers needs.
Perl is also a HLL like Lisp, it's interesting and fun at the same time. It derives from C so you can pick it up as you go. It can be hard sometimes and some people tend to get lost while learning, but it's worth knowing.
Both languages are free of use and come with Linux.
Links
Lisp:
If Lisp is so great,
An Introduction and Tutorial for Common Lisp
Perl:
PERL -- Practical Extraction and Report Language
Books
On Lisp - Great book by Paul Graham on the Lisp language. It's free and you can download it here.

Scala has been very good for making me see programming in a new light. I haven't used it for anything worklike yet, but it's still affected how I write code in other languages - not just Java, but PHP. I recently wrote a simple parser for a WordPress plugin, and the code is vastly more functional and immutable than it would have been six months ago, and better for it, despite the lack of enforcement in PHP.
The only other language to have affected the way I work so dramatically is Perl, nearly a decade earlier. Perl has contributed a lot to the way I pseudo-code, even if I never touch the language itself.
Many people compare the functional aspects of Scala to Haskell. You may even imagine that knowing Haskell means you already know all Scala could teach you, but I don't believe that. The way Scala combines OO and function has a way of making it seem like that's actually the truest form of both of them.

Like you, I have over a dozen languages under my belt. While shopping for something to play with for writing a cross-compiler, I ran across ML and family. Many very good ideas there, and they have taught me to write code is a much different way; for example, my JavaScript now has a decidedly functional bent.
After toying with OCaml under Windows a while (and getting frustrated with stability issues), I ran across F#, an offspring of OCaml. The two are quite similar (can cross-compile a lot of code), but OCaml apparently has a really good macro system (P4) and type-classes (in support of writing "strongly typed" operators against generic types), while F# has excellent support for asynchronous and parallel operations, monads, units-of-measure for numeric types, as well as cleaner OO syntax and awesome IDE integration (VS2008 & will be released in-the-box with VS2010). I much prefer F# these days, since I have access to the whole .NET runtime and loads of 3rd party libraries. In fact, I write most of my one-off and utility code in F# now; for me, its generally much more productive than C++, JavaScript, C#, PowerShell, or anything else.
F# works fairly well under Mono on Linux, and has a good following there. The compiler and runtime will be open sourced once stable (released with VS2010), and the developers consider Mono support enough of a priority for it to be seriously considered for non-Microsoft use.

Related

Scheme or Common Lisp? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am an intermediate programmer, and have decided to learn either common lisp or scheme. My question is simple, which one would you choose? I don't care much for the difficulty of the syntax, just the power, flexibility, and other aspects of the language itself. Also, which implementation of either common lisp or scheme should I choose? Thanks!
Like so many things, it depends on what you want to do.
Remember, if you choose one now, it doesn't preclude you from changing later. In fact, I found it quite easy to switch from knowing a little Scheme to learning a lot of Clojure.
If you just want to learn, and play around with a Lisp, or even build moderately complex programs, I'd say Scheme is probably a better bet. It's got a cleaner, crisper (smaller) standard library, and there are a lot of resources out that that cater to the learner (not that there aren't for CL, either).
If you want the raw power of tons of libraries (many very well written) and the toolkit of a standard (as standard as a CL implementation gets) library that comes with a CL, then it'd be your better bet.
Alternatively, I'd suggest Clojure. It's a relatively new language (< 5 years), but it's got a lot going for it. It's built for concurrency, with plenty of primitives that make it easy to write state-safe programs if you need to have state. And plenty of other perks, though again, the standard library manages to stay small.
It's also on the JVM, so you have access to all the libraries you would if you were using Java, should you need any of them, plus the raw speed that the JVM has to offer is at your fingertips.
However, it is a new language, with a new (but very friendly!) community. If you just want to dip your toes in the pool of Lisp, I'd say Scheme is your best bet. If you want to get things done, my preference and my love is Clojure.
EDIT Honestly, you can't go wrong with any of the three. One may be better depending on what you want to do, and I'd recommend Clojure to just about anyone.
If you want to write practical code, and/or you want a good degree of portability from one implementation to another, use Common Lisp. There are eleven implementations currently under active maintenance. See my survey of implementations.
The different implementations have different strengths. If you want a free, open-source one, Clozure Common Lisp (CCL) (not to be confused with "Clojure"!) and Steel Bank Common Lisp (SBCL) are good general-purpose implementations. There are also commercial implementations, the best known being Allegro Common Lisp and LispWorks. For Windows-friendliness, Corman Common Lisp has useful facilities. For embedding, Embedded Common Lisp (ECL) is great (you don't have to use it in an embedded way). If you want a Common Lisp that compiles to the Java Virtual Machine, there's Armed Bear Common Lisp (ABCL). See the paper for others; which one you want depends on your individual circumstances.
If you want power and flexibility you go with Common Lisp.
If you want clean and simple you go with Scheme.
So far I'm happy with SBCL.
This is an old one ;) Emacs or vi? KDE or Gnome? Red or White?
The biggest difference between the two is that Scheme tends to focus on functional programming; some authors stress functional programming in Common Lisp, such as Paul Graham, and if I write Common Lisp, I follow their advice.
I tend to prefer Scheme since it just makes more sense to me. I've found that the Scheme community, particularly surrounding free software implementations, is much more focused on free software. Consider that if it's important to you. Contrary to popular belief, Common Lisp is a very popular language, but it's most behind closed, corporate doors. That was a big factor for me to turn away from Common Lisp: when the community's not as open, you're not going to find as much in the way of help and libraries.
As far as implementations, I would recommend Guile if you're a GNU/Linux user. Other implementations are just too far outside the mainstream of GNU-consciousness; I like the GNU community, so Guile was the best choice for me. Also Guile has the best set of libraries included in the default installation that I've found (considering that different from the other respondents I know nothing about Clojure).
I've seen some other respondents repeating the old incantation "If you want to get something done, use Common Lisp; if you want to learn, use Scheme." That was probably true in the era of SICP, but I don't think it's true these days. A good implementation of Scheme, like Guile, has tons of libraries available and has plenty of good use-cases that show you can get plenty of stuff done with it.
My impression: Common Lisp is more for getting stuff done, Scheme is more for education and fun. I prefer the SBCL implementation. Scheme, I don't know.
I have an affinity for the more pragmatic, baroque, and warty programming languages, so I selected Common Lisp.
I use GNU clisp, but I am considering changing to SBCL due to its focus on efficiency.
I chose Scheme because it was the language taught in Structure and Interpretation of Computer Programs. It's been a fun read so far.
I usually view it like this: Common Lisp is to Scheme as C++ is to Python. With both Common Lisp and C++, you're given a huge load of tools and lots of power and essentially allowed to roam free. With Scheme, on the other hand, there's more of a focus on simplicity and you're given a little bit less rope to hang yourself by.
And just like with C++ vs. Python, there's this idea that one is for real, grownup projects while the other is sort of a toy language to play around with or create throwaway scripts, even though in most cases the "toy" is good enough for whatever you need to do.
If you want to look at Scheme, I recommend PLT Racket. It's not strictly standard Scheme, but it's essentially the same and it's a "batteries included" distribution.
common lisp is a lot more useful, but scheme is a lot cleaner. mostly comes down to that.
Scheme is of equal or greater power of Common Lisp, but it doesn't have as much support or bindings. I'd go with Common Lisp. As for the implementation? I've been using sbcl in slime/swank for awhile now, and it's pretty nice and fast. Slime is really nice.
I don't care much for the difficulty of the syntax, just the power, flexibility, and other aspects of the language itself.
The syntax is equally difficult or not in any lisp. Clojure's syntax is a bit easier for non-lispers because different brackets are used. This makes more of a difference than one would expect.
Both Clojure and CL have excellent introductory books. I haven't read scheme books in any depth, but they seem to have a more academic flavor in comparison.
I would recommend Clojure or Common Lisp to a neophyte, based on personal experience.
Clojure is more functional and eminently practical. If using CL I recommend an IDE (Allegro & others have free versions), or using a text-editor and repl. In other words, don't use slime. For Clojure I can't think of any IDEs, but perhaps Textmate or Eclipse will have something?
Scheme has some very good IDEs too such as DrScheme. But I found it easier to stay engaged when doing somewhat of a real project, and both Clojure and CL seemed to make that easier.

Is Lua a language that a non-developer can learn quickly?

Let's say a tester is to do some programming to create automated tests ... is Lua really easy to learn for someone who is not a developer?
It depends on the particular non-developer in question. Some people will utterly block on any programming language at all. Some will easily grok many languages and basic programming concepts. There is no silver bullet for putting the power of programming in the hands of someone who is untested on it.
That being said, my personal feeling is that Lua is as good of a place to start as any other programming language.
The Lua language has an active and usually novice-friendly community. It has a long history of use on the boundary between non-programmers and programmers. The language reference manual and standard text book are among the best written examples I've seen in my career. The full text of the reference manual is online, and the first edition of Programming in Lua is as well, although the second edition of PiL reflects the differences in the language that happened after PiL was first published and is well worth the investment to purchase.
One of Lua's strengths is the ease with which it can be integrated into an existing system to construct a configuration and scripting interface to an application. That makes the development cost to adopt it relatively low. Its small size makes the impact on an application release remarkably low as well. Thus getting an existing system to the point where it can be scripted enough with Lua to use Lua as a basis for testing will likely be a straightforward task with few hidden obstacles.
Lua is very forgiving which many people associate with "easy". You do not have to enter semi-colons, you do not have to scope variables, you can write all of your functions in the global scope. Of course doing these things only make your life easier when writing. When debugging even a new programmer may soon see why taking these short cuts is not such a good idea.
I also believe that you can write very simple, easy to use APIs in Lua and you could also create very complex APIs, which may involve object oriented concepts (such as the difference between . and :) or functional APIs with closures and passing around functions as function arguments, etc. Whether the user is able to properly use and understand the language to do the task at hand depends largely on the API as much as or more so than the language.
I do believe Lua is an easier language to learn than many others, like Ruby and Python (and obviously Perl). Lua's grammar and syntax are more consistent than Ruby's for instance; in Ruby you have so many reserved keywords, plus all sorts of symbols (curly-brackets for blocks and pipes for local variables etc), plus it gives you too many options (you can either use curly-brackets for blocks, or you can use the keywords do and end to start and end blocks).
I believe that for non-programmers Lua is much easier especially because of the reasons outlined above. As for programmers, I've read many people say this very same thing and I agree: programming in Lua is very pleasant. I believe that's also because of what I said above.
It probably is becausee its very similar to Python:
The number of universities using Python in there introductory Comp Sci courses is probably the highest of any language (empirically through google). Second probably being Java and Scheme.
The number of Python libraries is astronomical. And the number of people that know the language is quite high thus if you hire a new person there is a good chance they have seen the language before.
Ironically I have grown to not like the language so I am not saying this because I am python fan boy.
As long as you clearly explain to the testers the pitfalls that they may face when debugging in LUA it shouldn't be harder than learning the programming basics of any other language.
What goes through my mind is the situation where the tester made a typo and wrote a different, yet almost unnoticeable, name for a variable. The new variable will be created with the given value but the old variable won't be modified. That sort of thing can be pretty hard to debug when people are not extremely aware of it.
I'm a programmer for more than ten years.
I've learned and used different programming languages.
I've heard about Lua in different occasions, but I've never used it before.
Recently, I decided to learn Lua because our customers are using it.
After spending days on reading the PiL, it turned out for me that Lua is a powerful, flexible, yet sophisticated programming language.
From a software developer point of view, I don't think it's easy for me to be a good coder in Lua in a short time.
But if you just want to 'do something' with Lua, especially if you are from a background of non-programmer, you may feel pleased with Lua, which may be much easier to write some ready-to-use code than some 'traditional' language such as Java, C/C++, Python, etc.

What are the new language choices for Experienced programmers?

I know the topic I started is too subjective. But I just
wanted some expert guidance learning new languages. I've
been working with .NET languages (C#, VB.NET) quite a few
years (around 4). And it's been years since I stopped
experimenting with new laguages after settling down in a job.
Few weeks back I just started working on my personal
project, which I am going to spend much time in the coming
months. During the analysis I found that I just can't
accomodate the luxuries of cost effective languages,
programs and IDEs. So I planned to move to the wide spectrum
of open source languages and tools.
And when I look at the current choices, I was just
speechless. Hundreds of promising open languages and
toolsets and I found it's hard to choose. And I can't even
think of evaluating each language myself (it's a worst
nightmare). Currently I started with Mono (for the sake of
C#).
I felt this is going to be a good chance for learning new
programming languages and models. So I am open to any
language that offers me the following:
more functional
dynamic language features
better language elegance (like lambdas, Haskel like SQL syntaxes or C# LINQ)
better community support
must be open
easy interaction with the web
support for parallelism and concurrency (easy threading)
better in performance
proven web frameworks
better IDE support (I got this ease of use syndrome after using years of MS tools)
I love the Haskel and Erlang language programming approach.
But I don't have a clue about these languages' web stack and
concurrency mechanisms.
EDIT:
i would appreciate few reasons along with your choices. It will be really helpful.
I think that all these meet your requirements:
Groovy + Grails or
Python + one of these Web Frameworks or
Ruby + Rails/Camping/Merb/Sinatra or
Scala + Lift
My bet is that you'll get the groovier IDE experience with Groovy (and it's Groovy Eclipse Plugin).
Learn OOP, DesignPatterns, understanding of Algorithms... the rest is "just" language. You will find, if You learn 5th... 8th language there are some similarities, some prons and cons... what You need learn is to move business needs to some technical platform.
Weird. I can't believe noone has suggested Python yet.
These are not new languages, but I vote that if you have experioence with them, then you will be a better programmer in whatever language you choose to use:
Smalltalk (or Objective-C), otherwise you have not experienced OOP.
Lisp for functional, reflective, meta programming.
Prolog for logic programming.
All of these are quite far from your basic C-like language, both in concept and syntax.
Alan Kay invented OOP and Smalltalk, he is quoted as "C++ is not what I intended", and C++ is what most of todays OOP-languages mimics. C++-style OOP is merely syntactic sugar ontop of structs with function pointers. OOP can be so much more. Ruby is closely related, but you would miss out on interleaved method names.
Lisp has been around since 1958, and the fans keep saying that everything that gets added to any new language is just something borrowed from Lisp. Maybe not strictly true, but somewhat accurate, Lisp had garbage collection 50 years ago. Easiest way to experience it today would be to write something in Clojure.
Prolog is based on formal logic. Prolog is declarative, where you declare facts and rules and is executed by constructing queries on these relations. Kind of like puzzle games in some magazines :).
In the .NET world sounds like you're talking either F# and IronRuby. IronPython might also suit your needs.
Personally I'm going to give a vote for Python, Ruby and Mono.NET.
Of the three you were probably on the right track when you said you looked at Mono; it's C# (which you have previous experience with), there are good, free IDEs available SharpDevelop being one which makes it cheap and there's a really solid community behind it all.
You don't really say what kind of programming you want to do. Do you already know C/C++? If not, I'd really recommend learning those instead of anything new and fancy.
However, if it's new and fancy that you want and you'd like to be able to write native apps, then I'd have a look at:
D
It's similar to C++, but hopefully better in many ways. It has the advantage of out performing most other new and fancy languages and most of the features on your wish list.

Logical Languages - Prolog or Lisp/Smalltalk or something else?

So, I am writing some sort of a statistics program (actually I am redesigning it to something more elegant) and I thought I should use a language that was created for that kind of stuff (dealing with huge data of stats, connections between them and some sort 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).
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.
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 a 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 the 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 the similarity to Language X (for a wide range of values of X) is not what you'll get.
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 the powerful macro system, OO support which is never seen in other languages (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 doesn't like functional programming 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 to change your paradigm you should make your decision carefully.
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.
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 strong type offshoot of Prolog so isn't your classic implementation of the language, but has a respectable history - Borland marketed the DOS ancestor of it as Turbo-Prolog back in the late '80s.
It's also Windows only, but can be used to create standard Windows DLLs so you can link your 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.

Most interesting non-mainstream language? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I'm interested in compilers, interpreters and languages.
What is the most interesting, but forgotten or unknown, language you know about? And more importantly, why?
I'm interested both in compiled, interpreted and VM languages, but not esoteric languages like Whitespace or BF. Open source would be a plus, of course, since I plan to study and hopefully learn from it.
I love compilers and VMs, and I love Lua.
Lua is not as well supported as many other scripting languages, but from a mindset like yours I'm sure you will fall in love with Lua too. I mean it's like lisp, (can do anything lisp can as far as I know), has lots of the main features from ADA, plus it's got meta programming built right in, with functional programming and object oriented programming loose enough to make any type of domain language you might want. Besides the VM's code is simple C which means you can easily dig right into it to appreciate even at that level.
(And it's open-source MIT license)
I am a fan of the D programming language. Here is a wikipedia article and and intro from the official site.
Some snippets from the wikipedia article:
The D programming language, also known simply as D, is an object-oriented, imperative, multiparadigm system programming language by Walter Bright of Digital Mars. It originated as a re-engineering of C++, but even though it is predominantly influenced by that language, it is not a variant of C++. D has redesigned some C++ features and has been influenced by concepts used in other programming languages, such as Java, C# and Eiffel. A stable version, 1.0, was released on January 2, 2007. An experimental version, 2.0, was released on June 17, 2007.
on features:
D is being designed with lessons learned from practical C++ usage rather than from a theoretical perspective. Even though it uses many C/C++ concepts it also discards some, and as such is not strictly backward compatible with C/C++ source code. It adds to the functionality of C++ by also implementing design by contract, unit testing, true modules, garbage collection, first class arrays, associative arrays, dynamic arrays, array slicing, nested functions, inner classes, closures[2], anonymous functions, compile time function execution, lazy evaluation and has a reengineered template syntax. D retains C++'s ability to do low-level coding, and adds to it with support for an integrated inline assembler. C++ multiple inheritance is replaced by Java style single inheritance with interfaces and mixins. D's declaration, statement and expression syntax closely matches that of C++.
I guess a lot depends on what you mean by 'non-mainstream'.
Would lisp count as non-mainstream?
I would suggest having a look at Erlang - it's been getting a bit of press recently, so some of the learning resources are excellent. If you've used OO and/or procedural languages, Erlang will definitely bend your mind in new and exciting ways.
Erlang is a pure functional language, with ground-up support for concurrent, distributed and fault-tolerant programs. It has a number of interesting features, including the fact that variables aren't really variables at all - they cannot be changed once declared, and are in fact better understood as a form of pattern.
There is some talk around the blogosphere about building on top of the Erlang platform (OTP) and machine support for other languages like Ruby - Erlang would then become a kind of virtual machine for running concurrent apps, which would be a pretty exciting possibility.
I've recently fallen in love with Ocaml and functional languages in general.
Ocaml, for instance, offers the best of all possible worlds. You get code that compiles to executable native machine language as fast as C, or universally portable byte code. You get an interpreter to bring REPL-speed to development. You get all the power of functional programming to produce perfectly orthogonal structures, deep recursion, and true polymorphism. Atop all of this is support for Object-Orientation, which in the context of a functional language that already provides everything OOP promises (encapsulation, modularization, orthogonal functions, and polymorphic recyclability), means OOP that is forced to actually prove itself.
Smalltalk (see discussion linked here). Sort of the grand-daddy of the dynamic languages (with the possible exception of Lisp and SNOBOL). Very nice to work with and sadly trampled by Java and now the newer languages like Python and Ruby.
FORTH was a language designed for low level code on early CPU's. Its most notable feature was RPN stack based math operations. The same type of math used on early HP calculators. For example 1+2+3+4= would be written as 1, 2, 3, 4, + , +, +
Haskell and REBOL are both fascinating languages, for very different reasons.
Haskell can really open your eyes as a developer, with concepts like monads, partial application, pattern matching, algebraic types, etc. It's a smorgasbord for the curious programmer.
REBOL is no slouch either. It's deceptively simple at first, but when you begin to delve into concepts like contexts, PARSE dialects, and Bindology, you realize there's much more than meets the eye. The nice thing about REBOL is that it's much easier to get started with it than with Haskell.
I can't decide which I like better.
Boo targets the .NET framework and is open source. Inspired by Python.
Try colorForth.
PROLOG is a rule-based language with back-track functionality. You can produce very human-readable (as in prosa) code.
I find constraint languages interesting, but it is hard to know what constitutes forgotten or unknown. Here are some languages I know about (this is certainly not an exhaustive list of any kind):
Ciao, YAP, SWI-Prolog, and GNU Prolog are all Prolog implementations. I think they are all open source. Ciao, gnu prolog, and probably the others also, as is common in Prolog implementations, support other constraint types. Integer programming for example.
Mozart and Mercury are both, as I understand it, alternative logic programming languages.
Alice is more in the ML family, but supports constraint programming using the GECODE C++ library.
Drifting a little bit off topic....
Maude is an interesting term rewrite language.
HOL and COQ are both mechanized proof systems which are commonly used in the languages community.
Lambda-the-Ultimate is a good place to talk about and learn more about programming languages.
I would have to say Scheme, especially in it's R6RS incarnation.
Modula-2 is the non-mainstream language that I've found most interesting. Looks mainstream, but doesn't quite work like what we're used to. Inherits a lot from Pascal, and yet is different enough to provide interesting learning possibilities.
Have a look at Io at http://www.iolanguage.com/
or Lisaac at: https://gna.org/projects/isaac/
or Self at: http://self.sourceforge.net/
or Sather (now absolutly forgotten)
or Eiffel http://www.eiffel.com
Why here are a few reasons. Io is absolutly minimalistic and does not even have "control flow elements" as syntacit entities. Lisaad is a follow-up to Eiffel with many simplifications AFAIKT. Self is a followup to Smalltalk and Io has taken quite alot from Self also. The base thing is that the distinction between Class and Object has been given up. Sather is a anwer to Eiffel with a few other rules and better support for functional programming (right from the start).
And Eiffel is definitly a hallmark for statically typed OO-languages. Eiffel was the first langauge whith support for Design by contract, generics (aka templates) and one of the best ways to handle inheritance. It was and is one of the simpler languages still. I for my part found the best libraries for Eiffel.....
It's creator just has one problem, he did not accept other contributions to the OO field.....
Regards
I recently learned of the existence of Icon from this question.
I have since used it in answers to several questions. (1, 2, 3, 4)
It's interesting because of its evaluation strategy - it is the only imperative language I know that supports backtracking. It allows some nice succinct code for many things :)
Learning any language that requires you to rethink your programming habits is a must. A sure sign is the pace at which you skim through the documentation of a language's core (not library). Fast meaning fruitless here.
My short list would be, in my order of exposure and what were the concepts I learned from them:
Assembly, C: great for learning pointers and their arithmetic.
C++: same as C with an introduction to generics, as long as you can stand the incredibly verbose syntax.
Ruby/Lua: scripting languages, dynamically typed, writing bindings for existing C libraries.
Python/C#/Java: skipped, these languages look to me as a rehash of notions originating elsewhere with a huge standard library. Sure the whole packages are nice, but you won't learn new concepts here.
OCaml: type infererence done right, partial application, compiler infered genericity, immutability as a default, how to handle nulls elegantly.
Haskell: laziness by default, monads.
My €.02.
I can't believe Logo is so forgotten. Ok, it's Logo. Sort of like lisp, but with slightly uglier syntax. Although working with lists in Logo, one encounters the delightfully named 'butfirst' and 'butlast' operations. =P
ML. Learning it and using it forces you think differently about programming problems differently. It also grants one patience, in most cases. Most.
How about go? It's brand new, so it's unknown and not mainstream (yet).
It's interesting because the syntax looks like what happens after you put C and pascal into a jar and make 'em fight.
Well once it was called MUMPS but now its called InterSystems Caché
http://www.intersystems.com/cache/
First answer - Scheme. It's not too widely used, but definitely seems like a solid language to use, especially considering the robustness of DrScheme (which in fact compiles Scheme programs to native binary code).
After that - Haskell is incredibly interesting. It's a language which does lazy evaluation right, and the consequences are incredible (including such things as a one-line definition of the fibonnaci sequence).
Going more mainstream, Python is still not really widely accepted in the business circles, but it definitely should be, by now...
Ken Kahn's ToonTalk, a cartoon language with hard-core theoretic underpinnings:
http://www.toontalk.com/
Prograph: http://en.wikipedia.org/wiki/Prograph ... seems Prograph lives on as Marten:
http://andescotia.com/products/marten/
Self's IDE was/is a thing of beauty, talk about Flow (in the Csíkszentmihályi sense)...
Overall, though, I'd have to say Haskell is the most interesting, for the potential adavances in computing that it represents.
Harbour for dynamic type. Great opition to business apps.
Reia!
http://wiki.reia-lang.org/wiki/Reia_Programming_Language
It's Erlang made sense, it's beutifull and I'm in love. It's so unknown that it doesn't even have a wikipedia page!
The first major (non-BASIC) language that I learned was Dream Maker, from http://www.byond.com.
It's somewhat similar to C++ or Java, but it's largely pre-built for designing multiplayer online games. It's very much based on inheritance.
It's an intersting language especially as a starting language, it gets gratifying results quicker, and lets be honest, most people who are first learning to program are interested in one thing... games.
I find Factor, Oz and OCaml quite interesting. In fact, I have started using Factor for personal projects.
Rebol of course !
It's so simple but so powerfull learn it at http://reboltutorial.com
I've recently looked up a lot about Windows PowerShell.
While not necessarily just a language. It's an awesome shell that has a built-in scripting language. It's basically a super-beefed up command line shell.
Unlike Unix shells, where everything is string text (which definitely has it's benefits), PowerShell commands (cmdlets) use objects. It's based on the .Net framework so you guys who are familiar with that will have probably already figured out that anything PowerShell returns can be piped and the properties and methods of that object can be used. It's fun to say "everything is an object!" again just like when OOP was getting big.
Very neat stuff. For the first time, Windows is implementing some of the Unix command-line interface tools similar to grep and the whole bunch.
If you're interested in VMs, you should look at Parrot...There's a bunch of languages supported and that's pretty neat....
O'caml is a good language if you want to learn how to implement a compiler...

Resources