Usings lists in all circumstances because its functional is not appropriate. Show the ocaml implementation using arrays or an c++ implementation using linked lists for a valid comparision.
The strength of Ocaml is the flexibility it provides to a developer. If your solution is more elegantly coded using imperative constructs, then use them!
b) It's much easier to hack out some program in procedural language and then hack bits of it randomly until it kind of works. Programming in functional languages requires more thought.
This is nonsense. Functional programming almost always requires less thought because:
They are garbage collected
Programs tend to be much shorted
There are fewer assignments
Type systems catch a huge number of stupid mistakes
Functional programming is only feels harder because your are forced to correct your errors (instead of silently failing).
It might be hard (only at first) to wrap your head around higher-order functions, but all of you java programmers do the same thing (with ugly syntax) when you create inner classes.
For example in C, imagine we have the following function:
void foo(int& i) { if(i==1) g(); if(i==2) h(); }
In C, we have to assume that the call to g() may have changed the value of i. In a functional language this is not true.
That is not true. If you were to transliterate this into caml, then the type of i would be a reference to foo, which g() could still change. Odds are though, you will very infrequently need to pass a reference.
Modern programming languages can perform some of the safety features that operating systems provide. Many functional languages "can't go wrong". (meaning the compiler can prove a program does not access memory outside of its own space). Some languags like value Microsoft's Vault programming language can make sure an API is used properly. Check out Kernel Mode Linux for an example of how a "safe" scheme program can be speed up by executing in kernel space.
SML is the language on which OCaml is based. OCaml is really just SML with different (read: worse) syntax, some small differences, and then OO support.
The main reason is historical: Caml was invented before SML.
The Caml language is issued from the original ML language, invented by Robin Milner in 1978, and developped jointly at INRIA from 1981. The first Caml compiler was written in 1984, and distributed from 1985. Standard ML was not yet invented, and Caml's syntax was similar to the syntax of ML V6.2, whose compiler was used to compile the first Caml compiler. When the syntax of Standard ML has been defined, Caml kept its own syntax, for several reasons. The first reason is questionable and subjective: we thought that SML's syntax was not a major improvement of the original ML syntax (hence of Caml's one). The second, more fundamental, reason is that we thought the language not to be mature enough at that time to be completely defined and fixed by a standard; we are still doing some progress on the understanding of some features of ML, and these progress may imply some important modifications of the language (let's cite the type checking of imperative features or the semantics and type checking of modules). In addition, we wanted to be free to add some new constructs (and indeed we did it, e.g. ``for''loops, ``try with'' and ``match with'', character constants, access to vectors and strings, ``mutable'' annotations for records, ``when'' clauses in pattern matching). This relative freedom with respect to the syntax allows the emergence of new variants of Caml: for instance the Caml Light and Objective Caml systems have their own extensions to the core syntax of Caml.
Hence Caml has its own syntax.
More interestingly caml has a pre-processor(camlp4)which allows to write in various other syntaxes. E.g. there is a Standard ML syntax, as well as a lisp-ish syntax.
SML will probably be easier to start off on, is better supported and better documented.
They both have nice documentation. They are so similiar I doubt it makes a lot of difference. The nicest new programmer ocaml documentation is The Oreilly Book Developing Applications with Objective Caml. With the exception of Ocaml's object oriented features, most ocaml documentation can be used w/ SML, and vise versa.
Lisp's defmacro system will open your eyes to a whole new world. It is the most powerful macro system you'll ever use. You can perform arbitrary transformations to your code. You'll never think the same way again once you've gotten the hang of defmacro.
For whatever its worth, camlp4 gives you a nice macro system too. I don't know how it compares w/ common lisps, but it does give you static checking of your macros and let you work at the abstract syntax tree level.
I'd be all for it if it wasn't just an excuse to raise prices.
"Comcast, however, has no immediate plans to offer a lower-priced, slower service. David N. Watson, Comcast Cable Communications Inc.'s senior vice president of marketing, sales and customer service, said at a recent conference that it would be "pretty premature" for the company to offer a lower-priced broadband service, given that its current offering is selling well."
I work for a large defense contractor. We're forbidden to use most open source programs. MySQL, Jacorb, Postgresql, Log4J, and even perl (!) have been avoided because of liability issues... Its also difficult to convince our laywers open source can be used w/o (potentially) violating copyright of many developers...
Would be nice to see, but its not common (or likely) in my experience.
at http://www.cs.uwaterloo.ca/~klarson/teaching/F04-8 86/papers/loder04.pdf
Usings lists in all circumstances because its functional is not appropriate. Show the ocaml implementation using arrays or an c++ implementation using linked lists for a valid comparision.
The strength of Ocaml is the flexibility it provides to a developer. If your solution is more elegantly coded using imperative constructs, then use them!This is nonsense. Functional programming almost always requires less thought because:
They are garbage collected
Programs tend to be much shorted
There are fewer assignments
Type systems catch a huge number of stupid mistakes
Functional programming is only feels harder because your are forced to correct your errors (instead of silently failing).
It might be hard (only at first) to wrap your head around higher-order functions, but all of you java programmers do the same thing (with ugly syntax) when you create inner classes.
That is not true. If you were to transliterate this into caml, then the type of i would be a reference to foo, which g() could still change. Odds are though, you will very infrequently need to pass a reference.
I'm still waiting for my Linus inspired BitKeeper clone...
Theres lots of room for improvement in the election process.
Modern programming languages can perform some of the safety features that operating systems provide. Many functional languages "can't go wrong". (meaning the compiler can prove a program does not access memory outside of its own space). Some languags like value Microsoft's Vault programming language can make sure an API is used properly. Check out Kernel Mode Linux for an example of how a "safe" scheme program can be speed up by executing in kernel space.
From the Caml Faq
The main reason is historical: Caml was invented before SML.
The Caml language is issued from the original ML language, invented by Robin Milner in 1978, and developped jointly at INRIA from 1981. The first Caml compiler was written in 1984, and distributed from 1985. Standard ML was not yet invented, and Caml's syntax was similar to the syntax of ML V6.2, whose compiler was used to compile the first Caml compiler. When the syntax of Standard ML has been defined, Caml kept its own syntax, for several reasons. The first reason is questionable and subjective: we thought that SML's syntax was not a major improvement of the original ML syntax (hence of Caml's one). The second, more fundamental, reason is that we thought the language not to be mature enough at that time to be completely defined and fixed by a standard; we are still doing some progress on the understanding of some features of ML, and these progress may imply some important modifications of the language (let's cite the type checking of imperative features or the semantics and type checking of modules). In addition, we wanted to be free to add some new constructs (and indeed we did it, e.g. ``for''loops, ``try with'' and ``match with'', character constants, access to vectors and strings, ``mutable'' annotations for records, ``when'' clauses in pattern matching). This relative freedom with respect to the syntax allows the emergence of new variants of Caml: for instance the Caml Light and Objective Caml systems have their own extensions to the core syntax of Caml.
Hence Caml has its own syntax.
More interestingly caml has a pre-processor(camlp4)which allows to write in various other syntaxes. E.g. there is a Standard ML syntax, as well as a lisp-ish syntax.
They both have nice documentation. They are so similiar I doubt it makes a lot of difference. The nicest new programmer ocaml documentation is The Oreilly Book Developing Applications with Objective Caml. With the exception of Ocaml's object oriented features, most ocaml documentation can be used w/ SML, and vise versa.
For whatever its worth, camlp4 gives you a nice macro system too. I don't know how it compares w/ common lisps, but it does give you static checking of your macros and let you work at the abstract syntax tree level.
why not? lousy revision control. hard to diff
yeah, its pretty easy to make those types of decisions in black and white terms. "simplistic", but easy.
I'd be all for it if it wasn't just an excuse to raise prices.
"Comcast, however, has no immediate plans to offer a lower-priced, slower service. David N. Watson, Comcast Cable Communications Inc.'s senior vice president of marketing, sales and customer service, said at a recent conference that it would be "pretty premature" for the company to offer a lower-priced broadband service, given that its current offering is selling well."
I work for a large defense contractor. We're forbidden to use most open source programs. MySQL, Jacorb, Postgresql, Log4J, and even perl (!) have been avoided because of liability issues... Its also difficult to convince our laywers open source can be used w/o (potentially) violating copyright of many developers...
Would be nice to see, but its not common (or likely) in my experience.
are there unofficial .deb packages? whats the timeline for getting this into unstable?