pmod icon indicating copy to clipboard operation
pmod copied to clipboard

Few questions about pmod

Open bilsou opened this issue 8 years ago • 6 comments

Just found out about this gem and in all fairness I was surprised it did not get more attention, it looks really good. I have been through the FAQ but I wanted to clear some things up.

  • Has pmod been used in any production app(s) (or internally at Microsoft) ?
  • The scheme format and interface flows look somehow similar to a tool like Djinni; how different/limited/better is it from it ?
  • What are pmod roadmap ? Will new features/bug fixes being introduced in the future ?

Thanks in advance for your answers.

bilsou avatar Nov 20 '17 20:11 bilsou

Hey, I'm glad you get interested in this project, it is truly a gem, we spend many resources/hours on it. I architect the idea from the ground up and we spend many years perfecting the final goal and components. About your questions:

  • I would say this is Version 3 of the original product. The V1 was used (and is still being used) by the Skype Of Business (former Office LYNC). Large parts of that project heavily use a very similar runtime to power the Model and View Model objects that the Office UI render, the project was a complete success ! . V1 only runs on Windows and desktop machines. The V2 & V3 were planned to run on phones devices and be cross platform without loosing the Windows API core strategy. The V2 was intended to be used on the next generation Skype clients, but the project was cancelled at the last minute in favor of other alternatives outside the native approach.

  • About the format of the interface and flow, yes the Dijinni is similar but there are important differences. The pmod is based on the intrinsic support of 'reflection' on native objects which can be projected to different languages and platforms. In Dijini the code generation for java is C++ JNI code, with pmod you never see a piece of JNI code again. The pmod architecture allow different layers of code generation. Also Djini does not support any 'observable' pattern and in pmod most of the important objects already have this idea embedded, The pmod allow to fire events from the native layer into the UI layer, etc.. pmod support Windows platform E2E, including desktop, UWP, etc.. pmod also have an experimental support on Node, etc.. Djini is probably lighter in terms of runtime size/memory requirements.

  • Roadmap: I leave the group that was building this idea and most of the people are doing different things. I'm right now on the Visual Studio team doing other stuff, but pmod is my baby. I'm committed to maintain and invest more on this as long as people in the community want it. It was already super hard to get authorization to publish this as an open source project, i move mountains to make it happen. But this project require more people involved, the important pieces are there but the community needs to contribute to make it great,

Things on my mind that i have planned already:

  • Invest in a better description language, maybe move away from C# and create a better and less buggy language parser.
  • Better authoring library: the learning curve is not trivial, a better and simplified model would facilitate without the need to understand boxing/unboxing and reference count objects.
  • Factory objects: allow the integration on how to create new objects. pmod is great once you have a the first reference. We want something that allow consuming languages to create new instances in a natural way, for example in C# var myModel = new MyModel("foo", 200);
  • Better code generation for simple scenario that won't require any observable object but just a super simple projection which may people face today. ( i have a lot of C++ code that i need to be visible in other language)

Hope this helps and ready to answer more questions.

rodrigovaras avatar Nov 20 '17 21:11 rodrigovaras

Thank you for answering in a really detailed manner. I am currently using Djinni in production. Although it is mature and used in production by many, when one wants to use some custom types on Android (OBJC is almost transparent with C++), you still need to create your own JNI boilerplate for those types and it is a real PITA. So when I found pmod and how it uses a COM-like projection architecture (which I have quite some XP with) to overcome the JNI pain, it immediately got my interest.

I quickly tried to see how pmod worked by running the Movies example, precisely the Xcode project, but unfortunately ended up with errors w.r.t. some missing files/obj files. I unfortunately don't have time to look more at it as I have other things going on right now but will try to get back to it as soon as I have some time. It would be great to have a detailed README that describes how to use pmod the same way Djinni does it with its limitations, real world example (like displaying a JSON-based listview from some REST api on Android/iOS/UWP) etc.. You should also definitely mention in the description that it is/has been used in production internally at Microsoft, it will make a lot people not doubting its strength and value.

Once again, I will try to look at it as soon as I can and might even be able to help by giving some feedback.

bilsou avatar Nov 21 '17 20:11 bilsou

Thanks, I will add the reference to the README the existing use of pmod library inside MSFT. About the movies sample, i will double check again the build part. The painful part is getting the casablanca SDK (REST SDK) integrated into every platform. You may want to try the Android version since i think there is existing NuGet package. On this after noon i will attempt a clean build on the Movies sample on Android using VS. I think the XCode project is much more tricky since you need to follow the instructions to build casablanca on a Mac.

rodrigovaras avatar Nov 21 '17 21:11 rodrigovaras

Have you had success on the Movies sample? I did the build again on my Mac using Xcode and i was able to succeed and run the sample, it should work for you, but first you would need to follow the instructions to build the C++ REST SDK here:https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-iOS

But i understand you want to build the projection for Android instead. You have two options, use the regular Android SDK and make file or using VS 2017 with the Mobile C++ package support. I tried both on my Windows machine and they work. The VS 2017 seems to be nicer and simple if you like it. You should let me know if you want to work on a Mac instead and i can tried there too. You would need to produce the Movies native dll and then use the Android Studio to integrate it into the UI . Let me know how can i help you more. Note: for building for iOS you would need to have on a folder both the pmod & cpxprestdk repos, since i made some changes to the reference project.

rodrigovaras avatar Nov 24 '17 18:11 rodrigovaras

I haven't had the time to try since last time. Pretty busy lately. I will try to give it another go as soon as I am able to. I do remember looking at cpprestsdk once, it was definitely a PITA to build for iOS/Android. That's why I preferred going the libcurl way, built a C++ wrapper on top of it and it was way easier and lightweight to use. I might just try to look at your tutorial and try to build a small sample on my own by following the steps. I don't know how detailed your tutorial is, hopefully enough to give me a starting point. But again don't know when I will be able to do that, yet.

bilsou avatar Nov 25 '17 11:11 bilsou

Thanks again for the feedback. I read again the tutorial i made some months ago and it has some useful screen shots that will help, but it's only intended to help you when using VS 2017 as main platform and it ends only on the authoring assembly without too much explanation on the UI integration. My advise is to start and look in detail the DemoApp sample since it is the best supported code and should run and build on every platform. I admit the app itself does not does anything useful as the 'Movies' sample but illustrate the potential on the SDK by showing observable objects and commands that are well integrated on any UI. The Demo Sample itself will work very well on VS 2017 when using NuGet packages but on other platforms you would need to build the library itself and then the samples. Thanks for the feedback on using the cpprestsdk, its a nice MSFT library but agree that the iOS version is painful to build. Will explore using the libcurl SDK on the Movies sample.

rodrigovaras avatar Nov 26 '17 19:11 rodrigovaras