Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » TMF support for domain spacific embedded languages
TMF support for domain spacific embedded languages [message #33942] Wed, 25 March 2009 16:10 Go to next message
Auerliano is currently offline AuerlianoFriend
Messages: 149
Registered: July 2009
Senior Member
Hi,

Clearly TMF has been design for supporting DSL creation with minimal
effort. How can this be extended to support DSEL (domain specific embedded
language) support as well? Particularly, how is it possible to define a
language in TMF which can be embedded in c++?
Re: TMF support for domain spacific embedded languages [message #34263 is a reply to message #33942] Thu, 26 March 2009 07:10 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
It is possible to do so with Java, since you can at runtime parse text
and do stuff with it. Maybe if there's a C to Java bridge you could
invoke the parser from C++ as well. But I really don't know, and don't
think Xtext fits well here.
Another way to do this at somepoint in the future would be to define C++
in Xtext and then use this as a language library, so you're able to
modify the syntax as you like and write a code generator creating valid
C++ code for those programs.
But I guess this is not a low hanging fruit...

Sven

Auerliano schrieb:
> Hi,
>
> Clearly TMF has been design for supporting DSL creation with minimal
> effort. How can this be extended to support DSEL (domain specific
> embedded language) support as well? Particularly, how is it possible to
> define a language in TMF which can be embedded in c++?
>
Re: TMF support for domain spacific embedded languages [message #34399 is a reply to message #34263] Thu, 26 March 2009 09:10 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Auerliano,

I can confirm Sven's guess. We specified the complete Java5 syntax in
order to allow language extensions such as embedded DSLs. We succeeded,
but the effort spent was enormous. For C++ it might even be harder.
Nonetheless, you might want to have a look at
http://jamopp.inf.tu-dresden.de/ where you can find the meta model and
the syntax specification. This might give you an impression how high the
fruit hangs :)

Cheers,

Mirko


Sven Efftinge schrieb:
>
> It is possible to do so with Java, since you can at runtime parse text
> and do stuff with it. Maybe if there's a C to Java bridge you could
> invoke the parser from C++ as well. But I really don't know, and don't
> think Xtext fits well here.
> Another way to do this at somepoint in the future would be to define C++
> in Xtext and then use this as a language library, so you're able to
> modify the syntax as you like and write a code generator creating valid
> C++ code for those programs.
> But I guess this is not a low hanging fruit...
>
> Sven
>
> Auerliano schrieb:
>> Hi,
>>
>> Clearly TMF has been design for supporting DSL creation with minimal
>> effort. How can this be extended to support DSEL (domain specific
>> embedded language) support as well? Particularly, how is it possible
>> to define a language in TMF which can be embedded in c++?
>>
Re: TMF support for domain spacific embedded languages [message #34433 is a reply to message #34399] Thu, 26 March 2009 15:50 Go to previous messageGo to next message
Auerliano is currently offline AuerlianoFriend
Messages: 149
Registered: July 2009
Senior Member
Sven and Mirko,

Thanks for the useful information. Now that using embedded DSL in c++ is
not that viable, what about having an external DSL based on TMF which
'interacts' with c++ as an interpreter? This example should make it clear
what I mean by this 'interaction':

Imagine we want to have a language like MATLAB or R based on TMF. Writing
a grammar which ends up with a parser is not a a problem. This language
abstracts away some high-performance code written in c++ in a specific
domain. Given this, how can we interact with the c++ code?

(1) One way of calling the c++ code is to generate c++ code compiled from
our high-level TMF language and then compile the c++ code to binaries in a
JIT style.

(2) The other option is to have a _dynamic_ mechanism like Python, MATLAB,
R, etc which accepts c++ extensions and we can have a c++ wrapper for our
TMF-based language. I guess this will require things like data type
conversion. Is this currently supported in TMF? If so, are there any (even
somehow similar) examples around?



Mirko Seifert wrote:

> Hi Auerliano,

> I can confirm Sven's guess. We specified the complete Java5 syntax in
> order to allow language extensions such as embedded DSLs. We succeeded,
> but the effort spent was enormous. For C++ it might even be harder.
> Nonetheless, you might want to have a look at
> http://jamopp.inf.tu-dresden.de/ where you can find the meta model and
> the syntax specification. This might give you an impression how high the
> fruit hangs :)

> Cheers,

> Mirko


> Sven Efftinge schrieb:
>>
>> It is possible to do so with Java, since you can at runtime parse text
>> and do stuff with it. Maybe if there's a C to Java bridge you could
>> invoke the parser from C++ as well. But I really don't know, and don't
>> think Xtext fits well here.
>> Another way to do this at somepoint in the future would be to define C++
>> in Xtext and then use this as a language library, so you're able to
>> modify the syntax as you like and write a code generator creating valid
>> C++ code for those programs.
>> But I guess this is not a low hanging fruit...
>>
>> Sven
>>
>> Auerliano schrieb:
>>> Hi,
>>>
>>> Clearly TMF has been design for supporting DSL creation with minimal
>>> effort. How can this be extended to support DSEL (domain specific
>>> embedded language) support as well? Particularly, how is it possible
>>> to define a language in TMF which can be embedded in c++?
>>>
Re: TMF support for domain spacific embedded languages [message #34634 is a reply to message #34433] Fri, 27 March 2009 05:44 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
I'm not sure I got everything, but basically there are two options to
execute languages : You can either interpret them or compile them to
another language.

Interpretation of Xtext languages are based on the EMF ASTs constructed
by the parser. Which means that the language you're writing the
interpreter in, needs to allow access / interacting with EMF models. I
guess this means that interpreters must be implmente in a JVM-based
langauge. I don't know whether JNI could help you to access EMF mdoels
from C.

On the other hand if you write a compiler (aka code generator) for your
language, you can of course target any textual language.

Cheers,
Sven

Auerliano schrieb:
> Sven and Mirko,
>
> Thanks for the useful information. Now that using embedded DSL in c++ is
> not that viable, what about having an external DSL based on TMF which
> 'interacts' with c++ as an interpreter? This example should make it
> clear what I mean by this 'interaction':
>
> Imagine we want to have a language like MATLAB or R based on TMF.
> Writing a grammar which ends up with a parser is not a a problem. This
> language abstracts away some high-performance code written in c++ in a
> specific domain. Given this, how can we interact with the c++ code?
>
> (1) One way of calling the c++ code is to generate c++ code compiled
> from our high-level TMF language and then compile the c++ code to
> binaries in a JIT style.
>
> (2) The other option is to have a _dynamic_ mechanism like Python,
> MATLAB, R, etc which accepts c++ extensions and we can have a c++
> wrapper for our TMF-based language. I guess this will require things
> like data type conversion. Is this currently supported in TMF? If so,
> are there any (even somehow similar) examples around?
>
>
>
> Mirko Seifert wrote:
>
>> Hi Auerliano,
>
>> I can confirm Sven's guess. We specified the complete Java5 syntax in
>> order to allow language extensions such as embedded DSLs. We
>> succeeded, but the effort spent was enormous. For C++ it might even be
>> harder. Nonetheless, you might want to have a look at
>> http://jamopp.inf.tu-dresden.de/ where you can find the meta model and
>> the syntax specification. This might give you an impression how high
>> the fruit hangs :)
>
>> Cheers,
>
>> Mirko
>
>
>> Sven Efftinge schrieb:
>>>
>>> It is possible to do so with Java, since you can at runtime parse
>>> text and do stuff with it. Maybe if there's a C to Java bridge you
>>> could invoke the parser from C++ as well. But I really don't know,
>>> and don't think Xtext fits well here.
>>> Another way to do this at somepoint in the future would be to define
>>> C++ in Xtext and then use this as a language library, so you're able
>>> to modify the syntax as you like and write a code generator creating
>>> valid C++ code for those programs.
>>> But I guess this is not a low hanging fruit...
>>>
>>> Sven
>>>
>>> Auerliano schrieb:
>>>> Hi,
>>>>
>>>> Clearly TMF has been design for supporting DSL creation with minimal
>>>> effort. How can this be extended to support DSEL (domain specific
>>>> embedded language) support as well? Particularly, how is it possible
>>>> to define a language in TMF which can be embedded in c++?
>>>>
>
>
Re: TMF support for domain spacific embedded languages [message #34768 is a reply to message #34634] Fri, 27 March 2009 12:32 Go to previous messageGo to next message
Auerliano is currently offline AuerlianoFriend
Messages: 149
Registered: July 2009
Senior Member
Sven Efftinge wrote:

> I'm not sure I got everything, but basically there are two options to
> execute languages : You can either interpret them or compile them to
> another language.

> Interpretation of Xtext languages are based on the EMF ASTs constructed
> by the parser. Which means that the language you're writing the
> interpreter in, needs to allow access / interacting with EMF models. I
> guess this means that interpreters must be implmente in a JVM-based
> langauge. I don't know whether JNI could help you to access EMF mdoels
> from C.

I had the impression that xtext fully supports ANTLR backend. If ANTLR
allows the DSL to be interpreted in c++, why shouldn't the same be
possible in xtext?

> On the other hand if you write a compiler (aka code generator) for your
> language, you can of course target any textual language.

> Cheers,
> Sven

> Auerliano schrieb:
>> Sven and Mirko,
>>
>> Thanks for the useful information. Now that using embedded DSL in c++ is
>> not that viable, what about having an external DSL based on TMF which
>> 'interacts' with c++ as an interpreter? This example should make it
>> clear what I mean by this 'interaction':
>>
>> Imagine we want to have a language like MATLAB or R based on TMF.
>> Writing a grammar which ends up with a parser is not a a problem. This
>> language abstracts away some high-performance code written in c++ in a
>> specific domain. Given this, how can we interact with the c++ code?
>>
>> (1) One way of calling the c++ code is to generate c++ code compiled
>> from our high-level TMF language and then compile the c++ code to
>> binaries in a JIT style.
>>
>> (2) The other option is to have a _dynamic_ mechanism like Python,
>> MATLAB, R, etc which accepts c++ extensions and we can have a c++
>> wrapper for our TMF-based language. I guess this will require things
>> like data type conversion. Is this currently supported in TMF? If so,
>> are there any (even somehow similar) examples around?
>>
>>
>>
>> Mirko Seifert wrote:
>>
>>> Hi Auerliano,
>>
>>> I can confirm Sven's guess. We specified the complete Java5 syntax in
>>> order to allow language extensions such as embedded DSLs. We
>>> succeeded, but the effort spent was enormous. For C++ it might even be
>>> harder. Nonetheless, you might want to have a look at
>>> http://jamopp.inf.tu-dresden.de/ where you can find the meta model and
>>> the syntax specification. This might give you an impression how high
>>> the fruit hangs :)
>>
>>> Cheers,
>>
>>> Mirko
>>
>>
>>> Sven Efftinge schrieb:
>>>>
>>>> It is possible to do so with Java, since you can at runtime parse
>>>> text and do stuff with it. Maybe if there's a C to Java bridge you
>>>> could invoke the parser from C++ as well. But I really don't know,
>>>> and don't think Xtext fits well here.
>>>> Another way to do this at somepoint in the future would be to define
>>>> C++ in Xtext and then use this as a language library, so you're able
>>>> to modify the syntax as you like and write a code generator creating
>>>> valid C++ code for those programs.
>>>> But I guess this is not a low hanging fruit...
>>>>
>>>> Sven
>>>>
>>>> Auerliano schrieb:
>>>>> Hi,
>>>>>
>>>>> Clearly TMF has been design for supporting DSL creation with minimal
>>>>> effort. How can this be extended to support DSEL (domain specific
>>>>> embedded language) support as well? Particularly, how is it possible
>>>>> to define a language in TMF which can be embedded in c++?
>>>>>
>>
>>
Re: TMF support for domain spacific embedded languages [message #34961 is a reply to message #34768] Fri, 27 March 2009 14:48 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Auerliano,

Xtext uses a lot of other components to become the toolkit, that it is.
One of them is Antlr, another one is EMF, google guice and (of course)
Eclipse itself. They all play very well together. And they have
something in common: They require a JVM (the Antlr generator does, while
the runtime may be generated for other targets). If you want to interact
with a C++ backend, you'll have to implement the marshalling etc on your
own, as this is clearly not on the scope of TMF Xtext.
Please be aware of the fact, that you are free to generate other output
for your grammar, if you implement a IGeneratorFragment. You are free to
generate C++-Code or an Antlr input file which in turn will generate C++.

Hope that helps,
Sebastian


Auerliano schrieb:
> Sven Efftinge wrote:
>
>> I'm not sure I got everything, but basically there are two options to
>> execute languages : You can either interpret them or compile them to
>> another language.
>
>> Interpretation of Xtext languages are based on the EMF ASTs
>> constructed by the parser. Which means that the language you're
>> writing the interpreter in, needs to allow access / interacting with
>> EMF models. I guess this means that interpreters must be implmente in
>> a JVM-based langauge. I don't know whether JNI could help you to
>> access EMF mdoels from C.
>
> I had the impression that xtext fully supports ANTLR backend. If ANTLR
> allows the DSL to be interpreted in c++, why shouldn't the same be
> possible in xtext?
>
>> On the other hand if you write a compiler (aka code generator) for
>> your language, you can of course target any textual language.
>
>> Cheers,
>> Sven
>
>> Auerliano schrieb:
>>> Sven and Mirko,
>>>
>>> Thanks for the useful information. Now that using embedded DSL in c++
>>> is not that viable, what about having an external DSL based on TMF
>>> which 'interacts' with c++ as an interpreter? This example should
>>> make it clear what I mean by this 'interaction':
>>>
>>> Imagine we want to have a language like MATLAB or R based on TMF.
>>> Writing a grammar which ends up with a parser is not a a problem.
>>> This language abstracts away some high-performance code written in
>>> c++ in a specific domain. Given this, how can we interact with the
>>> c++ code?
>>>
>>> (1) One way of calling the c++ code is to generate c++ code compiled
>>> from our high-level TMF language and then compile the c++ code to
>>> binaries in a JIT style.
>>>
>>> (2) The other option is to have a _dynamic_ mechanism like Python,
>>> MATLAB, R, etc which accepts c++ extensions and we can have a c++
>>> wrapper for our TMF-based language. I guess this will require things
>>> like data type conversion. Is this currently supported in TMF? If so,
>>> are there any (even somehow similar) examples around?
>>>
>>>
>>>
>>> Mirko Seifert wrote:
>>>
>>>> Hi Auerliano,
>>>
>>>> I can confirm Sven's guess. We specified the complete Java5 syntax
>>>> in order to allow language extensions such as embedded DSLs. We
>>>> succeeded, but the effort spent was enormous. For C++ it might even
>>>> be harder. Nonetheless, you might want to have a look at
>>>> http://jamopp.inf.tu-dresden.de/ where you can find the meta model
>>>> and the syntax specification. This might give you an impression how
>>>> high the fruit hangs :)
>>>
>>>> Cheers,
>>>
>>>> Mirko
>>>
>>>
>>>> Sven Efftinge schrieb:
>>>>>
>>>>> It is possible to do so with Java, since you can at runtime parse
>>>>> text and do stuff with it. Maybe if there's a C to Java bridge you
>>>>> could invoke the parser from C++ as well. But I really don't know,
>>>>> and don't think Xtext fits well here.
>>>>> Another way to do this at somepoint in the future would be to
>>>>> define C++ in Xtext and then use this as a language library, so
>>>>> you're able to modify the syntax as you like and write a code
>>>>> generator creating valid C++ code for those programs.
>>>>> But I guess this is not a low hanging fruit...
>>>>>
>>>>> Sven
>>>>>
>>>>> Auerliano schrieb:
>>>>>> Hi,
>>>>>>
>>>>>> Clearly TMF has been design for supporting DSL creation with
>>>>>> minimal effort. How can this be extended to support DSEL (domain
>>>>>> specific embedded language) support as well? Particularly, how is
>>>>>> it possible to define a language in TMF which can be embedded in c++?
>>>>>>
>>>
>>>
>
>
Re: TMF support for domain spacific embedded languages [message #35184 is a reply to message #34961] Fri, 27 March 2009 15:58 Go to previous messageGo to next message
Auerliano is currently offline AuerlianoFriend
Messages: 149
Registered: July 2009
Senior Member
Sebastian,

Assume an external ANTLR grammar with c++ target. Wouldn't it be possible
to use TMF simply as an eclipse fully featured 'editor' for the c++ target
using existing tools (without extending TMF for the c++ part)? The c++
target compiler/interpreter can be run on the language script from within
eclipse as, for example, pydev does the same for python interpreter.

Sebastian Zarnekow wrote:

> Hi Auerliano,

> Xtext uses a lot of other components to become the toolkit, that it is.
> One of them is Antlr, another one is EMF, google guice and (of course)
> Eclipse itself. They all play very well together. And they have
> something in common: They require a JVM (the Antlr generator does, while
> the runtime may be generated for other targets). If you want to interact
> with a C++ backend, you'll have to implement the marshalling etc on your
> own, as this is clearly not on the scope of TMF Xtext.
> Please be aware of the fact, that you are free to generate other output
> for your grammar, if you implement a IGeneratorFragment. You are free to
> generate C++-Code or an Antlr input file which in turn will generate C++.

> Hope that helps,
> Sebastian


> Auerliano schrieb:
>> Sven Efftinge wrote:
>>
>>> I'm not sure I got everything, but basically there are two options to
>>> execute languages : You can either interpret them or compile them to
>>> another language.
>>
>>> Interpretation of Xtext languages are based on the EMF ASTs
>>> constructed by the parser. Which means that the language you're
>>> writing the interpreter in, needs to allow access / interacting with
>>> EMF models. I guess this means that interpreters must be implmente in
>>> a JVM-based langauge. I don't know whether JNI could help you to
>>> access EMF mdoels from C.
>>
>> I had the impression that xtext fully supports ANTLR backend. If ANTLR
>> allows the DSL to be interpreted in c++, why shouldn't the same be
>> possible in xtext?
>>
>>> On the other hand if you write a compiler (aka code generator) for
>>> your language, you can of course target any textual language.
>>
>>> Cheers,
>>> Sven
>>
>>> Auerliano schrieb:
>>>> Sven and Mirko,
>>>>
>>>> Thanks for the useful information. Now that using embedded DSL in c++
>>>> is not that viable, what about having an external DSL based on TMF
>>>> which 'interacts' with c++ as an interpreter? This example should
>>>> make it clear what I mean by this 'interaction':
>>>>
>>>> Imagine we want to have a language like MATLAB or R based on TMF.
>>>> Writing a grammar which ends up with a parser is not a a problem.
>>>> This language abstracts away some high-performance code written in
>>>> c++ in a specific domain. Given this, how can we interact with the
>>>> c++ code?
>>>>
>>>> (1) One way of calling the c++ code is to generate c++ code compiled
>>>> from our high-level TMF language and then compile the c++ code to
>>>> binaries in a JIT style.
>>>>
>>>> (2) The other option is to have a _dynamic_ mechanism like Python,
>>>> MATLAB, R, etc which accepts c++ extensions and we can have a c++
>>>> wrapper for our TMF-based language. I guess this will require things
>>>> like data type conversion. Is this currently supported in TMF? If so,
>>>> are there any (even somehow similar) examples around?
>>>>
>>>>
>>>>
>>>> Mirko Seifert wrote:
>>>>
>>>>> Hi Auerliano,
>>>>
>>>>> I can confirm Sven's guess. We specified the complete Java5 syntax
>>>>> in order to allow language extensions such as embedded DSLs. We
>>>>> succeeded, but the effort spent was enormous. For C++ it might even
>>>>> be harder. Nonetheless, you might want to have a look at
>>>>> http://jamopp.inf.tu-dresden.de/ where you can find the meta model
>>>>> and the syntax specification. This might give you an impression how
>>>>> high the fruit hangs :)
>>>>
>>>>> Cheers,
>>>>
>>>>> Mirko
>>>>
>>>>
>>>>> Sven Efftinge schrieb:
>>>>>>
>>>>>> It is possible to do so with Java, since you can at runtime parse
>>>>>> text and do stuff with it. Maybe if there's a C to Java bridge you
>>>>>> could invoke the parser from C++ as well. But I really don't know,
>>>>>> and don't think Xtext fits well here.
>>>>>> Another way to do this at somepoint in the future would be to
>>>>>> define C++ in Xtext and then use this as a language library, so
>>>>>> you're able to modify the syntax as you like and write a code
>>>>>> generator creating valid C++ code for those programs.
>>>>>> But I guess this is not a low hanging fruit...
>>>>>>
>>>>>> Sven
>>>>>>
>>>>>> Auerliano schrieb:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Clearly TMF has been design for supporting DSL creation with
>>>>>>> minimal effort. How can this be extended to support DSEL (domain
>>>>>>> specific embedded language) support as well? Particularly, how is
>>>>>>> it possible to define a language in TMF which can be embedded in c++?
>>>>>>>
>>>>
>>>>
>>
>>
Re: TMF support for domain spacific embedded languages [message #35343 is a reply to message #35184] Fri, 27 March 2009 16:29 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Yes, it would be possible.
As Sebastian suggested, you'll have to write a generator fragment
generating an Antlr.g file, containing the c++ actions you like and then
generate the corresponding c++ code by triggering Antlr's c++ generator.

regards,
Sven


Auerliano schrieb:
> Sebastian,
>
> Assume an external ANTLR grammar with c++ target. Wouldn't it be
> possible to use TMF simply as an eclipse fully featured 'editor' for the
> c++ target using existing tools (without extending TMF for the c++
> part)? The c++ target compiler/interpreter can be run on the language
> script from within eclipse as, for example, pydev does the same for
> python interpreter.
>
> Sebastian Zarnekow wrote:
>
>> Hi Auerliano,
>
>> Xtext uses a lot of other components to become the toolkit, that it
>> is. One of them is Antlr, another one is EMF, google guice and (of
>> course) Eclipse itself. They all play very well together. And they
>> have something in common: They require a JVM (the Antlr generator
>> does, while the runtime may be generated for other targets). If you
>> want to interact with a C++ backend, you'll have to implement the
>> marshalling etc on your own, as this is clearly not on the scope of
>> TMF Xtext.
>> Please be aware of the fact, that you are free to generate other
>> output for your grammar, if you implement a IGeneratorFragment. You
>> are free to generate C++-Code or an Antlr input file which in turn
>> will generate C++.
>
>> Hope that helps,
>> Sebastian
>
>
>> Auerliano schrieb:
>>> Sven Efftinge wrote:
>>>
>>>> I'm not sure I got everything, but basically there are two options
>>>> to execute languages : You can either interpret them or compile them
>>>> to another language.
>>>
>>>> Interpretation of Xtext languages are based on the EMF ASTs
>>>> constructed by the parser. Which means that the language you're
>>>> writing the interpreter in, needs to allow access / interacting with
>>>> EMF models. I guess this means that interpreters must be implmente
>>>> in a JVM-based langauge. I don't know whether JNI could help you to
>>>> access EMF mdoels from C.
>>>
>>> I had the impression that xtext fully supports ANTLR backend. If
>>> ANTLR allows the DSL to be interpreted in c++, why shouldn't the same
>>> be possible in xtext?
>>>
>>>> On the other hand if you write a compiler (aka code generator) for
>>>> your language, you can of course target any textual language.
>>>
>>>> Cheers,
>>>> Sven
>>>
>>>> Auerliano schrieb:
>>>>> Sven and Mirko,
>>>>>
>>>>> Thanks for the useful information. Now that using embedded DSL in
>>>>> c++ is not that viable, what about having an external DSL based on
>>>>> TMF which 'interacts' with c++ as an interpreter? This example
>>>>> should make it clear what I mean by this 'interaction':
>>>>>
>>>>> Imagine we want to have a language like MATLAB or R based on TMF.
>>>>> Writing a grammar which ends up with a parser is not a a problem.
>>>>> This language abstracts away some high-performance code written in
>>>>> c++ in a specific domain. Given this, how can we interact with the
>>>>> c++ code?
>>>>>
>>>>> (1) One way of calling the c++ code is to generate c++ code
>>>>> compiled from our high-level TMF language and then compile the c++
>>>>> code to binaries in a JIT style.
>>>>>
>>>>> (2) The other option is to have a _dynamic_ mechanism like Python,
>>>>> MATLAB, R, etc which accepts c++ extensions and we can have a c++
>>>>> wrapper for our TMF-based language. I guess this will require
>>>>> things like data type conversion. Is this currently supported in
>>>>> TMF? If so, are there any (even somehow similar) examples around?
>>>>>
>>>>>
>>>>>
>>>>> Mirko Seifert wrote:
>>>>>
>>>>>> Hi Auerliano,
>>>>>
>>>>>> I can confirm Sven's guess. We specified the complete Java5 syntax
>>>>>> in order to allow language extensions such as embedded DSLs. We
>>>>>> succeeded, but the effort spent was enormous. For C++ it might
>>>>>> even be harder. Nonetheless, you might want to have a look at
>>>>>> http://jamopp.inf.tu-dresden.de/ where you can find the meta model
>>>>>> and the syntax specification. This might give you an impression
>>>>>> how high the fruit hangs :)
>>>>>
>>>>>> Cheers,
>>>>>
>>>>>> Mirko
>>>>>
>>>>>
>>>>>> Sven Efftinge schrieb:
>>>>>>>
>>>>>>> It is possible to do so with Java, since you can at runtime parse
>>>>>>> text and do stuff with it. Maybe if there's a C to Java bridge
>>>>>>> you could invoke the parser from C++ as well. But I really don't
>>>>>>> know, and don't think Xtext fits well here.
>>>>>>> Another way to do this at somepoint in the future would be to
>>>>>>> define C++ in Xtext and then use this as a language library, so
>>>>>>> you're able to modify the syntax as you like and write a code
>>>>>>> generator creating valid C++ code for those programs.
>>>>>>> But I guess this is not a low hanging fruit...
>>>>>>>
>>>>>>> Sven
>>>>>>>
>>>>>>> Auerliano schrieb:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Clearly TMF has been design for supporting DSL creation with
>>>>>>>> minimal effort. How can this be extended to support DSEL (domain
>>>>>>>> specific embedded language) support as well? Particularly, how
>>>>>>>> is it possible to define a language in TMF which can be embedded
>>>>>>>> in c++?
>>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Previous Topic:[XText] using grammar inheritance
Next Topic:[XText] Sample for an operation
Goto Forum:
  


Current Time: Sat Jul 27 18:27:42 GMT 2024

Powered by FUDForum. Page generated in 0.05444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top