Embedding Go objects
drew-512 opened this issue · 8 comments
Hi friends, love gpython and would be into contributing. I'm looking to expose a particle physics Go module that I maintain via a module in gpython. Problem is, Objects in gpython only offer embedded Go methods. Yes, I suppose I could make a new closure for each Go struct/interface to embed, but we can all agree that is painfully wasteful.
If someone here can give me some guidance on how to approach this, I'd be into adding this code. This physics module is rerally exciting and we expect it to get some major traction in the physics community (the LHC for starters) -- and I'd much rather use gpython than lua!
I think I have it worked through and gpython's design makes life super easy and seems to need docs and high-level utils than much else. I would be into contributing to this as well as fixes to remove warnings from versions of Go 1.16 and above. @sbinet @ncw and others, would you prefer I start submitting PRs or otherwise tell me how you'd like to proceed.
I can carve up some time for reviews.
You could indeed start with a couple of "gardening" PRs.
As you wish :)
Sounds good!
In the coming month, I'll be focused on getting an alpha version of the project I described out and established (and confirm that gpython fits the bill, which appears to be the case). The design and concept of gpython is brilliant and elegant, and as a veteran of a major project that embeds CPython, gpython makes a TON of sense and is WAY easier to be with (and of course coupled with the awesomeness of Go). The fact that embedding Go types as "native" py.Objects works handsomely compared to the pain of capsules and ref counting, omg. Of course, there's many TODOs in gpython, but if you measure it toe to toe with Lua, then basically the only downside is a single interpreter instance (which can be worked around) and lack of docs. So, really, the TODOs of interest imo are: docs, any bug fixing, and bulletproofing (vs. adding support for fringe Python features that aren't used by 99.9% of the python world -- e.g. in science and research).
A distinguished CTO of a python scientific computing firm you've probably heard of has an insightful saying that "python is the world's "best" second language. He is referring to that python isn't necessarily what CS people choose for major projects, but it's what every non-CS person in the world either already uses (or would otherwise prefer to get their job done in because the learning curve is so friendly and the syntax is so lightweight).
The physicists at LHC (and other labs and universities) that use our project will get a ton of value from effectively being able to access our team's work via Python. If/when financial support shows up, we'd be able to more properly support and champion the continued improvement of gpython. We plan to do half a dozen tutorial videos that scientists and researches will be able to watch and get up and running. In that coverage of this project, I'll shoutout to gpython and what a game changer it is to be offering Python rather than Lua.
Lookin fwd to update y'all in a few weeks when we unveil the project.
I'd be interested to know what project you are talking about :) (or even just a vague description)
(I am a particle physicist by education, now software engineer trying to percolate some Go in HEP by way of Go-HEP. Apologies for the shameless plug.)
Awesome! No sorries for coolass work, my friend! :)
I would like to get to an alpha milestone and when we get some of these recordings done before I share details, if you don't mind. Otherwise, my OCD brain will be tortured by half baked stuff being out there. Now that I have gpython up and running, we'll have an alpha of phase I ready to present. Phase II is using Unity (my other main jam) to visualize particle structure diagrams that this model presents.
But this is really great news that you're into HEP and it makes me excited to show you what we're unveiling. The model explains the lepton universality violation observed at the LHCb in the last year and offers an analytical calculation that matches what they're getting (~0.8). After a year of getting to know the model, I have been increasingly sold on it and a shocking number of answers and explanations emerge from it, including dark matter if you can believe it. I'm sold on it enough to put my career as a software dev on pause and work full time creating a software suite in support of the physicist who's model this is.
Thanks for your patience and gpython!
@sbinet Do you suggest using tag v0.0.3 or master? If master, does it make sense to make a new tag with v0.0.4?
For development of gpython, 'master' makes most sense.
I'll tag v0.4.0 when in front of a real keyboard, though. (Tomorrow, Paris time)
@sbinet I emailed you last week and have not heard back so far (and I have a special talent for missing emails). It would be great to hear back as we build allies for this project and resources arrive to support continued development (including resource allocation to gpython). On a related note, it's entirely possible that that Google would want to sponsor continued development of gpython (it makes a TON of sense the more one thinks about it) and that's another string we can pull. However, we need to connect and get to know each other first. :)
Drew