* [Caml-list] How to explain static typing to other people?
@ 2013-08-28 11:45 oliver
2013-08-28 12:18 ` Francois Berenger
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: oliver @ 2013-08-28 11:45 UTC (permalink / raw)
To: caml-list
Hello,
did you ever get the response, that one could use Java,
when you talked about the static typing advantages of
languages like OCaml or Haskell?
I often heard that and after trying to explain the differences
for a while, I started to stop the discussion, because the other person
will not understand it. (Maybe it needs to be tried in the real world
to see the differences... discussing about it alone can't work, I guess.)
Here is a talk, that I enjoy(ed) viewing, because it's clearly
showing the advantages of static typing and IMHO this
guy has a lot of humor, making the talk fun to view:
[ny-haskell] A Pragmatic Case for Static Typing with Brian Hurt
http://vimeo.com/72870631
Ciao,
Oliver
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] How to explain static typing to other people?
2013-08-28 11:45 [Caml-list] How to explain static typing to other people? oliver
@ 2013-08-28 12:18 ` Francois Berenger
2013-08-28 19:25 ` Raoul Duke
2013-08-29 14:53 ` Florent Monnier
2013-08-29 16:00 ` Johan Grande
2 siblings, 1 reply; 6+ messages in thread
From: Francois Berenger @ 2013-08-28 12:18 UTC (permalink / raw)
To: caml-list
On 8/28/13 8:45 PM, oliver wrote:
> Hello,
>
> did you ever get the response, that one could use Java,
> when you talked about the static typing advantages of
> languages like OCaml or Haskell?
One advantage is that the OCaml (and Haskell) compilers automatically
infer the correct type.
In Java, you must always manually input the type, as far as I remember.
> I often heard that and after trying to explain the differences
> for a while, I started to stop the discussion, because the other person
> will not understand it. (Maybe it needs to be tried in the real world
> to see the differences... discussing about it alone can't work, I guess.)
>
> Here is a talk, that I enjoy(ed) viewing, because it's clearly
> showing the advantages of static typing and IMHO this
> guy has a lot of humor, making the talk fun to view:
>
> [ny-haskell] A Pragmatic Case for Static Typing with Brian Hurt
> http://vimeo.com/72870631
>
>
> Ciao,
> Oliver
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] How to explain static typing to other people?
2013-08-28 12:18 ` Francois Berenger
@ 2013-08-28 19:25 ` Raoul Duke
2013-08-28 19:40 ` oliver
0 siblings, 1 reply; 6+ messages in thread
From: Raoul Duke @ 2013-08-28 19:25 UTC (permalink / raw)
To: OCaml
> One advantage is that the OCaml (and Haskell) compilers automatically infer
> the correct type.
>
> In Java, you must always manually input the type, as far as I remember.
i was under the impression, based on personal experience as well as
hear-say, that anybody /really/ using haskell or ocaml or some such
would actually be manually entering type signatures all the time,
because they do not want to later have some incomprehensible error
that does not point to a root cause.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] How to explain static typing to other people?
2013-08-28 19:25 ` Raoul Duke
@ 2013-08-28 19:40 ` oliver
0 siblings, 0 replies; 6+ messages in thread
From: oliver @ 2013-08-28 19:40 UTC (permalink / raw)
To: Raoul Duke; +Cc: OCaml
On Wed, Aug 28, 2013 at 12:25:31PM -0700, Raoul Duke wrote:
> > One advantage is that the OCaml (and Haskell) compilers automatically infer
> > the correct type.
> >
> > In Java, you must always manually input the type, as far as I remember.
>
>
> i was under the impression, based on personal experience as well as
> hear-say, that anybody /really/ using haskell or ocaml or some such
> would actually be manually entering type signatures all the time,
> because they do not want to later have some incomprehensible error
> that does not point to a root cause.
[...]
It's possible (and possibly good style) to start with the signature.
If the problem is clear enough stated in the beginning.
Otherwise, it's possible to start with type inference as the helping tool,
and when the code is somewhat mature, create an mli-file to make things
less variable.
Which way to go depends on how much planning si done (and can be done)
in advcance.
But the talk had mentioned a lot more problems, not only type inference.
The comparision with unit testing also was nice. And many other aspects also.
Ciao,
Oliver
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] How to explain static typing to other people?
2013-08-28 11:45 [Caml-list] How to explain static typing to other people? oliver
2013-08-28 12:18 ` Francois Berenger
@ 2013-08-29 14:53 ` Florent Monnier
2013-08-29 16:00 ` Johan Grande
2 siblings, 0 replies; 6+ messages in thread
From: Florent Monnier @ 2013-08-29 14:53 UTC (permalink / raw)
To: oliver; +Cc: caml-list
2013/08/28, oliver wrote:
> Hello,
>
> did you ever get the response, that one could use Java,
> when you talked about the static typing advantages of
> languages like OCaml or Haskell?
>
> I often heard that and after trying to explain the differences
> for a while, I started to stop the discussion, because the other person
> will not understand it. (Maybe it needs to be tried in the real world
> to see the differences... discussing about it alone can't work, I guess.)
[...]
sometimes a drawing (or something visual) is better than a long explanation:
http://www.ekobutiks.com/1551-thickbox/jouet-boite-a-formes-classic-goki-jouets-en-bois.jpg
From the beginning I understand the OCaml type system to be something
very similar to this child educational game.
--
Regards
Florent
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] How to explain static typing to other people?
2013-08-28 11:45 [Caml-list] How to explain static typing to other people? oliver
2013-08-28 12:18 ` Francois Berenger
2013-08-29 14:53 ` Florent Monnier
@ 2013-08-29 16:00 ` Johan Grande
2 siblings, 0 replies; 6+ messages in thread
From: Johan Grande @ 2013-08-29 16:00 UTC (permalink / raw)
To: caml-list
Le 28/08/2013 13:45, oliver a écrit :
> did you ever get the response, that one could use Java,
> when you talked about the static typing advantages of
> languages like OCaml or Haskell?
I haven't used Java in a while but if I remember correctly, although
Java features static typing, it allows you to use not so safe tricks
such as cast and null, while OCaml doesn't.
Moreover, OCaml allows to define complex types (and use them with
pattern matching) very easily and thus makes you want to use the type
system instead of trying to circumvent it.
type 'a option = Some 'a | None
How many lines to express that in Java?
OCaml's type inference is also very useful even if you choose to write
some type information as good practice.
Last but not least, OCaml is a functional language. Well, I haven't
tried Java 7.
--
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-29 16:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28 11:45 [Caml-list] How to explain static typing to other people? oliver
2013-08-28 12:18 ` Francois Berenger
2013-08-28 19:25 ` Raoul Duke
2013-08-28 19:40 ` oliver
2013-08-29 14:53 ` Florent Monnier
2013-08-29 16:00 ` Johan Grande
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox