>
> I had a few questions about how some features of C++ translate to x10.
>
> First, are there features such as "const" or "typedef" in x10.  As
> far as I understand they exist in C++ to aid efficiency by allowing
> the preprocessor to do certain types of inlining.  Does the x10
> compiler infer these things automatically or are there keywords I
> can use for the sake of such efficiency.  Also, how does inlining a
> function work in x10?
>
> There is a typedef in X10 -- see Sec 4.4 in http://
> x10.sourceforge.net/documentation/languagespec/x10-latest.pdf
>
> There is no support for C++ const.

In principle, X10's val modifier (similar to Java's final) indicates
approximately the same things as C++'s const.  In practice, (because C++
constructors don't support the virtual method dispatch semantics that X10
requires) we can't actually make X10 val fields C++ const fields in the
generated C++ code, so it doesn't actually help the C++ compiler as much as
one would like :(.

>
> You can instruct the compiler to inline by marking methods as
> @Inline, after importing x10.compiler.Inline.

This does work, but should be used sparingly (and most likely not while
initially developing code).

> Secondly, I saw that there is a "vec" class in the standard
> libraries.  Is this an x10 vector class or something else?  If not,
> is there a standard x10 vector class or would I need to create one?

vec is a hack we'd like to get rid of soon.  It's intended for
constant-size, stack allocated vectors to enable hand-unrolling of loops.
We expect to be able to replace it with stack-allocated Rails in 2.4 (less
of a hack).


> Finally, I wanted to know how I could figure these things out for
> myself in general.  I am used to a language like Java where I can
> just google the term I am interested in and usually find something
> relevant.  However, for x10 it is very hard to get useful results
> for google (for example googling "x10 vector class" gives me results
> about where I can but the Vector X10 bike").  I am able to find some
> of the basic stuff at x10-lang.org but I struggle to find answers to
> specific questions like these.

The generated x10doc for the standard library of the latest X10 release can
be found online at:
http://www.x10-lang.org/documentation/x10-standard-library.html.  It's not
always complete, but it is a place to start to find out what classes are
available in the standard library.

--dave
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to