[Non-coders: it shouldn't matter if you don't know about the
specific technical issue that I'm discussing here. Hopefully, I've managed to convey something of what it feels like to code in different languages, which is the important thing
(
Read more... )
Fair enough, I guess I am a bit accustomed to it.
"And other people have successfully written large, scalable, maintainable systems in Perl."
Yes. I certainly didn't say that it can't be done! For that matter, probably someone managed to build large, scalable, maintainable systems in Visual Basic.
"Thirdly, I'm not really talking about whether or not static typing is better than dynamic typing"
The issue I am talking about is strong dynamic typing (Ruby/Python) versus weak (mutable, as you call it) dynamic typing (Perl/PHP).
"have you ever tried using a dynamic language seriously, ie as your main language for a year or two? Think about it - you might be pleasantly surprised, and you might even learn something)."
Ruby is presumably not dynamic enough, as it doesn't have mutable typing?
"Now I'm going back to static typing and, of course, hating it"
Well, even after Ruby I quite like expressive static typing (as in Haskell/OCaml/Nemerle/F#/...) I don't think I could go back to Java or C#, though.
"I think that Haskell development is about pushing axioms you want your code to satisfy into the type system, and then using your compiler as an automated theorem-checker."
Yes. Unfortunately, dependent types (which are needed for many desirable axioms) are ugly to express in Haskell. And Epigram, Cayenne or Sage (now there's a really nice type system!) are not ready for prime-time (and may never be).
Reply
So, you're a Ruby hacker? Interesting. I have no idea who you are, you see, so can't infer much about your choice of languages - but I've heard your comments about string concatenation versus addition a dozen times and don't find them in the least convincing, for reasons I've hopefully explained :-)
My problems with Haskell's type system are that 1) it causes me lots of grief and frustration (and will do until I rewire my brain to do stuff that a Perl interpreter would do for me >:( ), 2) I find it's often insufficiently expressive for my needs (and many of its more recondite aspects seem rather ad-hoc). As in, I can't do things in Haskell (or can't do them without going to ridiculous lengths) that are straightforward and standard practice in C++ or Ada. Still, I'm very interested by the automated-theorem-checker aspect, and some very smart friends of mine assure me that I'll come to like the type system eventually, so I'm persisting, with the occasional rant here to let off steam.
I'm aware of dependent typing, but haven't yet looked seriously into it. I hadn't heard of Sage - I'll check it out...
Reply
All types are values of the type *, so Haskell's Maybe is simply a function of the type * -> *, and -- here is what you wanted -- you can have Vector of the type Int -> *. You also have Dynamic type which can be cast to and from anything, so you can be as dynamic as you want, or as static as you want.
You can also have "refinement types", for example the type of positive integers: {x:Int | x > 0}. Since I tend to think of static typing as expressing contracts, this makes a lot of sense to me.
Reply
# (1 + 2) - 4;;
Type: (Refine Int (fn (z:Int) => (inteq z (sub (add 1 2) 4))))
Evaluation: -1
Hmmmm. Looks rather Lispy...
Reply
Leave a comment