Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (34 sloc) 1.497 kb

TITLE

DRAFT: Synopsis 21: Calling Foreign Code

AUTHORS

    Tim Nelson <wayland@wayland.id.au>
    Larry Wall <larry@wall.org>

VERSION

    Created: 27 Feb 2009

    Last Modified: 27 Feb 2009
    Version: 1

The document is a draft.

If you read the HTML version, it is generated from the Pod in the specs repository under https://github.com/perl6/specs/blob/master/S21-calling-foreign-code.pod so edit it there in the git repository if you would like to make changes.

Overview

Unfortunately, calling foreign code properly is quite platform dependent. This means that parts of the external calling conventions can't be standardised. But the parts that can be standardised are specified here.

Specification

The use statement allows an external language to be specified in addition to (or instead of) an authority, so that you can use modules from other languages. The from adverb also parses any additional parts as short-form arguments. For instance:

    use Whiteness:from<perl5>:name<Acme::Bleach>:auth<cpan:DCONWAY>:ver<1.12>;
    use Whiteness:from<perl5 Acme::Bleach cpan:DCONWAY 1.12>;  # same thing

    use libc:from<C>;

Other Considerations

Linking to common platforms

XXX We need a discussion of how to link to some of the common platforms

Additions

Please post errors and feedback to perl6-language. If you are making a general laundry list, please separate messages by topic.

Jump to Line
Something went wrong with that request. Please try again.