Re: Re: Mathematica + NETLink + CodeDom-Example 2
- To: mathgroup at smc.vnet.net
- Subject: [mg45670] Re: [mg45420] Re: [mg45304] Mathematica + NETLink + CodeDom-Example 2
- From: Todd Gayley <tgayley at wolfram.com>
- Date: Sat, 17 Jan 2004 02:34:40 -0500 (EST)
- References: <200401020923.EAA26158@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
At 12:09 AM 1/7/2004, murphee (Werner Schuster) wrote: >Todd Gayley wrote: > > At 11:22 PM 12/28/2003, ToolmakerSteve wrote: > >>which is a translator from a simple structure in Mathematica, > >>which represents the assembly as code snippets within some structural > >>constructs. > > Your approach is interesting, and I suggest you continue developing it, > > especially with an eye to allowing users to provide method implementations > > in the Mathematica language instead of only embedding strings of C# > code in > > a Mathematica expression structure. > >Hmm... what kind of "method implementations" do mean in this case? >Do you plan on having a .NET object, where one or more Methods are >actually implemented in Mathematica (ie. the method knows the name of >its corresponding Mathematica expression and evaluates it using Mathlink)? Yes, exactly. The class is defined entirely in Mathematica code, with method implementations written in the Mathematica language. The Mathematica code is not compiled into .NET byte codes, however. Instead, the class calls back to Mathematica via MathLink to execute the methods. > > This is quite similar to work that was > > in the development version of .NET/Link but pulled out before release > > because it was beyond the scope of a 1.0 release. Basically, it was > decided > > that there was not sufficient time for the considerable design work > > required. Methods like DefineNETClass and NETMethod were once part of > > .NET/Link. Presumably, functionality like this will be introduced in a > > future release. > >Are there any plans on doing something like this for Java? >It would be feasible using BCEL and a bit of classloader trickery (there >is an article on how the Beanshell guys did it over at Javaworld >http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-beanshell_p.html ) >actually, the 1.5 Tiger JSR contains a JSR for a Compiler API, though I >am not sure how far that goes (there is a beta program for J2SE 1.5, >but it comes with an NDA, so I can't really talk about anything); We will probably do this for Java as well. It's quite true that there is no major technical reason to prefer .NET over Java for such a project. It's just that .NET had a mature class library for dynamically creating byte codes in its very first release, and this did not arrive for Java until later in its life. In other words, if the technology had been in Java back when J/Link was first being designed, we probably would have considered adding this feature for Java. But it's not a small project, and needs to be designed carefully, and as a result it doesn't exist yet for either .NET or Java! --Todd
- References:
- Re: Mathematica + NETLink + CodeDom- Example 2
- From: Todd Gayley <tgayley@wolfram.com>
- Re: Mathematica + NETLink + CodeDom- Example 2