10

I started learning Standard ML recently out of curiosity. So what I know is that is has an efficient compiler (MLton) which allows us to freely use abstractions without worrying about performance.

It would be perfect if I could do some GUI programming with Standard ML, too. Is there anything like Gtk, Qt, or WxWidgets binding for Standard ML?

Thank you very much.

2
  • 3
    You'd have better luck with OCaml, which is a more widely used ML variant (outside of academia). If you're willing to make a larger leap away from SML, Haskell has excellent GUI toolkits too. Commented Oct 23, 2009 at 21:05
  • Oh thanks. I already learned Haskell, though not much with the GUI stuff. I was curious about SML just in case I needed performance that could compare with C, lol. Commented Oct 29, 2009 at 0:09

3 Answers 3

7

Here's a paper describing the mGTK project, which is a Standard ML binding to GTK. There are also a couple of interfaces to OpenGL, although this is more 2 and 3D graphics-oriented rather than specifically a GUI toolkit. eXene is a toolkit for X Windows. sml_tk is an interface to Tk.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I also did some googling and found the mGTK and SML-Gtk projects, but it looked like they haven't been updated for a long time :(
3

There are bindings for foreign toolkits, but the eXene toolkit was designed to be native for SML and to exploit the features of Concurrent ML. I used it years ago and found it a very smooth fit for the language and a pleasure to use. But it does not have the ginormous library of components that you find in the more widely used toolkits.

Comments

0

Giraffe Library provides SML bindings to libraries that support GObject Introspection, which includes GTK. At the time of writing, bindings are available for the GTK 3 stack. Although the cairo graphics library does not support GObject Introspection, Giraffe Library provides bindings to some cairo functions.

Although SML has a very precise definition, the definition does not include an FFI, and there is considerable variation between compilers. At the time of writing, Giraffe Library supports only the FFIs of MLton and Poly/ML.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.