FW: 1st build of an F# Type Provider for .proto files

130 views
Skip to first unread message

Don Syme

unread,
Nov 21, 2012, 4:32:12 AM11/21/12
to fsharp-o...@googlegroups.com

First steps towards a type provider for Protocol Buffers….

 

It looks like Cameron needs some help with the type provider here – can anyone help?

 

Thanks

Don

 

 

Feed: Planet F#
Posted on: 20 November 2012 06:18
Author: nor...@blogger.com (Cameron Taggart)
Subject: 1st build of an F# Type Provider for .proto files

 

Froto.Gen 0.0.0.1 is now up on NuGet. It was my first public build of an generative F# type provider for .proto files. The type provider uses Froto.Roslyn to generate an assembly internally and exposes the types.

Here is what is currently working. I generate types for serializing and deserializing messages defined in riak.proto in an F# project. Those two lines are all that is needed. I am then able to reference that F# project from another .NET project. Here I'm showing that the types were generated and are usable from a C# project. The only runtime dependency is protobuf-net. There is no dependency on Froto.Gen, Froto.Roslyn, Roslyn, etc.


Here is where doesn't work and where I need help. I must be doing something wrong in this code. When I try to use the types from the same F# project that the type is defined in, it says that the "type could not be found in that assembly". It is in there. I don't understand. Help!

I discovered the hard way that all dependencies for a type provider must be in the same directly. I was expecting a type provider to be able to use dependencies for the project. I don't think the Roslyn CTP license allows me to redistribute the assemblies, so you need to run packages/Froto.Gen.0.0.0.1\lib\net45\Roslyn.bat to download and copy them from NuGet or you need to install the Roslyn CTP. That is my current solution to the stackoverflow question I asked titled "How do I distribute an F# Type Provider via NuGet?".

I also opened these other questions:

 

 



View article...

Cameron Taggart

unread,
Jan 11, 2013, 12:02:17 AM1/11/13
to fsharp-o...@googlegroups.com
I finally got back around to looking at this today and I'm still stumped. I put together a small test case and the code is accessible via git:
git branch: help

Here is a video of how to reproduce the problem:

Any help would be appreciated.

Cameron

--
--
You received this message because you are subscribed to the Google
Groups "FSharp Open Source Community" group.
To post to this group, send email to fsharp-o...@googlegroups.com
To unsubscribe from this group, send email to
fsharp-opensou...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fsharp-opensource?hl=en
 
 
 

Cameron Taggart

unread,
Jan 11, 2013, 1:20:31 PM1/11/13
to fsharp-o...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages