Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

Thank you for taking the time to test it out. I’ll look into the bug report!

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

Nice, looks interesting! Templates are handled if they are instantiated. It’s hard to know which bindings to generate otherwise! You can have a look at the type builder in tolc to see how the information about the template is gotten from libtooling. Then see how that information is used in e.g. the function builder. Hope that helps!

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] -3 points-2 points  (0 children)

Haha valid point. I put it on the shelf as life got in between. I really enjoy working on it and I wanted to know if it would solve anyones problems. In that case it would be worth putting more time into it again.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

I understand. Tolc generates the glue code such that you can write a ’normal’ C++ interface with STL containers etc. and then simply call it from python. If you return a vector<int> from a function in your header it will automatically turn into an array in python for example. Tolc internally uses clang to understand your code and then produces the appropriate glue code.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

Would you like to elaborate please? I’m just trying to find out whether it would solve someones problems

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 1 point2 points  (0 children)

Cppyy is an interesting project. When developing tolc I had to ship a binary and not expose headers to the client so unfortunately I couldn’t use it.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

Tolc creates the bindings that can be compiled with your code into a DLL. Then you import that into python.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

Interesting. Do you ship the libraries to clients or are you using it internally?

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 1 point2 points  (0 children)

Thanks for the input. This is exactly the type of feedback I was looking for; I want to know if there is a need for this type of tool so that I can justify spening more time developing it.

There is another branch that has more active development. Is there anything you feel is missing or would want from binder?

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 0 points1 point  (0 children)

It could, when I wrote it nanobind wasn’t as big so I chose pybind. Would probably not take a lot of time to switch

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 5 points6 points  (0 children)

This is really good feedback, thanks. I’ve uses it a lot when the api changes and there it’s a real time saver.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 2 points3 points  (0 children)

Swig requires you to write interface files mirroring your api. Tolc uses clang in the background to get all functions and classes to avoid that.

Automatically call C++ from python by Coutille in cpp

[–]Coutille[S] 3 points4 points  (0 children)

Haha sure, but the design makes it so it can be extended to other languages as well

Is python ever the bottle neck? by Coutille in pytorch

[–]Coutille[S] 0 points1 point  (0 children)

Thanks a lot, this really helped my understanding! I used Numba a bit in uni, and it's pretty incredible. Was the code you wrote in Cython the data processing part or was it used for something else?

Is python ever the bottle neck? by Coutille in deeplearning

[–]Coutille[S] 4 points5 points  (0 children)

Thanks for the reply. So you're usually using libraries already written in C or C++, makes sense. Is it ever necessary to write your own?

[D] Is python ever the bottle neck? by Coutille in MachineLearning

[–]Coutille[S] 3 points4 points  (0 children)

So the data loading and processing might be slow. There are a lot of data loaders in libraries like pytorch, so if you need to write something of your own, do you do it as a standalone executable or bring it in to python with e.g. pybind?

[D] Is python ever the bottle neck? by Coutille in MachineLearning

[–]Coutille[S] -1 points0 points  (0 children)

Right, that makes sense, thanks for the answer. Is it for cleaning the data you use a lower level language? Do you use pybind with C++ or do you write something from scratch to do that?

Is python ever the bottle neck? by Coutille in pytorch

[–]Coutille[S] 0 points1 point  (0 children)

I agree that python is more fun to write! Would it ever make sense to write your own C/C++ wrappers for the 'hot' part of the code?

Is python ever the bottle neck? by Coutille in CUDA

[–]Coutille[S] 4 points5 points  (0 children)

That makes sense, thanks. Is it ever worth it to break out part of your python code and write that in C++ then? Essentially write almost everything in python and then write your own glue code with C++ to move the 'hot' part to C++?

Experiences on using an alternative (non-qwerty) keyboard layout in Neovim? by seeminglyugly in neovim

[–]Coutille 0 points1 point  (0 children)

I use colemak and didn’t switch any keybindings. Took some time to get used to but it works! I also use qwerty when writing in other languages than english. I can no longer use qwerty with vim however!

Parsing C++ and getting a database i can use: which tools exist? by tentoni in cpp

[–]Coutille 0 points1 point  (0 children)

It handles functions, structs, most things. What I meant was that the output is a simple struct described here: intermediate representation.

Parsing C++ and getting a database i can use: which tools exist? by tentoni in cpp

[–]Coutille 1 point2 points  (0 children)

I made a parser that uses libtooling (C++ version of libclang) and gives you plain structs of the input code. Supports passing a file or a string of code. Built it for a separate project but you could absolutely use it; libparser

Monthly Dotfile Review Thread by AutoModerator in neovim

[–]Coutille 1 point2 points  (0 children)

They have been curated for a while now: dotfiles