-2

Could you please, help me in follow question: how I can work with database from my Chapel programm?

Thanks

Cimbali
  • 11,012
  • 1
  • 39
  • 68
Iwan Kochan
  • 77
  • 1
  • 7
  • 1
    Ch 31 of (the latest revision of) the Chapel Language Specification covers interoperability with, in particular, C. I guess that if your database exposes a C (or C-like) API you should be able to access it from your Chapel programs. – High Performance Mark Sep 03 '13 at 12:15
  • Thank you! Using this I can to work with my data. My data are in MySQL database and I have experience with MySQL through C. I see that 31.2.3 have information about this. – Iwan Kochan Sep 03 '13 at 12:29

2 Answers2

5

Just an update. The comment by High Performance Mark on the question did a great job of answering the question. I wanted to provide a link to some more current documentation.

Have a look at C Interoperability which describes the options for calling C libraries. Note that Chapel supports a way to call C code directly (without explicitly using the foreign function interface) with the extern block feature.

extern {
   #include <stdio.h>
   static void hello(void) {
     printf("Hello Chapel and C Interoperability!\n");
   }
}

hello();

There's quite a lot more you can do - see the C Interoperability document linked above for details.

Another interesting option for working with libraries is the Python/Chapel integration module.

mppf
  • 1,820
  • 9
  • 9
1

There is now the CDO Library which I use extensively to connect to Postgres. Works great!

Brian Dolan
  • 3,086
  • 2
  • 24
  • 35