To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10258
10257  |  10259
Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 30 Aug 2005 12:37:55 GMT
Viewed: 
5405 times
  
On 29/08/05, Damien Guichard <damien.guichard@wanadoo.fr> wrote:
In lugnet.cad, Timothy Gould wrote:

Damien,

I don't see the advantage in using OCaml over any other language.
Particularly
ones people are more familiar with. Could you outline any advantages is
might
have over, say, Perl (which also has inbuilt strings and memory management).

Tim

(* off-topic discussion *)

Design and implementation are not as independant as i wish.

As part of the design requirements, i pointed moves should be functions and be
as composable as functions are. Practically that means the language must
support:
1. anonymous functions
2. closures
3. partial application
4. type inference (Milner's type system)

Java doesn't meet any of these requirements.
Perl, Python and Ruby may barely meet 2 or 3 of the requirements.
Scheme confortably meets 3 of the requirements.

The 4 requirements together leave only 3 language candidates:
1. OCaml
2. Haskell (the successor of Miranda)
3. SML (Standard ML)

OCaml is by far the most popular of them.

Why is a Milner's type system so much needed ?

Because of the heavy use of partial application.
Partial application means you can't check the number of applied arguments.
Thus
code is very fragile: forgetting a function argument goes undetected, this
leads
to code that is clean to read but nightmarish to debug. The solution found by
Robert Milner is a stronger typing system known as "Milner's type system".

damien


I think you may need to explain you choices further. Python supports
variable numbers of function arguments, as does Perl. In Python it is
relatively easy to check the types of the arguments, and implement
overloading and type checking inside a function. In Python you can
pass around an object containing a function and call it.

Considering that (as you pointed out) animation is mathemetics and
matrix multiplication - I quote this posting from comp.lang.python:

[QUOTE]
To create a matrix the OCAML code is

7 let mkmatrix rows cols =
8   let count = ref 1 and last_col = cols - 1
9   and m = Array.make_matrix rows cols 0 in
10   for i = 0 to rows - 1 do
11     let mi = m.(i) in
12     for j = 0 to last_col do mi.(j) <- !count; incr count done;
13   done;

In Python with Numeric it's just

x = zeros([nrow,ncol],Float)
[/QUOTE]

OCaml is not a widely used, or recognised language - and asking people
to learn something that is even more esoteric than Perl would be a
complete turn off. Popular is not a word I would associate with it at
all. My point about usability is even stronger - when you use an
obscure language, most developers wouldnt even touch it, let alone the
end users. Please dont make something so over the top - Lego is
simple, and easy to use - and so should any tools built to work with
it be simple and readable.

Dont get me wrong - I like the idea of embedding a nice, scriptable,
object oriented, readable and high-level language so that complex
animations using mathematical functions could be created. But I
strongly feel the OCaml is not the way to do it, its not as readable
as other languages - and going into Milner is just not necessary.

OrionRobots
--
http://orionrobots.co.uk - Build Robots



Message has 1 Reply:
  Re: LDraw Animation - Why MPD?
 
(...) (* off-topic discussion *) To create a matrix the OCaml code is: let x = Array.make_matrix nrow ncol 0.0 I acknowledge: * OCaml is not widely used * even more esoteric than Perl would be a complete turn off * popular is not a word I would (...) (19 years ago, 1-Sep-05, to lugnet.cad.dev)

Message is in Reply To:
  Re: LDraw Animation - Why MPD?
 
(...) (* off-topic discussion *) Design and implementation are not as independant as i wish. As part of the design requirements, i pointed moves should be functions and be as composable as functions are. Practically that means the language must (...) (19 years ago, 29-Aug-05, to lugnet.cad.dev)

61 Messages in This Thread:




















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR