News for hackers. Stuff that matters.
Re:I finally understand why I'm not allowed to use Lisp by DougBTX on Saturday February 19, 2011 @08:32PM (#2240615)
For me type inference changes the picture, since it reduces the duplication you see throughout Java-style statically typed code, but doesn't give up all the benefits.
Re:I finally understand why I'm not allowed to use Lisp by gnosis on Saturday February 19, 2011 @09:22PM (#2240739)
The main thing that make programming in statically typed languages painful isn't the additional type declarations (which, as you rightly point out, need not even exist in languages that do competent type inference), but with the constant need to wrestle with the type system to get your code to compile at all.

This is made doubly painful by the incredibly obtuse error messages spat out by some compilers, like:

  This expression has type   ((int * int) * string * string * channel) list
  but is here used with type ((int * int) * string * string * channel) list
or even more baroque and confusing monstrosities.

Programming in OCaml made me feel like I'd need to take years of type theory classes in order to feel really comfortable in the language.

In comparison, programming in Lisp is a joy, and very easy.

But, in defense of the modern statically typed languages like OCaml and Haskell, I'll have to admit that once you've finished wrestling with the type system and actually gotten your program to compile, you've probably eliminated whole classes of bugs that might still exist in a similar dynamically typed language program. Not to mention that it will save you the writing a ton of unit tests.

Re:I finally understand why I'm not allowed to use Lisp by mquander on Saturday February 19, 2011 @09:48PM (#2240797)
That's a very optimistic error message!

  error: conversion from std::_Rb_tree_const_iterator<std::pair<
  const std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
  std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
  to non-scalar type std::_Rb_tree_iterator<std::pair<
  const std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
  std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
  requested
Re:I finally understand why I'm not allowed to use Lisp by shadowfox on Saturday February 19, 2011 @11:59PM (#2241089)
Interestingly enough, the sort of error messages that you mention in OCaml occurs partly due to the inference itself. Because inference is essentially a unification between implicit constraints, once it finds an anomaly, the engine can't always predict correctly which among the conflicting constraints is the actual error from a user point of view.

Anyway just an aside

Re:I finally understand why I'm not allowed to use Lisp by ddkrone on Saturday February 19, 2011 @09:07PM (#2240708)
The only benefit I'm aware of is slightly faster code and even then the dynamic version is almost always more readable and easier to maintain and refactor. The ideal would be a dynamic language with optional static typing but I have yet to see a language like that.
Re:I finally understand why I'm not allowed to use Lisp by overgard on Sunday February 20, 2011 @09:04AM (#2241861)
"slightly faster" is a bit understated, you're usually talking about statically typed languages being an order of a magnitude faster for things that are computationally expensive. Granted most things aren't, so for a web page or whatnot, it probably doesn't matter; and certainly the expressive ability you gain from dynamic languages might be worth the trade off. But the trade off is undeniably there.

(Try comparing various languages here: http://shootout.alioth.debian.org/u32/benchmark.php?test=all... if you don't believe me)

Some dynamically typed languages can approach the speed of static languages, like Lisp, but they generally do that by introducing voluntary static typing hints, or having a JIT compiler introduce speculative code paths that guess the types coming in after some analysis.

Re:I finally understand why I'm not allowed to use Lisp by siika2000 on Sunday February 20, 2011 @03:28AM (#2241413)
> The ideal would be a dynamic language with optional static typing but I have yet to see a language like that.

That would be Common Lisp.

Re:I finally understand why I'm not allowed to use Lisp by stcredzero on Sunday February 20, 2011 @11:27AM (#2242213)
That would be Common Lisp.

There was such a version of Smalltalk called Strongtalk, but it never got a community behind it.

Re:I finally understand why I'm not allowed to use Lisp by igouy on Tuesday February 22, 2011 @03:06PM (#2251288)
Actually - "but then the Java phenomenon happened and we eventually had to switch to Java before ever releasing it".

http://www.strongtalk.org/history.html

Re:I finally understand why I'm not allowed to use Lisp by davidk0101 on Sunday February 20, 2011 @05:24AM (#2241582)
I'm waiting for perl 6.
Re:I finally understand why I'm not allowed to use Lisp by SapphireSun on Sunday February 20, 2011 @12:37AM (#2241143)
Re:I finally understand why I'm not allowed to use Lisp by kanak on Sunday February 20, 2011 @10:31AM (#2242034)
You should look into typed racket.