News for hackers. Stuff that matters.
Re:Extremist Programming by tikhonj on Wednesday November 21, 2012 @12:24PM (#4815191)
I agree with the blog's premise: "extremist" languages are great for language and for research. So this whole rant is not directly related to the post's central thesis. Instead, it's about the assumptions most people have whenever this topic comes up.

What I'm a little annoyed with can be summed up with a single banal and overused phrase: "the right tool for the right job".

For one, this phrase really doesn't say all that much--it's basically a tautology. Yes, using the right tool would be good, but with programming languages, it's rarely obvious what the right tool is! It's just a specialized version of the advice to "make the right choices", which is not much advice at all.

Another problem is that people inevitably ignore how much programming languages overlap. Virtually any languages worth comparing are going to be general-purpose languages. Choosing between a functional language and an OO language is not like choosing between a hammer and a screwdriver to pound in a nail, it's more like choosing between different types of hammer. In a world where hammers can do anything. (I don't know enough about carpentry to extend the analogy properly.) There are very few applications where one language clearly fits and another is clearly unsuited--and if you're in a vertical like that, the question just won't come up in the first place!

Another thing that comes up is people assuming that a multi-paradigm language has the benefits of all the paradigms it supports. I've found this is never the case. Even very multi-paradigm languages tend to favor one paradigm or the other more. And even if they didn't, there are benefits to being consistent. You can do much more by being functional everywhere than you can by merely supporting functional programming in some places. Any mix of paradigms is necessarily going to be a compromise, and the advantages of prioritizing one main paradigm can outweigh the flexibility of supporting more than one to any large extent. Doing one thing, and doing it well, is a powerful idea that doesn't stop applying in designing programming languages.

Now, I'm not leaning one way or the other here in any comparison of languages (I'm sure my biases are pretty evident and show through, they're just not germane to this comment); I just think that summarily dismissing a language for being too focused or too "extremist" or not multi-paradigm is rather short-sighted. Also, often, unless you've tried doing something in a language yourself, don't assume it's more difficult than what you already know. There is much "common wisdom" about (like "functional programming is bad for GUIs") which is often more "common" than "wisdom".

Re:Extremist Programming by papsosouid on Wednesday November 21, 2012 @01:15PM (#4815454)
>Choosing between a functional language and an OO language is not like choosing between a hammer and a screwdriver to pound in a nail, it's more like choosing between different types of hammer

Take it one step further and ditch the terrible "tool" analogy altogether. It isn't like choosing between two hammers. Nothing we do is like driving a nail. We can't mix and match the way a carpenter can, taking hammer A for pounding these big nails, hammer B for the small ones, 4 different saws, a lathe, planer, etc. You can't use java's classes and perl's regexes and haskell's laziness. You have to pick the whole toolbox together, and take it as it is.

Re:Extremist Programming by gerts on Wednesday November 21, 2012 @05:02PM (#4816548)
perl does give you a lot of that, since if has a vaguely lisp-ish facility for modifying language syntax, and is in general very flexible, so it supports things like inheritance, deferred evaluation, etc..

http://search.cpan.org/search?query=acme&mode=all

Re:Extremist Programming by Negitivefrags on Wednesday November 21, 2012 @04:01PM (#4816288)
It's like choosing between two different Swiss army knives.
Re:Extremist Programming by saraid216 on Wednesday November 21, 2012 @05:18PM (#4816628)
It's like having a goal of writing a poem and choosing between a sonnet and a haiku.
Re:Extremist Programming by aufreak3 on Wednesday November 21, 2012 @09:38PM (#4817288)
While on analogies, I like to think of a general purpose programming language as paper and myself - the programmer - as an origami artist. Papers come in different sizes, materials, thickness, elasticity, etc. with each better suited for a certain class of origami. When considering very similar papers, the outcome is more dependent on the artist than on the paper.

This also allows the possibility that it is possible to do great art with scrap paper or to crumple up a beautiful sheet of handmade paper. OOP/FP/etc are like various folding techniques.

Re:Extremist Programming by timwiseman on Wednesday November 21, 2012 @06:03PM (#4816773)
This is true to a degree, but there are ways you can use multiple tools mixed and matched.

For a simple example, I might write my prototype in Python. After profiling I might decide to rewrite a couple of inner loops in C (or Cython). I might tie it to SQL Server as a datastore and use T-SQL in the interface.

Re:Extremist Programming by PuercoPop on Wednesday November 21, 2012 @09:09PM (#4817220)
Also SOA allows to "use different toolboxes".
Re:Extremist Programming by jonsen on Wednesday November 21, 2012 @01:31PM (#4815544)
You are actually saying that we should rethink what a proper software engineering toolbox really ought to be.
Re:Extremist Programming by papsosouid on Wednesday November 21, 2012 @04:06PM (#4816313)
Not really. I am just saying the tool analogy is really poor, and thinking of languages as hammers doesn't help us reason about them in any way. The analogy to toolboxes is less bad, but I don't think it is really very helpful either. Programming languages are like any other languages, they are used to communicate ideas.
Re:Extremist Programming by jonsen on Wednesday November 21, 2012 @04:16PM (#4816352)
Well, programming languages are rather specialized languages, compared to languages in general. This specialization is what this thread is about. What I meant was something like: maybe programmers should have a toolbox, call it programming environment, where several specialized languages could be used together in the same application with considerable ease. I have no specific ideas, just a vision.
Re:Extremist Programming by charlieflowers on Wednesday November 21, 2012 @08:44PM (#4817164)
The Microsoft .NET framework makes some claims of being like that. There is a grain of truth in the claims, but also some big gaps in practice. You can mix different .NET languages that all compile to the CLR virtual machine. For example, F# code can call C# code and vice versa.

But if you're looking to do cross-language like that, you have to know a lot about both languages and place some constraints on yourself.

I don't really see .NET as a viable implementation of your vision, but I wanted to at least point out that it does make those claims in case you were unaware.

Re:Extremist Programming by sparkie on Wednesday November 21, 2012 @09:57PM (#4817330)
The "extremist programming" approach to enable language compositionality would begin by asking what do the languages have in common: are there any fundamental principles from which the specific principles in each language derive? If we were considering just F# and C# for now, and we asked what they have in common - I think the obvious approach is that we should model everything as functions: after all - everything in F# is a function, objects can be seen as tuples of sets of functions and sets of variables, and variables can be seen as functions returning a value.

Another approach might be to look at things as objects, and to try and model functional programming in terms of objects. I'm sure you're familiar with how F# is implemented, and you'll probably agree that it's a disaster (although the language itself isn't terrible). The idea of building functions on top of an OOP which is defined in terms of functions clearly misses the point somewhere. The end result is a very specific compatibility layer between two different languages, but very far from solving the more general problem of language compatibility.

.NET isn't the only platform, or even the first to attempt this approach though, and it's hard to really blame them for not solving this problem, which they didn't set out to solve, but merely added as an afterthought. The author's article is about solving problems on principle, rather than making practical solutions and then trying to adjust them to solve other problems.

Nemerle is an interesting language on the .NET platform. The idea behind it is to have a syntax which can be extended from the language's own macro system - using a type-safe AST which is targeted with a PEG grammar. The eventual idea is that you should be able to use any syntax to target the same semantics in the AST, essentially merging the language and compiler into the same tool. 2.0 version is an attempt to define all of Nemerle's own syntax as it's macros - making it a good example of the "extremist programming" the article is talking about (and certainly a bit closer to jonsen's vision than .NET in general).

Re:Extremist Programming by loup-vaillant on Thursday November 22, 2012 @08:33AM (#4818677)
> You can't use java's classes and perl's regexes and haskell's laziness. You have to pick the whole toolbox together, and take it as it is.

Which is (i) a pity, and (ii), not entirely true. Sure, current modern compilers represent huge piles of code, but others are small enough that you can realistically craft your tool like a jedi would her lightsaber.

Of the top of my head, I have 3 example of language implementation small enough to be customized, ported, or otherwise scavenged for ideas. Lua, OMeta, and Maru.

http://www.lua.org/

http://www.tinlizzie.org/ometa/

http://piumarta.com/software/maru/

Re:Extremist Programming by bosie on Wednesday November 21, 2012 @01:44PM (#4815633)
wouldn't using a popular VM (e.g. JVM) give you quite a few of those choices though?
Re:Extremist Programming by jeremyjh on Wednesday November 21, 2012 @03:24PM (#4816148)
It helps with things like library, tool or framework selection because you end up evaluating the language itself more so than the ecosystem. I don't think many people are actually writing their applications in more than two different general purpose languages at the same time and place. Maybe you inherit some crusty code you just wrap up and re-use but you probably aren't doing new development in that old code-base at the same time.
Re:Extremist Programming by gerts on Wednesday November 21, 2012 @05:03PM (#4816554)
In the Unix environment, you may often write Java, Python, and Shell, all in a day's work on one project.
Re:Extremist Programming by jeremyjh on Wednesday November 21, 2012 @08:06PM (#4817095)
And that would be two general purpose programming languages :)
Re:Extremist Programming by sparkie on Wednesday November 21, 2012 @08:46PM (#4817166)
Shell is general purpose (perhaps even more so than Java or Python), when you look at it from the perspective that programs are simply functions you call and get a result from, or which perform additional computation.
Re:Extremist Programming by jeremyjh on Wednesday November 21, 2012 @09:47PM (#4817311)
Sure.
Re:Extremist Programming by papsosouid on Wednesday November 21, 2012 @04:04PM (#4816304)
It would if you wrote a language with those choices in it for the VM in question, but that is also an option without a VM. Sticking to the toolbox analogy, the only way to pick and choose the tools to go into the toolbox is to make your own toolbox.