Re ANN: A new scripting language Tao 0.9.0 beta released!

Discussion in 'Perl Misc' started by Fu Limin, Apr 27, 2005.

  1. Fu Limin

    Fu Limin Guest

    > In what ways is your language distinctive?
    Well, I think the most distinctive feature is the integration of powerful
    text processing ability and powerful numerical computation with a
    simple syntax for them. I also try to support a simple and transparent
    interface to C++. Though there is still a long way to go, I think the
    status of Tao is promising, in fact I already benefit from it in my
    research where both text processing and numerically computation are
    important, for which I "suffered" a lot from using Perl in the beginning,
    which drived me to design my own one ^_^

    How does developing your own
    > language (as opposed to making stronger one of the languages whose
    > newsgroups you've posted to) make the sum of human experience richer?

    For the existing languages, I think they have already stabilized a kind of
    philosophy, and something have already got complicated. So I think it
    would be more difficult for me to dive into them. Anyway, I believe it
    worth trying to design a new language, if I found it more usesful in some
    work than the other languages, somebody will also find this. A new option
    is not bad thing.

    > And do any of these observations/questions below help you explain these
    > larger matters? :^)

    Yes, thank you for your time to make these observations/question and
    suggestions.

    > Odd things I've noticed in a quick trawl through your docs:
    > * What no bit-ops? And why give ^ a non C/C++ meaning?

    My using of ^ as power is influenced by Matlab. In the beginning I didn't
    know it is also used in C/C++.

    > * What sort of characters are you using?

    For strings, I use stl::string, so I didn't care about this.
    But for byte type numeric array, I used unsigned char.

    > * How does passing by reference square with constant arguments?

    In Tao constants are also represented by objects, their passing by reference
    are the same as other types of objects.

    > * Your I/O interface has a /long/ way to go!

    Right. I haven't concentrated on this part. The status of IO support
    deosn't conform to the version number which increased too rapidly :)

    > * The complex number and matrix stuff seems reasonable.

    Yes, this is one of the important features I intended to have in Tao.
    In fact, I spent much time on implementing them, and they contributed
    to half of the size of the compiled codes. I believe this part is one
    of the best implemented part. Some of the operations for numeric
    arrays are even more convenient than Matlab. Now a very simple
    and transparent interface is supported to pass numeric types to and
    from C++ modules, so the next step to support powerful numeric
    computation in Tao is to find somebody or by myself to write
    bindings to some commonly used numerical packages.

    > * It is probably a good idea to add something like a C/C++ switch; it
    > might only be syntactic sugar around if, but good syntax makes a
    > difference.

    Yes, I will do it.

    > * Given that you are using mutable objects, do you have a way for
    > someone to force a duplicate of an arbitrary object? That would make
    > doing things like security separation much easier.

    If you mean data object, yes, but it's not available for users yet. Now it is
    mainly used for passing Tao data types to C++ modules, where each Tao
    object can be copied and converted into its C++ equivalent object
    (though internally they are all C++ objects, but the object used in C++
    modules is different from the one used in Tao interpreter, e.g. TaoHash is
    used in the interpreter, while TcHash is used in C++ module, the conversion
    or copying keep its structure including cyclic ones).

    But for class or routine objects, no, I will support this when I started to
    support multi-threading.

    I should point out (since I am afraid I misunderstood something
    of you in this point), the assignment in Tao is simpily a new binding
    of object to pointer even if the objects in two side of assignment are
    or the same type (except for assign new values to numeric array elements).

    > * The ~~ operator is neat.
    > * Do you have some kind of subtype operator?

    Not yet. Yes, I should support it, it can be useful for checking
    type of numeric arrays and objects of Tao class. Though now
    Tao can well check the types of two objects are the same or
    different, e.g., if aa is an object of class AA and bb is an object
    of class BB, aa=?AA, bb=?BB, will give true, and aa=?bb will give
    false.

    > * Are classes, namespaces and modules all objects? Can you introspect
    > on them to discover what exists and what you can do with them?

    Yes, they are all objects. But no mechanism is provided to introspect
    them, I had thought about supporting this, but it simply slipped my mind.
    You remind me ^_^

    Best regards,

    Limin
    Fu Limin, Apr 27, 2005
    #1
    1. Advertising

  2. Fu Limin wrote:
    >>In what ways is your language distinctive?

    >
    > Well, I think the most distinctive feature is the integration of powerful
    > text processing ability and powerful numerical computation with a
    > simple syntax for them. I also try to support a simple and transparent
    > interface to C++. Though there is still a long way to go, I think the
    > status of Tao is promising, in fact I already benefit from it in my
    > research where both text processing and numerically computation are
    > important, for which I "suffered" a lot from using Perl in the beginning,
    > which drived me to design my own one ^_^


    Ah, the dilemma between whether to create your own or extend what is
    already there. Myself, I prefer the second option because that lets more
    people use it with a lower overhead; the barrier to entry on an entire
    programming language is quite a bit higher even if the integration it
    affords you is more closely tuned.

    >> How does developing your own
    >> language (as opposed to making stronger one of the languages whose
    >> newsgroups you've posted to) make the sum of human experience richer?

    >
    > For the existing languages, I think they have already stabilized a kind of
    > philosophy, and something have already got complicated. So I think it
    > would be more difficult for me to dive into them. Anyway, I believe it
    > worth trying to design a new language, if I found it more usesful in some
    > work than the other languages, somebody will also find this. A new option
    > is not bad thing.


    Every programming language is really a different way of thinking about
    programming problems. The hard bit is determining whether you're either
    covering some new fraction of the noosphere, or if not, covering some
    useful distinct subset of it instead. It is also a curiosity that
    sometimes reducing the number of things you do can make a language more
    suitable for some kinds of tasks (security often seems to work out that
    way for some reason).

    [Below, where I've not replied to some point made, it's because I don't
    feel I have anything more to say on the matter at the moment.]

    >>Odd things I've noticed in a quick trawl through your docs:
    >> * What no bit-ops? And why give ^ a non C/C++ meaning?

    >
    > My using of ^ as power is influenced by Matlab. In the beginning I didn't
    > know it is also used in C/C++.


    An alternative would be to use ** for exponentiation, deriving from
    Fortran, and give the bit-ops their conventional C/C++ meanings.

    >> * What sort of characters are you using?

    >
    > For strings, I use stl::string, so I didn't care about this.
    > But for byte type numeric array, I used unsigned char.


    The real Q here is chars vs. characters. :^)

    >> * How does passing by reference square with constant arguments?

    >
    > In Tao constants are also represented by objects, their passing by reference
    > are the same as other types of objects.


    So, that would mean that it is possible for a constant to be altered? My
    goodness me, that reminds me of some awfully buggy code I've seen in the
    past! Please make sure that you can't ever change the actual constants
    that come from your program (setting 0 to 1 is a good way to make things
    go belly up!)

    >> * Your I/O interface has a /long/ way to go!

    >
    > Right. I haven't concentrated on this part. The status of IO support
    > deosn't conform to the version number which increased too rapidly :)


    Concentrate on producing a system for externally-defined loadable
    modules and put (most of) your IO code in one of those. :^) Some people
    have had real success with doing that.

    >> * Given that you are using mutable objects, do you have a way for
    >> someone to force a duplicate of an arbitrary object? That would make
    >> doing things like security separation much easier.

    >
    > If you mean data object, yes, but it's not available for users yet. Now it is
    > mainly used for passing Tao data types to C++ modules, where each Tao
    > object can be copied and converted into its C++ equivalent object
    > (though internally they are all C++ objects, but the object used in C++
    > modules is different from the one used in Tao interpreter, e.g. TaoHash is
    > used in the interpreter, while TcHash is used in C++ module, the conversion
    > or copying keep its structure including cyclic ones).


    Firstly, control of when things get duplicated is very important,
    because doing a deep copy of a large object graph can be expensive. The
    easiest way to handle this would be to put in a monadic operator that
    duplicates an object.

    Secondly, is it really necessary to have TaoHash and TcHash as separate
    things? Unifying your entity system might be a big win over the longer term.

    Donal.
    Donal K. Fellows, Apr 28, 2005
    #2
    1. Advertising

  3. Fu Limin

    Fu Limin Guest

    Donal K. Fellows wrote:
    > Fu Limin wrote:
    > >>In what ways is your language distinctive?

    > >
    > > Well, I think the most distinctive feature is the integration of

    powerful
    > > text processing ability and powerful numerical computation with a
    > > simple syntax for them. I also try to support a simple and

    transparent
    > > interface to C++. Though there is still a long way to go, I think

    the
    > > status of Tao is promising, in fact I already benefit from it in my
    > > research where both text processing and numerically computation are
    > > important, for which I "suffered" a lot from using Perl in the

    beginning,
    > > which drived me to design my own one ^_^

    >
    > Ah, the dilemma between whether to create your own or extend what is
    > already there. Myself, I prefer the second option because that lets

    more
    > people use it with a lower overhead; the barrier to entry on an

    entire
    > programming language is quite a bit higher even if the integration it
    > affords you is more closely tuned.


    You can see the reason why I chose the first in my reply to Josef
    'Jupp' SCHUGT in comp.lang.ruby group.

    >
    > >> How does developing your own
    > >> language (as opposed to making stronger one of the languages whose
    > >> newsgroups you've posted to) make the sum of human experience

    richer?
    > >
    > > For the existing languages, I think they have already stabilized a

    kind of
    > > philosophy, and something have already got complicated. So I think

    it
    > > would be more difficult for me to dive into them. Anyway, I believe

    it
    > > worth trying to design a new language, if I found it more usesful

    in some
    > > work than the other languages, somebody will also find this. A new

    option
    > > is not bad thing.

    >
    > Every programming language is really a different way of thinking

    about
    > programming problems. The hard bit is determining whether you're

    either
    > covering some new fraction of the noosphere, or if not, covering some
    > useful distinct subset of it instead. It is also a curiosity that
    > sometimes reducing the number of things you do can make a language

    more
    > suitable for some kinds of tasks (security often seems to work out

    that
    > way for some reason).


    Yes, that's why I mostly concentrated on both regular expression and
    numeric
    types and operation.

    >
    > [Below, where I've not replied to some point made, it's because I

    don't
    > feel I have anything more to say on the matter at the moment.]
    >
    > >>Odd things I've noticed in a quick trawl through your docs:
    > >> * What no bit-ops? And why give ^ a non C/C++ meaning?

    > >
    > > My using of ^ as power is influenced by Matlab. In the beginning I

    didn't
    > > know it is also used in C/C++.

    >
    > An alternative would be to use ** for exponentiation, deriving from
    > Fortran, and give the bit-ops their conventional C/C++ meanings.


    Yes, this can be done. I didn't use Fortran for long time, I really
    forgot there is such an alternative as ** :)

    >
    > >> * What sort of characters are you using?

    > >
    > > For strings, I use stl::string, so I didn't care about this.
    > > But for byte type numeric array, I used unsigned char.

    >
    > The real Q here is chars vs. characters. :^)


    Sorry, I don't understand what you mean by chars vs. characters.
    Do you mean the encoding?

    >
    > >> * How does passing by reference square with constant arguments?

    > >
    > > In Tao constants are also represented by objects, their passing by

    reference
    > > are the same as other types of objects.

    >
    > So, that would mean that it is possible for a constant to be altered?

    My
    > goodness me, that reminds me of some awfully buggy code I've seen in

    the
    > past! Please make sure that you can't ever change the actual

    constants
    > that come from your program (setting 0 to 1 is a good way to make

    things
    > go belly up!)


    If you mean constant variable, yes, otherwise no(for constant
    value,strings).

    When a constant value is passed as parameter to functions, a new object
    is created to contain the value. But they are really created only when
    necessary, the interpreter takes a strategy to avoid unnecessary
    allocation
    of new objects. (Maybe this is the real answer you wanted:))

    For example:
    routine routA(a){ print(a); }
    routine routB(a){
    b={};
    b.insert(a);
    }
    for(i:=0;i<10;i++){ routA(222); }
    for(i:=0;i<10;i++){ routB(222); }

    In the first loop, only one object is created in the beginning,
    the same object is used in the following cycles, because that
    object is not assigned to any variable or inserted to any array,
    so the its reference count will not change, this means it is still
    "free" for following use.

    While in the second loop, new objects are created, because insertion
    of them to an array will increase the refCount of newly created
    objects.

    But constant variable can be changed only if there is the keyword
    "const"
    precede that variable, which means to re-initialize it. So the the
    program
    will not alter a constant variable by mistake. If it is necessary, this
    can
    also be changed.

    >
    > >> * Your I/O interface has a /long/ way to go!

    > >
    > > Right. I haven't concentrated on this part. The status of IO

    support
    > > deosn't conform to the version number which increased too rapidly

    :)
    >
    > Concentrate on producing a system for externally-defined loadable
    > modules and put (most of) your IO code in one of those. :^) Some

    people
    > have had real success with doing that.


    Good suggestion, it's my second time hear this kind of suggestion,
    I will do it in this way, so the basic IO will be built-in
    while advanced IO will be provided as modules.

    >
    > >> * Given that you are using mutable objects, do you have a way for
    > >> someone to force a duplicate of an arbitrary object? That would

    make
    > >> doing things like security separation much easier.

    > >
    > > If you mean data object, yes, but it's not available for users yet.

    Now it is
    > > mainly used for passing Tao data types to C++ modules, where each

    Tao
    > > object can be copied and converted into its C++ equivalent object
    > > (though internally they are all C++ objects, but the object used in

    C++
    > > modules is different from the one used in Tao interpreter, e.g.

    TaoHash is
    > > used in the interpreter, while TcHash is used in C++ module, the

    conversion
    > > or copying keep its structure including cyclic ones).

    >
    > Firstly, control of when things get duplicated is very important,
    > because doing a deep copy of a large object graph can be expensive.

    The
    > easiest way to handle this would be to put in a monadic operator that
    > duplicates an object.


    Yes, in Tao objects are copied only when they passed to a function
    from external modules, even in this case, the real data of numerical
    arrays are _NOT_ copied, only the pointers are passed.

    >
    > Secondly, is it really necessary to have TaoHash and TcHash as

    separate
    > things? Unifying your entity system might be a big win over the

    longer term.

    It really depends. TcHash is only used for external C++ modules as a
    bridge
    to pass data from and to C++ modules. The reason why I don't want pass
    TaoHash directly is that, to pass TaoHash, it means Tao must provide
    additional library to C++ modules for linking, and in Windows there
    could be some problems for this since STL and static variables are
    used.

    To provide TcXyz, only minimum interfaces are provided and can be put
    in a single header file. In this way it's possible to develop C++
    modules
    for Tao with only two header files, nothing else!
    Fu Limin, Apr 29, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fu Limin
    Replies:
    27
    Views:
    214
    Fu Limin
    May 1, 2005
  2. Fu Limin
    Replies:
    7
    Views:
    92
    Peter Hickman
    Apr 28, 2005
  3. Fu Limin
    Replies:
    0
    Views:
    81
    Fu Limin
    Apr 27, 2005
  4. Fu Limin
    Replies:
    1
    Views:
    87
    A. Sinan Unur
    Apr 27, 2005
  5. Fu Limin
    Replies:
    2
    Views:
    80
    Fu Limin
    Apr 29, 2005
Loading...

Share This Page