Skip to main content

C \(\longrightarrow\) HASKELL, or Yet Another Interfacing Tool

  • Conference paper
Implementation of Functional Languages (IFL 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1868))

Included in the following conference series:

Abstract

This paper discusses a new method for typed functional languages to access libraries written in a lower-level language. More specifically, it introduces an interfacing tool that eases Haskell access to C libraries. The tool obtains information about the C data type definitions and function signatures by analysing the C header files of the library. It uses this information to compute the missing details in the template of a Haskell module that implements a Haskell binding to the C library. Hooks embedded in the binding file signal where, which, and how C objects are accessed from Haskell. The Haskell code in the binding file determines Haskell type signatures and marshaling details. The approach is lightweight and does not require an extra interface description language.

This work was conducted, in large part, while working at the Institute of Information Sciences and Electronics, University of Tsukuba, Japan.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Beazley, D.M.: SWIG and automated C/C++ scripting. Dr. Dobb’s Journal (February 1998)

    Google Scholar 

  2. Chakravarty, M.M.T.: A compiler toolkit in Haskell (1999), http://www.cse.unsw.edu.au/~chak/haskell/ctk/

  3. Chakravarty, M.M.T.: A GTK+ binding for Haskell (1999), http://www.cse.unsw.edu.au/~chak/haskell/gtk/

  4. Chakravarty, M.M.T.: Lazy lexing is fast. In: Middeldorp, A., Sato, T. (eds.) Proceedings of the 4th Fuji International Symposium on Functional and Logic Programming. LNCS. Springer, Heidelberg (1999)

    Google Scholar 

  5. Finne, S., Leijen, D., Meijer, E., Jones, S.P.: Calling hell from heaven and heaven from hell. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming. ACM Press, New York (1999)

    Google Scholar 

  6. Finne, S., Leijen, D., Meijer, E., Jones, S.L.P.: H/Direct: A binary foreign language interface for Haskell. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP 1998), pp. 153–162. ACM Press, New York (1998)

    Google Scholar 

  7. Harlow, E.: Developing Linux. Applications with GTK+ and GDK. New Riders Publishing, Indianapolis (1999)

    Google Scholar 

  8. Jones, S.P., Marlow, S., Elliott, C.: Stretching the storage manager: Weak pointers and stables names in Haskell. In: Proceedings of the International Conference on Functional Programming (1999)

    Google Scholar 

  9. Nordin, T., Jones, S.L.P., Reid, A.: Green Card: a foreign-language interface for Haskell. In: Proceedings of the Haskell Workshop (1997)

    Google Scholar 

  10. The common object request broker: Architecture and specification, rev. 2.2. Technical report, Object Management Group, Framingham, MA (1998)

    Google Scholar 

  11. Pennington, H.: GTK+/Gnome Application Development. New Riders Publishing, Indianapolis (1999)

    Google Scholar 

  12. Jones, S.L.P., Wadler, P.: Imperative functional programming. In: ACM Symposium on Principles of Programming Languages, pp. 71–84. ACM Press, New York (1993)

    Chapter  Google Scholar 

  13. Haskell 98: A non-strict, purely functional language (February 1999), http://haskell.org/definition/

  14. Swierstra, S.D., Duponcheel, L.: Deterministic, error-correcting combinator parsers. In: Launchbury, J., Sheard, T., Meijer, E. (eds.) AFP 1996. LNCS, vol. 1129, pp. 184–207. Springer, Heidelberg (1996)

    Google Scholar 

  15. The Haskell FFI Team. A primitive foreign function interface (1998), http://www.dcs.gla.ac.uk/fp/software/hdirect/ffi.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chakravarty, M.M.T. (2000). C \(\longrightarrow\) HASKELL, or Yet Another Interfacing Tool. In: Koopman, P., Clack, C. (eds) Implementation of Functional Languages. IFL 1999. Lecture Notes in Computer Science, vol 1868. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722298_8

Download citation

  • DOI: https://doi.org/10.1007/10722298_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67864-9

  • Online ISBN: 978-3-540-44658-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics