However, having said all that, I really prefer MLs. It's all the fun of functional programming with syntax similar to Python's, but absolutely nowhere near as restricted as Python. Anyone here use any MLs? I got into F# recently and now I pretty much refuse to use anything else (Though I know I need to pick up OCaml since F# is basically a stripped-down bastardized OCaml. But I just love .NET so much.)
I played around with SML a bit before trying Ocaml. I like Ocaml and I'm trying to write a warlight AI bot in it, just to cement my understanding of it.
I really like ocaml, it's my first (lasting) foray into really strong type systems.
For those who are just following along, strong typing means that all the variables and values must have a single type. Every type conversion needs to be explicit. For example, if javascript were strongly typed, this code wouldn't compile:
Code:
function get_x() { return 3; }
var y = get_x();
y();
However, as things stand, that does compile. That is a valid javascript program, and if your javascript compiler rejected it, they're not following the standards. (Unless there's some technicality I'm missing.)
With strong typing, that cannot compile because get_x returns a number and you cannot call a number as a function. With weak typing, that is a correct javascript program. It runs, and then throws an error.
At first, strong typing is a bitch and a half. It's like BSDM programming. Whips and chains. But you start to work with the type system, and things flow a lot more smoothly after that point.
See, the benefit is that probably 90% of the errors I get with other programming languages is type errors. Null pointers. I meant to pass a list of arrays, instead of an array of lists of arrays. Or my closure returns another closure that returns the object, instead of whatever I was expecting.
So when I write a program in a traditional language, it compiles right as soon as I hit save. And then I spend the next two months holding my breath, because it could crash at any moment. It doesn't crash frequently, but still, when it does, that's an afternoon down the toilet tracking down a silly bug.
When I write code in a BDSM language, I hold my breath every time I compile, and sometimes I need to compile a few times before it goes through. But when it does, I know it's working. It's such a great feeling to have a program compile, and to know it's correct even before it runs.
Now, of course, this sort of thing isn't appropriate for all situations. Sometimes, you just need to be more dynamic and go with the flow. And sometimes the extra rigidity is worth it. It depends. I think of it as working in two different mediums. Marble versus charcoal.
I'm not saying that LISP is shit, but it's bad outside of a few select domains.
See, I think that's more of a stereotype, and it's not actually borne out by any evidence. Lisp seems to excel pretty broadly. It's only specialized circumstances, like things like matlab, where it's not an effective tool.
Lisp is a turing complete language, you can do anything with it, the question is one of compatibility, maintainability, efficiency, etc. And on these metrics, lisp fails pretty damn hard.
Compatibility, maintability and efficiency are things lisp excels at. Like, all popular dynamic programming languages have FFIs. They're all pretty equal in that department. Maintainability is pretty solid for lisp. Efficiency is actually a bonus for lisp, because lisp compilers really outperform many of the popular scripting languages today.
Dude, Lisps are super complicated compared to MLs.
That's a really strange assertion. What makes you say that?
I recommend that you spend some time reading the Microsoft Developer Network so that you can learn about .NET languages, which are very, very common in industry, and will make you a lot more money than the academic circlejerk that is functional programming.
.NET as a platform seems to be lacking. And if you're talking about platforms, language matters a lot, lot less.