From: Xah Lee
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <4eea52fb-f6b6-4e4c-a484-6deefa20e3bc@g1g2000pra.googlegroups.com>
On Jan 23, 12:32 pm, Thant Tessman <·············@gmail.com> wrote:
> I've been thinking about graphics file formats on and off for many years
> now. Somewhere along the way I figured out that people were thinking
> about the problem from the wrong point of view.
>
> The problem is that graphics file formats invariably have to let the
> semantics of the data they represent drive the syntax of the format. For
> example, geometric vertex position data usually--but not
> necessarily--takes the form of homogeneous arrays of 3-dimensional
> coordinates. Applications are forced to work within the semantic
> confines of the data structures the format can faithfully represent. If
> the format hopes to allow for the efficient parsing of data directly
> into memory, its design is forced to anticipate every kind of data its
> designers think might need to be stored.
>
> Invariably, designers are forced to create complex formats that never
> quite transcend an overly-specific approach to the development of
> computer graphics applications.
>
> What we need is not a file format, but a programming language--or at
> least something like a programming language. This programming language's
> job is merely to read in a 'program' and build the data structures
> described. It doesn't need to evaluate anything. It doesn't need control
> structures. It doesn't need functions. But it does need a type system.
>
> The end goal was always to provide the services of this 'language' as a
> highly-optimized C++ library, but on my third or fourth attempt to
> create just such a 'language' I decided to do a 'reference'
> implementation in Standard ML. What this bought me was a huge amount of
> confidence that there were no holes in the semantics or un-accounted-for
> corner cases in the design.
>
> The language is described here:
>
>        http://www.thant.com/projects/dl/dl090117.pdf
>
> The SML 'reference' implementation is available here:
>
>        http://www.thant.com/projects/dl/dl_sml_090122.tar.gz
>
> It builds for both SML/NJ and MLton.
>
> Data Language can be thought of as playing the role that XML plays in
> the Collada standard, only it's more efficient, easier to implement,
> safer, and can be described in a dozen pages instead of a hundred. And I
> can't help but think that even my SML implementation is far more
> efficient than any XML library written in C. The Collada standard
> explicitly states that it is not a "run-time delivery format" or
> "streaming-friendly." But my C++ implementation of my "Data Language" is
> already serving as exactly that.
>
> Although I do have some experience with XML, I'm no expert. What am I
> missing? What is the use of XML for these kinds of things buying people?
>
> -thant

I scanned your doc and read your message, but i don't quite understand
your idea clearly. It appears to me, you Data Language (DL) is just a
lean version of XML. (as one way to put it)

here's some thought about this topic ...

things that happen in the industry or academia has a strong, not
neglect-able social causes. It might be obvious, that some language X,
protocols Y, etc, is clearly technically superior, yet nobody seems to
thought of it, invented it, or use it, while the industry and everyone
is using or talking about Z and its variants. If one puts social
aspects into this equation, many such mystery dissolves.

if i understand your case correctly... note that the concept of XML
was due to the popularity of HTML, and was born as a effort to cleaned
up HTML, when HTML hit the world big time with once known as World
Wide Web in the 1990s. (HTML itself is borne out of SGML, which is
quite complex) Once XML with its regularity of syntax came into broad
awareness among tech people, large number of ideas and movement
happened... you have a bunch of XML related technologies (RSS, XSLT,
the whole Ajax related protocols, too many to list)

few years ago, it was popularly thought among lisp fanatics, that the
world finally got the sexp idea and copied lisp to have XML. But lisp
syntax is not regular. XML is. (and Mathematica is) Once you have a
pure uniform syntax that can trivially parsed, the ideas of the its
power spread and lots of tech based on it comes into being, as we see
with the case of XML. (note that the many tech development derived
from XML happened similarly to Mathematica since 1996 with Mathematica
3)

For details on this, the implication and consequences of a regular
syntax, see:

• Fundamental Problems of Lisp
  http://xahlee.org/UnixResource_dir/writ/lisp_problems.html

Now, given XML, we notice that it is EXTREMELY verbose. Verbose to the
point that in puts significant burden to even machines. One wonders,
that XML could simply have a lisp like syntax. For example:

 <entry>
   <title>a</title>
   <id>b</id>
   <updated>2009-01-24T20:39:02-08:00</updated>
   <summary>c...</summary>
  <link rel="alternate" href="xyz"/>
 </entry>

could simply be:

(entry
 (title a)
 (id b)
 (updated 2009-01-24T20:39:02-08:00)
 (summary c...)
 (link rel:alternate href:xyz)
)

this would be clearly superior. (any tech problem, such as easy
conflict of data string with the demilitor, can be easily mended by
several ways. (e.g. JSON, due to javascript and xml influence, is a
format similar to the above))

However, consider the social and historical factor, things just
happened the way they happened. In retrospect, one can always spot
lots flaws that seems obvious.

In regard to your idea, i think similar reason apply. Sure, your DL
may be superior. The world doesn't know about it, and probably doesn't
need it. Unless, perhaps you started a movement, and if successful,
than perhaps all future graphics data will be in DL, and you write a
page of history.

On the subject of graphics format... here's some of my grievances. I
always hated OpenGL. The incomprehensible, low level, hardware based,
speed oriented, C unix style type of shit. I wanted a high level
graphics lang.

Around 1995, Apple tried to do something about it. The result is
 http://en.wikipedia.org/wiki/QuickDraw3D

and subsequently, SGI, HP, Microsoft followed with
 http://en.wikipedia.org/wiki/Fahrenheit_graphics_API

for complex social reasons (Apple was in the verge of bankruptcy;
fighting among the corporations) history be what it is, these fall off
the planet earth. We are stuck with the fucking “free & OpenSoure”
OpenGL garbage, and DirectX low level fuck.

• Graphics Programing Pains
  http://xahlee.org/3d/graphics_programing_pain.html

You might also be interested in:

• Requirements For A Visualization Software System For 2020
  http://xahlee.org/3d/viz.html

  Xah
∑ http://xahlee.org/

☄

From: Thant Tessman
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <glhuqe$api$1@news.xmission.com>
Xah Lee wrote:

[...]

> things that happen in the industry or academia has a strong, not
> neglect-able social causes. It might be obvious, that some language X,
> protocols Y, etc, is clearly technically superior, yet nobody seems to
> thought of it, invented it, or use it, while the industry and everyone
> is using or talking about Z and its variants. If one puts social
> aspects into this equation, many such mystery dissolves.

This is indeed the conclusion I have come to. It's just that XML is SO 
horrible I was trying to get folks to play devil's advocate in case I 
was missing something.


> On the subject of graphics format... here's some of my grievances. I
> always hated OpenGL. The incomprehensible, low level, hardware based,
> speed oriented, C unix style type of shit. I wanted a high level
> graphics lang.

Welcome to my world.

Thanks for the references. I'll check them out.

-thant
From: Jon Harrop
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <RdadnUKkhcWHFOHUnZ2dnUVZ8sXinZ2d@posted.plusnet>
Thant Tessman wrote:
> Xah Lee wrote:
>> On the subject of graphics format... here's some of my grievances. I
>> always hated OpenGL. The incomprehensible, low level, hardware based,
>> speed oriented, C unix style type of shit. I wanted a high level
>> graphics lang.
> 
> Welcome to my world.

If you're after high-level easy-to-use graphics libraries then you will
appreciate my work, although it is commercial and mostly Windows only.
Smoke is a library for high-performance 2D vector graphics that is based
upon OpenGL:

  http://www.ffconsultancy.com/products/smoke_vector_graphics/?clfl

F# for Visualization is a more evolved form of Smoke rewritten from scratch
to use Microsoft's Windows Presentation Foundation (WPF) instead of OpenGL
and with 3D support as well:

  http://www.ffconsultancy.com/products/fsharp_for_visualization/?clfl

In both cases, the interfaces were designed to be declarative. Smoke is more
hardcore, featuring a lot more complexity and vastly better performance. F#
for Visualization focuses on a broad range of features ideal for
interactive technical computing (inspired by Mathematica) but can also be
used as WPF controls embedded in users' own GUI programs.

Modern functional programming languages excel at all aspects of these
applications, most notably interactive technical computing. For example, F#
makes our visualization software run 20x faster than the equivalent
Mathematica because F# is JIT compiled to native code. The ability to embed
our graphics in Windows applications at no extra cost obviously adds value
to our libraries.

F# is unquestionably better suited to such applications than any existing
FPL implementation in the open source world. Hopefully this will be
addressed in the future through the creation of an open source equivalent
to the CLR and robustly deployable graphics libraries like WPF but, until
then, Windows has no competition here.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
From: Xah Lee
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <053e664f-4f93-42e3-8285-4c4aa25604ee@i20g2000prf.googlegroups.com>
On Jan 25, 7:49 am, Jon Harrop <····@ffconsultancy.com> wrote.

yeah?

you know that one line of mathematica equals to about ten thousand
lines of F#, right?

are you aware, that you can solve differential equations, algebraic
equations, symbolic logic equations, transcendental equations, all in
one line in Mathematica, right?

you are aware that Mathematica can do typesetting of any 2D math
notation on the fly, right?

now, in scientific visualization, often you need to solve equations
with your data. So, Mathematica lets you do that with few lines and
few more lines gives you interactive dynamic visualization with
buttons and sliders. So what the fuck you?

I gave a few problems for the graphics world for the next 10 years:

• Requirements For A Visualization Software System For 2020
  http://xahlee.org/3d/viz.html

why don't you try to write a functional 3D library to solve this
problem?

  Xah
∑ http://xahlee.org/

☄
From: Jon Harrop
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <pYadnQx4-PHxiODUnZ2dnUVZ8vednZ2d@posted.plusnet>
Xah Lee wrote:
> On Jan 25, 7:49 am, Jon Harrop <····@ffconsultancy.com> wrote.
> 
> yeah?
> 
> you know that one line of mathematica equals to about ten thousand
> lines of F#, right?

Apparently you did not learn your lesson after you failed my ray tracer
challenge.

> are you aware, that you can solve differential equations, algebraic
> equations, symbolic logic equations, transcendental equations, all in
> one line in Mathematica, right?

F# has the TPL for parallel programming, PLINQ for database querying, XNA
for GPU programming and WPF for GUI programming. Mathematica 7 is nowhere
near providing that level of functionality.

> you are aware that Mathematica can do typesetting of any 2D math
> notation on the fly, right?

So does F# for Visualization.

> now, in scientific visualization, often you need to solve equations
> with your data.

I often need to do intensive numerical computations for which Mathematica is
far too slow. Also, I want correct answers and Mathematica is extremely
buggy.

> So, Mathematica lets you do that with few lines and 
> few more lines gives you interactive dynamic visualization with
> buttons and sliders.

So does F# for Visualization.

> I gave a few problems for the graphics world for the next 10 years:
> 
> • Requirements For A Visualization Software System For 2020
>   http://xahlee.org/3d/viz.html
> 
> why don't you try to write a functional 3D library to solve this
> problem?

I already did.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
From: Xah Lee
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <9452f3d4-a8ba-466b-875a-d07b7946c37c@a12g2000pro.googlegroups.com>
For a introduction of Mathematica 7, see:

http://wolfram.com/products/mathematica/newin7/

  Xah
∑ http://xahlee.org/

☄
From: Kaz Kylheku
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <20090131183904.690@gmail.com>
On 2009-01-25, Xah Lee <······@gmail.com> wrote:
> On Jan 25, 7:49 am, Jon Harrop <····@ffconsultancy.com> wrote.
>
> yeah?
>
> you know that one line of mathematica equals to about ten thousand
> lines of F#, right?

That's can only be true if the Mathematica programmer gets the advantage
of choosing the one line, not if the F# programmer gets the advantage of
choosing the ten thousand lines. :)
From: ········@gmail.com
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <1fad4cde-d3ef-481d-964d-e2bb10cbdfe0@w39g2000prb.googlegroups.com>
On 25 Gen, SUNDAY, Jon Harrop, advertising:
> $$$

YOU SHALL NOT DO WORK ON SUNDAYS.
YOU HAVE 6 (SIX) DAYS TO EARN YOUR LIVING.
OTHERWISE THE LORD HIMSELF WILL VISIT YOU UNEXPECTEDLY AND DESTROY ALL
OF YOUR BANK ACCOUNTS.
YES, HE WILL DO SO, ONE DAY (BUT MOSTLY THE OTHER).

Oh, sorry, wrong list, wrong day, wrong recipient(s)...

Oh, sorry for the sorry: right list, right day, right recipient(s)!!!
From: Kenneth Tilton
Subject: Re: Standard ML as graphics file format design tool
Date: 
Message-ID: <497cbb64$0$17985$607ed4bc@cv.net>
Jon Harrop wrote:
> Thant Tessman wrote:
>> Xah Lee wrote:
>>> On the subject of graphics format... here's some of my grievances. I
>>> always hated OpenGL. The incomprehensible, low level, hardware based,
>>> speed oriented, C unix style type of shit. I wanted a high level
>>> graphics lang.
>> Welcome to my world.
> 
> If you're after high-level easy-to-use graphics libraries then you will
> appreciate my work, although it is commercial and mostly Windows only.
> Smoke is a library for high-performance 2D ...


What a genius. His Amphibitude takes two great things (3D and 
portability) and transforms it into propietary and flat. Reminds me of 
people who take the cool dynamic functional paradigm and turn them into 
languages with static... oh, OK.

kth