Prerak Mann
Back to Blog

Google Summer of Code 2020 with Dart

May 12, 2020
Google Summer of Code 2020 with Dart

In this post, I’ll be writing updates about my project during my GSoC period with Dart :partying_face:. Dart

A quick word on GSoC

Google Summer of Code (GSoC) is a global program focused on bringing more student developers into open source software development. Students work with an open source organization on a 3 month programming project during their break from school.

You can learn more from their official website.

How I got here

I have been working with Dart and Flutter(Dart is the language used in it) from about 2018. So when Dart was announced in GSoC this year I was really excited and thought about applying.

There were a lot of interesting projects, but I decided to focus on writing a single proposal (keeping my focus solely on one project). The proposal was on generation of Dart FFI bindings. This involved working with LibClang and Dart.

Project Link - https://github.com/dart-lang/ffigen

About FFIGEN

FFIGEN is an FFI bindings generator for dart. FFI stands for Foreign Function Interface. This tool parses C/C++ header files and generates bindings which could be directly used in Dart, and for that we use LibClang.

LibClang is a C interface to Clang, using which we can parse C/C++ header files, it is used by many IDE’s to provide C/C++ intellisense. We can call functions in Libclang via Dart, but first we need the dart bindings.

The generated bindings for libclang’s headers files are ~4.5kLOC! Imagine writing these by hand, and what happens when libclang changes, how hard would it be to track these changes and re-write the updates. Hopefully this explains the need for having such a tool in your inventory.

That’s pretty much the basics, if you would like to know more and/or contribute to this project head over to https://github.com/dart-lang/ffigen.