in reply to What do you use as a language litmus?

Lexical closures

You already mentioned these :-) Closures are so incredibly useful I don't really want to code without them, but if I must, the language should at least support functions as a data type (i.e. C-style function pointers). Java-style object systems are a much too rigid on their own.

Closures and its flexible object system are what make JavaScript a good language. Shame about the ugly syntax, though :-)

Basically, anything that helps writing real functional code is a big plus.

Backtracking.

It's sort of a niche technique, but it's amazingly useful when applicable. See also the discussion at How implement AMB in perl?

A "freestyle" type/object system

I like perl's automatic type conversions. I like Ruby's strategy of duck-typing. I like C-style pointer casting. I even like the idea behind C++ templates. I don't like being restricted by the language.

"Real (i.e. LISP-style) Macros"

Anything that allows you to subvert the language itself is a good thing :-) Though it seems it's hard to implement unless the language syntax is extremely simple (this might not be a bad thing, I'm only just getting my feet wet with LISP, so it just looks more intimidating than it probably is :-) )

  • Comment on Re: What do you use as a language litmus?

Replies are listed 'Best First'.
Re^2: What do you use as a language litmus?
by apotheon (Deacon) on Jun 27, 2007 at 07:48 UTC

    It's not just the syntax that gets in the way with JavaScript -- it's the broken implementations and the short-sighted language definition (no direct system I/O, for example). It's a good language the same way Lance Armstrong would be a good athlete if he was was riding a circa 1980 banana seat bicycle designed for a ten year old girl in the Tour de France.

    Anyhow -- yeah, I agree, regarding "anything that helps writing real functional code", as long as it doesn't also get in the way of writing real useful code. I'm not saying that writing real functional code necessarily makes the code less useful -- just that I've seen some people do some really boneheaded things with language design for the purpose of rigidly adhering to some kind of design aesthetic.

    Thanks for the link about implementing amb in Perl, and the other commentary. I'll need to get significantly more well versed in things Lispy to really appreciate macros, I think, but one of the things I tend to look for in a programming language is duck typing or, alternatively, type inference. Thus, none of your suggestions really go amiss for me.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin