spacer Dylan Foundry
  • About

Binding nanomsg with melange

For those who haven't heard about it, nanomsg is a great library from Martin Sustrik. It provides high performance messaging with a simple API similar to that of BSD sockets. It bears some similarity to what someone might do with ZeroMQ and is licensed under the liberal terms of the MIT license. The nanomsg library is currently in a pre-alpha state.

I have recently written bindings for it for use with Dylan which are available as nanomsg-dylan.

In Dylan, we have a couple of options when writing bindings. We have a low level direct-c-ffi and a higher level C-FFI. Using the lower level interface is fairly tedious and verbose while using C-FFI is fairly convenient. But writing a binding using either involves a lot of work and hand-translation of the C APIs into the right Dylan definitions. (Currently, the direct-c-ffi system is not documented.)

This is where the melange tool is very useful. Melange can parse C headers and automatically generate the C-FFI bindings. While doing this code generation, it also handles details like automatically translations the C names into the correct Dylan names following the Dylan conventions.

Melange now has some preliminary documentation.

Using Melange

Melange generates a ...

read more »

Posted in Dylan by Bruce Mitchener, Jr. on Fri 25 January 2013 .

TutorialsC-FFImelange

There are comments.

The Dylan Foundry is working on tools and libraries to make it easier to use the Dylan programming language in production.

  • Other Sites
  • OpenDylan.org
  • Social
  • Atom feed
  • @DylanFoundry
  • @DylanLanguage
  • dylan-foundry/GitHub
  • dylan-lang/GitHub
  • Tip me via GitTip
  • Categories
  • Dylan
  • Tags
  • Debugging
  • HTTP
  • LLVM
  • C-FFI
  • Method Dispatch
  • Editor Support
  • Saying Good-bye
  • melange
  • LLDB
  • Dylan 2016
  • Streams
  • Type System
  • Atom
  • Tutorials
  • Performance
  • IDE
  • Platform Support
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.