ndk
pybind11
Our great sponsors
ndk | pybind11 | |
---|---|---|
14 | 42 | |
1,875 | 14,741 | |
1.6% | 1.7% | |
3.0 | 8.7 | |
9 days ago | 7 days ago | |
C++ | ||
- | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ndk
- Android NDK finally support C++20
-
CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers
Android folks are thinking about using WASM for NDK, with compilation to native code on the PlayStore.
https://github.com/android/ndk/issues/1771
-
New Rust course by Android: Comprehensive Rust 🦀
We have looked into what work would be required to support Rust in the NDK, but even if we did it (which is not certain!) it's a lot of work. Today, we're mainly investing in the lower-level work (compiler changes for some of the complexity around linkage on android, etc.). Feel free to follow along / make suggestions here: https://github.com/android/ndk/issues/1742
-
Ocrmypdf stopped working in termux with python 3.10
If it used to work then you probably just need to reinstall(/recompile) it with something like pip3 install ocrmypdf --force. Most likely issue happens because some library it links against had a major upgrade, which caused the mentioned symbol to disappear (could also be a variant of https://github.com/android/ndk/issues/1614, but seems unlikely)
- Roadmap for supporting Rust in Android apps
-
Ask HN: Pros and Cons of Switching from Linux to M1 MacBook in 2022
I have an M1. I compile Android apps in Android Studio a lot. For a small Android app without many bells and whistles M1 compiles fast (even faster than my Ubuntu laptop). However some Android apps I compile have some C/C++ code compiled with the NDK and accessed via JNI - and which now have to compile on an ARM chip - and that is a rigmarole currently ( https://github.com/android/ndk/issues/1299 ) to the extent that I am just sticking with Ubuntu on x86-64 until ARM is fully supported in Android Studio full release (not some alpha/canary version).
Also, I have never used the MacOS Active Trader Pro app, but I downloaded it to my M1 and it did not work, and online old Macbook users say it works and people with M1s say it has problems on M1.
So my experience is look to see what apps support M1 and ARM. I can tell you that Rosetta does not work for everything.
Apps were not working, and I put Rosetta in, and now some apps work and some don't. So this is another thing to look into.
-
Apple’s risky, yearslong effort to design its own silicon is paying off
> The new architecture also doesn't make much difference. Stuff just works, though homebrew needs to be told it's not on Intel anymore (terraform breaks weirdly if you don't do this). There seem to be plenty of M1 versions for your generic coder stuff.
I bought an MBP with M1 recently. The main reason was to run video conferencing software, which so far it has done well at. That it is a powerful machine yet small and lightweight was a plus for it as well - its easy portability.
I bought it for some secondary reasons, but those have not panned out yet. In mid-February I tried to compile a program with the release version of Android Studio, the project had NDK (C language) components. Even with Rosetta it was not working ( https://github.com/android/ndk/issues/1299 ). Google said they had M1 support coming down in Android Studio canary version and other fixes coming out as well in the future. I'm not in a rush, but it compiles on my Ubuntu box and on Intel-based Macs, but not M1 out of the box yet (not without having to fiddle around to do it any how).
For my Android projects that were fully Java/Kotlin based, the M1 did compile fast though.
Also, Fidelity said they have an application called Active Trader Pro that works on Macs. It's not something I ever used, or that I would probably use regularly, but I decided to check it out. It would not work for me either, and support forums made mention of difficulties it has on M1.
One thing I haven't tried yet is loading Unity 3d and futzing around with it, hopefully when I have the time to do that it will be working.
Still happy with my purchase as it's working for my primary need, and more Android Studio support seems to be coming, and it is not a big rush to me. It's probably good that Apple is pulling software into a world where it supports ARM (kind of weird Android code primarily targets ARM devices, yet has trouble compiling on ARM devices). I had heard about how fast things compile on it, but it was even faster than I expected. So all in all I like it, and hopefully more software will be supported as time goes on.
-
Linux Developer Laptops: Dell's Precision 5500 series reigns supreme
> And ARM compatibility issues not really helping
There were two things I wanted to try on my MBP w/ M1 - compiling an Android app that has some C code, and also to run Fidelity's Active Trader Pro program (not that I would use it that actively). I also installed the Rosetta stuff it prompted for.
The Active Trader Pro program would not run.
In Android Studio, the production version can not compile with CMake as it can on Intel-based Macs yet ( https://github.com/android/ndk/issues/1299 ). They say there is stuff in the beta/alpha/canary branches where it is working, but I am not in a rush and will wait for that to make its way into production.
> It’s good, fast
Yes, I did see the speed, especially with a normal Kotlin/Java Android Studio compile, on 16GB RAM.
-
CANNOT LINK EXECUTABLE "findimagedupes"
Could you open an issue at github.com/termux/termux-packages? Miiight be a variant of https://github.com/android/ndk/issues/1614, but we haven't seen that for golang packages before
-
Anyone tried the M1 Pro/Max with AS yet?
NDK development is not supported, but my understanding is that everything else is good to go.
pybind11
-
Experience using crow as web server
I'm investigating using C++ to build a REST server, and would love to know of people's experiences with Crow-- or whether they would recommend something else as a "medium-level" abstraction C++ web server. As background, I started off experimenting with Python/FastAPI, which is great, but there is too much friction to translate from pybind11-exported C++ objects to the format that FastAPI expects, and, of course, there are inherent performance limitations using Python, which could impact scaling up if the project were to be successful.
- Swig – Connect C/C++ programs with high-level programming languages
-
returning numpy arrays via pybind11
I have a C++ function computing a large tensor which I would like to return to Python as a NumPy array via pybind11.
-
I created smooth_lines python module, great for drawing software
This is based on the Google Ink Stroke Modeler C++ library, and using pybind11 to make it available on python.
-
Facial Landmark Detection with C++
pybind11 makes it easy to call C++ from Python if you want to mix.
-
Python’s Multiprocessing Performance Problem
If you've never used Pybind before these pybind tests[1] and this repo[2] have good examples you can crib to get started (in addition to the docs). Once you handle passing/returning/creating the main data types (list, tuple, dict, set, numpy array) the first time, then it's mostly smooth sailing.
Pybind offers a lot of functionality, but core "good parts" I've found useful are (a) use a numpy array in Python and pass it to a C++ method to work on, (b) pass your python data structure to pybind and then do work on it in C++ (some copy overhead), and (c) Make a class/struct in C++ and expose it to Python (so no copying overhead and you can create nice cache-aware structs, etc.).
[1] https://github.com/pybind/pybind11/blob/master/tests/test_py...
- Making Python Web Application with C++ Backend
-
Using pybind11 with minGW to cross compile pyhton module for Windows
I have a python module for which the logic is written in C++ and I use pybind11 to expose the objects and functions to Python.
-
IPC communication between rust, c++, and python
Reading from Python requires a wrapper, using pybind11 this is fairly done.
-
[ADVICE] Python to C++
Also I can highly recommend starting using C++ to augment your Python code, i.e. find the parts that are slow or undoable in Python and write those in C++ then expose them as Python functions. You can use https://github.com/pybind/pybind11 to call C++ code from Python.
What are some alternatives?
kotlin-wasm-examples - Examples with Kotlin/Wasm
PyO3 - Rust bindings for the Python interpreter
disable-webassembly - Browser hacks to disable WebAssembly (WASM)
nanobind - nanobind: tiny and efficient C++/Python bindings
jvm-alternatives-to-js - Repository comparing JVM alternatives to JS: CheerpJ, GWT, JSweet, TeaVM, Vaadin Flow, bck2brwsr (bonus: React, Dart)
Optional Argument in C++ - Named Optional Arguments in C++17
termux-packages - A package build system for Termux.
setuptools-rust - Setuptools plugin for Rust support
Bytecoder - Framework to interpret and transpile JVM bytecode to JavaScript, OpenCL or WebAssembly.
sol2 - Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
gcc_termux - Gcc for termux with fortran scipy etc... Use apt for newest updates instructions in README.txt
PEGTL - Parsing Expression Grammar Template Library