News for hackers. Stuff that matters.
Re:Letter to a Young Haskell Enthusiast by marcosdumay on Friday August 01, 2014 @06:49PM (#8123245)
Every single value in Python is weakly defined, and can change at runtime. Functions can accept any set of parameters, objects do not need to conform to a class, the entire namespace can be replaced during the execution of a function. If you have a better name than "flexibility", please tell me, because I can't think of any.

Haskell is in the oposite extreme of that dimension.

Anyway, that has no relation to readability. Python's flexibility leads too easily to metaprogramming, for example, what's extremely powerfull, but a nightmare to read. And classifying a language as "mathematical" is borderline nonsensical - it only carries some slight meaning because people that say that normaly want to say "algebrical", in oposition to, maybe, "logic-temporal".

Re:Letter to a Young Haskell Enthusiast by nbouscal on Friday August 01, 2014 @07:35PM (#8123404)
Maybe reread my post - I wasn't saying that those typecasts of the languages were accurate, I was doing exactly the opposite.

The characteristics of Python you just mentioned are only specific to it in cases when they are erroneous. They basically all evaluate to "Python isn't type-safe." So again, show me a program that is best represented in a non-type-safe way, and I will concede the point. If you can't, then this flexibility you're praising isn't a feature, it's a bug.

Re:Letter to a Young Haskell Enthusiast by marcosdumay on Friday August 01, 2014 @10:54PM (#8123852)
> The characteristics of Python you just mentioned are only specific to it in cases when they are erroneous.

They are explicit at the official documentation, if they got there by error, they are official features now.

> They basically all evaluate to "Python isn't type-safe."

Yes, they do. They are at the opposite extreme from type-safety. That's why I used them to exemplify how it's the languages that apply better to some problems.

> So again, show me a program that is best represented in a non-type-safe way, and I will concede the point.

Well, any Django[1] CRUD would do. They are quite trivial, in there's little meaning in specifying exactly the manipulated data. Yes, Haskell has tools for displaying data at the web, and querying a database; no they are simply not as powerful when applied to that problem.

[1] In other frameworks they are about as simple, but you asked for one example.

Re:Letter to a Young Haskell Enthusiast by lomnakkus on Saturday August 02, 2014 @04:12AM (#8124389)
I find this a strange and unconvincing example -- if I'm understanding you correctly, that is. Is your complaint about strong typing here that you'd be forced to define stuff like a record Customer with fields "lastName", "firstName", etc. and you'd rather avoid that?

If you'd like something more "dynamic" (i.e. type-unsafe), you can instead just define a "universal data type" for all your CRUD data. For example you could define, say

   data Any = Number Int
            | Str String
            | Map String Any
            | Date ...
            | ...
and where you want "universal" data manipulation you just use Any.

EDIT: Thus you've confined all the "fuzziness" of your data definitions to a "subsystem" of your system and you can still benefit from proper types and type checking everywhere else.