nodejs / nodejs/nan

Addon-WG: Bundle CPython into Addon Tooling

Open
#516 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.4k
Forks
531
Avg merge
21m
Merged PRs (30d)
1

Description

TL;DR

Bundling Python on unix is really simple . Exchanging data (e.g. objects) as well. Feels a bit like compiling the whole Python-lang though and runs for 2+ mins. Was attempting this at eljefedelrodeodeljefe/node-cpython in order to run py-libs natively.

Disclaimer
It's a working API but not tested currently (left that for vacation next week)

I am doing lot's of native addon building and figured out that compilation can be a real pain. I was investigating on this for quite a while and wanted to propose shipping Python.h and exposing a high level API (streams as well) to JS in order to be able to abstract gyp.
It would render you to not just call .exec() on it, but having it in cpp-land.

@bnoordhuis would that be something worth a discussion? (pointing at you since you were talking about this in the last CTC and I liked your opinions in Berlins Code and Learn)

I think it has been mentioned a lot that gyp will not change and especially the python-2.7 dependence is quite annoying. With the above approach, one could just choose which version to run from JS.
Also it would enable one to slowly deprecate some of the gyp or python tooling, by keeping the API, but exchanging the below implementations with JS stuff.

Maybe this would ease the multitude of node-gyp problems on Windows, as an example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposal and its linked node-cpython project, then consider how Python.h, CPython bundling, streams, and a high-level JavaScript API would relate to node-gyp and gyp. No repository files or tests are named; the work is not ready until the scope and implementation approach are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, nodejs, python
Domain
build-system, devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.