Hybrid Projects | Advancing
In order to get setup with hybrid development we first need to understand exactly what we mean by this. As we mentioned before, hybrid development is the idea of taking multiple programming languages such as Go, C and C++ in this case and fusing them together to create one project. We have already mentioned Foreign Function Interfaces within the programming language but did you know you could also do more with that? Well, what if you wanted to take it further than Go code for plugins? The cool thing about the Go programming language and why we chose to use it for SkyLine was because you can call C directly from Go using CGO!
Well, cool we have our CGO program but how exactly do we tie this into foreign function interfaces? Well as we mentioned before, all your go program needs to do is interact directly with the backend of the SkyLine programming language. We can modify this program to return the subtraction of an equation using CGO and SkyLine like so!
So now when we run the program mixed with a SkyLine LoadPlugin
call we will see the output of the function. But what if we wanted to take it further? See, developers like us never really wanted to stop or have a limit, we are here to break rules. So, we built a advanced way to work with C++ and C and Go at the same time and embedded it into SLC. But we will get to utilizing SLC in a second. Lets move onto actually working with C++ and understanding how to call C++ from C essentially building a wrapper.
Last updated