Unfortunately rediculous feature request: c++ interop

http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/c1994.html

Mentions C but I guess C++ is too weird to work with? :frowning: I wanna work
with OpenSceneGraph that is all in C++.

hi, Thanks for the suggestion re: externs. Yeah that is too much
effort. I’m going to try Felix and then Cling and then hope that Clasp
gets to a usable point soon. :wink: Or use a scheme.
(http://wmfarr.blogspot.com/2007/07/question-and-answer-sort-of-about.html)
I just want to make progress on the project rather than make my own
hacky tools or have to learn swig again. :-}

Quoting Raoul Duke (2015-02-03 04:56:25)

http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/c1994.html

Mentions C but I guess C++ is too weird to work with? :frowning: I wanna work
with OpenSceneGraph that is all in C++.

It will involve a bit of boilerplate, but in a pinch you can write a
wrapper that let’s the C++ be called from C. e.g:

// wrapper.h
#ifdef _cplusplus
extern "C" {
#endif

int fact2_in_cpp(int n);

#ifdef _cpplus
}
#endif

// wrapper.cpp
extern "C"
int fact2_in_cpp(int n) {
    return cpp_library::fact2(n);
}

Then you can call the wrapper from ATS.

-Ian

signature.asc (819 Bytes)

Oh yeah, Felix … I should really give it a try someday, but really, I
just wish I could find a C or C++ oriented project to work on.

Maybe it is just my lack of perspective, but it really seems like SML style
syntax is taking off these days. The funny thing is a lot of languages that
do have such traits don’t reference (S)ML as an influencing language on
wikipedia, though Felix seems to be an exception.

It might be fun to show an interactive session log here:
http://en.wikipedia.org/wiki/Felix_(programming_language)On Tue, Feb 3, 2015 at 11:15 AM, Raoul Duke rao...@gmail.com wrote:

hi, Thanks for the suggestion re: externs. Yeah that is too much
effort. I’m going to try Felix and then Cling and then hope that Clasp
gets to a usable point soon. :wink: Or use a scheme.
(Scheming: A Question (and an Answer, sort of) About Scheme FFIs
)
I just want to make progress on the project rather than make my own
hacky tools or have to learn swig again. :-}


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAJ7XQb6MqktNwMNAYzRAP_6xVFhPDYEGEDCjz%2BBrdA%2Bai-oEFQ%40mail.gmail.com
.

Brandon Barker
brandon...@gmail.com