I am not positive, but I believe Daveed Vandevoorde created the term back when we were working together on the HP C++ compiler. I believe I provided the first written definition, and I'm not sure it's 100% what Daveed had in mind.
Note for the list: Definition on the old web site, http://mozart-dev.sourceforge.net/activelib.html.
> -are there examples of active libraries using external datasource?
In the XL world, not yet. In other environments, I guess things as old as CLOS could qualify (the Lisp macro system is pretty powerful).
> (More questions are incoming :) )
Can't wait :-)
> -Is concept programming intrinsically related with "very" flexible
> syntax or "not syntax at all" a' la lisp or it is possible to do it
> without such support?
The core idea of concept programming is that you start by choosing the natural notations for you, and then you tweak the compilation process to implement these notations. So yes, this requires flexible syntax and semantics. However, you use concept programming techniques with more restricted languages, e.g. I used it with the C++ preprocessor or even with a preprocessor for Itanium assembly language :-)
> There are some line on the argument in the website but I have not fully understand.
I believe that you are looking at the mozart-dev web site. XL migrated to http://xlr.sourceforge.net something like 5 or 6 years ago. You may want to read http://xlr.sourceforge.net/xlr-ref (and XLRef.pdf attached there) for more up-to-date information.
Please be aware that there are now two flavors of XL, an imperative one called XL2 (second version of XL after the one you saw on Mozart-dev), and a "functional" one called XLR (XL runtime). They share a lot, notably the syntax, parse tree, and many core concepts.
> -I have difficulty to understand this "flexible operator overloading" as in http://mozart-dev.sourceforge.net/xl_style.html
> function Multiply_Add(vector A, B, C) return vector written A*B+C
> but you say
> A+B*C
> MulAdd(A,B,C) in
> http://mozart-dev.sourceforge.net/cp.html
I call this "expression reduction". Think of it as expression overloading instead of operator overloading.
> So, it is the order of operators relevant or not? do you create code
> for managing "expression containing both + and * or do you define
> operators able to do only a*b+c?
You can do both. Expression reduction is how XL defines basic binary operators like A+B. See http://xlr.git.sourceforge.net/git/gitweb.cgi?p=xlr/xlr;a=blob;f=xl2/native/library/runtime/C/xl_builtins.xs;h=259b00b1bf730401fcb62f53badbe488e88a4ab9;hb=HEAD for the definitions in XL2.
Once you have defined A+B = Add(A, B) and A*B = Mul(A, B), a more complex expression like 2*C+X*Y will "reduce" to Add(Mul(2,C), Mul(X, Y)).
However, if you have defined a "more specialized" version, e.g. X*Y+Z*T -> Foo(X,Y,Z,T), then the same expression will now reduce to Foo(2,C,X,Y)
The order and precedence of operators is defined by a special file, xl.syntax, see http://xlr.git.sourceforge.net/git/gitweb.cgi?p=xlr/xlr;a=blob;f=xl2/xl.syntax;h=8b6da2b521052885395d2e549b5d4bbc2919f1ca;hb=HEAD.
> And in the latter case, how do XL manage ambiguities? is somehow
> related to method overloading disambiguation?
It is related. Basically, the simple rule to remember is "larger and more specialized wins". For example, X+1 is more specialized than X+Y, so if you have both declarations for X+1 and X+Y, then for expression A+1, X+1 will win. X+Y*Z is larger than X+Y, so for A+2*C, it wins over the binary X+Y.
> Is XL still in development?
XL is still under very active development. However, most of the work these days is on the XLR side. If you want to see a practical application, look at http://www.taodyne.com/. The input language for presentations is XL.
> is there some formalization
The XLRef.pdf I gave you is the best I have right now, though it's mostly for XLR and not XL2. I used to have a rather extensive version in FrameMaker format, but I no longer have that software (not supported on the Mac), so I'm rewriting it using a different tool.
> it is sound (in the sense of avoid ram corruption and undefined
> behavior a' la C++?)
I believe that it is. However, one of the things I have in my brain that I never had time to realize is a general garbage collector, one that collects any resource, not just memory. This is the reason XL2 still lacks basic memory management. XLR has its own "standard" garbage collector.
>
>> -are there examples of active libraries using external datasource?
>> In the XL world, not yet. In other environments, I guess things as old as CLOS could qualify >(the Lisp macro system is pretty powerful).
> In Template Haskell (not really a language I know) they are making a
> library to typecheck SQL queries connecting to the DB at compile time.
> Is this to be considered an active library, right?
I think it qualifies, yes.
Thanks
Christophe
> Hi Christophe,
>
> Where does the original post/email come from? I only see your answers
> here on xlr-talk.
Marco contacted me on Facebook, then we switched to e-mail.
> And a question about this:
> On Feb 7, 1:45 am, Christophe de Dinechin <christo...@dinechin.org>
> wrote:
>> Basically, the simple rule to remember is "larger and more specialized wins". For example, X+1 is more specialized than X+Y, so if you have both declarations for X+1 and X+Y, then for expression A+1, X+1 will win. X+Y*Z is larger than X+Y, so for A+2*C, it wins over the binary X+Y.
>
> Probably a silly example, but say you have declarations for a*b+y and x
> +c*d, which one would be used for 1*2+3*4?
It's considered ambiguous, and the compiler emits an error message. I just noticed there was no test for this in the test suite, so I added one, see http://xlr.git.sourceforge.net/git/gitweb.cgi?p=xlr/xlr;a=blob;f=xl2/native/TESTS/05.Expressions/ambiguous-reduction.ref;h=30ad08aed6f483a9de90cefda2030fb59a25a9a9;hb=HEAD.
Christophe