f# type providers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

f# type providers

blackdog

F# and it seem C#/VB are adding this facility as the next big thing.

Given haXe's macro and code completion facilities, how much work would it take to implement
a facility like f# type providers? That is the construction of types during a compile possibly from external sources.
It seems to me a lot of the work may have been done already.

More info



bd.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: f# type providers

Benjamin Dasnois
Hi,

I think this is what several of us have been asking for for some time. :)
We can almost add types already with @:build() the only thing being that these needs to be "hand declared":

@:build(...) class Something {}

Now, if we could just specify a function that would return a list of types to be added to the compilation that would be good. So I think we are pretty close to it.

Hope Nicolas hears us.

Regards,

On Tue, Sep 20, 2011 at 5:04 PM, ritchie turner <[hidden email]> wrote:

F# and it seem C#/VB are adding this facility as the next big thing.

Given haXe's macro and code completion facilities, how much work would it take to implement
a facility like f# type providers? That is the construction of types during a compile possibly from external sources.
It seems to me a lot of the work may have been done already.

More info



bd.

--
haXe - an open source web programming language
http://haxe.org



--
DASNOIS Benjamin
http://www.benjamindasnois.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: f# type providers

blackdog
aha, thanks. 

It would be good to use the MS marketing to haXe's advantage if it was quite easy to implement.

R

On Tue, Sep 20, 2011 at 12:16 PM, Benjamin Dasnois <[hidden email]> wrote:
Hi,

I think this is what several of us have been asking for for some time. :)
We can almost add types already with @:build() the only thing being that these needs to be "hand declared":

@:build(...) class Something {}

Now, if we could just specify a function that would return a list of types to be added to the compilation that would be good. So I think we are pretty close to it.

Hope Nicolas hears us.

Regards,

On Tue, Sep 20, 2011 at 5:04 PM, ritchie turner <[hidden email]> wrote:

F# and it seem C#/VB are adding this facility as the next big thing.

Given haXe's macro and code completion facilities, how much work would it take to implement
a facility like f# type providers? That is the construction of types during a compile possibly from external sources.
It seems to me a lot of the work may have been done already.

More info



bd.

--
haXe - an open source web programming language
http://haxe.org



--
DASNOIS Benjamin
http://www.benjamindasnois.com

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: f# type providers

Heinz Hölzer-2
In reply to this post by blackdog
You can build typedefs,

take a look at http://haxe.org/manual/macros/build, especially the MacroType part.

Am 20.09.2011 17:04, schrieb ritchie turner:

F# and it seem C#/VB are adding this facility as the next big thing.

Given haXe's macro and code completion facilities, how much work would it take to implement
a facility like f# type providers? That is the construction of types during a compile possibly from external sources.
It seems to me a lot of the work may have been done already.

More info



bd.




--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: f# type providers

Nicolas Cannasse
In reply to this post by Benjamin Dasnois
Le 20/09/2011 17:16, Benjamin Dasnois a écrit :

> Hi,
>
> I think this is what several of us have been asking for for some time. :)
> We can almost add types already with @:build() the only thing being that
> these needs to be "hand declared":
>
> @:build(...) class Something {}
>
> Now, if we could just specify a function that would return a list of
> types to be added to the compilation that would be good. So I think we
> are pretty close to it.

The issue I had with this that there was an chicken-and-egg issue that
might happen if the type is accessed _before_ it is defined by the
macro, leading to a "class not found" error. This can somehow be lifted
thanks to macro-aliases (haxe.macro.MacroType) so I'm planning to add
this as part of 2.08 (to be released very soon - I hope)

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org