3 ms·
I get it, but switching to Rust places the codebase on an Island I can't easily get to. I am already switching between C++, Swift, Kotlin, and Python on an almo
by waynecochran 2y ago
I get it, but switching to Rust places the codebase on an Island I can't easily get to. I am already switching between C++, Swift, Kotlin, and Python on an almost daily basis.
- sieabahlpark 2y ago[dead]
- cl0ckt0wer 2y agojust get the AI to understand it for you /s
- waynecochran 2y agoIt is not a matter of understanding source code. It is matter of bridging, building, and linking another language with yet another binary layout and interface.
- int0x29 2y agoIt's an extern c interface. That's not any different than dealing with a c library
- waynecochran 2y agoThat is good to know.
- bobajeff 2y agoFor me it was already hard to get into chromium's code base. It takes too long to build and there's just so much to understand about it before you can make changes. It might help if there was some way to play around with the APIs without having to wait so long for it to build. But as far as i know that's not currently possible.
- MyOutfitIsVague 2y agoWas this a codebase you were working with regularly already? This project exposes a C FFI, so unless you were already working in the guts here, I don't think this should affect you terribly. edit: I'm actually not seeing the C FFI, looking at the library. It must be there somewhere, because it's being used from a C++ codebase. Can somebody point to the extern C use? I'm finding this inside that `fontations` repository: > rg 'extern "' fontations/fauntlet/src/font/freetype.rs 161:extern "C" fn ft_move_to(to: *const FT_Vector, user: *mut c_void) -> c_int { 168:extern "C" fn ft_line_to(to: *const FT_Vector, user: *mut c_void) -> c_int { 175:extern "C" fn ft_conic_to( 187:extern "C" fn ft_cubic_to( >
- drott 2y agoWe're using https://cxx.rs/ https://cxx.rs/ to create the bindings and FFI interface. That's not provided with Fontations, but this bit is part of the Chromium and Skia integration. The code is here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/ports/fontations/src/ffi.rs;l=1521 https://source.chromium.org/chromium/chromium/src/+/main:thi...
- deleted 2y ago[deleted]
- jsheard 2y agoChromium is >35 million lines of code, switching languages all in one go just isn't happening.
- syklemil 2y agoYou've already had some replies for the C FFI side of things, you might also be interested in maturin & PyO3 for python bindings. I haven't looked if they've exposed some python interface (guessing not), but Rust/Python interop is often pretty easy: https://www.maturin.rs/ https://www.maturin.rs/