I support this extended functionality. It will be convenient to specify

use "filepath.suffix";

and have the compiler dispatch that depending on the suffix, e.g. .chpl 
=> compile that, .h => insert #include, .c, .o => pass to the C compiler.

All 1,2,3 feel useful. I can see that expanding params, not just shell 
variables, will come handy as well, surely not a high priority.

Vass

On 02/11/15 23:23, Brad Chamberlain wrote:
>
> Hi Chapel Developers --
>
> I want to float an idea that's been proposed for quite some time, but
> which I've only started to prototype tonight.  The motivation is that you
> are a user or developer writing a wrapper for some external library, so
> you create a Chapel module, Foo, that wraps its externed routines.
>
> However, at present, for a user to make use of such a module, they'd also
> need to list the .h, .c, .o, .a files on the 'chpl' command-line in order
> for the compiler to know what headers to include and what to link against.
> This puts an unfortunate burden on the user.
>
> So, the proposal is to permit library developers to specify these
> dependences within the module itself.  This could be done using new
> syntax/keywords (in which case, we'd need a proposal), or by extending the
> 'use' keyword to take string literals that would be treated similarly to
> how they would be if listed on the command-line.
>
> I've partially prototyped this capability tonight by adding support for
> 'use'-ing .h, .c, and .o files from within a module (available in a very
> rough draft form on my use-other-stuff branch for anyone that wants to
> take a look).  I've used the 'use' keyword for this purpose for now, both
> for simplicity and because it didn't require any parser changes (!).
>
> Pieces that are missing, and required for the capability to be useful, I
> think, are some combination of:
>
>       1) support for expanding shell variables in such strings
> and/or
>       2) support for specifying "-I", "-L", "-l" variants of such
>          strings
> and/or
>       3) support for specifying ".a" and/or ".so" files in such strings
>
>
> Before going much further, I wanted to check in and get commentary,
> though:
>
> Q: Do you like the general idea?
>
> If so...
>
> Q: Do you prefer overloading 'use' or some other syntax?  (must propose an
>      alternative, if that's your choice)
>
> Q: Which of the three "and/or" options above are you in favor of? (choose
>      0-3, though 0 is problematic without a counterproposal, I think)
>
> If not...
>
> Q: Why not?
>
>
> Thanks,
> -Brad
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Chapel-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/chapel-developers
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to