Giter VIP home page Giter VIP logo

Comments (11)

takemyoxygen avatar takemyoxygen commented on July 28, 2024 1

@EHotwagner, @jhugard, I hope #72 should fix the NotSupported error. I tried to use the type provider with the proto from https://github.com/Blizzard/s2client-proto (compiled in one file, with syntax, package and import directives removed) and it worked fine. It still requires some work to implement import in the type provider.

from froto.

jhugard avatar jhugard commented on July 28, 2024

I worked on the parser but never really looked at the TypeProvider. DebugGameState is the only enum in that list so that may be a clue. However, I'm not sure what's wrong because the generator does appear to support enum values in a oneof (see here).

Could you try adding an unknown=0; as the first member of DebugGameState?

Are there any additional error details? Stack trace, line numbers, etc.?

from froto.

jhugard avatar jhugard commented on July 28, 2024

@takemyoxygen could you add an enum to the oneof in type_provider_test.proto and write a unit test? Also might be useful to include the TypeProvider tests in the main Froto.sln.

from froto.

takemyoxygen avatar takemyoxygen commented on July 28, 2024

@jhugard, I'll try to have a look on the weekend

from froto.

EHotwagner avatar EHotwagner commented on July 28, 2024

I will investigate further after the weekend. Thanks for taking a look.

from froto.

jhugard avatar jhugard commented on July 28, 2024

@EHotwagner PR #65 could probably be merged as-is to provide import support to the parser, but it's not hooked into the TypeProvider yet. @ctaggart I'd intended to do all of Issue #48 with that PR, but might be worth merging just for what it currently does.

from froto.

ctaggart avatar ctaggart commented on July 28, 2024

Sounds good @jhugard.

from froto.

EHotwagner avatar EHotwagner commented on July 28, 2024

I did add unknown=0; with no effect. A basic proto file with only DebugCommand as a message and only DebugGameState in the oneof does work tough.

The error mesage i get is: "The type provider 'Froto.TypeProvider.ProtocolBuffersTypeProviderCreator' reported an error: Specified method is not supported."

Parse.fromFile genereates a nice Ast List tough. Is the roslyn example the current way of working without the TypeProvider?

from froto.

jhugard avatar jhugard commented on July 28, 2024

I would truly love to see you successful with F# and SC2: both are close to my heart. However, to be honest, while Froto may be useful for some base cases it still needs some attention to get it finished it up.

Froto has three approaches from three different authors: the TypeProvider, Roslyn code gen, and a model for source gen of either records or classes. The first two have some rough edges, and there isn't a released generator for the third.

If the TypeProvider isn't working for you, the Roslyn approach might be worth a try, but then again it might not support oneof.

As a last-ditch effort, the serializer record model is pretty simple to generate, so you could probably hand-write everything in the SC2 API in a few hours, but that kinda defeats the purpose of having an IDL. If you do go this route, let me know and I'll try to remember how oneof support works.

Some time back, as an experiment I wrote a plug-in for protoc.exe in golang which generated code using the record model. The result still needed hand editing to get it to compile, so was never released. It was a bit discouraging that the resulting DLL was not significantly smaller (in bytes) than generated C++ code, which was one of my main goals. On top of that, politically there was no way I'd be able to move the prototype into production, so never finished any of this up.

from froto.

EHotwagner avatar EHotwagner commented on July 28, 2024

Thanks a lot. This gives me enough points to start from.

from froto.

EHotwagner avatar EHotwagner commented on July 28, 2024

Great. Thx a lot.

from froto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.