Git Product home page Git Product logo

Comments (11)

yoshiki-okawa avatar yoshiki-okawa commented on May 27, 2024 3

Either way would work but I think code gen based on lib.dom.d.ts would be easier than understanding and modifying the generator.

from blazorjsproxy.

yoshiki-okawa avatar yoshiki-okawa commented on May 27, 2024

Possibly. I was looking at typescript instead of WebIDL (e.g. https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts) as TS is much closer to C# than WebIDL like https://searchfox.org/mozilla-central/source/dom/webidl/Window.webidl

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

Isn't the typescrpt generated from webidl? @yoshiki-okawa

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

Maybe we could use this to generate the c# interop code? Am I looking at this right?
https://github.com/jsdom/webidl2js

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

or this
https://github.com/microsoft/TypeScript-DOM-lib-generator

from blazorjsproxy.

yoshiki-okawa avatar yoshiki-okawa commented on May 27, 2024

What I mean is that I think it is possible to do code gen based on https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts to cover pretty much all WebIDL. lib.dom.d.ts is generated from MDN Web APIs (https://developer.mozilla.org/en-US/docs/Web/API) but pretty much same as WebIDL.

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

Got it, I understand. But, would this be easier than changing

https://github.com/microsoft/TypeScript-DOM-lib-generator

to generate c# rather than typescript? I think it already iterates the webidl tree? Or is there something else I'm missing?

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

@yoshiki-okawa is this more in line w/ your thinking? From what I can tell, dart syntax looks a lot like c#? If I'm not mistaken, this project is generating dart wrappers from typescript typedefinitions?

https://github.com/Blimster/babylon_dart_gen

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

I'm wondering if there will also be demand in the near future for wrapping c++ w/ c# pinvoke wrappers? When using webassembly?
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html

(ie kill two birds w/ one stone)

from blazorjsproxy.

yoshiki-okawa avatar yoshiki-okawa commented on May 27, 2024

yes babylon_dart_gen is pretty much what's in my mind.
regarding c++, if you are talking about c# -> JS -> c++, I cannot see benefit of it.

from blazorjsproxy.

unicomp21 avatar unicomp21 commented on May 27, 2024

my thinking was generating c# -> c++ pinvoke wrappers, where the c++ api is described in webidl. but the more I think about it, this sort of thing is probably better filled by something like protobuf.

from blazorjsproxy.

Related Issues (2)

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.