[MLton] OpenGL

Mike Thomas mike.thomas@brisbane.paradigmgeo.com
Mon, 23 Feb 2004 10:06:41 +1000

Hi Stephen.

| Mike, what is the status of the OpenGL port?

Thanks for asking - I was about to ask you what you would like.
(Congratulations on your new release by the way - I think that with the
front end you have a winner on your hands as far as SML compilers go.)

The status is that a basic subset of OpenGL is available in CVS sufficient
to write basic OpenGL based applications.  Before release I would like to
add a test for the Glut menu functions - I've been distracted from this task
for the past few weeks.

I think you should wait and see whether anyone actually uses what is there
before pushing ahead further - OpenGL and GLUT are very big libraries.

|  I'm not planning on
| announcing it as part of the upcoming MLton release, but I would like
| to release it sometime afterwards.  Are you about ready to hand the
| code off to us?  Once we get it, I'd like to MLton-ize the signatures,
| making them more consistent with the style of the other libraries we
| plan to release.  This includes
|   * using tupled arguments
|   * renaming values (dropping the redundant prefixes)

By all means go ahead, but be aware that it will substantially break
compatibility with the MoscowML version and will break C function name
compatibility with standard OpenGL books etc - not in any insurmountable
way, but it just adds another small barrier to learners.

I also like the idea of curried functions as it makes function application
easier to my Haskellised way of thinking - I may be missing something about
how SML people work with curried functions though, as I'm not very
experienced with SML.

For example:

  map ( glutStrokeCharacter GLUT_STROKE_ROMAN ) ( String.explode text );

|   * using types where possible to clarify the arguments to functions

Yes - this can be improved but I think you should try and use the OpenGL
type names where possible.  On case which I have been meaning to clean up is
that I accidentally used GLreal instead of GLfloat.

| I'd also like to know what you think can be done about cleaning up the
| directories in the CVS.  What is needed beyond the mlton subdirectory?

I have been generating the MLton binding by running the C pre-processor over
the combined MoscowML/MLton source files in the gl, glut, glu subdirectories
and putting the results into the mlton subdirectory.    This doesn't really
need to be done now; it was just an initial attempt to unify the sources and
has not been a big help.

The only files you really need to keep are the files in the mlton directory

| Also, the top-level Makefile is invalid and needs to be fixed or
| removed.

It is actually part of the Moscow ML distribution and I was thinking that
for MLton you could change into the mlton directory and type make.

I would suggest that you just remove everything except for the contents of
the mlton subdirectory and move those up one level.

You would then just edit the Makefile to remove the preprocessor steps and
"Bob's your uncle!"


Mike Thomas.