Re: Ad- and disad- vantages of OCaml.
"Kenneth Miller [email protected] [ocaml_beginners]" <[email protected]> Wed, 23 Mar 2016 18:31:45 +0000 (UTC)
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Hendrik,
| when the problem is naturally procedural...
Well, there are problems that are more naturally understood as procedural than other problems, but I'd say this is a weakness of people because we know that the functional and imperative computational classes are equivalent.
On Wednesday, March 23, 2016 2:25 PM, "Hendrik Boom [email protected] [ocaml_beginners]" <[email protected]> wrote:
On Wed, Mar 23, 2016 at 05:05:28PM +0000, Kenneth Miller [email protected] [ocaml_beginners] wrote:
>
> Thinking about math isn't what very many people want to do with their
> time because it's hard, you're going to have to acknowledge that.
> Rigor is what it is: rigor.
And rigor is necessary for any kind of reliable programming. But don't
confuse rigor with a strait-jacket.
The big advantage of languages like OCaml isn't that you have to use
math; nor is it that it makes you think functionally.
It's that:
* when your problem is naturally functional, the syntax allows
you to use functional notation.
* It's strongly typed. (This alone accounts for much of its
reliability)
* It's syntactcally compact.
On the other hand,
* When your problem is naturally procedural, the syntax isn't as
accomodating.
* It doesn't lend itself to handling detailed compact storage layouts
for data, often needed by externally specified data structures and
file layouts. In particular,
* You lose a bit in every word of memory.
* Variables seem to require extra storage overhead in the form of a
pointer to a separately allocated and garbage-collected storage.
* The syntactically compact style can be confusing when it leads
programmers to leave out explicit typing of parameters and other
names.
* The compiler only finds one error per compilation. This could
perhaps be obviated by a new compiler, but it's not clear that the
language provides enough redundancy for useful syntactic error
recovery. (I'm using the word 'syntax' to include static typing)
-- hendrik
#yiv3396273956 #yiv3396273956 -- #yiv3396273956ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv3396273956 #yiv3396273956ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv3396273956 #yiv3396273956ygrp-mkp #yiv3396273956hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv3396273956 #yiv3396273956ygrp-mkp #yiv3396273956ads {margin-bottom:10px;}#yiv3396273956 #yiv3396273956ygrp-mkp .yiv3396273956ad {padding:0 0;}#yiv3396273956 #yiv3396273956ygrp-mkp .yiv3396273956ad p {margin:0;}#yiv3396273956 #yiv3396273956ygrp-mkp .yiv3396273956ad a {color:#0000ff;text-decoration:none;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ygrp-lc {font-family:Arial;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ygrp-lc #yiv3396273956hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ygrp-lc .yiv3396273956ad {margin-bottom:10px;padding:0 0;}#yiv3396273956 #yiv3396273956actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv3396273956 #yiv3396273956activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv3396273956 #yiv3396273956activity span {font-weight:700;}#yiv3396273956 #yiv3396273956activity span:first-child {text-transform:uppercase;}#yiv3396273956 #yiv3396273956activity span a {color:#5085b6;text-decoration:none;}#yiv3396273956 #yiv3396273956activity span span {color:#ff7900;}#yiv3396273956 #yiv3396273956activity span .yiv3396273956underline {text-decoration:underline;}#yiv3396273956 .yiv3396273956attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv3396273956 .yiv3396273956attach div a {text-decoration:none;}#yiv3396273956 .yiv3396273956attach img {border:none;padding-right:5px;}#yiv3396273956 .yiv3396273956attach label {display:block;margin-bottom:5px;}#yiv3396273956 .yiv3396273956attach label a {text-decoration:none;}#yiv3396273956 blockquote {margin:0 0 0 4px;}#yiv3396273956 .yiv3396273956bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv3396273956 .yiv3396273956bold a {text-decoration:none;}#yiv3396273956 dd.yiv3396273956last p a {font-family:Verdana;font-weight:700;}#yiv3396273956 dd.yiv3396273956last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv3396273956 dd.yiv3396273956last p span.yiv3396273956yshortcuts {margin-right:0;}#yiv3396273956 div.yiv3396273956attach-table div div a {text-decoration:none;}#yiv3396273956 div.yiv3396273956attach-table {width:400px;}#yiv3396273956 div.yiv3396273956file-title a, #yiv3396273956 div.yiv3396273956file-title a:active, #yiv3396273956 div.yiv3396273956file-title a:hover, #yiv3396273956 div.yiv3396273956file-title a:visited {text-decoration:none;}#yiv3396273956 div.yiv3396273956photo-title a, #yiv3396273956 div.yiv3396273956photo-title a:active, #yiv3396273956 div.yiv3396273956photo-title a:hover, #yiv3396273956 div.yiv3396273956photo-title a:visited {text-decoration:none;}#yiv3396273956 div#yiv3396273956ygrp-mlmsg #yiv3396273956ygrp-msg p a span.yiv3396273956yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv3396273956 .yiv3396273956green {color:#628c2a;}#yiv3396273956 .yiv3396273956MsoNormal {margin:0 0 0 0;}#yiv3396273956 o {font-size:0;}#yiv3396273956 #yiv3396273956photos div {float:left;width:72px;}#yiv3396273956 #yiv3396273956photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv3396273956 #yiv3396273956photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv3396273956 #yiv3396273956reco-category {font-size:77%;}#yiv3396273956 #yiv3396273956reco-desc {font-size:77%;}#yiv3396273956 .yiv3396273956replbq {margin:4px;}#yiv3396273956 #yiv3396273956ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv3396273956 #yiv3396273956ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv3396273956 #yiv3396273956ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv3396273956 #yiv3396273956ygrp-mlmsg select, #yiv3396273956 input, #yiv3396273956 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv3396273956 #yiv3396273956ygrp-mlmsg pre, #yiv3396273956 code {font:115% monospace;}#yiv3396273956 #yiv3396273956ygrp-mlmsg * {line-height:1.22em;}#yiv3396273956 #yiv3396273956ygrp-mlmsg #yiv3396273956logo {padding-bottom:10px;}#yiv3396273956 #yiv3396273956ygrp-msg p a {font-family:Verdana;}#yiv3396273956 #yiv3396273956ygrp-msg p#yiv3396273956attach-count span {color:#1E66AE;font-weight:700;}#yiv3396273956 #yiv3396273956ygrp-reco #yiv3396273956reco-head {color:#ff7900;font-weight:700;}#yiv3396273956 #yiv3396273956ygrp-reco {margin-bottom:20px;padding:0px;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ov li a {font-size:130%;text-decoration:none;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv3396273956 #yiv3396273956ygrp-sponsor #yiv3396273956ov ul {margin:0;padding:0 0 0 8px;}#yiv3396273956 #yiv3396273956ygrp-text {font-family:Georgia;}#yiv3396273956 #yiv3396273956ygrp-text p {margin:0 0 1em 0;}#yiv3396273956 #yiv3396273956ygrp-text tt {font-size:120%;}#yiv3396273956 #yiv3396273956ygrp-vital ul li:last-child {border-right:none !important;}#yiv3396273956