pijul_org / pijul

#99 Make a C api

Opened by TraktorToni, on May 26, 2017
Open
Feature
TraktorToni commented on May 26, 2017

if you want to write it in Rust then that's fine but I cant read Rust, I have no idea how to use this gigantic language and it takes forever to learn it. Please just offer a regular C api so I can use pijul like a normal person.

lthms commented on May 26, 2017

AFAIK, it is rather easy to call rust code from C so such a wrapper should be easy to write; however, the current libpijul api is not stable. So it might be done in the future, but it requires to have a clean rust API first, which is still a work in progress.

TraktorToni commented on May 26, 2017

Can you tell me how to check if there was a new commit periodically or get some kind of event when it happens? I want to integrate pijul into my CI system if it's possible in an easy way.

edit: ok i guess i can just watch the filesystem for changes

pmeunier commented on May 26, 2017

We want to have a C API at some point, because that is currently the main way to communicate with other languages.

For your periodic checking, I'm super interested in your use case. I can send you notifications from the Nest, for example. This is not written, but is super easy to add, just tell me what you need.

Also, I know Rust is not easy in the beginning, but I want to state that it is really worth the pain. The language is actually smaller than C (if you want to know C well enough to write libraries), and is much more portable. In some of my projects, Rust is faster than the C/C++ equivalents (I translated a chemistry library recently, and the result is about faster 30% due to a better modularity, and easy and correct parallelism).

The only real difficulty in the learning is the borrow checker, but believe it or not, that difficulty also exists in C, and is much harder: In Rust, the compiler tells you instantly where your borrows are wrong, whereas C calls it "debugging", and it can take forever.

lthms commented on May 26, 2017

Side note: having something like “pijul hoosk” (similar to git hooks) would be awesome