Re: [proto] Other methods for embedding DSL in C++

2010-07-26 Thread joel falcou

On 26/07/10 21:36, Manjunath Kudlur wrote:

If you have to do heavy-weight things like optimizing the generated
AST, you got to anyway do it at runtime. You can still inspect the
code, transform it, etc at runtime. (Note : I am not trying to defend
the runtime retained execution model. I am a big fan of Proto. I am
just trying to understand the differences and see where each model
makes sense).
   
I'm biased as I mostly do HPC DSL but for me wastiung RT cycles to do 
stuff which are fully statis is useless.
The only thign RT shoudl bring is specialization over RT onyl data (liek 
data set size etc).


___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] Other methods for embedding DSL in C++

2010-07-26 Thread joel falcou

On 26/07/10 21:52, Eric Niebler wrote:

I confess I'm having a hard time seeing how the code posted in
Manjunath's original email could result in something that can be
introspected at runtime. Does it generate byte code? A runtime
polymorphic AST? And the JIT ... does it actually generate machine code
that then gets executed?
   
Yeah screw introspection. It usually generates C code in a string then 
JIT it using w/e compiler is lying around.

Manjunath asked about why this technique is popular in industry. I don't
know; I've never heard about it before. Is it because it's easier then
programming with expression templates? Maybe had proto been available
earlier we'd see more ET-based DSELs today. That could just be my ego
talking. ;-

Popular != pushed by Intel/Google.

For me it's a bad solution. Hence why we look at CT-EDSL

___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] Other methods for embedding DSL in C++

2010-07-26 Thread Manjunath Kudlur
 I confess I'm having a hard time seeing how the code posted in
 Manjunath's original email could result in something that can be
 introspected at runtime. Does it generate byte code? A runtime
 polymorphic AST? And the JIT ... does it actually generate machine code
 that then gets executed?

At the end of the END block, you would have an AST. Yes, there will be
a JIT and an associated run time to compile this and run on different
platforms.

 P.S : Someone more familiar with Rapidmind or other variants, can you
 please explain how they do it in more detail?

 Rapidmind is one huge vaporware. Nobody ever saw it running ...

 Manjunath asked about why this technique is popular in industry. I don't
 know; I've never heard about it before. Is it because it's easier then
 programming with expression templates? Maybe had proto been available

You wouldn't believe how many of my otherwise expert C++ programmer
friends get a disgusted look on their face when they see templates. I
couldn't figure out why :(
That being said, I see one obvious advantage with proto. With proto,
when you write an expression like
if_(a  b) [c = d + 2.0*a].else_[c = d-2.0*a]
you can just natively execute it. But with RT-DSLs, you have to
generate an AST by running the code, then JIT and only then you can
execute it. If you wanted a system where you can just natively
interpret you program, or generate code for different platforms,
then proto makes the interpreter very fast. Whereas with RT-DSLs, even
interpreting has to be differed to run time.

Manjunath
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] Other methods for embedding DSL in C++

2010-07-26 Thread joel falcou

On 26/07/10 22:12, Eric Niebler wrote:

Convincing people of what in your article?

That C++ EDSL are good thanks to templae meta-programming in general

That compile-time introspection is a Good Thing?

Among other

What are the complaints you hear most often?

It's C++ ?!?
Why not making a real compiler ?
Seriously, you CAN NOT get that fast, you're cheating
Who use C++ anyway ?
Again Expression Tempaltes, ok, that's old, please move on
how do you compare to insert JAVA based library, that's real 
industrial strength system !
authors should focus on real benchmarks (like dot product) insetad of 
this lengthy useless implementation description



(Which article, btw?)
   

Among other:

http://dl.dropbox.com/u/3819406/edsl/parco_07.pdf
http://dl.dropbox.com/u/3819406/edsl/europar_08.pdf
http://dl.dropbox.com/u/3819406/edsl/pact_09.pdf

Note that most predates proto but are basically hand made C++ EDSL with 
Expression Templates.

The pact paper is made out of proto though.

___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto