To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 13276
Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad, lugnet.cad.ray, lugnet.animation
Date: 
Sun, 28 Aug 2005 01:55:39 GMT
Viewed: 
15713 times
  
In lugnet.cad, Tore Eriksson wrote:
In lugnet.cad, Damien Guichard wrote:

* output would be a unique MPD file, each animation step being separated by a
CLEAR statement


What's the Pro with MPD files in this case? My experince is that it makes
programming much, much more difficult, and the gain is...(?) In LDA, I inlined
all submodels into one model DAT* file for each Frame, and then one Master DAT
file that calls all Frames separated by a STEP and a CLEAR statement.

*(Today I would of course have given them the LDR extension...)

Not really a big deal, i could change my mind if that's too difficult for me to
program.

The Pros:
* no change to existing standard material
* unlimited expressive power

The Cons:
* previous POV work would be not supported
* advanced OCaml programming quickly ressembles academic math work

* and yet another programming syntax to learn...

It's much worse than a new syntax.
A whole new, entirely different programming paradigm to learn.
A whole new program semantic.
Almost any programming skill you have would vanish in planned obsolescence.
You would have to restart from scratch, using only modern math background.

When i say academic i really mean academic:
1. Most important notion is recurrence theorem
2. Another important notion is anonymous functions
3. As far as possible, loops and variable assignments are banned!

But i also said no elitism: the basic usage would have basic syntax.
I could even add a preprocessor for those who don't like the syntax.
A friend advised me it may be necessary to provide a preprocessor for smooth
transition to more powerful concepts that people don't intuitively master.

damien

my lego web page: http://perso.wanadoo.fr/alphablock/


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad, lugnet.cad.ray, lugnet.animation
Date: 
Sun, 28 Aug 2005 10:18:51 GMT
Viewed: 
15842 times
  
* and yet another programming syntax to learn...

It's much worse than a new syntax.
A whole new, entirely different programming paradigm to learn.
A whole new program semantic.
Almost any programming skill you have would vanish in planned obsolescence.
You would have to restart from scratch, using only modern math background.

When i say academic i really mean academic:
1. Most important notion is recurrence theorem
2. Another important notion is anonymous functions
3. As far as possible, loops and variable assignments are banned!

But i also said no elitism: the basic usage would have basic syntax.
I could even add a preprocessor for those who don't like the syntax.
A friend advised me it may be necessary to provide a preprocessor for smooth
transition to more powerful concepts that people don't intuitively master.

damien

my lego web page: http://perso.wanadoo.fr/alphablock/

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


Subject: 
Reply to me
Newsgroups: 
lugnet.off-topic.geek
Date: 
Sun, 28 Aug 2005 10:21:02 GMT
Viewed: 
5311 times
  
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

Follow up set to .off-topic.geek


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 29 Aug 2005 21:59:10 GMT
Viewed: 
5406 times
  
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


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.off-topic.geek
Date: 
Mon, 29 Aug 2005 22:31:10 GMT
Viewed: 
5446 times
  
(* 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

Hi Damien,

The correct place for your response would be .off-topic.geek which is where I
set the follow up to in the response post.

I thought you were proposing to write a scripting language, but now I suspect
you mean that people should use OCaml for their programming. Is this correct?

If you are proposing that people learn OCaml just to run animations then I would
suspect that your target audience would most probably be yourself only. I have
experience in quite a few programming languages and I would not wish to learn
OCaml unless it was for a very good reason.

Please correct these assumptions if you think they are wrong!

Yours,

Tim


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 30 Aug 2005 03:36:14 GMT
Viewed: 
5541 times
  
Why not develop something abstract.  If you come up with a way to
notate an animation in any langauge, perhaps it will catch on.

James

On Aug 29, 2005, at 9:59 PM, Damien Guichard wrote:

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.


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 30 Aug 2005 04:00:33 GMT
Viewed: 
5487 times
  
I wonder if anyone remembers the 80s game "Story Machine" from Spinnaker
Software (publishers of "Face Maker" and other silly products.)

This program acted out the sentences you typed in. It was a kind of
self-illustrating text adventure. For example typing "The boy walked to the
tree" meant that the two characters would materialize out of nothing and the boy
would walk over next to the house. Or you could make the tree run to the boy (it
had animated legs.) There were a limited number of nouns and verbs, about 30 in
all.  As you typed (or erased), your story was recorded for replay later. My
stories ended with the terrible tree eating everything on the screen. Yum.

This concept is mostly for calling up canned routines. However, 6 year olds and
non-programmers will happily write programs in such languages. If you implement
natural language, certainly many more people will use your program.

-Erik


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 30 Aug 2005 12:37:55 GMT
Viewed: 
5485 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


Subject: 
Re: LDraw Animation - Why MPD?
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 1 Sep 2005 15:34:21 GMT
Viewed: 
5494 times
  
In lugnet.cad.dev, danny staple <orionrobots@gmail.com> wrote:

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

(* 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 associate with OCaml (other than relativily to
Haskell)
* OCaml is obscure (assuming the average user is not familiar with
lambda-calculus)

I even add my own comment to the mix:
* OCaml sucks as an OOP language

These are facts and i won't deny.
Now why would i stick to OCaml?

I have read the thread "Lego CAD systems infuriating?" and it convinced me
usability is a user-concern. Users are zappers, they try and zap, try something
else and zap again in the vain hope that "Just imagine...", "Plug & Play", "Just
do it" are more than slogans.
There IS a barrier for CAD and animation. Whatever low the barrier it will be
too high anyway.


OCaml is a full-fledged functional language, and that's what i need.

Paste the 6 following lines in your OCaml top-level (this is the
implementation), there are a bunch of nonsense definitions:

let to_the () = ();;
let walk_minifig () () = ();;
let drive_car  () () = ();;

let mario = ();;
let mario_car = ();;
let grocery_store = ();;


Now paste the 2 following lines (this is the end-user command) in the top-level:

(walk_minifig mario (to_the mario_car));
(drive_car mario_car (to_the grocery_store));;

The text is valid OCaml and executes nicely.

Suddenly what was an obscure OCaml implementation seems much like a natural
language interface.
What programming tricks i would use to derivate the animation from the user
command is my business, not the user concern.

My plan is to go bottom-up, to progress seamlessly from math concepts to natural
concepts. The first prototype would be inaccessible for the average lego
builder. But, incrementally, as more and more layers would be added, the command
line would be more and more pleasant to use. At the upper level the commands
would be usable both as a user command line tool and as a load/save text format
for a point-and-click interface.

We have the same usability goal, just you concentrate first on the interface, i
concentrate first on the implementation.

I don't see how "walk_minifig" and "drive_car" could be implemented.
Because they certainly need concepts i have not yet developped.
Probably they are just gimmicks and other commands will reveal more appropriate.
What is important is that the final user syntax will be readeable and
user-friendly. That is a long-term goal, the more abstract layers are added, the
less skills required for scripting:
* the lowest implementation level would be a quite stable animation engine
* above it would be generic animation commands
* above them would be domain-specific animation commands

The strength of OCaml is all user/developper levels would use the same language
that will seamlessly connect thus allowing incremental improvements.
The feedback would be straightforward:
* changes in the implementation would surface as improvements in the upper level
commands
* user requests would drive adjustments in the lower level commands
* as they progress advanced users would seamlessly become implementers

Having XML for datas and Python for commands would be having two languages, that
is playing Dr. XML & Mr. Python and separating the users from the implementers.

So when users would explain me why my tool is not useable i could answer "Just
do it".

Moreover i am not an OCaml believer, i have used Scheme, Smalltalk and Eiffel
previously and i know how "cutting-edge" technology can be misleading. So let me
assume the implementation failure before i can assume the interface failure.
Having a working implementation would already be a huge success for me.

damien

my lego web page: http://perso.wanadoo.fr/alphablock/


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