Update directory structure and rename from Cppyy->CppJIT - #14
Conversation
|
As discussed/planned, following this merge we can squash the history and begin active development. |
|
|
||
|
|
||
| namespace CPyCppyy { | ||
| namespace PyCppJIT { |
There was a problem hiding this comment.
Is that the middle layer? I am wondering if we have better options for a namespace name to signal that.
|
@vgvassilev I'm continuing our discussions here, so I can propose the design we seem to be converging upon: cppjit namespace design: cppjit::{cpy_rt, interop}We use a single C++ namespace tree,
What one writes and reads as a cppjit developerThe two layers are siblings under // src/cpy_rt/Converters.cxx
namespace cppjit::cpy_rt {
bool VectorConverter::SetArg(PyObject* pyobject, Parameter& para, CallContext* ctxt)
{
// sibling namespace, no full qualification needed
interop::TCppScope_t scope = interop::GetScope("std::vector<double>");
...
}
} // namespace cppjit::cpy_rtSomeone extending cppjit from outside includes the installed headers #include "cpy_rt/API.h"
class MyConverter : public cppjit::cpy_rt::Converter {
bool SetArg(PyObject*, cppjit::cpy_rt::Parameter&,
cppjit::cpy_rt::CallContext* = nullptr) override;
};
cppjit::cpy_rt::RegisterConverter("MyType", ...);From Python and from JIT-side C++ the same tree shows up as nested import cppjit
cppjit.cppdef("int f(int x) { return x + 1; }")
cppjit.gbl.f(41)
# the reflection API is a normal namespace under gbl
scope = cppjit.gbl.cppjit.interop.GetScope("std::vector<int>")The naming conventions in one place:
How python-fortran interop would fitThe split between the two namespaces is also the extension seam.
The invariant that makes this "unintrusive": new languages add siblings cc @guitargeek |
|
Sounds good! Anyway I have no strong preference at all because there is no public API, but if there would be one at some point, I'd definitely prefer |
This is a bit clunky but I guess we can solve that later not now... |
Structurally, |
Not an actual problem for now fortunately, because we won't expose the public C++ API |
sI would prefer |
If we are discussing folder name then that's fine, for a namespace I think it is a bit long. In that sense (assuming we follow the 80 col llvm rule) people will probably do using namespace EDIT: |
Sounds good. @guitargeek? |
|
Sure! |
fe26006 to
9702f93
Compare
Test Results
|
For maybe a future improvement, we should have this either to the bottom of the PR description which has the last run and in |
This is currently posts the last run results, ensuring it is always at the end of the PR (so it follows a force push for e.g), and the intermediate runs are discarded: at any given point in time there is only one "Test Results" displayed by github actions. What do you mean by multirun setups |
|
Pending work-items for this PR:
This should in the end give us a relatively "minimal" starting point for development after squashing the history. Some post squash items have been recorded in #15 |
No description provided.